2024-02-21 06:36 AM - edited 2024-02-23 02: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.
2024-02-22 02:51 AM
correct. I tried 15 WS without any improvement.
2024-02-22 02:57 AM - edited 2024-02-22 02:59 AM
2024-02-23 02: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.