Question
Flash Memory: crash on write access
Posted on October 07, 2013 at 18:11
Hi
I'm trying to write to the Flash ROM on my STM32F3 board (256k). Erasing a page works fine, but when I try to write a word (or half word), the MCU crashes. I'm doing what the standard peripheral library suggests:FLASH_Unlock();
FLASH_ErasePage(0x0803f800);
FLASH_ProgramHalfWord(0x0803f800, 0x0001); // crash!
FLASH_Lock();
What am I doing wrong?
Btw, the CPU speed is 72 MHz and the Flash is configured accordingly:
FLASH->ACR = FLASH_ACR_PRFTBE | FLASH_ACR_LATENCY_1;
I'm using Keil uVision to install the program on the flash memory (start address is 0x08000000). Vector table offset is 0x0.