[SOLVED] Jlink Reset strategies Type 3: Connect under Reset for STM32L476

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

  • [SOLVED] Jlink Reset strategies Type 3: Connect under Reset for STM32L476

    Hi,

    We are using jlink V 4.99a software with JLink Lite CoretxM Hardware to erase/reflash to stm32l476 controller, Our application is sleep intensive, So when we are trying to re-flash the controller, its getting failed.

    JLink.exe -device STM32L476QE -CommanderScript C:\CommandFile.jlink

    CommandFile.jlink looks like

    Source Code

    1. f
    2. Speed 12000
    3. r
    4. h
    5. erase
    6. r
    7. qc


    Below is the error log

    Source Code

    1. $ mingw32-make flash_erase
    2. SEGGER J-Link Commander V4.99a ('?' for help)
    3. Compiled May 8 2015 17:36:27
    4. Script file read successfully.
    5. Info: Device "STM32L476QE" selected.
    6. DLL version V4.99a, compiled May 8 2015 17:35:47
    7. Firmware: J-Link Lite-Cortex-M V8 compiled Jul 17 2014 11:40:12
    8. Hardware: V8.00
    9. S/N: 518110332
    10. Feature(s): GDB
    11. VTarget = 3.338V
    12. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    13. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    14. No devices found on JTAG chain. Trying to find device on SWD.
    15. Info: Found SWD-DP with ID 0x2BA01477
    16. ****** Error: Error while identifying Cortex-M core.
    17. Info: Found SWD-DP with ID 0x2BA01477
    18. No device found on SWD.
    19. Failed to identify target. Trying again with slow (4 kHz) speed.
    20. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    21. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    22. No devices found on JTAG chain. Trying to find device on SWD.
    23. Info: Found SWD-DP with ID 0x2BA01477
    24. ****** Error: Error while identifying Cortex-M core.
    25. Info: Found SWD-DP with ID 0x2BA01477
    26. No device found on SWD.
    27. No device found at all. Selecting JTAG as default target interface.
    28. Processing script file...
    29. Firmware: J-Link Lite-Cortex-M V8 compiled Jul 17 2014 11:40:12
    30. Hardware: V8.00
    31. Target interface speed: 2000 kHz
    32. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    33. Reset delay: 0 ms
    34. Reset type UNKNOWN: ???
    35. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    36. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    37. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    38. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    39. PC: (R15) = 00000000, CPSR = 00000000 (Unknown mode, ARM)
    40. Current:
    41. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    42. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    43. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    44. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    45. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    46. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    47. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    48. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    49. R0 =00000000, R1 =00000000, R2 =00000000, R3 =00000000
    50. R4 =00000000, R5 =00000000, R6 =00000000, R7 =00000000
    51. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    52. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    53. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    54. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    55. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    56. USR: R8 =00000000, R9 =00000000, R10=00000000, R11=00000000, R12=00000000
    57. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    58. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    59. R13=00000000, R14=00000000
    60. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    61. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    62. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    63. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    64. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    65. FIQ: R8 =00000000, R9 =00000000, R10=00000000, R11=00000000, R12=00000000
    66. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    67. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    68. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    69. R13=00000000, R14=00000000, SPSR=00000000
    70. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    71. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    72. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    73. IRQ: R13=00000000, R14=00000000, SPSR=00000000
    74. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    75. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    76. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    77. SVC: R13=00000000, R14=00000000, SPSR=00000000
    78. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    79. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    80. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    81. ABT: R13=00000000, R14=00000000, SPSR=00000000
    82. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    83. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    84. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    85. UND: R13=00000000, R14=00000000, SPSR=00000000
    86. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    87. Erasing device (STM32L476QE)...
    88. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    89. ERROR: Erase returned with error code -1.
    90. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    91. Reset delay: 0 ms
    92. Reset type UNKNOWN: ???
    93. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    94. Script processing completed.
    Display All



    When manually pressing/releasing the reset button 2-3 times while flashing, in that case somehow it's succeeding

    Source Code

    1. JLink.exe -device STM32L476QE -CommanderScript C:\CommandFile.jlink
    2. SEGGER J-Link Commander V4.99a ('?' for help)
    3. Compiled May 8 2015 17:36:27
    4. Script file read successfully.
    5. Info: Device "STM32L476QE" selected.
    6. DLL version V4.99a, compiled May 8 2015 17:35:47
    7. Firmware: J-Link Lite-Cortex-M V8 compiled Jul 17 2014 11:40:12
    8. Hardware: V8.00
    9. S/N: 518110332
    10. Feature(s): GDB
    11. VTarget = 3.338V
    12. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    13. Info: TotalIRLen = ?, IRPrint = 0x..FFFFFFFFFFFFFFFFFFFFFE11
    14. No devices found on JTAG chain. Trying to find device on SWD.
    15. Info: Found SWD-DP with ID 0x2BA01477
    16. Info: Found Cortex-M4 r0p1, Little endian.
    17. Info: FPUnit: 6 code (BP) slots and 2 literal slots
    18. Info: CoreSight components:
    19. Info: ROMTbl 0 @ E00FF000
    20. Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
    21. Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
    22. Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
    23. Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
    24. Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
    25. Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
    26. Cortex-M4 identified.
    27. Target interface speed: 100 kHz
    28. Processing script file...
    29. Firmware: J-Link Lite-Cortex-M V8 compiled Jul 17 2014 11:40:12
    30. Hardware: V8.00
    31. Target interface speed: 2000 kHz
    32. Reset delay: 0 ms
    33. Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    34. PC = 1FFF3E8A, CycleCnt = 00000000
    35. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    36. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    37. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    38. R12= 00000000
    39. SP(R13)= 20002AD0, MSP= 20002AD0, PSP= 00000000, R14(LR) = FFFFFFFF
    40. XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
    41. CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    42. FPU regs: FPU not enabled / not implemented on connected CPU.
    43. Erasing device (STM32L476QE)...
    44. **************************
    45. WARNING: CPU is running at low speed (4018 kHz).
    46. **************************
    47. Info: J-Link: Flash download: Total time needed: 5.797s (Prepare: 0.135s, Compar
    48. e: 0.000s, Erase: 5.654s, Program: 0.000s, Verify: 0.000s, Restore: 0.008s)
    49. Erasing done.
    50. Reset delay: 0 ms
    51. Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    52. Script processing completed.
    Display All



    I think by using "Reset strategies Type 3: Connect under Reset" it
    can be solved, If yes, where and what command i should put in above
    script?

    The post was edited 3 times, last by Horaira ().

  • Hi Horaira,

    sorry for the delay in response.
    Were are currently improving the handling of sleep modes.
    Could you provide us with an example application which runs on an evaluation board for reproduction purposes?

    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,

    It can be easily reproduced by flashing STM32Cube_FW_L4_V1.1.0\Projects\STM32L476G_EVAL\Applications\FreeRTOS\FreeRTOS_LowPower Application Project.
    After first flash, if we are trying to re-flash the eval kit with any binary it will give error.
    But If we are using ST-Link then we are not facing this issue.
    In ST-Link there is option "connect during reset",

    same behavior we are expecting from SEGGER JLink commander using command line

    Please let me know if you need any other detail.
    Right now this has become blocker for us :(



    Regards
    Horaira

    The post was edited 3 times, last by Horaira ().

  • Hi Horaira,

    we were able to reproduce this behavior. It has been fixed in version V5.02f of the J-Link software & documentation pack.
    - DLL: Connect under reset did not work properly for ST STM32L4 series devices. Fixed

    Would you like to be added to the J-Link software update notification list, so you get informed automatically when the new version becomes available?
    In case you want to subscribe to it yourself: segger.com/notification/subscribe.php?prodid=7,94

    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.
  • Thanks for update,
    I am not aware of how to use the particular option with JLink Commander which forces JLink to "connect under reset" or it will be automatically/internally taken care by V5.02f and we should be not worried ?

    JLink.exe -device STM32L476QG -CommanderScript C:\CommandFile.jlink

    CommandFile.jlink looks like

    Source Code

    1. f
    2. Speed 12000
    3. r
    4. h
    5. erase
    6. r
    7. qc

    The post was edited 2 times, last by Horaira ().

  • Hi Horaira,

    it will be automatically/internally taken care by V5.02f and we should be not worried

    Correct.

    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.