-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Description
Since we are moving towards firmware having variants, it may be a good time to shift our dev stack onto platform IO.
We are trying to solve the following problems:
- Maintain code structure to keep Arduino Compatibility
Add a provision to selectboardandfw variationto create the specific bin file from source- Increase automation in creating binaries for different boards
Process flow
ToDo: add process flow explaining how different variations of the firmware can be built using different build flags.
Important Notes
Adafruit SAMD board package
- The latest firmware on EmotiBit(currently v1.5.4) uses an older
Adafruit SAMD board package (v1.5.1)- A history of all versions can be found here
- To get an environment set up in platformIO, one needs to specify the
board,platformand theframeworkin the.inifile. - For our code, that looks something like
[env:adafruit_feather_m0]
platform = atmelsam @3.8.1
board = adafruit_feather_m0
framework = arduino
- We need to specifically specify the
atmelsamversion asv3.8.1because as per the release notes, that platformio version is the parity for adafruit samd board package v1.5.1. You can check this in the release notes forv3.8.0 - But, this version of the platform is compatible with an earlier version of the framework(v4.3.0) which unfortunately has been marked as obsolete. As a consequence, when platformio is compiled with the enviroment set as above, the required framework is unable to be installed automatically.
- To solve this, you need to manually add this framework to the PIO core.
- Download the zip from the link.
- Unzip the archive and place the unzipped folder in your platformIO core folder. The location should be equivalent to
C:\Users\nitin\.platformio\packagespath on windows. - It should look something like
- Once the framework is added, you should be able to build from source using platformIO!
Useful Links
-
How to make platformio knows that where the libraries locate at? - PlatformIO IDE - PlatformIO Community: https://community.platformio.org/t/how-to-make-platformio-knows-that-where-the-libraries-locate-at/15553
-
platformio init: change source directory ·platformio/platformio-core: platformio init: change source directory platformio/platformio-core#83
-
Example of project using ino file as source: https://github.com/platformio/platform-atmelavr/blob/develop/examples/arduino-own-src_dir/platformio.ini
-
example for building same project for multiple target
-
Customize the output firmware name
