cancel
Showing results for 
Search instead for 
Did you mean: 

U385 EEPROM/Flash writing is giving me a headache

In the past I've used F401 and the following code works flawlessly

HAL_FLASH_Unlock();
HAL_ICACHE_Disable();
uint64_t myWord = 0x00000001;
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, 0x080C0000, myWord);
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET);
HAL_FLASH_Lock();
HAL_ICACHE_Enable();

Now, after switching to U385, i only get grief, with any Write command exiting in HardFault_Handler(). My research points to Option Bytes - Write Protection being enabled but the GUI in STM32CubeProgrammer is very confusing for U385, and it seems that I may have permanently locked the MCU? I cannot tick back the UNLOCK_1A _1B _2A and _2B flags. How can one unlock the Flash fully in U3?

0 REPLIES 0