Friday, February 23rd 2018, 5:42am UTC+1

You are not logged in.

  • Login
  • Register

roymesi

Beginner

Date of registration: Dec 19th 2017

Posts: 7

1

Sunday, January 14th 2018, 6:56pm

[SOLVED] image secure is disabled but flash still secured

I'm using K64 chip. The bin file shows the flash is not secured. See attached (address 0x40C, FSEC register).
Nevertheless, whenever flashing with Segger, I'm getting the following message:
"Your application message would set the system securityand/or disable the mass erase functionality of the device.
This is not supported in the current configuration.
Application data has been changed accordingly."And I need to Unlock using J-Link commander.
How can it be?
roymesi has attached the following image:
  • 1.png

roymesi

Beginner

Date of registration: Dec 19th 2017

Posts: 7

2

Sunday, January 14th 2018, 6:59pm

Attached the ELF zipped file.projectFile.zip

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

3

Wednesday, January 17th 2018, 3:11pm

Hello,

Thank you for your inquiry.

Quoted

The bin file shows the flash is not secured. See attached (address 0x40C, FSEC register).


Quite the contrary. According to the manual the MCU is secured with 0x00. Quote: "00 MCU security status is secure"

You will need to unlock the device with a mass erase.
This can be done with command "unlock kinetis". More information can be found in the J-Link user manual.
When handling securable devices with our software we generally suggest not to select the "allow security" devices. That way our software makes sure you don't accidentally lock you device.

Best regards,
Nino

roymesi

Beginner

Date of registration: Dec 19th 2017

Posts: 7

4

Thursday, January 18th 2018, 7:52pm

Thanks, Nino,
I must say I'm totally confused.
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. Both changes are made in the Flash Configuration Field in the Startup file (K64).
When I load the FF bin file. I see it in the Segger flasher as follows:





It means the MCU is secured, right?
Ok, now I flash this file, and it changes immediately after flashing to FE:



How come?
I wanted it to be FF.
I don't understand. If the register at CFC (address 0x40C) was set to FF, how come Segger changed it to FE?

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 716

5

Friday, January 19th 2018, 9:44am

Hello,

You are using a relatively outdated version of J-Flash.
Could you update it to the latest version and see if the behaviour improves for your case?

Quoted

It means the MCU is secured, right?

Yes with 0xFF at that spot the flash security is enabled.
J-Flash will change it because when selecting the target device at J-Flash project setup you selected the not (allow security) device (screenshot attached).
If you select the (allow security) device you can activate the flash security and J-Flash will not change the value to 0xFE anymore.
Keep in mind that with the (allow security) device setting J-Link will program any value you give him into flash without additional checks. So if you lock your device definitely J-Link won't be able to recover it.
So be very careful and sure about what you are programming with the (allow security) activated.
If you activate flash security memory access over the debug port is not possible. See Kinetis user manual section Security for more information.
So if you want to program the device a second time J-Link will offer you a mass erase of the flash.

Best regards,
Nino
SEGGER - Nino has attached the following image:
  • Capture.PNG