Cloning an existing platform to make a custom platform

The old .piopm in the “platform” folder (actually the package folder for framework-arduino-sam) is the problem. Just delete it. It somehow messes with the install.

I have

[env:dueFB1]
platform = symlink://C:/Users/Max/Downloads/atmelsam
board = dueFB1
framework = arduino
platform_packages =
   framework-arduino-sam@symlink://C:/Users/Max/Downloads/platform

and it did build cleanly.

grafik

And now, in regards what is actually the right way, let me show you how just create a minimalistic PlatformIO project that uses the official atmelsam platform that has your new variant and board definition. Because again, forking the platform is 100% overkill for that.

Awesome that worked! The instructions for modifying an existing package the right way would be awesome to have. I know the community would value that greatly!

Thank you Max!

Please carefully inspect

This technique is possible due to this.

But pretty much all builder scripts allow you to do that, e.g. atmelsamd or stm32 too, see GitHub - maxgerhardt/pio-samd51n19-test or GitHub - maxgerhardt/pio-custom-stm32duino-variants: A short example of how to use a custom variant folder for the PlatformIO + STM32Duino environment.

And, if you did need to modify the framework package’s core/ or system files, you could still use a (pinned) version of the official atmelsam platform and then exchange the whole framework package with platform_packages and a symlink to a local folder in the project. The above is the most minimal one for your current case though.

Perfect Max! I will implement this method and report on my results.
Thank you for the huge support on this!

This method works perfectly and is far simpler than what I initially tried to do.
I appreciate all that you have done Max! Have a great day!