Hello,
I am trying to write a code to test the serial flash on LPC54s018-EVK. I need to first confirm that erasing the flash sector by sector is possible and functional, then proceed with other phases of my test. (I do not want to erase the entire chip at once since our main software will need to erase a selective set of sectors from flash). To do this, I started looking at the software examples from the SDK version 2.12.0. Specifically, the example called "spifi_dma_transfer". I realized that the example erases a sector and then proceeds to writing into it page by page. So, I modified that example code and added a loop around the erasing part to erase all sectors one after another and commented out the part where it writes into flash. The results were that the first time I am trying to erase flash, it succeeds and I can see that all of the data in flash is set to 1s; However, If I try erasing the flash while it is already erased, after erasing about 500 to 700 sectors, a signal handler is called and the CPU will start hanging in a function called "IntDefaultHandler(void)" in the startup_lpc54s018.c. using the debugger's stack trace, I can see the signal Handler being called is CTIMER0_IRQHandler().
After realizing this, I tried defining that handler as an empty function as well; However, it constantly keeps getting called.
I was wondering if you can let me know why I am seeing this behavior and how I would be able to fix this.
(I have also tried in this state of the flash being erased to write into it page by page using the example code, but that also does not work due to the same handler being called)
Below is the example code (The portion deleting a sector)
And this is my modified version (Trying to delete sector by sector, all of the flash)
Thank you in advance,
Regards,
Mohammad
已解决! 转到解答。
I was able to solve this issue with defining the CTIMER0_IRQHandler in my code and acknowledging the interrupt inside it by setting the first bit of the interrupt register for CTIMER0 to a 1 (Screenshot below)
Note: used tables 348 and 349 from UM11060 document in solving this issue
Regards,
Mohammad
I was able to solve this issue with defining the CTIMER0_IRQHandler in my code and acknowledging the interrupt inside it by setting the first bit of the interrupt register for CTIMER0 to a 1 (Screenshot below)
Note: used tables 348 and 349 from UM11060 document in solving this issue
Regards,
Mohammad