I have an project with an arduino Mega 2560, that I build on PlatformIO.
2 months ago, this project was correctly build and I’haven’t work on it for few weeks.
Today, I’m back on this project and the first thing that platformio do it’s an update.
I hadn’t change anything but today this project’size is 339034 byte (greather than the arduino memory) and I cant’ use it, but it’s correctly build.
2 month ago, this project’s size was approximatly 60000~70000 bytes !
How is possible, without any change (but an platformio update) that my project grow like this ??? I don’t understand…
I need to put it like before on my arduino…
It has nothing to do with the platformio update.
Have you tried building the same project using the arduino IDE??
platformio still uses avr-gcc on the backend to compile and build the project. So if your project code binary has increased then it is due to the change in avr-gcc.
OK, I have change the configuration in platformio.ini. I have add theses lines:
build_unflags = -Os -std=gnu++11
build_flags = -O2
build_flags = -s
and now my binary’size is almost 170 000 bytes… for now it’s ok!
I don’t know why I need that, maybe during the update the command line to build/link the project has change…
Where I can see the default command line to build a project ?
We switched to GCC 4.9.2 a 1 month ago. See
That’s it! Is it possible to go back to the previous gcc ?
Sure. Please have a look under general options - platform section in the project configuration section in the platformio docs. You can specify the exact version of gcc you would like to use to compile the source code.
You don’t need to play with toolchains to back to previous version. PlatformIO is very powerful ecosystem that allows to depend on specified version of development version. The previous version before migration to GCC 4.9 was
1.1.0. Then, just place this line to your project
platform = firstname.lastname@example.org
Please note that you can have multiple different versions of the same development platform. PlatformIO will automatically manage all packages and load them depending on your requirements specified in the config file.