Im trying to erase flash starting at address 0x14000 for a total of 3 4096 byte sectors. when the erase function is called (Im using SDK 2.0) the code resets - the same occurs when I try to program the flash -
Im running the chip at 120Mhz and the flash clock is 24mhz
Im not using Kboot or other.... its our own code
when I program the very top of flash memory (x1FE000 & x1FF000) the erase and program operation works fine
only at lower memory addresses it fails
Hello Steve Robalino:
Usually this kind of error is caused by one of the next:
1- Not relocating the Flash Command function to RAM (Read-While-Write error).
- Check that you are calling the Flash_Init() function before any flash operations.
2- Interrupt triggering during a Flash operation (Read-While-Write error).
- Disable all interrupts globally before calling any Flash operation API.
e.g.
DisableGlobalIRQ();
FLASH_Erase(...);
EnableGlobalIRQ();
3- MCU working in HSRUN mode (180 MHz for K65) where flash operations are not allowed.
- You are working at 120 MHz so I do not think this applies to your case.
Check these points and if you cannot solve the issue please let me know.
Best regards,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------