Thanks @maxgerhardt.
-
All my boards have 25Mhz crystal and when I build a blinky binary with env:env:blackpill_f401cc/arduino, all the three CPU type runs that binary well and blink at the same rate.
-
As for debugging, I tried it but the env:blackpill_f401ce binary is so bad that I cannot even break at Reset_Handler or main.
For example, here is an attempt to debug a simple blinky. It works when I use the f401cc env but when I try it with the f401ce env the MCU doesnât break
platformio.ini:
[env:blackpill_f401ce]
platform = ststm32
board = blackpill_f401ce
framework = arduino
debug_tool = stlink
upload_protocol = stlink
build_flags = -Wl,-Map,output.map
debug_init_break = tbreak Reset_Handler
Debug log:
Processing blackpill_f401ce (platform: ststm32; board: blackpill_f401ce; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/blackpill_f401ce.html
PLATFORM: ST STM32 (11.0.0) > BlackPill F401CE
HARDWARE: STM32F401CEU6 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES:
- framework-arduinoststm32 4.10900.200819 (1.9.0)
- framework-cmsis 2.50501.200527 (5.5.1)
- toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 10 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Linking .pio\build\blackpill_f401ce\firmware.elf
Checking size .pio\build\blackpill_f401ce\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.9% (used 888 bytes from 98304 bytes)
Flash: [ ] 2.4% (used 12392 bytes from 524288 bytes)
========================= [SUCCESS] Took 8.51 seconds =========================
Reading symbols from c:\Users\User\Downloads\test4\.pio\build\blackpill_f401ce\firmware.elf...
undefinedC:\Users\User\.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 2000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.243243
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on pipe
Info : accepting 'gdb' connection from pipe
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x21000003 pc: 0xfffffffe msp: 0x20000be8
Info : device id = 0x10016433
Info : flash size = 512 kbytes
Info : flash size = 512 bytes
0xfffffffe in ?? ()
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1028 ms). Workaround: increase "set remotetimeout" in GDB
Loading section .isr_vector, size 0x194 lma 0x8000000
Loading section .text, size 0x2b44 lma 0x8000194
Loading section .rodata, size 0x498 lma 0x8002cd8
Loading section .ARM, size 0x8 lma 0x8003170
Loading section .init_array, size 0x14 lma 0x8003178
Loading section .fini_array, size 0x8 lma 0x800318c
Loading section .data, size 0x8c lma 0x8003194
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000b2c msp: 0x20018000
Start address 0x8000b2c, load size 12832
Transfer rate: 7 KB/sec, 1833 bytes/write.
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Unable to match requested speed 2000 kHz, using 1800 kHz
Error: timed out while waiting for target halted
TARGET: stm32f4x.cpu - Not halted
timed out while waiting for target halted
TARGET: stm32f4x.cpu - Not halted
Temporary breakpoint 1 at 0x8000b2c: file C:\Users\User\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\gcc\startup_stm32f401xe.s, line 78.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak Reset_Handler`
PlatformIO: More configuration options -> http://bit.ly/pio-debug
Note: automatically using hardware breakpoints for read-only addresses.
Warn : target not halted
Info : target stm32f4x.cpu was not halted when resume was requested
target not halted
target stm32f4x.cpu was not halted when resume was requested
I would post here the firmware.elf it generates but the system doesnât let me.
Any suggestion will be greatly appreciated. Or experience of other uses of blackpill_f401ce/arduino.
Edit: Google search to âenv:blackpill_f401ceâ (with the double quotes) doesnât yield results beyond the platformio documentation and makes me think that that configuration was actually used.
Thanks,
Z.