Updating compiler/toolchain version

What could be included in further releases
Post Reply
iamtr3s
Posts: 2
Joined: Mon Dec 30, 2019 11:25 am

Updating compiler/toolchain version

Post by iamtr3s »

Hi guys,

As most of you may know, the bundled GNU toolchain for the (now known as) Roger's/LibMaple Core is quite old.
Because some of the personal projects I've been working on started to give me headaches due to program size and memory consumption, I decided to investigate on how I could reduce the program size of my builds. So I found out that there is new stuff on the compilers to help with this, but unfortunately the current toolchain is too old and does not support these features.

I edited my platform.txt to use the same toolchain as the STM32 Core and to my surprise, with the same build flags, the program size reduced in almost 50%! :shock: :o :o
Also, the memory consumption reduced around 25%.
compiler.path={runtime.tools.xpack-arm-none-eabi-gcc-9.2.1-1.1.path}/bin/
I had to make a few changes though. Had to remove the defines for min and max in wirish_math.h as they collide with the stl_algobase.h ones. Still don't understand why they don't collide with the older toolchain though. Can someone explain this to me?

I took my research a little further and learned that the latest STM32 Core (1.8.0) has support for the nano.specs and LTO which help to reduce the program size of your builds even more (of course, in detriment of speed).

What do you guys think about updating the toolchain of this Core?

P.S.: By the way, where are these keys -> {runtime.tools.xpack-arm-none-eabi-gcc-9.2.1-1.1.path} defined?
Last edited by iamtr3s on Mon Dec 30, 2019 3:48 pm, edited 2 times in total.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Updating compiler/toolchain version

Post by fpiSTM »

The SAMD core use this version:

Code: Select all

compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
See: https://github.com/arduino/ArduinoCore- ... rm.txt#L34

The one using the xpack-arm-none-eabi-gcc-9.2.1-1.1 is from the STM32 core version 1.8.0 :

Code: Select all

compiler.path={runtime.tools.xpack-arm-none-eabi-gcc-9.2.1-1.1.path}/bin/ 
iamtr3s wrote: Mon Dec 30, 2019 11:56 am P.S.: By the way, where are these keys -> {runtime.tools.xpack-arm-none-eabi-gcc-9.2.1-1.1.path} defined?
This is linked to the JSON file definition which defines tools dependencies for the core and describes each version:
https://github.com/stm32duino/BoardMana ... 1022-L1057
iamtr3s
Posts: 2
Joined: Mon Dec 30, 2019 11:25 am

Re: Updating compiler/toolchain version

Post by iamtr3s »

Hi fpiSTM,

You're correct, my mistake! I ended up using the STM32 Core toolchain in the final tests!
Thanks for noticing that. I'll edit the original post.

Regarding the key, does it (IDE) have a rule to convert that into a folder path?
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Updating compiler/toolchain version

Post by fpiSTM »

iamtr3s wrote: Mon Dec 30, 2019 3:46 pm Regarding the key, does it (IDE) have a rule to convert that into a folder path?
The IDE check in the JSON the dependencies tools name and version which are used for the path of a dedicated core.
If you have installed the STM32 core with xpack gcc 9 then maybe it would works using the same syntax.
This is purely Arduino IDE stuff so hard to tell.
Post Reply

Return to “Ideas & suggestions”