Fault Occurred When read Flash content on MK24FN1M0

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

Fault Occurred When read Flash content on MK24FN1M0

ソリューションへジャンプ
1,819件の閲覧回数
ruiyeqin
Contributor I

As stated in the title,hard fault occurred when i try to read flash content. i was used "memcpy" function.and i tried myself function too,like this:

pastedImage_1.png

it was the same problem,when i used "Flash_read" function with parameter "Addr" was 0xFF000. but,it was no problem when parameter "Addr" was 0xFE000. i'd want to ask,whether this problem is caused by the security of flash sector?

thanks

 

ラベル(1)
0 件の賞賛
返信
1 解決策
1,675件の閲覧回数
mjbcswitzerland
Specialist V

Hi

Try a mass erase of the Flash and repeat your test. If it works after this the problem was that you had programmed the Flash (usually using in application programming) but performed something incorrectly (eg. tried to write to a location twice without first performing a section erasure). Illegal operations can cause damage and some of the Kinetis parts (newer ones like K64, K24) will mark the area of Flash as corrupted and hard fault when reads are attempted to it. A erasure of the corrupted area (sector, but better still a mass erase) recovers this.


Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis K21/K22/K24:
- http://www.utasker.com/kinetis/TWR-K21D50M.html
- http://www.utasker.com/kinetis/TWR-K21F120M.html
- http://www.utasker.com/kinetis/FRDM-K22F.html
- http://www.utasker.com/kinetis/TWR-K22F120M.html
- http://www.utasker.com/kinetis/BLAZE_K22.html
- http://www.utasker.com/kinetis/tinyK22.html
- http://www.utasker.com/kinetis/TWR-K24F120M.html


For less questions and restrictions, and faster, cheaper developments: try uTasker for Kinetis

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,676件の閲覧回数
mjbcswitzerland
Specialist V

Hi

Try a mass erase of the Flash and repeat your test. If it works after this the problem was that you had programmed the Flash (usually using in application programming) but performed something incorrectly (eg. tried to write to a location twice without first performing a section erasure). Illegal operations can cause damage and some of the Kinetis parts (newer ones like K64, K24) will mark the area of Flash as corrupted and hard fault when reads are attempted to it. A erasure of the corrupted area (sector, but better still a mass erase) recovers this.


Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis K21/K22/K24:
- http://www.utasker.com/kinetis/TWR-K21D50M.html
- http://www.utasker.com/kinetis/TWR-K21F120M.html
- http://www.utasker.com/kinetis/FRDM-K22F.html
- http://www.utasker.com/kinetis/TWR-K22F120M.html
- http://www.utasker.com/kinetis/BLAZE_K22.html
- http://www.utasker.com/kinetis/tinyK22.html
- http://www.utasker.com/kinetis/TWR-K24F120M.html


For less questions and restrictions, and faster, cheaper developments: try uTasker for Kinetis

0 件の賞賛
返信
1,675件の閲覧回数
ruiyeqin
Contributor I

hi Mark Butcher

The corrupted area which base is 0xFF000,is recover when i tried sector erase. I did not try a mass erase. And,i tried to executed sector erase on a sector first,then write twice of that sector. The write command interface just return false when i write that sector on the second time instead of hard fault. so i can't reappear the problem.

Any other suggestions?

Thanks.

best regards

0 件の賞賛
返信
1,675件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi ruiye qin

The problem may be caused by access to the flash sector via the read function whose location resides in the same flash sector.
So I'd highly recommend you to map the read function to RAM area and give a try again.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信