cancel
Showing results for 
Search instead for 
Did you mean: 

Flash @ STM32F429VIT6

gui2
Associate II
Posted on November 02, 2015 at 00:43

Hi,

I'm using FLASH to store some data. Everything works great when I write in an empty address. When I try to write in a already used memory position, the stored value becomes to zero!

I tried erase the sector before call the write function but the uC crashes. 

Here it follows:

FLASH_Unlock();

FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR|FLASH_FLAG_PGSERR); 

FLASH_EraseSector(ADDR_FLASH_SECTOR_4,VoltageRange_3);

FLASH_ProgramWord(ADDR_FLASH_SECTOR_4, data);

FLASH_Lock();

Anyone can help me? I'm using FreeRTOS.

Thanks in advance,

--

Guilherme 
11 REPLIES 11
Posted on November 02, 2015 at 19:02

If you define USE_FULL_ASSERT does the code fail with an assertion?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gui2
Associate II
Posted on November 02, 2015 at 20:36

SOLVED!!!!

Thank you very much everyone specially clive1!

You was right! I was making confusion with the index and with the initial address of sectors! Everything goes right now!

Thank you!

--

Guilherme