Help with MK22DX256

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

Help with MK22DX256

814 Views
Toe
Contributor IV

I have a similar problem to Flash driver C90TFS Partition MK10FX512VLQ12. I'm using a MK22DX256.  I've looked at the example for the MK21DX128xxx5 and have trouble with it as well.  The normal flash demo checks the DFlash IFR for a value before setting up the partition.  For my MCU the value does not equal 0xFFFF (I get 0xF0FF) so it skips the partitioning.  If I remove the check I get an ACCERR on the partition command.

Is there something that needs to occur before setting up the partition?  Everything up to that command works fine.

Labels (1)
Tags (1)
2 Replies

480 Views
LuisCasado
NXP Employee
NXP Employee

Hi Ryan,

You should do a "Erase Whole Device" from Flash Programmer in CW. (Not sure what IDE are you using). to get the IFR area also erased.

Other option could be to use the J-Link command line to full erase the device.

If that doesn't work for you, you can also set the right partion value in advanced programming options in Debugger Settings.

advanced.jpg

In Keil uvision + ulink, I think that IFR is not erased. You could run a new project for your device, with an asm file .s with a code like this (that code is for K70, check the IFR location for your device) , to set the partition:

 

nDATA0 EQU 0x21

nDATA1 EQU 0x05

DATA0 EQU nDATA0:AND:0x3F

DATA1 EQU nDATA1:AND:0x0F

AREA |.ARM.__AT_0x13FFFFF8|, CODE, READONLY

DCB 0xFF, 0xFF, DATA0, DATA1, 0xFF, 0xFF, 0xFF, 0xFF

END


I hope this helps.

Luis

480 Views
Toe
Contributor IV

Luis, thanks for replying.  Looks like your suggestion helped me out.  I am using CW 10.5.  I tried to use the "Flash Programmer" button initially to do the erase and ran into some protection errors.  That caused me to create a task for the project that I knew wasn't enabling any protection and would execute a mass erase.  This fixed the problem I was seeing and the C90TFS demo ran as I expected.

Thanks again!

0 Kudos