I’m trying to get platformio working on an RPI3 for a nucleo_f401re but I get a version error:
> Processing nucleo_f401re (platform: ststm32; upload_port: /media/pi/NUCLEO; board: nucleo_f401re; framework: mbed)
> ------------------------------------------------------------------------------------------------------
> PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.60301.0
> Error: Could not find a version that satisfies the requirement '>=1.60301.0' for your system 'linux_armv7l'
If I use ‘pio platform install ststm32’ it does install an older version:
> PlatformManager: Installing ststm32
> Downloading [####################################] 100%
> Unpacking [####################################] 100%
> ststm32 @ 3.4.0 has been successfully installed!
> PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.40803.0,<1.40805.0
> Downloading [####################################] 100%
> Unpacking [####################################] 100%
> toolchain-gccarmnoneeabi @ 1.40803.0 has been successfully installed!
> The platform 'ststm32' has been successfully installed!
> The rest of packages will be installed automatically depending on your build environment.
But when trying to ‘platformio run --target upload’ I get the above mentioned error.
How can I install the correct version of the toolchain?
OK, so it seems that the high version number is not necessary for my purposes. In the file .platformio/platforms/ststm32/platform.py
I can change the requirement to the version that can be installed: self.packages['toolchain-gccarmnoneeabi']['version'] = ">=1.40803.0"
Now I can compile and upload my code.
> Executing task: platformio run <
Processing debug (platform: ststm32; board: genericSTM32F103RC; framework: arduino)
---------------------------------------------------------------------------------------------------
Tool Manager: Installing platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0
Error: Could not find the package with 'platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0' requirements for your system 'linux_aarch64'
The terminal process "platformio 'run'" terminated with exit code: 1.
Thanks Max, pio upgrade --dev didn’t help, but specifying in platformio.ini did the trick, so this is good!
However, when trying to compile I had other issues. The first one I hit was the compiler complained __always_inline flag in the maple lib, I worked around that by specifying this to nothing in arm-none-eabi/include/sys/cdefs.h.
But then when uploading, I hit an error similar to the original toolchain error:
Error: Could not find the package with 'platformio/tool-dfuutil @ ~1.9.190708' requirements for your system 'linux_aarch64'
What shall I specify for this one?
And when debug with ST-Link, I got an error:
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target...
xPack OpenOCD, aarch64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:33)
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 1000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed
.pioinit:13: Error in sourced command file:
Remote communication error. Target disconnected.: Connection reset by peer.
I could use the system openocd to create a gdb session and get the unified debugger to connect to that and worked fine, but not directly from pio. From the error I guess it’s some kind of permission issue, since when I open run openocd, I used sudo, but how do I grant Pio this permission, any idea for this error?
Oh if you’re compiling Maple and not the standard Arduino-STM32, that needs an older compiler. Now PIO specifies
but there actually is no compiler between thos version numbers available, only 1.90301.200702 and 1.50401.1.tar.gz, the first one too new and the other one too old. So PIO was actually right in this case and I didn’t read the version numbers properly at first.
Hm PIO does not have the dfuutil for Aarch64, but for armv6l (see bintray). Maybe they are binary compatible and you’re able to run these arm-32 bins? You can try and download Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog, extract it yourself and try and run the binary. If that works, add tool-dfuutil@<link> as a new (indented) line in platform_packages.
You can also try and compile from source (dfu-util / Code / [7e1fc9]), then create a tool-dfuutil package with a package.json just like the one in the link above but with the correct architecture description, and publish it (docs)
Do you have the udev rules installed? See Redirecting... and reboot the system. If that still fails try with sudo pio run -t upload once.
You are right about the rules @maxgerhardt, I installed it and it solves the last issue. As of the other suggestions I’ll give them a try later, at least now the whole chain is working and I can start debugging the unit. Big thanks!