Fault Occurred When read Flash content on MK24FN1M0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fault Occurred When read Flash content on MK24FN1M0

Jump to solution
838 Views
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

 

Labels (1)
0 Kudos
1 Solution
694 Views
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

View solution in original post

0 Kudos
3 Replies
695 Views
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 Kudos
694 Views
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 Kudos
694 Views
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 Kudos