I have created my own board, its currently at the PCB manufacture getting built, the problem is, I want to be able to program it with Platformio.
I have read all the documentation on how to create a custom board, and I have gone through many of the source files and I am still scratching my head about how to do this. I have also checked Adding a new SAMD board and seen the samd21g18a.json file that was linked there.
The board I built is based on an Atmel ATSAML21E15B which uses an ARM Cortex M0+ processor. Therefore, I assume that the board will need to use the atmelsam platform. I wish to use this with a CMSIS framework, but the atmelsam platform doesn’t seem to support it.
There are quite a few fields in he board.json file which I am unsure about, such as the hwids and the ldscript. obviously the ldscript is a linker script, but which script do I use? Do I need to create my own ldscript specifically for this board? Do I need an ldscript at all? I noticed that the saml_xpro_b doesn’t have one.
When approaching sometihng like this I would usually look for something similar and adapt it. There is only one other saml21 board in the boards database, the saml_xpro_b which uses the ATSAML21J18B microprocessor which uses the mbed framework. But this uses mbed not cmsis. I doubt that I can use that source file and just put “cmsis” in the “frameworks”.
From what I can gather, I also need to create a board variant for my board in the packages directory. I then have to modify the atmelsam builder .py file to include a cmsis framework and add this to the platform.json file as well as the board .json file.
The documentation for undertaking this is a little unclear, the examples of current boards look remarkably different to the example scripts provided in the ‘custom platform & board’ tab in the docs. I’m a little lost and any assistance from someone who has added custom boards before would be fantastic. Unfortunately, I have very little knowledge of python, so this may be one barrier to getting this complete.