-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stm32duino in Arduino on Raspberry Pi #708
Comments
Hi @odo2063, If anyone want contribute to this this will be greatly appreciated. |
the arm-none-eabi-gcc seems easy... What else do you need? i could also give you SSH to Raspi if you like...or you find something with https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/legacy-mpus/spear-arm-cortex-a9-microprocessors.html |
Thanks but I will not have access with SSH due to security policies.
All tools (binaries and scripts) tested and updated in the https://github.com/stm32duino/Arduino_Tools repo. |
Hi I found this one |
For now consider Raspian as standard Debian on armhf....this will maybe change to arm64 for the Raspi4 in the future |
...seems to compile I can run any script you want me to...but I am a newbie when it comes to build up a toolchain with my own hands... |
Currently, I've no time frame to investigate this at least until next year. |
Just FYI:
After installing these packages, you can compile stm32 code on Raspberry. Eg. you can compile this: gdb debugger for blue pill. I've added a list of available commands and the output of arm-none-eabi-g++ -v: gcc-output.txt What's missing (I think) is the STM32 arduino libraries and their headers in the arduino IDE. |
@koendv |
Fine. If you provide a STM32 board package that assumes arm-none-eabi-g++, arm-none-eabi-ld, dfu-util, ... are in /usr/bin, I can try to compile some examples ("blink") on raspberry and get the examples running on black pill/blue pill. OK? |
When I said "integrate", I mean store it on GitHub and reference it in the boards JSON files. |
OK. odo2063, if I put an arm-none-eabi toolchain up, are you willing to test it? |
I could give you SSH to a raspi if you like...with X-Forwarding... |
OK. Your turn. https://github.com/koendv/stm32duino-raspberrypi gcc-arm-none-eabi-9-2019-q4-major, dfu-util 0.9, hid-flash 2.2.1, built for armv7l-linux-gnu (raspberry in 32-bit mode). Build takes 16.5 hours. I could recompile this for aarch64 if needed. |
I'll compile it that weekend...can we meet at IRC or something like that so I can hand you over the login credentials, because I don't know what to do any further? |
OK. I've got a raspberry, I've already compiled the toolchain, and you can download toolchain and stm32tools for 32-bit raspbian "Buster" from my github. What comes next is installing toolchain in the arduino ide. If I look at the package_stm_index.json file, there are 4 things needed for a functioning toolchain.
There are some issues here: it seems arduino packages need to be signed before they can be installed. And because I've compiled arm-none-eabi-gcc-9.2.1 you'll probably need to change "8.2.1-1.7" in platforms.txt to "9.2.1". But, summarizing: it's no longer a problem of compiling, it's a problem of packaging and installing. Perhaps it would be best if some small .json package index file were created for the arm/raspberry platform, for testing. I will try to compile toolchain and tools for aarch64 this weekend, so we don't have to go through this again when raspbian goes 64-bit. Does this seem logical to you? |
i got a raspi4 ;-) and if this goes productive we could do a crosscompile... |
OK. That is good news. You can download the gcc-arm-none-eabi 9.2.1 toolchain and STM32Tools for armv7l (raspberry pi in 32-bit mode) and aarch64 (raspberry pi in 64-bit mode). There's also build notes. Anything else needed? |
I did some research and I learned that the first time arm64 was supported by a major Debian distribution was Debian 9 Stretch ( Due to the relative order of the system libraries versions, I would say that binaries built on Debian 9 might fail on Ubuntu 16. Thus, although personally I'd prefer to base my binaries on Debian distributions, it is safer to go for the oldest, which means that for Arm we'll probably have to use Ubuntu 16.04. This is in line with the Arm build procedure, which also uses Ubuntu 16.04 for the And, for consistency reasons, I'd use the same 16.04 for both 32 and 64-bit variants ( Any comments on this? For the moment I installed an Ubuntu 16.04 arm64 on QEMU and I'll use it to update my xPack build scripts to add support for Arm binaries. Later on I'll probably need a hardware solution, since I expect the build times to be unbearable long in emulation. |
OK. Estimate 2.5 days build time. |
right
I know nothing about these tools, but if stm32duino is to run on generic Arm 32-bit machines, i guess they have to be The comment about avoiding the raspberry-specific But the question has another meaning too, if choosing Ubuntu 16.04, anything with On the other side, given that making a build environment based on the old Ubuntu 16 is already difficult, and going even further back in time to Ubuntu 14 is almost 'mission impossible', if there are such very old Arm 32-bit systems not able to run Ubuntu 16 |
Yes some binaries will have to be built for the targeted hosts (ex: DFU utils).
I'm not aware of arm based distribution anyway I guess supporting all possibles arch is not possible. |
OK. The latest version of dfu-utils is v0.9. If we have to recompile for armhf, let's compile on the same os used for the toolchain, and let's compile the latest version, so we don't have to revisit the subject for a year or longer. |
Good, we'll stick to Ubuntu 16.04.6 LTS, ldd --version -> 2.23 for both
Probably it would be good to build them using the same Ubuntu 16. The binaries do not need to be build necessarily on a Pi, since I'm not sure there is such an old official Ubuntu 16 running on Pi (http://cdimage.ubuntu.com/releases/16.04.6/release/), but can also be build on QEMU; for usual projects the speed should not be a limitation, as it is for toolchains; I'll publish the details of my build environments on a separate page, for those who want to play with it. |
In 2.0.0 please be sure you use the correct 32/64-bit version. |
Well, currently I don't know if it should be switch, unfortunately some user always run on 32 bits version. |
|
Is Arduino for Arm able to differentiate between 32/64-bit systems and install the proper toolchain and tools? |
Unfortunately not. Only we are on Windows else I would deploy both toolchain 32/64-bit. |
Sorry for the misunderstanding, the question was related to Linux Arm, I currently do not have Windows Arm binaries for the toolchain. So, is the Linux Arm version of Arduino able to differentiate between 32/64-bit systems? |
Sorry read to quickly. yes for ARM host OS this is OK for both system. |
Great, thank you. Please be sure you configure the correct toolchain for 32/64-bit Arm Linux systems, since they're both available. |
@koendv silly question, but I'm guessing that rpi 1 isn't supported by your package file? I get segfaults and illegal instructions so I guess I've got the armv7 versions? I wasn't seriously going to use a pi 1 to develop on, just had one lying about so decided to dust it off.... |
On Sun, 14 Mar 2021 13:50:03 -0700 Ben Anderson ***@***.***> wrote:
@koendv silly question, but I'm guessing that rpi 1 isn't supported
by your package file? I get segfaults and illegal instructions so I
guess I've got the armv6 versions? I wasn't seriously going to use a
pi 1 to develop on, just had one lying about so decided to dust it
off....
No, AFAIK you'd have to write the board package for rpi1 yourself.
I'd type gcc -v on the rpi, to get the compiler options that were used
to build gcc for the rpi1, compare that with the compiler options of
the gcc used for the arduino build, and work from there.
koen
|
OK, thought as much. The toolchain does get installed just I guess the embedded logic doesn't make any distinction between rpi1 & 2+ (just 32 & 64 bit). I had to downgrade the JDK to allow Arduino to function, Armv6 was desupported at JDK 9. |
Works lovely on an rpi4 - but I did have to rename the maple_upload bash script to maple_upload.sh and also amend line 39 to point to the correct location and filename for dfu-util.
Works a charm afterward. |
Just FYI, latest release now provides the arm none eabi toolchains for arm host: Tools will come later. |
Koen also has a build with the new Arduino IDE for AArch64. |
Hello all, I have trouble with the combination of Arduno-cli, a raspberry pi 4b and stm32duino. Current behaviorBehavior is as shown. While trying to install core STMicroelectronics:stm32, the packages download proceeds as expected, and all the arm-none-eabi-gcc packages are correctly downloaded. But the STM32Tools download that follows is leading to an error: This makes it impossible for me to install stm32duino.
Expected behaviorI would like to be able to download and install the stm32 core properly to be able to compile and upload stm32duino based sketches for the board/mcu I am using (STM32H743) from my Raspberry Pi 4B, using the arduino-cli. Environment
Arduino-cli 0.18.3 on Raspberry Pi 4 model B.
If somebody has some advice for me, that would be amazing thanks! |
BTW, since December 2020 there is also a 10.x toolchain release. |
Hi, |
Hi @camelator |
Is your feature request/improvement related to a problem? Please describe.
yes
Describe the solution you'd like
Being able to install stm32duino in Arduino on Raspberry Pi.
Describe alternatives you've considered
none
Additional context
It would be nice to be able to compile and flash stm32duino boards from a Raspberry Pi. At the moment we doing a longterm test where all devices are only available by wifi or GSM. So it would be nice to be able to implement improvements in field. It would also great in schools. the raspi4 is powerful enough to be cheap desktop for schoolusage and then it would be nice if your boards could be used besides it.
The text was updated successfully, but these errors were encountered: