How do you start a new project using a custom board?

It took a while to figure everything out, and it’s probably not all 100% done the right way but I can now compile and upload! Thanks @maxgerhardt!

[env:clearcore]
platform = https://github.com/patrickwasp/platform-atmelsam
board = clearcore
framework = arduino

or

[env:clearcore]
platform = atmelsam
board = clearcore
framework = arduino

after using the “Advanced Installation” in the “Platforms” menu and entering the repo.

Is there any danger to messing up the original atmelsam platform setup on people’s computers if I instruct others to add the custom platform the way I did?

The diff from mainline to your fork looks very clean actually. I would suggest that you create a pull request into platformio/platform-atmelsam so that your work can get pulled into mainline. A few minor suggestions before that:

  1. The _ldscript_comment and similiar entries in the board JSON file should be removed
  2. In the builder script, no need to create CLEARCORE_BASE_DIR = platform.get_package_dir("framework-arduino-samd-clearcore") since this is actually FRAMEWORK_DIR already. Similiarly for CLEARCORE_LIB_DIR I’d suggest removing that variable and going from FRAMEWORK_DIR, "Teknik", ... instead in the os.path.joins.
1 Like

Thanks for the tips. I made the changes and submitted a pull request. Add support for Teknic ClearCore by patrickwasp · Pull Request #215 · platformio/platform-atmelsam · GitHub. It seems it can take a while for requests to get merged, so in the meantime, I will ask users to use the github link directly, unless it’s better to have them install the platform?

1 Like

I think using the forked platform link directly in the platformio.ini is a better option because it 1. makes it clear that this forked platform is used and 2. if a user downloads a project repo that uses this forked platform and opens it in VSCode, the platform will be automatically installed and no manual installation will be necessary.