How to check memory flash sector in MCXA cpu

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

How to check memory flash sector in MCXA cpu

ソリューションへジャンプ
389件の閲覧回数
_Ferrari_
Contributor V

Dear all,

I'm developing a project based on the MCXA153VLH and I have to read and write a sector of internal flash memory.

I have developed a procedure based on romapi_flashiap example in the SDK but in the SDK example I can't find any procedure to verify if a sector of flash memory is erased or written.

The problem I have is that, on power-on, I need to check if a flash memory sector has never been written. If that's the case, I have to initialize it with default data.

 

Did you encountred asimilar problem ?

How did you fix it ?

Thank you very much for your help and cooperation

regards

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
239件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi _Ferrari_,

MCX and LPC55 Flash are different.  LPC55Sxx parts are delivered from the factory mass erased with ECC unset. If performing AHB reads of the flash memory contents AFTER a sector erase, we will have the same HardFault issue. We need to program the sector or use Flash controller read command to overcome it. See my article on this topic

[LPC55xx] How to fix AHB Read HardFault Error - NXP Community

MCX Flash don't have this limit.  While Flash verify API function still works for MCX.

Hope this will help you.

Jun Zhang

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
356件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @_Ferrari_ 

The MCX153 Flash memory has default values of all 0xFF when erased. Therefore, we can check if the specific Flash memory bits are all ’1‘ to determine whether the Flash sector has been written to. If all the contents in a sector are read as 0xFF, the sector is unused.

Does this answer your question?

Hope this helps,

Jun Zhang

0 件の賞賛
返信
320件の閲覧回数
_Ferrari_
Contributor V

I previously used an LPC5526 processor, where the flash memory could have three states:

erased

programmed (or written)

uninitialized

So, before accessing the flash, I had to use the FLASH_VerifyErase function to check if the flash was accessible. It seems to me that, with this type of processor, the problem doesn't exist. Can you confirm?

Thank you very much for your help and cooperation

regards

タグ(2)
0 件の賞賛
返信
240件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi _Ferrari_,

MCX and LPC55 Flash are different.  LPC55Sxx parts are delivered from the factory mass erased with ECC unset. If performing AHB reads of the flash memory contents AFTER a sector erase, we will have the same HardFault issue. We need to program the sector or use Flash controller read command to overcome it. See my article on this topic

[LPC55xx] How to fix AHB Read HardFault Error - NXP Community

MCX Flash don't have this limit.  While Flash verify API function still works for MCX.

Hope this will help you.

Jun Zhang

0 件の賞賛
返信