Skip to content

Add support for platformIO #242

@nitin710

Description

@nitin710

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 select board and fw variation to 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, platform and the framework in the .ini file.
  • 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 atmelsam version as v3.8.1 because 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 for v3.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\packages path on windows.
    • It should look something like
      • image
  • Once the framework is added, you should be able to build from source using platformIO!

Useful Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions