k65 flash erase

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

k65 flash erase

502 次查看
steverobalino
Contributor I

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

0 项奖励
1 回复

344 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励