Install STM32duino on Raspbian?

All distros
User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Install STM32duino on Raspbian?

Post by Rick Kimball » Tue Jun 27, 2017 3:15 pm

-rick

GianniDPC
Posts: 16
Joined: Thu Jun 22, 2017 10:09 am

Re: Install STM32duino on Raspbian?

Post by GianniDPC » Tue Jun 27, 2017 3:31 pm

Ok, almost there.. now I get an error after compilation, so I it can't upload to the board..

The error in the picture below is in dutch, but it translates to "Can't execute wrong executable file"

http://imgur.com/a/9hNlv

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Install STM32duino on Raspbian?

Post by Rick Kimball » Tue Jun 27, 2017 3:49 pm

You are failing because it is trying to run an intel executable on an arm processor. You need to replace the intel binaries with arm binaries. That means compiling the source and putting the exectuables in the right place.

... or

You change to the upload method to "Mass Storage" , recompile and copy the .bin file it creates in /tmp/arduino_build_xxxx/sketchname.ino.bin and copy it to NODE_R091RC disk.
-rick

GianniDPC
Posts: 16
Joined: Thu Jun 22, 2017 10:09 am

Re: Install STM32duino on Raspbian?

Post by GianniDPC » Tue Jun 27, 2017 4:11 pm

Rick Kimball wrote:
Tue Jun 27, 2017 3:49 pm
You are failing because it is trying to run an intel executable on an arm processor. You need to replace the intel binaries with arm binaries. That means compiling the source and putting the exectuables in the right place.

... or

You change to the upload method to "Mass Storage" , recompile and copy the .bin file it creates in /tmp/arduino_build_xxxx/sketchname.ino.bin and copy it to NODE_R091RC disk.
Well https://github.com/rogerclarkmelbourne/ ... /pull/283 is a ARMv7 version, I tried this one now but it gives me the following error. It's says it can't find the shared libraries but they are in home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash/lib

Code: Select all

/home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash: error while loading shared libraries: libstlink-shared.so.1: cannot open shared object file: No such file or directory

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Install STM32duino on Raspbian?

Post by Rick Kimball » Tue Jun 27, 2017 5:20 pm

Did you try recompiling and installing the massStorageCopy source and do a make install? The source is in the tools directory. That is a very simple program. All it does is find the mount point of the NUCELO-F091RC and copies the sketchname.bin file to it.
-rick

ag123
Posts: 801
Joined: Thu Jul 21, 2016 4:24 pm

Re: Install STM32duino on Raspbian?

Post by ag123 » Tue Jun 27, 2017 6:07 pm

it would seem to me that there isn't any arm-none-gcc/g++ compiler tool chain on arm platform itself isn't it?
https://developer.arm.com/open-source/g ... /downloads

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Install STM32duino on Raspbian?

Post by Rick Kimball » Tue Jun 27, 2017 6:17 pm

Wouldn't that be ironic :)
-rick

User avatar
ddrown
Posts: 145
Joined: Sat Jan 09, 2016 4:49 am

Re: Install STM32duino on Raspbian?

Post by ddrown » Tue Jun 27, 2017 9:08 pm

GianniDPC wrote:
Tue Jun 27, 2017 4:11 pm
Well https://github.com/rogerclarkmelbourne/ ... /pull/283 is a ARMv7 version, I tried this one now but it gives me the following error. It's says it can't find the shared libraries but they are in home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash/lib

Code: Select all

/home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash: error while loading shared libraries: libstlink-shared.so.1: cannot open shared object file: No such file or directory
I don't see the libraries in #283, but if they're in .../stlink/st-flash/lib, try adding one line near the top of tools/rpi/stlink_upload:

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=$(dirname $0)/stlink/st-flash/lib/
$(dirname $0)/stlink/st-flash write "$4" 0x8000000

GianniDPC
Posts: 16
Joined: Thu Jun 22, 2017 10:09 am

Re: Install STM32duino on Raspbian?

Post by GianniDPC » Wed Jun 28, 2017 11:32 am

ddrown wrote:
Tue Jun 27, 2017 9:08 pm
GianniDPC wrote:
Tue Jun 27, 2017 4:11 pm
Well https://github.com/rogerclarkmelbourne/ ... /pull/283 is a ARMv7 version, I tried this one now but it gives me the following error. It's says it can't find the shared libraries but they are in home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash/lib

Code: Select all

/home/pi/Arduino/hardware/stm/tools/linux/stlink/st-flash: error while loading shared libraries: libstlink-shared.so.1: cannot open shared object file: No such file or directory
I don't see the libraries in #283, but if they're in .../stlink/st-flash/lib, try adding one line near the top of tools/rpi/stlink_upload:

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=$(dirname $0)/stlink/st-flash/lib/
$(dirname $0)/stlink/st-flash write "$4" 0x8000000
I still get the same error. And yes the libraries are not included in the pull request, but I copied the ones from the linux folder.

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Install STM32duino on Raspbian?

Post by Rick Kimball » Wed Jun 28, 2017 12:13 pm

Which raspberry pi are you using?

Why haven't you tried the mass storage approach yet? It doesn't seem like you are using the debug features of the stlink. The whole idea of putting a mass storage device as the upload method on the nucleo boards was to make it simple to use with no extra drivers required.
Last edited by Rick Kimball on Wed Jun 28, 2017 3:20 pm, edited 1 time in total.
-rick

Post Reply