- /* check for valid flash size */
- if (flash_size == 0xffff) {
- /* number of sectors incorrect on revA */
- LOG_ERROR("STM32 flash size failed, probe inaccurate");
+ if ((device_id & 0xfff) == 0x416) {
+ /* check for early silicon */
+ if (flash_size_in_kb == 0xffff) {
+ /* number of sectors may be incorrrect on early silicon */
+ LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 128k flash");
+ flash_size_in_kb = 128;
+ }
+ } else if ((device_id & 0xfff) == 0x436) {
+ /* check for early silicon */
+ if (flash_size_in_kb == 0xffff) {
+ /* number of sectors may be incorrrect on early silicon */
+ LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 384k flash");
+ flash_size_in_kb = 384;
+ }
+ } else {
+ LOG_WARNING("Cannot identify target as a STM32L family.");