STM32U575VGT HAL_FLASHEx_Erase() not working (page is not erased)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 6:36 AM - edited ‎2024-02-23 2:43 AM
Hello all,
this code snippet is not working: the page is not erased, although the HAL does not report errors.
No RTOS is running.
if (HAL_ICACHE_Disable() != HAL_OK) {
Error_Handler();
}
status = HAL_FLASH_Unlock();
if (status != HAL_OK) {
Error_Handler();
}
erase_init_struct.TypeErase = FLASH_TYPEERASE_PAGES;
erase_init_struct.Banks = FLASH_BANK_1;
erase_init_struct.Page = 127;
erase_init_struct.NbPages = 1;
status = HAL_FLASHEx_Erase(&erase_init_struct, &page_error);
if (status != HAL_OK) {
Error_Handler();
}
Any suggestion?
Solved! Go to Solution.
- Labels:
-
Flash
-
STM32U5 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-22 2:51 AM
correct. I tried 15 WS without any improvement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-22 2:57 AM - edited ‎2024-02-22 2:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-23 2:22 AM
Hello all,
I found the source of the problem: the DUALBANK bit in FLASH_OPTR was set to 1.
On this device this arranges the FLASH page access in two banks of 64 pages each.

- « Previous
-
- 1
- 2
- Next »