I am having an issue getting Platformio to ‘find’ a custom package I created by cloning an existing package. The package I started with was atmelsam - I copied the platfroms\atmelsam directory to atemlsamFB1 directory; Copied the packages\framework-arduino-sam to framework-arduino-samB1.
I then modified platform.json by adding:
“framework-arduino-samFB1”: {
“type”: “framework”,
“optional”: true,
“owner”: “platformio”,
“version”: “~1.6.12”
},
and changed the “package” variable from “framework-arduino-sam” to “framework-arduino-samB1” as shown below;
“version”: “8.1.0”,
“frameworks”: {
“arduino”: {
“package”: “framework-arduino-samFB1”,
“script”: “builder/frameworks/arduino.py”
},
I also modified package.json;
{
“name”: “framework-arduino-samFB1”,
“version”: “1.6.12”,
“description”: “The official Arduino Wiring-based Framework for ATSAM3 microcontrollers”,
“keywords”: [
“framework”,
“arduino”,
“microchip”,
“sam”
],
And finally modified arduino-sam.py changing the framework_package variable as follows;
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
framework_package = “framework-arduino-samFB1”
if board.get(“build.core”, “”).lower() != “arduino”:
framework_package += “-%s” % board.get(“build.core”).lower()
FRAMEWORK_DIR = platform.get_package_dir(framework_package)
I modified platform.py;
self.frameworks[“arduino”][“package”] = framework_package
if not board.get(“build.mcu”, “”).startswith(“samd”):
self.packages[“framework-arduino-samFB1”][“optional”] = True
After all of that I get:
Error: Platform Manager: Installing atmelsamFB1
Error: Could not find the package with ‘atmelsamFB1’ requirements for your system ‘windows_amd64’
What did I miss?
Why am I doing this? I am compiling code to run in flash bank 1 only - I was able to modify the original atmelsam to do exactly that and it worked. But since I want to compile programs for both normal compiling as well as compiling for just flash bank 1 I cloned the atmelsam with all the changes that worked into atmelsamFB1.