2025-10-17 2:47 AM
Hello,
I've been using the Nucleo-U385RG-Q for my project and all features work fine, but when I switch the code to a STM32U385VGT6Q, there is a problem when attempting to write to FLASH. My Write function starts with:
if (HAL_FLASHEx_Erase(&flashErase, &error) != HAL_OK)
{
break;
}
and it precisely crashes at: FLASH_WaitForLastOperation in error = ((*reg_sr) & FLASH_FLAG_SR_ERRORS); with error code 128 (0x80). Searching for the error leads me to believe that the CPU is attempting to write protected/secure state areas but the Option Bytes says otherwise.I use Nima-LTD-I-CUBE-EE library.