2015-11-01 03:43 PM
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,--Guilherme2015-11-02 10:02 AM
If you define USE_FULL_ASSERT does the code fail with an assertion?
2015-11-02 11:36 AM
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