Custom Processor

I would like to setup a new processor for use with PlatformIO. Specifically I would like to use the ATSAMD51 processor. I have code compiling and running using eclipse and makefiles but would like to create a platform/framework for platformio such that it is easier for others to use the libraries I have created.

I have read through forums and the documentation but it is very lacking in how to do this and confusing on the terminology (difference between platform and framework). Looking through the forum it appears others have the same confusion.

Is it possible to create a new platform and framework easily with PlatformIO? If so is there some documentation and examples of how to do so?


If you’d need a custom board / processor then you want to have an addition to the platform-atmelsam packages. (GitHub - platformio/platform-atmelsam: Atmel SAM: development platform for PlatformIO). Note that there are already 9 ATSAMD51 based boards defined (PlatformIO Registry).

Adding a board is documented here. You basically only add a board JSON file to your platform’s boards folder. (example).

To clear up some confusion:

  • platform: The general microcontroller platform type, e.g. ststm32, atmel-sam, atmelavr, espressif32, espressif8266
  • framework: The software framework you use for your firmwares, e.g., arduino, mbed, stm32cube
  • board: The definition of an embedded board, containing the processor type and other macro defines.

Further note that for the PlatformIO 4.0 beta versions, you can easily define to use different platform and platform_packages: See documentation. You can either do local modifications to your folder (<home dir>\.platformio\platforms\atmelsam) or fork the original repo and use it using the platform = <git link here> directive, as documented.