Custom arduino framework


#1

Is there anyway to make adjustments to the arduino framework that’s being used? I have a system that’s programmed through usbasp and does not have a physical serial. I’d like to remove the Serial object and it’s hardware serial library including buffers etc to save the 157 bytes it’s using.


#2

You need to fork https://github.com/platformio/platform-atmelavr and https://github.com/platformio/platformio-pkg-framework-arduinoavr. Update the last repo and it’s core files.

Then, replace Semantic Version with full path to patched repo here

In platformio.ini please use

[env:my]
platform = http://url/to/forked/platform.git

#3

Thanks Ivan, see my other post, it’s working now after some struggling. But replacing the package version with a git repo breaks the arduino.py because it doesn’t receive a version from the package.


#4

Yes this generates an error in arduino.py. Has anyone worked around this? I want to use a forked version in a travis build and am blocked.


#5

And my workaround was to add the following to detect when FRAMEWORK_VERSION is a commit id:

diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py
index 8746e3b..5e61f66 100644
--- a/builder/frameworks/arduino.py
+++ b/builder/frameworks/arduino.py
@@ -33,6 +33,12 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoavr")
 FRAMEWORK_VERSION = platform.get_package_version("framework-arduinoavr")
 assert isdir(FRAMEWORK_DIR)
 
+# hack the version when it has no dots and is probably a commit id
+# not great to hard code the arduino version but there is no where
+# else to put it
+if "." not in FRAMEWORK_VERSION:
+    FRAMEWORK_VERSION = "~1.10620."+FRAMEWORK_VERSION
+
 # USB flags
 ARDUINO_USBDEFINES = [
     "ARDUINO_ARCH_AVR",