Erasing serial flash - LPC54S018

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Erasing serial flash - LPC54S018

ソリューションへジャンプ
936件の閲覧回数
mh_n
Contributor III

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)

mh_n_2-1668619646958.png

 

And this is my modified version (Trying to delete sector by sector, all of the flash)

mh_n_0-1668619586793.png

 

Thank you in advance,

Regards,

Mohammad

 

0 件の賞賛
返信
1 解決策
922件の閲覧回数
mh_n
Contributor III

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)

mh_n_0-1668698859583.png

Note: used tables 348 and 349 from UM11060 document in solving this issue

 

Regards,

Mohammad

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
923件の閲覧回数
mh_n
Contributor III

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)

mh_n_0-1668698859583.png

Note: used tables 348 and 349 from UM11060 document in solving this issue

 

Regards,

Mohammad

0 件の賞賛
返信