![]() ![]() (Though I haven’t used it with PlatformIO before.) I know the CMSIS-DAP probe works, because I’ve used it many times with ATSAMD MCUs. So it still fails, although the error message is a little bit different than when using the ST-Link probe. pio/build/genericSTM32F103C8/firmware.elf pio/build/genericSTM32F103C8/firmware.elfĪVAILABLE: blackmagic, cmsis-dap, dfu, jlink, serial, stlink pio/build/genericSTM32F103C8/firmware.elfĬhecking size. pio/build/genericSTM32F103C8/FrameworkCMSIS/system_stm32f1xx.oĬompiling. pio/build/genericSTM32F103C8/FrameworkCMSIS/gcc/startup_stm32f103xb.oĬompiling. 64k Flash)ĭEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)Ĭompiling. Processing genericSTM32F103C8 (platform: ststm32 framework: cmsis board: genericSTM32F103C8) I added this to the platformio.ini file: Īnd then I hooked up my CMSIS-DAP probe to the Blue Pill, and gave it a try: pio run -e genericSTM32F103C8 -target upload ![]() Then switch back to ST-Link.ĭoes that mean my ST-Link probe is no good? I have a CMSIS-DAP probe maybe I’ll try that next. Upload a benign program via the serial connection (setting the BOOT0 jumper first) to ensure to remove the problematic firmware.If it works, the current firmware likely reconfigures SWCLK/SWDIO. Change the BOOT0 jumper to 1 and try to connect to the target like so.Try to press the reset button when the ST-Link tries to initially connect to the board.But others don’t and you will have to power the board separately, e.g. Some ST-Links will provide power if they don’t measure any voltage. The VCC pin on the ST-Link is mainly to measure the voltage, not to provide it. Ensure that the Bluepill is correctly powered.It should include GND, SWDIO, SWCLK and VCC (3.3V). Ensure that the wiring between the ST-Link and the Bluepill is correct and working.The communication between PlatformIO/your computer and the ST-Link likely works. So “unable to connect to target” is a communication issue between the ST-Link and the MCU. USB Multimedia Keyboardīus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubĪnd it looks like that is covered by a udev rule: fgrep 3748 lesĪTTRS="3748", MODE="0666" Mass Storage Deviceīus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubīus 003 Device 002: ID 04ca:002f Lite-On Technology Corp. Here is how my probe shows up: lsusbīus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubīus 004 Device 003: ID 0483:3748 STMicroelectronics ST-LINK/V2īus 004 Device 002: ID 04f2:0939 Chicony Electronics Co., Ltd USB Optical Mouseīus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubīus 001 Device 003: ID 058f:6363 Alcor Micro Corp. I wondered if this could be a udev problem, but it doesn’t look like it is. Does it mean that it could not connect to the ST-Link probe? Or does it mean that the ST-Link probe could not connect to the Blue Pill board? I’m unclear exactly what “unable to connect to the target” means. XPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (-09:27)Įrror: init mode failed (unable to connect to the target) RAM: 0.1% (used 28 bytes from 20480 bytes)įlash: 0.6% (used 396 bytes from 65536 bytes)ĪVAILABLE: blackmagic, cmsis-dap, dfu, jlink, mbed, stlink pio/build/bluepill f103c8/firmware.elfĪdvanced Memory Usage is available via "PlatformIO Home > Project Inspect" LDF Modes: Finder ~ chain, Compatibility ~ softĬhecking size. Warning! Cannot find a linker script for the required board! An auto-generated script will be used to link firmware! HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 64KB FlashĭEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink) ![]() Verbose mode can be enabled via `-v, -verbose` option Tool Manager: tool-dfuutil 10 has been installed! Tool Manager: Installing platformio/tool-dfuutil ~08 Tool Manager: tool-openocd 2.1000.200630 has been installed! Tool Manager: Installing platformio/tool-openocd ~2.1000.0 Tool Manager: tool-stm32duino 1.0.1 has been installed! Tool Manager: Installing platformio/tool-stm32duino ~1.0.1ĭownloading 100% Processing bluepill f103c8 (platform: ststm32 framework: cmsis board: bluepill_f103c8) I’m using PlatformIO 5.1.1 on Ubuntu 20.04, and I tried uploading to the board like this: pio run -e 'bluepill f103c8' -target upload (And apparently I don’t know what I’m doing.) I’m attempting to upload the cmsis-blink example to a Blue Pill board using ST-Link, as a quick sanity check to make sure I know what I’m doing before I move on to more complicated things.
0 Comments
Leave a Reply. |