• Welcome to Andy's Workshop Forums. Please login or sign up.
 
October 20, 2021, 01:10:42 pm

News:

SMF - Just Installed!


Compatible arm-none-eabi gcc packages

Started by Andy Brown, July 17, 2016, 07:29:44 am

Previous topic - Next topic

Andy Brown

July 17, 2016, 07:29:44 am Last Edit: December 30, 2016, 02:32:59 am by Andy Brown
gcc is now following a few separate release tracks including 4.9.x, 5.x and 6.x and I thought it might be helpful to document which is the most recent supported version for stm32plus.

4.9.x: legacy. stm32plus was developed on the 4.9.x compilers and will likely continue to work on it for some time but you are encouraged to upgrade.

5.x: current. 5-2015-q4-major release from the 5.0 series released 2015-12-23 is the latest tested release. This is gcc version 5.2.1. Do not upgrade to the 5.4 release because it contains regression bugs that affect the build. 5.4.1 (5-2016-q3-update) is now supported. A workaround is in place for the regression.

6.x: future. No support yet but when an official release appears I will look to upgrade and test with this new release.
It's worse than that, it's physics Jim!

Carlos47

Hi,
Sadly for me i upgraded arm-none-eabi-* to 5.4 before finding this post, and where having errors when building the library, i "solve" it having arm-none-eabi-* 4.9 bins located on the /usr/local directory (as described here).
After reading the SConstruct i found this section:

env.Replace(CC="arm-none-eabi-gcc")
env.Replace(CXX="arm-none-eabi-g++")
env.Replace(AS="arm-none-eabi-as")
env.Replace(AR="arm-none-eabi-ar")
env.Replace(RANLIB="arm-none-eabi-ranlib")

Where i placed /usr/local/gcc-arm-none-eabi-4_9/bin/ before the different tools names:

env.Replace(CC="/usr/local/gcc-arm-none-eabi-4_9/bin/arm-none-eabi-gcc")
env.Replace(CXX="/usr/local/gcc-arm-none-eabi-4_9/bin/arm-none-eabi-g++")
env.Replace(AS="/usr/local/gcc-arm-none-eabi-4_9/bin/arm-none-eabi-as")
env.Replace(AR="/usr/local/gcc-arm-none-eabi-4_9/bin/arm-none-eabi-ar")
env.Replace(RANLIB="/usr/local/gcc-arm-none-eabi-4_9/bin/arm-none-eabi-ranlib")

Now i can build it sucessfully, but i think this might "break" the git repo, is there a clean way to solve this?
Maybe providing SConstruct a optional parameter with the arm-none-eabi-* 4.9 path in case there's a newer version installed already?
Another recommendation?

Thanks in advance and thanks for the work on this lib.
Carlos

Andy Brown

Hi Carlos,

The build scripts have to work on all platforms: Linux, Windows and Mac and they can't make assumptions about where someone has installed the toolchain on their local system. For that reason you're expected to have your PATH variable set so that it picks up the toolchain that's correct for your local installation.
It's worse than that, it's physics Jim!

Carlos47

Hi Andy,
I didn't mean a hardcoded PATH, did a little test adding an optional parameter (it's named toolchain), and modified the SConstructor file:
Quote
...
# replace the compiler values in the environment
toolchain = ARGUMENTS.get('toolchain')

if not toolchain:
   env.Replace(CC="arm-none-eabi-gcc")
   env.Replace(CXX="bin/arm-none-eabi-g++")
   env.Replace(AS="bin/arm-none-eabi-as")
   env.Replace(AR="arm-none-eabi-ar")
   env.Replace(RANLIB="arm-none-eabi-ranlib")
else:
   env.Replace(CC=toolchain+"arm-none-eabi-gcc")
   env.Replace(CXX=toolchain+"arm-none-eabi-g++")
   env.Replace(AS=toolchain+"arm-none-eabi-as")
   env.Replace(AR=toolchain+"arm-none-eabi-ar")
   env.Replace(RANLIB=toolchain+"arm-none-eabi-ranlib")
...

And tested with:
Quote
scons mode=small mcu=f4 hse=8000000 -j4 float=hard install toolchain=/usr/local/gcc-arm-none-eabi-4_9/bin/

The toolchain option must be the path to the version 4.9 bins, if the user doesn't provide the toolchain option it's because the default toolchain on the system is version 4.9.

But yeah, i don't know if this would bring more problems on the future.
Anyways thanks for the work on the library :D

Andy Brown

A workaround is now in place for the 5.4.1 regression so the latest release can now be used.
It's worse than that, it's physics Jim!