cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve the error "CM4 Failed to read all registers" when trying to debug?

OYann.1
Associate

Hi, I'm tring to write my program on a Mikrobus Clicker 2 (STM32F407VG) from the Software STM32CubeiDE with a mac. then I create a project and connected my board on my ST-LINK/V2.

I configured Pins and set As Serial Wire. and the Debug As SWD.

I got this 2 errors (Alternate with same configuration):

ERROR 1 :

STMicroelectronics ST-LINK GDB server. Version 5.5.0
 Copyright (c) 2019, STMicroelectronics. All rights reserved.
  
 Starting server with the following options:
     Persistent Mode      : Disabled
     LogFile Name        : /Users/admin/STM32CubeIDE/workspace_1.3.0/myproject/Debug/st-link_gdbserver_log.txt 
    Logging Level       : 31 
    Listen Port Number     : 61234 
    Status Refresh Delay    : 15s 
    Verbose Mode        : Enabled 
    SWD Debug         : Enabled 
  
Target connection mode: Attach 
Hardware watchpoint supported by the target  
COM frequency = 4000 kHz 
ST-LINK Firmware version : V2J36S7 
Device ID: 0x413 
PC: 0xfffffffe 
 
ST-LINK device status: HALT_MODE 
ST-LINK detects target voltage = 1.19 V 
ST-LINK device status: HALT_MODE 
ST-LINK device initialization OK 
 
Waiting for debugger connection... 
Waiting for connection on port 61234... 
Accepted connection on port 61234... 
Debugger connected 
 
CM4 Failed to read all registers 
FAILED to REGISTER Values from the target 
Debugger connection lost.
Shutting down...

 ERROR 2 :

STMicroelectronics ST-LINK GDB server. Version 5.5.0
Copyright (c) 2019, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        LogFile Name               : /Users/admin/STM32CubeIDE/workspace_1.3.0/alphaboxv2/Debug/st-link_gdbserver_log.txt
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled
 
Target connection mode: Attach
Target connection failed
Target no device found
 
Error in initializing ST-LINK device.
Reason: No device found on target.

What could make this error and how resolve it? What's CM4?

Thank you!

2 REPLIES 2
OYann.1
Associate

looks like the target voltage was too Low. I put the VCC (pin 1) of the JTAG CONNECTOR to the 3V3 of the Mikroe Clicker 2. Like this, the ST-LINK got the 3V3

Kaveh
Associate III

I also had the same issue and apparently none of my laptop USB ports couldn't supply correct voltage. Powered up my board by an external voltage source and worked like a charm. Give it a try, it's worst your time!!