PlatformIO Community

Env:bluepill_f103c6 & stlink & board_build.core = maple -> verify does not finish

Hi,

I want to flash a STM32 “Blue Pill” (env:bluepill_f103c6) using the maple build core. But it fails verifying the upload. If I remove board_build.core = maple from my platformio.ini file, it verifies fine and works as expected.

platformio.ini file:

[env:bluepill_f103c6]
platform = ststm32
board = bluepill_f103c6
framework = arduino
board_build.core = maple
debug_tool = stlink
upload_protocol = stlink

Terminal output:

 *  Task wird ausgeführt: platformio run --target upload --target monitor --environment bluepill_f103c6 

Processing bluepill_f103c6 (platform: ststm32; board: bluepill_f103c6; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c6.html
PLATFORM: ST STM32 (15.4.1) > BluePill F103C6
HARDWARE: STM32F103C6T6 72MHz, 10KB RAM, 32KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduinoststm32-maple @ 3.10000.201129 (1.0.0) 
 - tool-dfuutil @ 1.11.0 
 - tool-openocd @ 2.1100.211028 (11.0) 
 - tool-stm32duino @ 1.0.1 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/board.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/wirish/boards.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/wirish/boards_setup.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/wirish/start.S.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/wirish/start_c.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduinoVariant/wirish/syscalls.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/HardwareTimer.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/Print.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/WString.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/avr/dtostrf.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/cxxabi-compat.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/ext_interrupts.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/hooks.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/itoa.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/adc.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/adc_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/bkp_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/dac.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/dma.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/dma_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/exc.S.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/exti.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/exti_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/flash.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/fsmc_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/gpio.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/gpio_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/i2c.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/i2c_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/iwdg.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/nvic.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/pwr.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/rcc.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/rcc_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/spi.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/spi_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/stm32f1/performance/isrs.S.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/stm32f1/performance/vector_table.S.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/systick.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/timer.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/timer_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usart.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usart_f1.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usart_private.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/stm32f1/usb.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/stm32f1/usb_cdcacm.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/stm32f1/usb_reg_map.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/usb_lib/usb_core.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/usb_lib/usb_init.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/usb_lib/usb_mem.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/usb/usb_lib/usb_regs.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/libmaple/util.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/main.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/new.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/pwm.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/sdio.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/stm32f1/util_hooks.c.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/stm32f1/wiring_pulse_f1.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/stm32f1/wirish_debug.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/stm32f1/wirish_digital_f1.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/tone.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/usb_serial.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/wirish_analog.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/wirish_digital.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/wirish_math.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/wirish_shift.cpp.o
Compiling .pio/build/bluepill_f103c6/FrameworkArduino/wirish_time.cpp.o
Compiling .pio/build/bluepill_f103c6/src/main.cpp.o
Linking .pio/build/bluepill_f103c6/firmware.elf
Checking size .pio/build/bluepill_f103c6/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  42.1% (used 4312 bytes from 10240 bytes)
Flash: [======    ]  59.3% (used 19420 bytes from 32768 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, serial, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/bluepill_f103c6/firmware.elf
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-17-00:18)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

hla_swd
none separate

target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08001ce8 msp: 0x20002800
** Programming Started **
Warn : no flash bank found for address 0x08008000
Warn : no flash bank found for address 0x08008768
Warn : no flash bank found for address 0x08009410
** Programming Finished **
** Verify Started **
Error: timed out while waiting for target halted
Error: error executing cortex_m crc algorithm
embedded:startup.tcl:1070: Error: ** Verify Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 1131
at file "embedded:startup.tcl", line 1070
*** [upload] Error 1
======================================================================================================== [FAILED] Took 23.83 seconds ========================================================================================================

Is there something I can do to get it working? I want to use this library:

And it seems it only works with maple build.

greetings,
André

Add

board_build.ldscript = jtag_c6.ld

to the platformio.ini.

Already discussed in STM32 platform uploads ELF file, not BIN

wow, that was quick. And it works! Thanks a lot! I will read now why that works. :smiley:

Thank you very much!
André