Warning message while flashing freescale mk60n512

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Warning message while flashing freescale mk60n512

    Hi,
    I'm using JLink ce to debug freescale mk60n512 target board. It works with "hello world" program compiled by keil.
    but when I switch to arm-none-eabi-gcc, JLink popped up a Warning dialog with following message:
    "Your application message would set the system security
    and/or disable the mass erase functionality of the device.
    This is not supported in the current configuration.
    Application data has been changed accordingly."

    What does this message mean? How to fix it?

    Though I can continue downloading the program by clicking "OK" on that Warning dialog, the target board seems going
    to some kind state that have to use JLink unlock command to back it to normal.

    So any suggestion? Thanks very much.

    BTW, I'm using the V4.28c version GDB server.
  • Hi,

    What does this message mean? How to fix it?


    It means what it says: The application image you are trying to download sets the security bits of the K60 device or disables mass erase of the device.
    These configuration bits are part of the normal flash area (see K60 manual for more information about flash security especially FSEC register. They are located at 0x40C)
    Since a lot of customers accidentally locked their devices in the past, we decided to implement a mechanism to avoid this and to make sure that the device can still be mass erased by the unlock command.

    Though I can continue downloading the program by clicking "OK" on that Warning dialog, the target board seems going
    to some kind state that have to use JLink unlock command to back it to normal.


    I am wondering a bit how that can happen because I checked the code and the security should not be enabled,
    so it should not be necessary to use the "unlock" command.
    Could you please post the ELF file you are trying to download so we can check the mechanism again?


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Alex wrote:

    Hi,

    It means what it says: The application image you are trying to download sets the security bits of the K60 device or disables mass erase of the device.
    These configuration bits are part of the normal flash area (see K60 manual for more information about flash security especially FSEC register. They are located at 0x40C)
    Since a lot of customers accidentally locked their devices in the past, we decided to implement a mechanism to avoid this and to make sure that the device can still be mass erased by the unlock command.

    Thanks Alex, I found value of my binary at address 0x40c is "0x02", as the warning message said, it will change my application data accordingly.
    I am wondering since "0x02" does not break any FSEC rules, why this message is popped up and the application data changed to "0x32"?

    I am wondering a bit how that can happen because I checked the code and the security should not be enabled,
    so it should not be necessary to use the "unlock" command.
    Could you please post the ELF file you are trying to download so we can check the mechanism again?

    well, this I am not very sure, could be the changed application data results in reset while running my program, which I comfused it with security state.

    Please see the binary file in attachment and Thanks very much


    Files
    • a.zip

      (23.38 kB, downloaded 812 times, last: )
  • Hi,

    But Still don't understand why my application data got changed from 0x02 to 0x32, the binary is attached in previous message.

    Because J-Link makes sure that neither mass erase is disabled nor the system security is enabled by the application image.
    0x02 at 0x40C would cause the mass erase enable bits to be set into the disabled state.
    Even if the system security is not set (which causes the mass erase bits to be meaningless),
    J-Link makes sure that the mass erase bit keep their enabled state if bad application code accidentally enables the system security,
    so J-Link still has a chance to unlock the device.


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    I gave the ELF file you provided a short try.
    So far I do not see any problems with it.
    The data is corrected accordingly to avoid system security and mass erase disable.
    The device does not stop working and I can still access it (even after a power on reset).


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks for trying it.
    This might be my mistake. Probably the changed application data results in malfunction of my program, which confused me.
    As for the target board, I guess it is OK.

    But the 0x02 --> 0x32 question.
    In K60 sub-family reference manual, Page 639, it says that bit5-4's definition as following:

    Mass Erase Enable Bits
    Enables and disables mass erase capability of the FTFL module. The state of the MEEN bits is only
    relevant when the SEC bits are set to secure outside of NVM Normal Mode. When the SEC field is set to
    unsecure, the MEEN setting does not matter.
    00 Mass erase is enabled
    01 Mass erase is enabled
    10 Mass erase is disabled
    11 Mass erase is enabled

    First, Doesn't it mean MEEN only matter when SEC bits are secure?
    Second, Doesn't 0x02 mean Mass erase enabled according to the doc?

    Thanks

    The post was edited 1 time, last by can.finner ().

  • Hi,

    First, Doesn't it mean MEEN only matter when SEC bits are secure?

    This is what I wrote before...
    But J-Link still makes sure that they are set to a non-critical state.

    Nevertheless, we will check if we can improve the warning so that it only shows up under very special circumstances: Security enabled + mass erase enabled, Security enabled + mass erase disabled, Security disabled but mass erase enabled does not cause the warning)


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.