Poking around with the SWD interface on the debug board I just received.
Setup details:
I'm using the STM32F4 discovery's J-link interface as my debugger, hooked up to the crazyflie debug adapter, hooked up to a CF2. I'm running natively on windows (via some combination of cygwin and eclipse). This is all properly set up and running using OpenOCD, etc. (I know this for a fact because I'm able to load firmware via the radio and then connect and step in eclipse via SWD)
I'm trying to build and deploy firmware via the SWD interface -- I've done 'make DEBUG=1 CLOAD=0' followed by 'make flash'. The flashing goes through and succeeds, but the CF2 ends up sitting with a single blue light, doing nothing. I'm also not able to enter the bootloader via long-pressing the button any longer.
Here's the output from openOCD on the flash command:
Thinking I perhaps managed to hose the bootloader on my CF, I decided to try to rebuild and went back to the crazyflie2-stm-bootloader project to reflash it (also via SWD) and sure enough the self test went off without a hitch as soon as the flash completed (With no need to re-flash the actual firmware).Sean@txtmsgbreakup ~/projects/crazyflie/official_repos/crazyflie-firmware
$ make flash
openocd -d2 -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c init -c targets -c "reset halt" \
-c "flash write_image erase cf2.elf" -c "verify_image cf2.elf" -c "reset run" -c shutdown
Open On-Chip Debugger 0.9.0 (2015-05-19-12:06)
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 v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.892490
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* stm32f4x.cpu hla_target little stm32f4x.cpu running
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080002bc msp: 0x20005000
auto erase enabled
Info : device id = 0x10016413
Info : flash size = 1024kbytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20005000
wrote 262144 bytes from file cf2.elf in 9.438923s (27.122 KiB/s)
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20005000
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20005000
verified 178344 bytes in 1.703063s (102.265 KiB/s)
shutdown command invoked
Kind of feels like I'm missing an obvious step here -- should I expect a firmware loaded via 'make flash' to boot just the same as if I flashed via radio? The fact that it sends a shutdown after flashing would explain why the firmware doesn't run, but I would have expected power cycling via the pushbutton to start up normally.
Thanks
Sean