mk22fn1m0vlh12 erase fails at 0x000e200 even though all bytes read as 0xFF

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

mk22fn1m0vlh12 erase fails at 0x000e200 even though all bytes read as 0xFF

423 Views
albertdoe
Contributor I

Address should have been 0x000e2000 (typing missed the final zero)

Using MCUXpresso IDE v10.2.0 (build 759) with SDK v2.3.1.

Tracing the code shows the problem in fsl_flash.c function flash_command_sequence() . After the line callFlashRunCommand() attempting to erase flash sector 0x000e2000 fails with the failure indicated by FSTAT register bit MGSTAT0 being set after callFlashRunCommand().

Reading the sector after the erase indicates all bytes are 0xFF. Writing the sector anyway always works.

Multiple erase then write cycles always shows erase fails at 0x000e2000, but write always succeeds.

No other sectors seem to have a problem.

Similar characteristics using Segger's J-FLASH utility or JLink utility.

Albert@cetci.com

Labels (1)
Tags (1)
0 Kudos
1 Reply

354 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Albert Doe,

   Do you download the SDK code for MK22FN1M0VLH12?

  pastedImage_1.png

After you download the SDK code, do you modify the chip to MK22FN1M0XXX12? SDK_2.5.0_MK22FN1M0XXX12\devices will have the according files for MK22FN1M0XXX12.

The default project device should used for the MK21 chip, so you need to modify it at first. Change the all the project headfile, startup files, this is very important.

 After you modify it, you may make the erase works.

Please try it at first.

If you still have question, please kindly let me know.


Have a great day,
Kerry

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos