Fault Occurred When read Flash content on MK24FN1M0

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

Fault Occurred When read Flash content on MK24FN1M0

跳至解决方案
936 次查看
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 解答
792 次查看
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 回复数
793 次查看
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 项奖励
792 次查看
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 项奖励
792 次查看
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 项奖励