[SOLVED] Nucleo-F303RE - CPU could not be halted

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

  • [SOLVED] Nucleo-F303RE - CPU could not be halted

    Hello,

    I am using STM32 Nucleo-F446RE board to program and debug a custom STM32F3 board through J-Link and it works fine. To be able to debug the communication between 2 of my custom boards I wanted to debug them both simultaneously, so I bought a second Nucleo board, this time STM32 Nucleo-F303RE. However I can't make the new Nucleo flash and debug my microcontroller.

    I used the Reflash Utility to convert the ST-Link into J-link. I tested it and it didn't work, so I updated the firmware, but no result.

    I use the exactly same setup with both Nucleos: same target board, same cables, same jumper configuration. I use Eclipse IDE as a programming environment. Here are both SEGGER logs (working and not working) that I get:

    SEGGER Log for Nucleo-F446RE (working):

    Brainfuck Source Code

    1. SEGGER J-Link GDB Server V6.60f Command Line Version
    2. JLinkARM.dll V6.60f (DLL compiled Jan 20 2020 16:15:17)
    3. Command line: -if swd -device STM32F303CB -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
    4. -----GDB Server start settings-----
    5. GDBInit file: none
    6. GDB Server Listening port: 2331
    7. SWO raw output listening port: 2332
    8. Terminal I/O port: 2333
    9. Accept remote connection: localhost only
    10. Generate logfile: off
    11. Verify download: on
    12. Init regs on start: on
    13. Silent mode: off
    14. Single run mode: on
    15. Target connection timeout: 0 ms
    16. ------J-Link related settings------
    17. J-Link Host interface: USB
    18. J-Link script: none
    19. J-Link settings file: none
    20. ------Target related settings------
    21. Target device: STM32F303CB
    22. Target interface: SWD
    23. Target interface speed: 1000kHz
    24. Target endian: little
    25. Connecting to J-Link...
    26. J-Link is connected.
    27. Firmware: J-Link STLink V21 compiled Jun 26 2017 10:35:16
    28. Hardware: V1.00
    29. S/N: 774801057
    30. Checking target voltage...
    31. Target voltage: 3.30 V
    32. Listening on TCP/IP port 2331
    33. Connecting to target...
    34. Connected to target
    35. Waiting for GDB connection...Connected to 127.0.0.1
    36. Reading all registers
    37. Read 4 bytes @ address 0x00000000 (Data = 0x2000A000)
    38. Read 2 bytes @ address 0x00000000 (Data = 0xA000)
    39. Received monitor command: speed 1000
    40. Target interface speed set to 1000 kHz
    41. Received monitor command: clrbp
    42. Received monitor command: reset
    43. Resetting target
    44. Received monitor command: halt
    45. Halting target CPU...
    46. ...Target halted (PC = 0x0000029C)
    47. Received monitor command: regs
    48. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    49. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    50. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    51. R12= 00000000, R13= 2000A000, MSP= 2000A000, PSP= 00000000
    52. R14(LR) = FFFFFFFF, R15(PC) = 0000029C
    53. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    54. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    55. Reading all registers
    56. Read 4 bytes @ address 0x0000029C (Data = 0xF7FFB508)
    57. Read 2 bytes @ address 0x0000029C (Data = 0xB508)
    58. Received monitor command: speed auto
    59. Select auto target interface speed (2000 kHz)
    60. Received monitor command: flash breakpoints 0
    61. Flash breakpoints disabled
    62. Received monitor command: semihosting enable
    63. Semi-hosting enabled (Handle on BKPT)
    64. Received monitor command: semihosting IOClient 3
    65. Semihosting I/O set to TELNET and GDB Client
    66. Read 4 bytes @ address 0x0000029C (Data = 0xF7FFB508)
    67. Downloading 928 bytes @ address 0x00000000 - Verified OK
    68. Downloading 40 bytes @ address 0x000003A0 - Verified OK
    69. Downloading 4096 bytes @ address 0x000003D0 - Verified OK
    70. Downloading 4096 bytes @ address 0x000013D0 - Verified OK
    71. Downloading 4096 bytes @ address 0x000023D0 - Verified OK
    72. Downloading 4096 bytes @ address 0x000033D0 - Verified OK
    73. Downloading 4096 bytes @ address 0x000043D0 - Verified OK
    74. Downloading 4096 bytes @ address 0x000053D0 - Verified OK
    75. Downloading 4096 bytes @ address 0x000063D0 - Verified OK
    76. Downloading 4096 bytes @ address 0x000073D0 - Verified OK
    77. Downloading 2011 bytes @ address 0x000083D0 - Verified OK
    78. Downloading 8 bytes @ address 0x00008BAC - Verified OK
    79. Downloading 1548 bytes @ address 0x00008BB4 - Verified OK
    80. Comparing flash [....................] Done.
    81. Writing register (PC = 0x 188)
    82. Read 4 bytes @ address 0x00000188 (Data = 0xB083B500)
    83. Received monitor command: clrbp
    84. Received monitor command: reset
    85. Resetting target
    86. Received monitor command: halt
    87. Halting target CPU...
    88. ...Target halted (PC = 0x0000029C)
    89. Received monitor command: regs
    90. R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
    91. R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
    92. R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    93. R12= 00000000, R13= 2000A000, MSP= 2000A000, PSP= 00000000
    94. R14(LR) = FFFFFFFF, R15(PC) = 0000029C
    95. XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    96. CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    97. Reading all registers
    98. Read 4 bytes @ address 0x0000029C (Data = 0xF7FFB508)
    99. Starting target CPU...
    Display All

    SEGGER Log for Nucleo-F303RE (not working):

    Source Code

    1. Could not connect to target.
    2. Please check power, connection and settings.SEGGER J-Link GDB Server V6.60f Command Line Version
    3. JLinkARM.dll V6.60f (DLL compiled Jan 20 2020 16:15:17)
    4. Command line: -if swd -device STM32F303CB -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
    5. -----GDB Server start settings-----
    6. GDBInit file: none
    7. GDB Server Listening port: 2331
    8. SWO raw output listening port: 2332
    9. Terminal I/O port: 2333
    10. Accept remote connection: localhost only
    11. Generate logfile: off
    12. Verify download: on
    13. Init regs on start: on
    14. Silent mode: off
    15. Single run mode: on
    16. Target connection timeout: 0 ms
    17. ------J-Link related settings------
    18. J-Link Host interface: USB
    19. J-Link script: none
    20. J-Link settings file: none
    21. ------Target related settings------
    22. Target device: STM32F303CB
    23. Target interface: SWD
    24. Target interface speed: 1000kHz
    25. Target endian: little
    26. Connecting to J-Link...
    27. J-Link is connected.
    28. Firmware: J-Link STLink V21 compiled Aug 12 2019 10:29:20
    29. Hardware: V1.00
    30. S/N: 775245505
    31. Checking target voltage...
    32. Target voltage: 3.30 V
    33. Listening on TCP/IP port 2331
    34. Connecting to target...
    35. WARNING: CPU could not be halted
    36. Halting target device failed. Trying again with reset
    37. WARNING: CPU could not be halted
    38. WARNING: CPU could not be halted
    39. WARNING: CPU could not be halted
    40. WARNING: CPU could not be halted
    41. WARNING: CPU could not be halted
    42. ERROR: Failed to halt CPU.
    43. WARNING: CPU could not be halted
    44. Failed to halt target device on connect
    45. ERROR: Could not connect to target.
    46. Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
    47. Shutting down...
    Display All


    When I use the J-Link Commander I get a similar message that the CPU could not be halted.

    I tried to upload the Blinky example to the on-board STM32F303RE controller and it works fine.

    What could be causing this behaviour? Any help would be appreciated.

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

  • Hi,
    Thank you for your inquiry.

    Please note that the usage of the J-Link on the ST board in such way is a license violation and illegal.
    You can read the license agreement in the daily pop-up and here:
    segger.com/products/debug-prob…nk-on-board/#terms-of-use

    Since you seem to be using this setup in an educational purpose please find information about our official products for educational use here:
    Small/cheaper version: segger.com/products/debug-prob…k/models/j-link-edu-mini/
    More robust version with more features: segger.com/products/debug-probes/j-link/models/j-link-edu/

    Pros:
    - Use is legal for private and educational purposes.
    - Cheaper than most evaluation boards, so it should be affordable for any budget.
    - Supports all our supported devices.

    We will close this thread now.
    Please do not open further threads regarding this topic or we will have to remove you from this forum.

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