I am working with the crazyflie using the St-Link V2 and the debug adapter.
In the beginning everything was working fine, I could run "make openocd" and debug from another terminal window using "make gdb", I also run some python scripts that connected to openocd using telnet.
Suddenly and quickly things degraded and openocd started having problems connecting to the cf platform.
According to the openocd printouts it seems that the problem is the target voltage is too low: at most I get 1.54V (just enough to get it to start but then it fails soon after) but it is usually below 1V and close to 0V. I am not sure what it was before since I didn't pay attention to it but it looks like it should be above 3V. I am not sure this is useful but the value 1.54V is the same that I get if I run "make openocd" and the crazyflie is unplugged. Otherwise with the crazyflie connected the terminal printouts looks something like this:
Code: Select all
openocd -d2 -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c init -c targets -c "\$_TARGETNAME configure -rtos auto"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v37 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 0.001567
Error: target voltage may be too low for reliable debugging
Error: init mode failed (unable to connect to the target)
in procedure 'init'
in procedure 'ocd_bouncer'
make: *** [openocd] Error 1
Code: Select all
openocd -d2 -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c init -c targets -c "\$_TARGETNAME configure -rtos auto"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v37 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 1.455353
Error: target voltage may be too low for reliable debugging
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* stm32f4x.cpu hla_target little stm32f4x.cpu unknown
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f4x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
- I updated the stlink firmware
- I tried different firmware versions (it could have been some recent low power setting of the MCU, at the beginning I was using an older version of the firmware)
but the problem persists.
I thought it could be some contact in the cables that are wearing out, but everything is very new and seems in good condition.
I am using mac and tried also with your virtual machine but I get the same errors.
One thing that could have cause the problem is that I did try some "wild" and low-level memory writings through openocd, like for example:
Code: Select all
mww 0x2000c810 0
Do you have any guess on what I might have broken and how to fix it?
Any reset more radical than re-flashing the firmware that I could try?
Thanks a lot in advance for any help
Claudio