---

** [tickets:#350] stm32f07/9x wrong flash sector size **

**Status:** new
**Milestone:** 0.11.0
**Created:** Thu May 05, 2022 02:11 PM UTC by Jan Hildenbrand
**Last Updated:** Thu May 05, 2022 02:11 PM UTC
**Owner:** nobody


While trying to enable and disable write protect the problem arises that on a 
stm32f071 only the first 16 sectors can be enabled/disabled the latter 16 
sectors cannot be changed.

Furthermore, "flash info 0" shows a sector size of 8KB (which is wrong, it 
should be 4KB according to the stm32f0x reference manual - see 
https://www.st.com/resource/en/reference_manual/dm00031936-stm32f0x1stm32f0x2stm32f0x8-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
 page 54)

The root cause is the wrongly configured ppage_size (1 sector is 2 pages for 
stmf07/9x)
The following patch solves the issue for me, but I only have stm32f072 to test.
@@ -863,7 +863,7 @@ static int stm32x_probe(struct flash_bank *bank)
                break;
        case 0x448: /* stm32f07x */
                page_size = 2048;
-               stm32x_info->ppage_size = 4;
+               stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 128;
                stm32x_info->user_data_offset = 16;
                stm32x_info->option_offset = 6;
@@ -872,7 +872,7 @@ static int stm32x_probe(struct flash_bank *bank)
                break;
        case 0x442: /* stm32f09x */
                page_size = 2048;
-               stm32x_info->ppage_size = 4;
+               stm32x_info->ppage_size = 2;
                max_flash_size_in_kb = 256;
                stm32x_info->user_data_offset = 16;
                stm32x_info->option_offset = 6;


---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to