[SOLVED] Flasher ARM Stand-alone -secure device option does not seem to work

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

  • [SOLVED] Flasher ARM Stand-alone -secure device option does not seem to work

    I have a Flasher ARM configured to program a STM32F, the project setting for Production, Auto - Secure chip is set.

    In J-Link mode the auto option does secure the chip after programming, I cannot read back the chip contents via the Target, Read Back drop down menus, so far so good.

    But when the Flasher is started in stand alone mode and a chip is programmed, the chip contents can be read back later in J-Link mode.

    I assume that the chip has not been secured in standalone mode. How do I get the stand alone mode to secure the chip?

    The Flasher code version is 4.14i
  • Hello,

    thank you for the information.
    We are already analyzing the problem.
    We will inform you, as soon as a fix is available.


    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,

    is there a solution for this problem meanwhile?

    I tried using Flasher with STM32F415RG, but 'Secure chip' still only works when using flasher in non-standalone mode!
    Securing the chip is absolutely essential!

    My device: SEGGER Flasher ARM V4.0

    Regards
    Dirk
  • Hi,

    Currently, Flasher does not perform the "Secure chip" sequence. This is still on our internal ToDo.
    However, you should be able to lock the device in stand-alone-mode, by using the "Exit steps" (Project settings -> CPU -> Exit steps).
    I can provide you with the secure chip sequence (c-style) so you can simply adapt it into the J-Flash project:

    v = FLASH_OPTCR;
    //
    // If flash option control register is locked, unlock it
    //
    if (v & (1uL << 0)) {
    JLINKARM_WriteU32(FLASH_OPTKEYR, 0x08192A3B);
    JLINKARM_WriteU32(FLASH_OPTKEYR, 0x4C5D6E7F);
    }
    v &= 0xFFFF00FC;
    //
    // Set protection to protection level 1
    //
    v |= 0x000000FF << 8;
    FLASH_OPTCR = v;
    //
    // Start option byte programming
    //
    FLASH_OPTCR |= (1uL << 1);
    //
    // Wait for operation to complete
    //
    do {
    Status = FLASH_SR;
    } while (Status & (1uL << 16));
    FLASH_OPTCR = v | (1uL << 0)); // Lock access to flash option control register

    The Do - While to wait for operation to complete, can be adapted by using BEQ or BNE action type or by simply adding a delay.
    If you have any questions or need any help, please just let me know.


    Best regards
    Erik
    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,

    thanks for your hints, i finally got it working with "Exit steps" :thumbsup: .



    I wasn't sure how to use BEQ/BNE so I easily took a delay of 100ms.


    Now I can program my ARM Cortex M4 system with flasher in standalone mode, including read out protection.


    Regards
    Dirk
  • Hi,

    Thanks for the feedback.
    Good to hear that you have been successfully :)

    I wasn't sure how to use BEQ/BNE so I easily took a delay of 100ms.
    Maybe we can add a small description / example in the manual. Anyhow, using the fixed delay should be fine, too as it is only performed once (at the end of a programming session).


    Best regards
    Erik
    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.