[SOLVED] "Active read protected STM32 device" message after upgrading J-Trace to V5.10g

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

  • [SOLVED] "Active read protected STM32 device" message after upgrading J-Trace to V5.10g

    The J-Trace CM (3.2 14-34) was working well with my STM32F746IGK6 application before updating to the newest firmware V5.10g. Since then, I get this message and a lot of JLink errors after starting debugging (Keil uV v5.16a):

    **JLink Warning: CPU could not be halted
    ***JLink Error: Can not read register 15 (R15) while CPU is running
    ***JLink Error: Can not read register 16 (XPSR) while CPU is running
    **JLink Warning: CPU could not be halted
    **JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
    ***JLink Error: Failed to read current instruction.
    **JLink Warning: CPU could not be halted
    **JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
    ***JLink Error: Failed to read current instruction.
    ***JLink Error: Can not read register 0 (R0) while CPU is running
    ***JLink Error: Can not read register 1 (R1) while CPU is running
    ....


    I would be glad to get a hint ...
    Regards
    Marcus

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

  • Hi,

    could you open J-Link Commander (jlink.exe) type in connect, follow the instructions and post the output here?
    Which version did you use prior to 5.10g ?


    Best regards,
    Niklas
    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.
  • Below please find the output of jlink.exe. For some unknown reason, the "Active read protected" message does not come reliably. Also, the jlink errors do not appear in a working copy with minimal changes. I removed the GPIO initialization of PIN PB4 - which is connected to NJTRST. There are posts in the STM32 forum about this function - indicating potential problems when PB4 is used in the application - even though the debugger seems to not need the NJTRST.

    Kind regards
    Marcus


    TIF>s
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "STM32F746IG" selected.


    Found SWD-DP with ID 0x5BA02477
    Found SWD-DP with ID 0x5BA02477
    Found Cortex-M7 r0p1, Little endian.
    FPUnit: 8 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl 0 @ E00FD000
    ROMTbl 0 [0]: 00001000, CID: B105100D, PID: 000BB4C8 ROM Table
    ROMTbl 1 @ E00FE000
    ROMTbl 1 [0]: 00001000, CID: B105100D, PID: 000BB4C7 ROM Table
    ROMTbl 2 @ E00FF000
    ROMTbl 2 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
    ROMTbl 2 [1]: FFF02000, CID: B105E00D, PID: 000BB002 DWT
    ROMTbl 2 [2]: FFF03000, CID: B105E00D, PID: 000BB00E FPB
    ROMTbl 2 [3]: FFF01000, CID: B105E00D, PID: 000BB001 ITM
    ROMTbl 1 [1]: FFF43000, CID: B105900D, PID: 000BB975 ETM-M7
    ROMTbl 0 [1]: FFF43000, CID: B105900D, PID: 000BB9A9 TPIU-M7
    Cache: Separate I- and D-cache.
    I-Cache L1: 4 KB, 64 Sets, 32 Bytes/Line, 2-Way
    D-Cache L1: 4 KB, 32 Sets, 32 Bytes/Line, 4-Way
    Cortex-M7 identified.

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

  • Hi,


    I am not sure if I understood you correctly about the issue you are facing:

    A) J-Link reports that the STM32F7 is locked / read protected, but its actually not.

    B)
    jlink errors do not appear in a working copy with minimal changes.
    This sounds more like a configuration/setup related issue.

    I removed the GPIO initialization of PIN PB4 - which is connected to NJTRST

    Did this work previously?
    Which version of the J-Link software did you use prior to 5.10g ?

    Best regards,
    Niklas
    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 Marcus,

    thanks for your update.

    Since then, I get this message and a lot of JLink errors after starting debugging

    Could you describe at which point in time the issue occurs?
    Does the "Active read protected STM32 device" message show up before or after the download?
    Show the J-Link errors up immediately or only under certain conditions, e.g. if you set a Breakpoint or start tracing?


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

    the J-Link message Popup "Active read protected ..." appears directly after clicking download to flash (see content of output window below).
    The flashing works fine, then. The subsequent jlink errors occur after starting debug session and hitting code with the gpiob configuration. I still assume, the errors are linked to the njtrst function of the PBA pin of the STM32F7.

    Kind regards
    Marcus


    Load "Gamma-S Configuration/\\out.axf"
    * JLink Info: Device "STM32F746IG" selected.
    Set JLink Project File to "D:\Software\Gamma\Gamma-S_gestern\MDK-ARM\JLinkSettings.ini"
    * JLink Info: Device "STM32F746IG" selected.

    JLink info:
    ------------
    DLL: V5.10g, compiled Jan 6 2016 13:44:33
    Firmware: J-Trace Cortex-M Rev.3 compiled Sep 4 2015 18:16:12
    Hardware: V3.10
    S/N : 203200722
    Feature(s) : RDI, FlashBP, FlashDL, JFlash, GDB

    * JLink Info: Could not measure total IR len. TDO is constant high.
    * JLink Info: STM32 (connect): Can not attach to CPU. Trying connect under reset.
    * JLink Info: TotalIRLen = 9, IRPrint = 0x0011
  • Hi Forum,

    the detection of write protection of STM32 devices has been fixed / improved in the J-Link software & documentation pack V5.10n .

    Best regards,
    Niklas
    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.
  • "Active read protected STM32 device" message with new STM32H743 using J-Trace V6.12f

    I got the same error again, now trying to debug code for the new STM32H743.
    Should I open a new thread?
    - Marcus


    JLink info:
    ------------
    DLL: V6.12f, compiled Jan 13 2017 16:37:50
    Firmware: J-Trace Cortex-M Rev.3 compiled Dec 15 2016 14:46:47
    Hardware: V3.10
    S/N : 203200722
  • Hi Forum,


    Discussion continues here: "Active read protected STM32 device" message with new STM32H743 using J-Trace V6.12f
    (TL;DR: will be fixed in a future version)

    Best regards,
    Niklas
    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.