Could not initialize project BluePill

Hello everyone,
I’m trying to create a basic blink project with bluepill. And I’m getting this error:

Could not initialize project
PIO Core Call Error: “The current working directory /home/pi/Documents/PlatformIO/Projects/blinkkkk will be used for the project.\n\nThe next files/directories have been created in /home/pi/Documents/PlatformIO/Projects/blinkkkk\ninclude - Put project header files here\nlib - Put here project specific (private) libraries\nsrc - Put project source files here\nplatformio.ini - Project Configuration File\n\n\nError: Could not find the package with ‘platformio/toolchain-gccarmnoneeabi @ ~1.90201.0’ requirements for your system ‘linux_armv7l’”

I am using a RPi 4.

Thanks in advance!

Indeed PlatformIO doesn’t have the ARM GCC compiler package for the Raspbi / Linux ARMv7L architecture, but I think the same tricks as per Error compiling Arduino board "teensy40" on Raspbian GNU/Linux 10 (buster) · Issue #51 · platformio/platform-teensy · GitHub can be applied here.

The project should have been created anyways, so you can open the platformio.ini of it and add

platform_packages = 
   toolchain-gccarmnoneeabi@https://dl.registry.platformio.org/download/platformio/tool/toolchain-gccarmnoneeabi/1.90301.200702/toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200702.tar.gz

to it and maybe it works with the ARMv6L package.

Otherwise, please open an issue at Issues · platformio/platform-ststm32 · GitHub to have those toolchains added.

(I remember compiling the compiler was an extremely painfull process though :smiley: )

Well, now I do think I have to high expectations from the RPi. :smiley:

Okay, switched to Windows 10. Again Blue Pill and ST Link Clone. Blink a LED again.

This error mesage pops out now.

Uploading .pio\build\bluepill_f103c8\firmware.elf
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
debug_level: 1

hla_swd
none separate

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: open failed
in procedure ‘program’
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1

Is it a driver problem that I have?

And a prt sc.

Can you try and download & install the STSW-LINK004 - STM32 ST-LINK utility (replaced by STM32CubeProgrammer) - STMicroelectronics to make sure you have the latest ST-Link drivers installed? (uninstall an older version if it exists).

If this tool also can’t connect to the chip under any settings (SWD + lower clock speed + system core reset / hardware reset), your wiring may be wrong.

1 Like

I just installed it. That was the problem (the driver that came with the software). The Blue Pill is blinking happily away. Thank you Maximilian! :smile:

Uploading .pio\build\bluepill_f103c8\firmware.elf
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
debug_level: 1

hla_swd
none separate

target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080006b4 msp: 0x20005000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
========================================================================== [SUCCESS] Took 10.43 seconds ==========================================================================