flash is secured but flash config field is not

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

flash is secured but flash config field is not

Jump to solution
1,281 Views
roymessinger
Contributor V

I'm having a very strange issue.

Even though the Flash Configuration Field (FCF) is at its default state:

/* Flash Configuration*/
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFE

Whenever I try to flash my (custom) board with Segger J-link I'm getting a secure alert (stating that the image causes the flash to be secured), and obviously when trying to delete app later on with KBOOT, I'm getting a message saying flash cannot be deleted since it is secured. This pop up is shown also with a 'regular app' located at address 0x00 (so no connection to KBOOT).

But,

when changing the FCF to the following:

/* Flash Configuration*/
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF

I am not receiving the message and the flash is not secured and can later be deleted successfully.

This is totally opposite than it should be, as I understand (also clearly explained here: https://www.nxp.com/docs/en/application-note/AN4835.pdf )

So, what is going on?

Tags (1)
0 Kudos
Reply
1 Solution
1,063 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Roy,

  Do you want to write the 0X40C to 0xff, then to secure the chip?

  If yes, please check this picture:

pastedImage_1.png

When you select the chip, you should select the chip MK64XXX(allow security), othewise, the chip will automatically modify the 0X40C to 0xfe.


Have a great day,
Kerry

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

View solution in original post

3 Replies
1,063 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi roymessinger,

   What the kinetis chip you are using?

   You can use the JLINK commander, select the chip allow the security, then input : unlock kinetis

   check the flash configuration field data with command: mem 0x400, 0x10

   Then, give me some picture about the above command information.

   Besides, when you flash the board, do you use any IDE? If yes, what the IDE you are using?


Have a great day,
Kerry

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

0 Kudos
Reply
1,063 Views
roymessinger
Contributor V

Hi kerryzhou‌,

I'm using K64.

I'm now facing another strange behavior. After the board security is disabled, I now cannot enable it again. I want to emphasize I do not want security (thus I do not want to use unlock), but I wanted to debug the error I explained above so I made 2 bin files. One with FE at FSEC register (0x40C) and one with FF.

When I load the FF bin file. I see it in the Segger flasher as follows:

before_40c_FF.png

You can see FF at 0x40C.

After I flash the file, it changes to FE (turned red):

after_40c_FE.png

So, I do not understand. If the register at CFC (address 0x40C) was set to FF, how come Segger changed it to FE?

Roy

0 Kudos
Reply
1,064 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Roy,

  Do you want to write the 0X40C to 0xff, then to secure the chip?

  If yes, please check this picture:

pastedImage_1.png

When you select the chip, you should select the chip MK64XXX(allow security), othewise, the chip will automatically modify the 0X40C to 0xfe.


Have a great day,
Kerry

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