From 6303be14c6eeaa506ca0981bacfec0bc4749f360 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Tue, 16 Nov 2021 16:12:25 +0200 Subject: [PATCH 01/21] Update Ubuntu image in CI --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d55f793..547b9fc 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, windows-latest, macos-latest] + os: [ubuntu-18.04, windows-latest, macos-latest] python-version: [3.7] example: - "examples/arduino-blink" From 317e3e82bb90e40aa15efe931763290881223a0e Mon Sep 17 00:00:00 2001 From: valeros Date: Tue, 16 Nov 2021 16:15:56 +0200 Subject: [PATCH 02/21] Better handling of bootloader path in AVRDUDE upload flags Resolve #33 --- builder/bootloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/bootloader.py b/builder/bootloader.py index 40eed1a..ebba454 100644 --- a/builder/bootloader.py +++ b/builder/bootloader.py @@ -84,7 +84,7 @@ def get_suitable_optiboot_binary(framework_dir, board_config): os.path.join(env.PioPlatform().get_package_dir( "tool-avrdude-megaavr") or "", "avrdude.conf"), ], - BOOTFLAGS=['-Uflash:w:"%s":i' % bootloader_path], + BOOTFLAGS=["-U", "flash:w:%s:i" % bootloader_path], UPLOADBOOTCMD="$BOOTUPLOADER $BOOTUPLOADERFLAGS $UPLOAD_FLAGS $BOOTFLAGS", ) From 1610a9a8f133212d6e9fe3c60eaa94d50066919d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 22 Nov 2021 18:32:50 +0200 Subject: [PATCH 03/21] Convert README to markdown --- .../README.rst => arduino-blink/README.md} | 32 +++++++++---------- .../README.md} | 32 +++++++++---------- .../README.md} | 32 +++++++++---------- .../README.rst => native-blink/README.md} | 32 +++++++++---------- 4 files changed, 64 insertions(+), 64 deletions(-) rename examples/{native-blink/README.rst => arduino-blink/README.md} (53%) rename examples/{arduino-blink/README.rst => arduino-external-libs/README.md} (53%) rename examples/{arduino-external-libs/README.rst => arduino-internal-libs/README.md} (53%) rename examples/{arduino-internal-libs/README.rst => native-blink/README.md} (53%) diff --git a/examples/native-blink/README.rst b/examples/arduino-blink/README.md similarity index 53% rename from examples/native-blink/README.rst rename to examples/arduino-blink/README.md index 443aaec..e2149eb 100644 --- a/examples/native-blink/README.rst +++ b/examples/arduino-blink/README.md @@ -12,27 +12,27 @@ How to build PlatformIO based project ===================================== -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: -.. code-block:: bash +```shell +# Change directory to example +$ cd platform-atmelmegaavr/examples/arduino-blink - # Change directory to example - > cd platform-atmelmegaavr/examples/native-blink +# Build project +$ pio run - # Build project - > platformio run +# Upload firmware +$ pio run --target upload - # Upload firmware - > platformio run --target upload +# Build specific environment +$ pio run -e uno_wifi_rev2 - # Build specific environment - > platformio run -e uno_wifi_rev2 +# Upload firmware for the specific environment +$ pio run -e uno_wifi_rev2 --target upload - # Upload firmware for the specific environment - > platformio run -e uno_wifi_rev2 --target upload - - # Clean build files - > platformio run --target clean +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-blink/README.rst b/examples/arduino-external-libs/README.md similarity index 53% rename from examples/arduino-blink/README.rst rename to examples/arduino-external-libs/README.md index 0f9a902..87a1e72 100644 --- a/examples/arduino-blink/README.rst +++ b/examples/arduino-external-libs/README.md @@ -12,27 +12,27 @@ How to build PlatformIO based project ===================================== -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: -.. code-block:: bash +```shell +# Change directory to example +$ cd platform-atmelmegaavr/examples/arduino-external-libs - # Change directory to example - > cd platform-atmelmegaavr/examples/arduino-blink +# Build project +$ pio run - # Build project - > platformio run +# Upload firmware +$ pio run --target upload - # Upload firmware - > platformio run --target upload +# Build specific environment +$ pio run -e uno_wifi_rev2 - # Build specific environment - > platformio run -e uno_wifi_rev2 +# Upload firmware for the specific environment +$ pio run -e uno_wifi_rev2 --target upload - # Upload firmware for the specific environment - > platformio run -e uno_wifi_rev2 --target upload - - # Clean build files - > platformio run --target clean +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-external-libs/README.rst b/examples/arduino-internal-libs/README.md similarity index 53% rename from examples/arduino-external-libs/README.rst rename to examples/arduino-internal-libs/README.md index 5ddeceb..0e8460c 100644 --- a/examples/arduino-external-libs/README.rst +++ b/examples/arduino-internal-libs/README.md @@ -12,27 +12,27 @@ How to build PlatformIO based project ===================================== -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: -.. code-block:: bash +```shell +# Change directory to example +$ cd platform-atmelmegaavr/examples/arduino-internal-libs - # Change directory to example - > cd platform-atmelmegaavr/examples/arduino-external-libs +# Build project +$ pio run - # Build project - > platformio run +# Upload firmware +$ pio run --target upload - # Upload firmware - > platformio run --target upload +# Build specific environment +$ pio run -e uno_wifi_rev2 - # Build specific environment - > platformio run -e uno_wifi_rev2 +# Upload firmware for the specific environment +$ pio run -e uno_wifi_rev2 --target upload - # Upload firmware for the specific environment - > platformio run -e uno_wifi_rev2 --target upload - - # Clean build files - > platformio run --target clean +# Clean build files +$ pio run --target clean +``` diff --git a/examples/arduino-internal-libs/README.rst b/examples/native-blink/README.md similarity index 53% rename from examples/arduino-internal-libs/README.rst rename to examples/native-blink/README.md index 9650226..e411f35 100644 --- a/examples/arduino-internal-libs/README.rst +++ b/examples/native-blink/README.md @@ -12,27 +12,27 @@ How to build PlatformIO based project ===================================== -1. `Install PlatformIO Core `_ -2. Download `development platform with examples `_ +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: -.. code-block:: bash +```shell +# Change directory to example +$ cd platform-atmelmegaavr/examples/native-blink - # Change directory to example - > cd platform-atmelmegaavr/examples/arduino-internal-libs +# Build project +$ pio run - # Build project - > platformio run +# Upload firmware +$ pio run --target upload - # Upload firmware - > platformio run --target upload +# Build specific environment +$ pio run -e uno_wifi_rev2 - # Build specific environment - > platformio run -e uno_wifi_rev2 +# Upload firmware for the specific environment +$ pio run -e uno_wifi_rev2 --target upload - # Upload firmware for the specific environment - > platformio run -e uno_wifi_rev2 --target upload - - # Clean build files - > platformio run --target clean +# Clean build files +$ pio run --target clean +``` From d5a3cada524723451b337ecadfdcd84bf6966b95 Mon Sep 17 00:00:00 2001 From: Bruno Bousquet <21108660+brunob45@users.noreply.github.com> Date: Mon, 17 Jan 2022 11:36:21 -0500 Subject: [PATCH 04/21] Add DxCore framework (#19) Co-authored-by: valeros --- boards/AVR128DA28.json | 24 +++++ boards/AVR128DA32.json | 24 +++++ boards/AVR128DA48.json | 24 +++++ boards/AVR128DA64.json | 24 +++++ boards/AVR128DB28.json | 24 +++++ boards/AVR128DB32.json | 24 +++++ boards/AVR128DB48.json | 24 +++++ boards/AVR128DB64.json | 24 +++++ boards/AVR32DA28.json | 24 +++++ boards/AVR32DA32.json | 24 +++++ boards/AVR32DA48.json | 24 +++++ boards/AVR32DB28.json | 24 +++++ boards/AVR32DB32.json | 24 +++++ boards/AVR32DB48.json | 24 +++++ boards/AVR64DA28.json | 24 +++++ boards/AVR64DA32.json | 24 +++++ boards/AVR64DA48.json | 24 +++++ boards/AVR64DA64.json | 24 +++++ boards/AVR64DB28.json | 24 +++++ boards/AVR64DB32.json | 24 +++++ boards/AVR64DB48.json | 24 +++++ boards/AVR64DB64.json | 24 +++++ boards/AVR64DD14.json | 24 +++++ boards/AVR64DD20.json | 24 +++++ boards/AVR64DD28.json | 24 +++++ boards/AVR64DD32.json | 24 +++++ builder/frameworks/arduino.py | 97 +++++++++++++------ examples/arduino-blink/platformio.ini | 35 +++++++ examples/arduino-internal-libs/platformio.ini | 35 +++++++ examples/native-blink/platformio.ini | 15 +++ platform.json | 7 +- platform.py | 4 +- 32 files changed, 785 insertions(+), 32 deletions(-) create mode 100644 boards/AVR128DA28.json create mode 100644 boards/AVR128DA32.json create mode 100644 boards/AVR128DA48.json create mode 100644 boards/AVR128DA64.json create mode 100644 boards/AVR128DB28.json create mode 100644 boards/AVR128DB32.json create mode 100644 boards/AVR128DB48.json create mode 100644 boards/AVR128DB64.json create mode 100644 boards/AVR32DA28.json create mode 100644 boards/AVR32DA32.json create mode 100644 boards/AVR32DA48.json create mode 100644 boards/AVR32DB28.json create mode 100644 boards/AVR32DB32.json create mode 100644 boards/AVR32DB48.json create mode 100644 boards/AVR64DA28.json create mode 100644 boards/AVR64DA32.json create mode 100644 boards/AVR64DA48.json create mode 100644 boards/AVR64DA64.json create mode 100644 boards/AVR64DB28.json create mode 100644 boards/AVR64DB32.json create mode 100644 boards/AVR64DB48.json create mode 100644 boards/AVR64DB64.json create mode 100644 boards/AVR64DD14.json create mode 100644 boards/AVR64DD20.json create mode 100644 boards/AVR64DD28.json create mode 100644 boards/AVR64DD32.json diff --git a/boards/AVR128DA28.json b/boards/AVR128DA28.json new file mode 100644 index 0000000..afc4b8e --- /dev/null +++ b/boards/AVR128DA28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128da28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DA28", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DA28", + "vendor": "Microchip" +} diff --git a/boards/AVR128DA32.json b/boards/AVR128DA32.json new file mode 100644 index 0000000..779271e --- /dev/null +++ b/boards/AVR128DA32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128da32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DA32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DA32", + "vendor": "Microchip" +} diff --git a/boards/AVR128DA48.json b/boards/AVR128DA48.json new file mode 100644 index 0000000..17432eb --- /dev/null +++ b/boards/AVR128DA48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128da48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DA48", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DA48", + "vendor": "Microchip" +} diff --git a/boards/AVR128DA64.json b/boards/AVR128DA64.json new file mode 100644 index 0000000..4803d52 --- /dev/null +++ b/boards/AVR128DA64.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DA64 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128da64", + "variant": "64pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DA64", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DA64", + "vendor": "Microchip" +} diff --git a/boards/AVR128DB28.json b/boards/AVR128DB28.json new file mode 100644 index 0000000..ec77311 --- /dev/null +++ b/boards/AVR128DB28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128db28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DB28", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DB28", + "vendor": "Microchip" +} diff --git a/boards/AVR128DB32.json b/boards/AVR128DB32.json new file mode 100644 index 0000000..9f15417 --- /dev/null +++ b/boards/AVR128DB32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128db32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DB32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DB32", + "vendor": "Microchip" +} diff --git a/boards/AVR128DB48.json b/boards/AVR128DB48.json new file mode 100644 index 0000000..937eaaa --- /dev/null +++ b/boards/AVR128DB48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128db48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DB48", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DB48", + "vendor": "Microchip" +} diff --git a/boards/AVR128DB64.json b/boards/AVR128DB64.json new file mode 100644 index 0000000..56e4f2b --- /dev/null +++ b/boards/AVR128DB64.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DB64 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr128db64", + "variant": "64pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR128DB64", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR128DB64", + "vendor": "Microchip" +} diff --git a/boards/AVR32DA28.json b/boards/AVR32DA28.json new file mode 100644 index 0000000..aadfad3 --- /dev/null +++ b/boards/AVR32DA28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32da28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DA28", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DA28", + "vendor": "Microchip" +} diff --git a/boards/AVR32DA32.json b/boards/AVR32DA32.json new file mode 100644 index 0000000..088c8c0 --- /dev/null +++ b/boards/AVR32DA32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32da32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DA32", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DA32", + "vendor": "Microchip" +} diff --git a/boards/AVR32DA48.json b/boards/AVR32DA48.json new file mode 100644 index 0000000..1d3f73c --- /dev/null +++ b/boards/AVR32DA48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32da48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DA48", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DA48", + "vendor": "Microchip" +} diff --git a/boards/AVR32DB28.json b/boards/AVR32DB28.json new file mode 100644 index 0000000..ed0765b --- /dev/null +++ b/boards/AVR32DB28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32db28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DB28", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DB28", + "vendor": "Microchip" +} diff --git a/boards/AVR32DB32.json b/boards/AVR32DB32.json new file mode 100644 index 0000000..ec85b6d --- /dev/null +++ b/boards/AVR32DB32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32db32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DB32", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DB32", + "vendor": "Microchip" +} diff --git a/boards/AVR32DB48.json b/boards/AVR32DB48.json new file mode 100644 index 0000000..a84b44c --- /dev/null +++ b/boards/AVR32DB48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR32DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr32db48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR32DB48", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR32DB48", + "vendor": "Microchip" +} diff --git a/boards/AVR64DA28.json b/boards/AVR64DA28.json new file mode 100644 index 0000000..f1af8ee --- /dev/null +++ b/boards/AVR64DA28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64da28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DA28", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DA28", + "vendor": "Microchip" +} diff --git a/boards/AVR64DA32.json b/boards/AVR64DA32.json new file mode 100644 index 0000000..3b37710 --- /dev/null +++ b/boards/AVR64DA32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64da32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DA32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DA32", + "vendor": "Microchip" +} diff --git a/boards/AVR64DA48.json b/boards/AVR64DA48.json new file mode 100644 index 0000000..995721b --- /dev/null +++ b/boards/AVR64DA48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64da48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DA48", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DA48", + "vendor": "Microchip" +} diff --git a/boards/AVR64DA64.json b/boards/AVR64DA64.json new file mode 100644 index 0000000..017a8f7 --- /dev/null +++ b/boards/AVR64DA64.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DA64 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64da64", + "variant": "64pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DA64", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DA64", + "vendor": "Microchip" +} diff --git a/boards/AVR64DB28.json b/boards/AVR64DB28.json new file mode 100644 index 0000000..8d5e05d --- /dev/null +++ b/boards/AVR64DB28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64db28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DB28", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DB28", + "vendor": "Microchip" +} diff --git a/boards/AVR64DB32.json b/boards/AVR64DB32.json new file mode 100644 index 0000000..140a3d2 --- /dev/null +++ b/boards/AVR64DB32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64db32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DB32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DB32", + "vendor": "Microchip" +} diff --git a/boards/AVR64DB48.json b/boards/AVR64DB48.json new file mode 100644 index 0000000..3c9fb3c --- /dev/null +++ b/boards/AVR64DB48.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64db48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DB48", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DB48", + "vendor": "Microchip" +} diff --git a/boards/AVR64DB64.json b/boards/AVR64DB64.json new file mode 100644 index 0000000..539de31 --- /dev/null +++ b/boards/AVR64DB64.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DB64 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64db64", + "variant": "64pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DB64", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DB64", + "vendor": "Microchip" +} diff --git a/boards/AVR64DD14.json b/boards/AVR64DD14.json new file mode 100644 index 0000000..d062d90 --- /dev/null +++ b/boards/AVR64DD14.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DD14 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64dd14", + "variant": "14pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DD14", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DD14", + "vendor": "Microchip" +} diff --git a/boards/AVR64DD20.json b/boards/AVR64DD20.json new file mode 100644 index 0000000..e965dc0 --- /dev/null +++ b/boards/AVR64DD20.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DD20 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64dd20", + "variant": "20pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DD20", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DD20", + "vendor": "Microchip" +} diff --git a/boards/AVR64DD28.json b/boards/AVR64DD28.json new file mode 100644 index 0000000..1165f8e --- /dev/null +++ b/boards/AVR64DD28.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DD28 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64dd28", + "variant": "28pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DD28", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DD28", + "vendor": "Microchip" +} diff --git a/boards/AVR64DD32.json b/boards/AVR64DD32.json new file mode 100644 index 0000000..2171f2c --- /dev/null +++ b/boards/AVR64DD32.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR64DD32 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "f_cpu": "24000000L", + "mcu": "avr64dd32", + "variant": "32pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "AVR64DD32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/AVR64DD32", + "vendor": "Microchip" +} diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 441545a..3f52bc3 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -26,6 +26,8 @@ from SCons.Script import DefaultEnvironment +from platformio.package.version import get_original_version + env = DefaultEnvironment() platform = env.PioPlatform() board = env.BoardConfig() @@ -34,38 +36,33 @@ FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-megaavr") if build_core != "arduino": FRAMEWORK_DIR = platform.get_package_dir( - "framework-arduino-megaavr-%s" % build_core.lower()) + "framework-arduino-megaavr-%s" % build_core.lower() + ) assert isdir(FRAMEWORK_DIR) -CPPDEFINES = [ - "ARDUINO_ARCH_MEGAAVR", - ("ARDUINO", 10808) -] +CPPDEFINES = ["ARDUINO_ARCH_MEGAAVR", ("ARDUINO", 10808)] if "build.usb_product" in board: CPPDEFINES += [ ("USB_VID", board.get("build.hwids")[0][0]), ("USB_PID", board.get("build.hwids")[0][1]), - ("USB_PRODUCT", '\\"%s\\"' % - board.get("build.usb_product", "").replace('"', "")), - ("USB_MANUFACTURER", '\\"%s\\"' % - board.get("vendor", "").replace('"', "")) + ( + "USB_PRODUCT", + '\\"%s\\"' % board.get("build.usb_product", "").replace('"', ""), + ), + ("USB_MANUFACTURER", '\\"%s\\"' % board.get("vendor", "").replace('"', "")), ] env.SConscript("_bare.py", exports="env") env.Append( CPPDEFINES=CPPDEFINES, - CPPPATH=[ join(FRAMEWORK_DIR, "cores", build_core, "api", "deprecated"), - join(FRAMEWORK_DIR, "cores", build_core) + join(FRAMEWORK_DIR, "cores", build_core), ], - - LIBSOURCE_DIRS=[ - join(FRAMEWORK_DIR, "libraries") - ] + LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")], ) # @@ -73,11 +70,54 @@ # oscillator_type = board.get("hardware", {}).get("oscillator", "internal") -if build_core == "megatinycore": +if build_core in ("megatinycore", "dxcore"): env.Append(CPPDEFINES=[("CLOCK_SOURCE", 2 if oscillator_type == "external" else 0)]) elif oscillator_type == "external" and build_core == "MegaCoreX": env.Append(CPPDEFINES=["USE_EXTERNAL_OSCILLATOR"]) +# +# Additional definitions for DxCore +# + +if build_core == "dxcore": + package_version = platform.get_package_version("framework-arduino-megaavr-dxcore") + major, minor, patch = package_version.split(".") + env.Append( + CCFLAGS=["-mrelax"], + + CPPDEFINES=[ + ("DXCORE", '\\"%s\\"' % package_version), + ("DXCORE_MAJOR", "%sUL" % major), + ("DXCORE_MINOR", "%sUL" % minor), + ("DXCORE_PATCH", "%sUL" % patch), + "CORE_ATTACH_ALL", + "TWI_MORS_SINGLE", + "MILLIS_USE_TIMERB2", + ], + + LINKFLAGS=[ + "-mrelax", + "-Wl,--section-start=.FLMAP_SECTION1=%s" + % board.get("build.arduino.flmap_section1", "0x8000"), + "-Wl,--section-start=.FLMAP_SECTION2=%s" + % board.get("build.arduino.flmap_section2", "0x10000"), + "-Wl,--section-start=.FLMAP_SECTION3=%s" + % board.get("build.arduino.flmap_section3", "0x18000"), + ], + ) + + env.Replace( + CXXFLAGS=[ + "-std=gnu++17", + "-fpermissive", + "-fno-exceptions", + "-fno-threadsafe-statics", + "-flto", + "-Wno-sized-deallocation", + "-Wno-error=narrowing", + ], + ) + # # Target: Build Core Library # @@ -85,23 +125,22 @@ libs = [] if "build.variant" in board: - variants_dir = join( - "$PROJECT_DIR", board.get("build.variants_dir")) if board.get( - "build.variants_dir", "") else join(FRAMEWORK_DIR, "variants") - - env.Append( - CPPPATH=[ - join(variants_dir, board.get("build.variant")) - ] + variants_dir = ( + join("$PROJECT_DIR", board.get("build.variants_dir")) + if board.get("build.variants_dir", "") + else join(FRAMEWORK_DIR, "variants") ) + + env.Append(CPPPATH=[join(variants_dir, board.get("build.variant"))]) env.BuildSources( join("$BUILD_DIR", "FrameworkArduinoVariant"), - join(variants_dir, board.get("build.variant")) + join(variants_dir, board.get("build.variant")), ) -libs.append(env.BuildLibrary( - join("$BUILD_DIR", "FrameworkArduino"), - join(FRAMEWORK_DIR, "cores", build_core) -)) +libs.append( + env.BuildLibrary( + join("$BUILD_DIR", "FrameworkArduino"), join(FRAMEWORK_DIR, "cores", build_core) + ) +) env.Prepend(LIBS=libs) diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index 7c3afb8..b349ae7 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -72,3 +72,38 @@ board = ATtiny406 platform = atmelmegaavr framework = arduino board = ATtiny817 + +[env:AVR128DA64] +platform = atmelmegaavr +framework = arduino +board = AVR128DA64 + +[env:AVR128DA48] +platform = atmelmegaavr +framework = arduino +board = AVR128DA48 + +[env:AVR128DA32] +platform = atmelmegaavr +framework = arduino +board = AVR128DA32 + +[env:AVR128DA28] +platform = atmelmegaavr +framework = arduino +board = AVR128DA28 + +[env:AVR32DB28] +platform = atmelmegaavr +framework = arduino +board = AVR32DB28 + +[env:AVR32DB32] +platform = atmelmegaavr +framework = arduino +board = AVR32DB32 + +[env:AVR32DB48] +platform = atmelmegaavr +framework = arduino +board = AVR32DB48 diff --git a/examples/arduino-internal-libs/platformio.ini b/examples/arduino-internal-libs/platformio.ini index 0672aa4..e4c8058 100644 --- a/examples/arduino-internal-libs/platformio.ini +++ b/examples/arduino-internal-libs/platformio.ini @@ -16,3 +16,38 @@ board = uno_wifi_rev2 platform = atmelmegaavr framework = arduino board = nano_every + +[env:AVR128DA64] +platform = atmelmegaavr +framework = arduino +board = AVR128DA64 + +[env:AVR128DA48] +platform = atmelmegaavr +framework = arduino +board = AVR128DA48 + +[env:AVR128DA32] +platform = atmelmegaavr +framework = arduino +board = AVR128DA32 + +[env:AVR128DA28] +platform = atmelmegaavr +framework = arduino +board = AVR128DA28 + +[env:AVR32DB28] +platform = atmelmegaavr +framework = arduino +board = AVR32DB28 + +[env:AVR32DB32] +platform = atmelmegaavr +framework = arduino +board = AVR32DB32 + +[env:AVR32DB48] +platform = atmelmegaavr +framework = arduino +board = AVR32DB48 diff --git a/examples/native-blink/platformio.ini b/examples/native-blink/platformio.ini index e1cb18c..e80a765 100644 --- a/examples/native-blink/platformio.ini +++ b/examples/native-blink/platformio.ini @@ -14,3 +14,18 @@ board = uno_wifi_rev2 [env:nano_every] platform = atmelmegaavr board = nano_every + +[env:AVR128DA64] +platform = atmelmegaavr +framework = arduino +board = AVR128DA64 + +[env:AVR128DA48] +platform = atmelmegaavr +framework = arduino +board = AVR128DA48 + +[env:AVR32DB48] +platform = atmelmegaavr +framework = arduino +board = AVR32DB48 diff --git a/platform.json b/platform.json index 0115e51..b0b2fc6 100644 --- a/platform.json +++ b/platform.json @@ -30,7 +30,7 @@ "type": "toolchain", "owner": "platformio", "version": "~1.70300.0", - "optionalVersions": ["~2.70300.0"] + "optionalVersions": ["~3.70300.0"] }, "framework-arduino-megaavr": { "type": "framework", @@ -50,6 +50,11 @@ "owner": "platformio", "version": "~2.4.0" }, + "framework-arduino-megaavr-dxcore": { + "type": "framework", + "optional": true, + "version": "~1.4.5" + }, "tool-avrdude-megaavr": { "type": "uploader", "optional": true, diff --git a/platform.py b/platform.py index f0daa52..9ed128a 100644 --- a/platform.py +++ b/platform.py @@ -32,8 +32,8 @@ def configure_default_packages(self, variables, targets): self.packages[framework_package]["optional"] = False self.packages["framework-arduino-megaavr"]["optional"] = True - if build_core in ("MegaCoreX", "megatinycore"): - self.packages["toolchain-atmelavr"]["version"] = "~2.70300.0" + if build_core in ("MegaCoreX", "megatinycore", "dxcore"): + self.packages["toolchain-atmelavr"]["version"] = "~3.70300.0" self.packages["tool-avrdude-megaavr"]["version"] = "~2.60300.0" if any(t in targets for t in ("fuses", "bootloader")): From 129b04d63d670a47c79a18b157da2a2a152c5877 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Mon, 17 Jan 2022 19:54:18 +0200 Subject: [PATCH 05/21] Update support for MegaTinyCore --- builder/frameworks/arduino.py | 60 +++++++++++++++++++++-------------- platform.json | 2 +- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 3f52bc3..9415929 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -26,8 +26,6 @@ from SCons.Script import DefaultEnvironment -from platformio.package.version import get_original_version - env = DefaultEnvironment() platform = env.PioPlatform() board = env.BoardConfig() @@ -76,34 +74,26 @@ env.Append(CPPDEFINES=["USE_EXTERNAL_OSCILLATOR"]) # -# Additional definitions for DxCore +# Additional definitions for DxCore and MegaTinyCore # -if build_core == "dxcore": - package_version = platform.get_package_version("framework-arduino-megaavr-dxcore") +if build_core in ("dxcore", "megatinycore"): + package_version = platform.get_package_version( + "framework-arduino-megaavr-%s" % build_core + ) major, minor, patch = package_version.split(".") + + core_macro_name = build_core.upper() env.Append( CCFLAGS=["-mrelax"], - CPPDEFINES=[ - ("DXCORE", '\\"%s\\"' % package_version), - ("DXCORE_MAJOR", "%sUL" % major), - ("DXCORE_MINOR", "%sUL" % minor), - ("DXCORE_PATCH", "%sUL" % patch), + (core_macro_name, '\\"%s\\"' % package_version), + ("%s_MAJOR" % core_macro_name, "%sUL" % major), + ("%s_MINOR" % core_macro_name, "%sUL" % minor), + ("%s_PATCH" % core_macro_name, "%sUL" % patch), + ("%s_RELEASED" % core_macro_name, 1), "CORE_ATTACH_ALL", - "TWI_MORS_SINGLE", - "MILLIS_USE_TIMERB2", - ], - - LINKFLAGS=[ - "-mrelax", - "-Wl,--section-start=.FLMAP_SECTION1=%s" - % board.get("build.arduino.flmap_section1", "0x8000"), - "-Wl,--section-start=.FLMAP_SECTION2=%s" - % board.get("build.arduino.flmap_section2", "0x10000"), - "-Wl,--section-start=.FLMAP_SECTION3=%s" - % board.get("build.arduino.flmap_section3", "0x18000"), - ], + ] ) env.Replace( @@ -118,6 +108,30 @@ ], ) + if build_core == "megatinycore": + env.Append( + CPPDEFINES=[ + "TWI_MORS" + ], + ) + elif build_core == "dxcore": + env.Append( + CPPDEFINES=[ + "TWI_MORS_SINGLE", + "MILLIS_USE_TIMERB2", + ], + LINKFLAGS=[ + "-mrelax", + "-Wl,--section-start=.FLMAP_SECTION1=%s" + % board.get("build.arduino.flmap_section1", "0x8000"), + "-Wl,--section-start=.FLMAP_SECTION2=%s" + % board.get("build.arduino.flmap_section2", "0x10000"), + "-Wl,--section-start=.FLMAP_SECTION3=%s" + % board.get("build.arduino.flmap_section3", "0x18000"), + ], + ) + + # # Target: Build Core Library # diff --git a/platform.json b/platform.json index b0b2fc6..6e484d6 100644 --- a/platform.json +++ b/platform.json @@ -48,7 +48,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~2.4.0" + "version": "~2.5.0" }, "framework-arduino-megaavr-dxcore": { "type": "framework", From 6ff4448bd94408c63ec72167dd9e1a8fdaaced23 Mon Sep 17 00:00:00 2001 From: Bruno Bousquet <21108660+brunob45@users.noreply.github.com> Date: Tue, 18 Jan 2022 05:11:38 -0500 Subject: [PATCH 06/21] Add Curiosity Nano boards (#35) --- boards/AVR128DA28.json | 2 +- boards/AVR128DA32.json | 2 +- boards/AVR128DA48.json | 2 +- boards/AVR128DA64.json | 2 +- boards/AVR128DB28.json | 2 +- boards/AVR128DB32.json | 2 +- boards/AVR128DB48.json | 2 +- boards/AVR128DB64.json | 2 +- boards/AVR32DA28.json | 2 +- boards/AVR32DA32.json | 2 +- boards/AVR32DA48.json | 2 +- boards/AVR32DB28.json | 2 +- boards/AVR32DB32.json | 2 +- boards/AVR32DB48.json | 2 +- boards/AVR64DA28.json | 2 +- boards/AVR64DA32.json | 2 +- boards/AVR64DA48.json | 2 +- boards/AVR64DA64.json | 2 +- boards/AVR64DB28.json | 2 +- boards/AVR64DB32.json | 2 +- boards/AVR64DB48.json | 2 +- boards/AVR64DB64.json | 2 +- boards/AVR64DD14.json | 2 +- boards/AVR64DD20.json | 2 +- boards/AVR64DD28.json | 2 +- boards/AVR64DD32.json | 2 +- boards/curiosity_nano_da.json | 23 +++++++++++++++++++ boards/curiosity_nano_db.json | 23 +++++++++++++++++++ examples/arduino-blink/platformio.ini | 7 +++++- examples/arduino-internal-libs/platformio.ini | 7 +++++- examples/native-blink/platformio.ini | 7 +++++- 31 files changed, 90 insertions(+), 29 deletions(-) create mode 100644 boards/curiosity_nano_da.json create mode 100644 boards/curiosity_nano_db.json diff --git a/boards/AVR128DA28.json b/boards/AVR128DA28.json index afc4b8e..aa51a91 100644 --- a/boards/AVR128DA28.json +++ b/boards/AVR128DA28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DA28 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr128da28", "variant": "28pin-standard" diff --git a/boards/AVR128DA32.json b/boards/AVR128DA32.json index 779271e..7245d32 100644 --- a/boards/AVR128DA32.json +++ b/boards/AVR128DA32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DA32 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr128da32", "variant": "32pin-standard" diff --git a/boards/AVR128DA48.json b/boards/AVR128DA48.json index 17432eb..2434e5d 100644 --- a/boards/AVR128DA48.json +++ b/boards/AVR128DA48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DA48 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr128da48", "variant": "48pin-standard" diff --git a/boards/AVR128DA64.json b/boards/AVR128DA64.json index 4803d52..d5a1ef6 100644 --- a/boards/AVR128DA64.json +++ b/boards/AVR128DA64.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DA64 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DA64 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr128da64", "variant": "64pin-standard" diff --git a/boards/AVR128DB28.json b/boards/AVR128DB28.json index ec77311..232adc9 100644 --- a/boards/AVR128DB28.json +++ b/boards/AVR128DB28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DB28 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr128db28", "variant": "28pin-standard" diff --git a/boards/AVR128DB32.json b/boards/AVR128DB32.json index 9f15417..2bc1c92 100644 --- a/boards/AVR128DB32.json +++ b/boards/AVR128DB32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DB32 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr128db32", "variant": "32pin-standard" diff --git a/boards/AVR128DB48.json b/boards/AVR128DB48.json index 937eaaa..3e31d10 100644 --- a/boards/AVR128DB48.json +++ b/boards/AVR128DB48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DB48 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr128db48", "variant": "48pin-standard" diff --git a/boards/AVR128DB64.json b/boards/AVR128DB64.json index 56e4f2b..3e5bf54 100644 --- a/boards/AVR128DB64.json +++ b/boards/AVR128DB64.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR128DB64 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR128DB64 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr128db64", "variant": "64pin-standard" diff --git a/boards/AVR32DA28.json b/boards/AVR32DA28.json index aadfad3..c413d49 100644 --- a/boards/AVR32DA28.json +++ b/boards/AVR32DA28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DA28 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr32da28", "variant": "28pin-standard" diff --git a/boards/AVR32DA32.json b/boards/AVR32DA32.json index 088c8c0..23f0786 100644 --- a/boards/AVR32DA32.json +++ b/boards/AVR32DA32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DA32 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr32da32", "variant": "32pin-standard" diff --git a/boards/AVR32DA48.json b/boards/AVR32DA48.json index 1d3f73c..50454bc 100644 --- a/boards/AVR32DA48.json +++ b/boards/AVR32DA48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DA48 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr32da48", "variant": "48pin-standard" diff --git a/boards/AVR32DB28.json b/boards/AVR32DB28.json index ed0765b..47bd8e6 100644 --- a/boards/AVR32DB28.json +++ b/boards/AVR32DB28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DB28 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr32db28", "variant": "28pin-standard" diff --git a/boards/AVR32DB32.json b/boards/AVR32DB32.json index ec85b6d..faf4b4d 100644 --- a/boards/AVR32DB32.json +++ b/boards/AVR32DB32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DB32 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr32db32", "variant": "32pin-standard" diff --git a/boards/AVR32DB48.json b/boards/AVR32DB48.json index a84b44c..e55bb5b 100644 --- a/boards/AVR32DB48.json +++ b/boards/AVR32DB48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR32DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR32DB48 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr32db48", "variant": "48pin-standard" diff --git a/boards/AVR64DA28.json b/boards/AVR64DA28.json index f1af8ee..44a8e21 100644 --- a/boards/AVR64DA28.json +++ b/boards/AVR64DA28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DA28 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DA28 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr64da28", "variant": "28pin-standard" diff --git a/boards/AVR64DA32.json b/boards/AVR64DA32.json index 3b37710..983cebd 100644 --- a/boards/AVR64DA32.json +++ b/boards/AVR64DA32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DA32 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DA32 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr64da32", "variant": "32pin-standard" diff --git a/boards/AVR64DA48.json b/boards/AVR64DA48.json index 995721b..cd5f87e 100644 --- a/boards/AVR64DA48.json +++ b/boards/AVR64DA48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DA48 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DA48 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr64da48", "variant": "48pin-standard" diff --git a/boards/AVR64DA64.json b/boards/AVR64DA64.json index 017a8f7..3dc9d61 100644 --- a/boards/AVR64DA64.json +++ b/boards/AVR64DA64.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DA64 -DARDUINO_avrda -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DA64 -DARDUINO_avrda", "f_cpu": "24000000L", "mcu": "avr64da64", "variant": "64pin-standard" diff --git a/boards/AVR64DB28.json b/boards/AVR64DB28.json index 8d5e05d..59d3a86 100644 --- a/boards/AVR64DB28.json +++ b/boards/AVR64DB28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DB28 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DB28 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr64db28", "variant": "28pin-standard" diff --git a/boards/AVR64DB32.json b/boards/AVR64DB32.json index 140a3d2..e953d00 100644 --- a/boards/AVR64DB32.json +++ b/boards/AVR64DB32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DB32 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DB32 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr64db32", "variant": "32pin-standard" diff --git a/boards/AVR64DB48.json b/boards/AVR64DB48.json index 3c9fb3c..5bb887b 100644 --- a/boards/AVR64DB48.json +++ b/boards/AVR64DB48.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DB48 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DB48 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr64db48", "variant": "48pin-standard" diff --git a/boards/AVR64DB64.json b/boards/AVR64DB64.json index 539de31..c658b60 100644 --- a/boards/AVR64DB64.json +++ b/boards/AVR64DB64.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DB64 -DARDUINO_avrdb -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DB64 -DARDUINO_avrdb", "f_cpu": "24000000L", "mcu": "avr64db64", "variant": "64pin-standard" diff --git a/boards/AVR64DD14.json b/boards/AVR64DD14.json index d062d90..f5ce226 100644 --- a/boards/AVR64DD14.json +++ b/boards/AVR64DD14.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DD14 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DD14 -DARDUINO_avrdd", "f_cpu": "24000000L", "mcu": "avr64dd14", "variant": "14pin-standard" diff --git a/boards/AVR64DD20.json b/boards/AVR64DD20.json index e965dc0..930c297 100644 --- a/boards/AVR64DD20.json +++ b/boards/AVR64DD20.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DD20 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DD20 -DARDUINO_avrdd", "f_cpu": "24000000L", "mcu": "avr64dd20", "variant": "20pin-standard" diff --git a/boards/AVR64DD28.json b/boards/AVR64DD28.json index 1165f8e..7b1d1e3 100644 --- a/boards/AVR64DD28.json +++ b/boards/AVR64DD28.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DD28 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DD28 -DARDUINO_avrdd", "f_cpu": "24000000L", "mcu": "avr64dd28", "variant": "28pin-standard" diff --git a/boards/AVR64DD32.json b/boards/AVR64DD32.json index 2171f2c..9b4b57c 100644 --- a/boards/AVR64DD32.json +++ b/boards/AVR64DD32.json @@ -1,7 +1,7 @@ { "build": { "core": "dxcore", - "extra_flags": "-DARDUINO_AVR_AVR64DD32 -DARDUINO_avrdd -DMILLIS_USE_TIMERB0", + "extra_flags": "-DARDUINO_AVR_AVR64DD32 -DARDUINO_avrdd", "f_cpu": "24000000L", "mcu": "avr64dd32", "variant": "32pin-standard" diff --git a/boards/curiosity_nano_da.json b/boards/curiosity_nano_da.json new file mode 100644 index 0000000..fbc24bb --- /dev/null +++ b/boards/curiosity_nano_da.json @@ -0,0 +1,23 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DA48 -DARDUINO_avrda -DLED_BUILTIN=PIN_PC6", + "f_cpu": "24000000L", + "mcu": "avr128da48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "Curiosity Nano AVR128DA48", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "pkobn_updi" + }, + "url": "https://www.microchip.com/developmenttools/ProductDetails/DM164151", + "vendor": "Microchip" +} diff --git a/boards/curiosity_nano_db.json b/boards/curiosity_nano_db.json new file mode 100644 index 0000000..2b3beeb --- /dev/null +++ b/boards/curiosity_nano_db.json @@ -0,0 +1,23 @@ +{ + "build": { + "core": "dxcore", + "extra_flags": "-DARDUINO_AVR_AVR128DB48 -DARDUINO_avrdb -DLED_BUILTIN=PIN_PB3", + "f_cpu": "24000000L", + "mcu": "avr128db48", + "variant": "48pin-standard" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "Curiosity Nano AVR128DB48", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072, + "protocol": "pkobn_updi" + }, + "url": "https://www.microchip.com/developmenttools/ProductDetails/EV35L43A", + "vendor": "Microchip" +} diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index b349ae7..ed1ca29 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -81,7 +81,7 @@ board = AVR128DA64 [env:AVR128DA48] platform = atmelmegaavr framework = arduino -board = AVR128DA48 +board = curiosity_nano_da [env:AVR128DA32] platform = atmelmegaavr @@ -107,3 +107,8 @@ board = AVR32DB32 platform = atmelmegaavr framework = arduino board = AVR32DB48 + +[env:AVR128DB48] +platform = atmelmegaavr +framework = arduino +board = curiosity_nano_db diff --git a/examples/arduino-internal-libs/platformio.ini b/examples/arduino-internal-libs/platformio.ini index e4c8058..1dc2a68 100644 --- a/examples/arduino-internal-libs/platformio.ini +++ b/examples/arduino-internal-libs/platformio.ini @@ -25,7 +25,7 @@ board = AVR128DA64 [env:AVR128DA48] platform = atmelmegaavr framework = arduino -board = AVR128DA48 +board = curiosity_nano_da [env:AVR128DA32] platform = atmelmegaavr @@ -51,3 +51,8 @@ board = AVR32DB32 platform = atmelmegaavr framework = arduino board = AVR32DB48 + +[env:AVR128DB48] +platform = atmelmegaavr +framework = arduino +board = curiosity_nano_db diff --git a/examples/native-blink/platformio.ini b/examples/native-blink/platformio.ini index e80a765..4a89f14 100644 --- a/examples/native-blink/platformio.ini +++ b/examples/native-blink/platformio.ini @@ -23,9 +23,14 @@ board = AVR128DA64 [env:AVR128DA48] platform = atmelmegaavr framework = arduino -board = AVR128DA48 +board = curiosity_nano_da [env:AVR32DB48] platform = atmelmegaavr framework = arduino board = AVR32DB48 + +[env:AVR128DB48] +platform = atmelmegaavr +framework = arduino +board = curiosity_nano_db From 678311d8851cb7640e4f59f3d7cca4d92e81c788 Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 18 Jan 2022 11:19:06 +0100 Subject: [PATCH 07/21] Add AVR-Dx support to fuses.py script (#20) --- builder/fuses.py | 96 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 32 deletions(-) diff --git a/builder/fuses.py b/builder/fuses.py index ab55e32..dbea0c4 100644 --- a/builder/fuses.py +++ b/builder/fuses.py @@ -11,18 +11,32 @@ def get_wdtcfg_fuse(): def get_bodcfg_fuse(bod): - if bod == "4.3v": - return 0xF4 - elif bod == "2.6v": - return 0x54 - elif bod == "1.8v": - return 0x14 - else: # bod disabled - return 0x00 + if core == "dxcore": + if bod == "2.85v": + return 0x74 + elif bod == "2.7v": + return 0x54 + elif bod == "2.45v": + return 0x34 + elif bod == "1.9v": + return 0x14 + else: # bod disabled + return 0x00 + elif core in ("MegaCoreX", "megatinycore"): + if bod == "4.3v": + return 0xF4 + elif bod == "2.6v": + return 0x54 + elif bod == "1.8v": + return 0x14 + else: # bod disabled + return 0x00 def get_osccfg_fuse(f_cpu, oscillator): - if ( + if core == "dxcore": + return 0x00 + elif ( f_cpu == "20000000L" or f_cpu == "10000000L" or f_cpu == "5000000L" ) and oscillator == "internal": return 0x02 @@ -36,7 +50,7 @@ def get_tcd0cfg_fuse(): def get_syscfg0_fuse(eesave, pin, uart): eesave_bit = 1 if eesave == "yes" else 0 - if core == "MegaCoreX": + if core in ("MegaCoreX", "dxcore"): if pin == "gpio": if uart == "no_bootloader": rstpin_bit = 0 @@ -48,44 +62,59 @@ def get_syscfg0_fuse(eesave, pin, uart): elif core == "megatinycore": if pin == "gpio": - updipin_bits = 0x0 + updipin_bits = 0 elif pin == "updi": - updipin_bits = 0x1 + updipin_bits = 1 else: - updipin_bits = 0x2 + updipin_bits = 2 return 0xC0 | updipin_bits << 2 | eesave_bit -def get_syscfg1_fuse(): - return 0x06 +# Handle AVR-DB's differently since these has MVIO pins +def get_syscfg1_fuse(mvio): + if core == "dxcore" and ("db" in board.get("build.mcu").lower()): + if(mvio == "yes"): + return 0x0E + else: + return 0x16 + else: + return 0x06 +# Called CODESIZE on AVR-Dx def get_append_fuse(): return 0x00 +# Called BOOTSIZE on AVR-Dx def get_bootend_fuse(uart): if uart == "no_bootloader": return 0x00 - else: - return 0x02 + else: + if core in ("MegaCoreX", "megatinycore"): + return 0x02 + elif core == "dxcore": + return 0x01 def get_lockbit_fuse(): - return 0xC5 + if core in ("MegaCoreX", "megatinycore"): + return 0xC5 + elif core == "dxcore": + return 0x5CC5C55C def print_fuses_info(fuse_values, fuse_names, lock_fuse): if "upload" in COMMAND_LINE_TARGETS: return print("\nSelected fuses:") - print("------------------------") + print("-------------------------") for idx, value in enumerate(fuse_values): if value: - print("[fuse%d / %-7s = %s]" % (idx, fuse_names[idx].upper(), value)) + print("[fuse%d / %-8s = %s]" % (idx, fuse_names[idx].lower(), value)) if lock_fuse: - print("[lfuse / LOCKBIT = %s]" % lock_fuse) - print("------------------------\n") + print("[lock / lockbit = %s]" % lock_fuse) + print("-------------------------\n") def calculate_fuses(board_config, predefined_fuses): @@ -95,26 +124,29 @@ def calculate_fuses(board_config, predefined_fuses): bod = board_config.get("hardware.bod", "2.6v").lower() uart = board_config.get("hardware.uart", "no_bootloader").lower() eesave = board_config.get("hardware.eesave", "yes").lower() - if core == "MegaCoreX": + mvio = board_config.get("hardware.mvio_enable", "no").lower() + if core in ("MegaCoreX", "dxcore"): pin = board_config.get("hardware.rstpin", "reset").lower() # Guard that prevents the user from turning the reset pin # into a GPIO while using a bootloader if uart != "no_bootloader": pin = "reset" - elif core == "megatinycore": pin = board_config.get("hardware.updipin", "updi").lower() print("\nTARGET CONFIGURATION:") - print("------------------------") + print("-------------------------") print("Target = %s" % target) print("Clock speed = %s" % f_cpu) print("Oscillator = %s" % oscillator) print("BOD level = %s" % bod) print("Save EEPROM = %s" % eesave) + if core == "dxcore" and "db" in board.get("build.mcu").lower(): + print("MVIO enable = %s" % mvio) print("%s = %s" % ( - "Reset pin mode" if core == "MegaCoreX" else "UPDI pin mode", pin)) - print("------------------------") + "Reset pin mode" if core in ("MegaCoreX", "dxcore") else "UPDI pin mode", pin)) + print("-------------------------") + return ( predefined_fuses[0] or "0x%.2X" % get_wdtcfg_fuse(), @@ -123,7 +155,7 @@ def calculate_fuses(board_config, predefined_fuses): "", # reserved predefined_fuses[4] or "0x%.2X" % get_tcd0cfg_fuse(), predefined_fuses[5] or "0x%.2X" % get_syscfg0_fuse(eesave, pin, uart), - predefined_fuses[6] or "0x%.2X" % get_syscfg1_fuse(), + predefined_fuses[6] or "0x%.2X" % get_syscfg1_fuse(mvio), predefined_fuses[7] or "0x%.2X" % get_append_fuse(), predefined_fuses[8] or "0x%.2X" % get_bootend_fuse(uart), ) @@ -152,15 +184,15 @@ def calculate_fuses(board_config, predefined_fuses): "tcd0cfg", "syscfg0", "syscfg1", - "append", - "bootend" + "append" if core in ("MegaCoreX", "megatinycore") else "codesize", + "bootend" if core in ("MegaCoreX", "megatinycore") else "bootsize" ) board_fuses = board.get(fuses_section, {}) if ( not board_fuses and "FUSESFLAGS" not in env - and core not in ("MegaCoreX", "megatinycore") + and core not in ("MegaCoreX", "megatinycore", "dxcore") ): sys.stderr.write( "Error: Dynamic fuses generation for %s / %s is not supported. " @@ -170,7 +202,7 @@ def calculate_fuses(board_config, predefined_fuses): fuse_values = [board_fuses.get(fname, "") for fname in fuse_names] lock_fuse = board_fuses.get("lockbit", "0x%.2X" % get_lockbit_fuse()) -if core in ("MegaCoreX", "megatinycore"): +if core in ("MegaCoreX", "megatinycore", "dxcore"): fuse_values = calculate_fuses(board, fuse_values) From 614a254e68a22c5a24e372e2cdb577212d8e3f28 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Tue, 18 Jan 2022 12:23:10 +0200 Subject: [PATCH 08/21] Update avrdude packages Now it contains several missing programmers mentioned in #31 --- platform.json | 2 +- platform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform.json b/platform.json index 6e484d6..f075e70 100644 --- a/platform.json +++ b/platform.json @@ -60,7 +60,7 @@ "optional": true, "owner": "platformio", "version": "~1.60300.0", - "optionalVersions": ["~2.60300.0"] + "optionalVersions": ["~3.60300.0"] } } } diff --git a/platform.py b/platform.py index 9ed128a..468bd41 100644 --- a/platform.py +++ b/platform.py @@ -34,7 +34,7 @@ def configure_default_packages(self, variables, targets): if build_core in ("MegaCoreX", "megatinycore", "dxcore"): self.packages["toolchain-atmelavr"]["version"] = "~3.70300.0" - self.packages["tool-avrdude-megaavr"]["version"] = "~2.60300.0" + self.packages["tool-avrdude-megaavr"]["version"] = "~3.60300.0" if any(t in targets for t in ("fuses", "bootloader")): self.packages["tool-avrdude-megaavr"]["optional"] = False From 11007ccb47d8a86d8c1943a06b28dd60a046f4a4 Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 18 Jan 2022 13:21:08 +0100 Subject: [PATCH 09/21] Add support for the entire tinyAVR-2 family (#36) --- boards/ATtiny1624.json | 24 ++++++++++++++++++++++++ boards/ATtiny1626.json | 24 ++++++++++++++++++++++++ boards/ATtiny1627.json | 24 ++++++++++++++++++++++++ boards/ATtiny3224.json | 24 ++++++++++++++++++++++++ boards/ATtiny3226.json | 24 ++++++++++++++++++++++++ boards/ATtiny3227.json | 24 ++++++++++++++++++++++++ boards/ATtiny424.json | 24 ++++++++++++++++++++++++ boards/ATtiny426.json | 24 ++++++++++++++++++++++++ boards/ATtiny427.json | 24 ++++++++++++++++++++++++ boards/ATtiny824.json | 24 ++++++++++++++++++++++++ boards/ATtiny826.json | 24 ++++++++++++++++++++++++ boards/ATtiny827.json | 24 ++++++++++++++++++++++++ 12 files changed, 288 insertions(+) create mode 100644 boards/ATtiny1624.json create mode 100644 boards/ATtiny1626.json create mode 100644 boards/ATtiny1627.json create mode 100644 boards/ATtiny3224.json create mode 100644 boards/ATtiny3226.json create mode 100644 boards/ATtiny3227.json create mode 100644 boards/ATtiny424.json create mode 100644 boards/ATtiny426.json create mode 100644 boards/ATtiny427.json create mode 100644 boards/ATtiny824.json create mode 100644 boards/ATtiny826.json create mode 100644 boards/ATtiny827.json diff --git a/boards/ATtiny1624.json b/boards/ATtiny1624.json new file mode 100644 index 0000000..bc22256 --- /dev/null +++ b/boards/ATtiny1624.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny1624", + "variant": "txy4" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny1624", + "upload": { + "maximum_ram_size": 2048, + "maximum_size": 16384, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY1624", + "vendor": "Microchip" +} diff --git a/boards/ATtiny1626.json b/boards/ATtiny1626.json new file mode 100644 index 0000000..2c4d51b --- /dev/null +++ b/boards/ATtiny1626.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny1626", + "variant": "txy6" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny1626", + "upload": { + "maximum_ram_size": 2048, + "maximum_size": 16384, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY1626", + "vendor": "Microchip" +} diff --git a/boards/ATtiny1627.json b/boards/ATtiny1627.json new file mode 100644 index 0000000..a9d8291 --- /dev/null +++ b/boards/ATtiny1627.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny1627", + "variant": "txy7" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny1627", + "upload": { + "maximum_ram_size": 2048, + "maximum_size": 16384, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY1627", + "vendor": "Microchip" +} diff --git a/boards/ATtiny3224.json b/boards/ATtiny3224.json new file mode 100644 index 0000000..b633cf0 --- /dev/null +++ b/boards/ATtiny3224.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny3224", + "variant": "txy4" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny3224", + "upload": { + "maximum_ram_size": 3072, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY3224", + "vendor": "Microchip" +} diff --git a/boards/ATtiny3226.json b/boards/ATtiny3226.json new file mode 100644 index 0000000..756d792 --- /dev/null +++ b/boards/ATtiny3226.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny3226", + "variant": "txy6" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny3226", + "upload": { + "maximum_ram_size": 3072, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY3226", + "vendor": "Microchip" +} diff --git a/boards/ATtiny3227.json b/boards/ATtiny3227.json new file mode 100644 index 0000000..92d6bb6 --- /dev/null +++ b/boards/ATtiny3227.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny3227", + "variant": "txy7" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny3227", + "upload": { + "maximum_ram_size": 3072, + "maximum_size": 32768, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY3227", + "vendor": "Microchip" +} diff --git a/boards/ATtiny424.json b/boards/ATtiny424.json new file mode 100644 index 0000000..ccb0876 --- /dev/null +++ b/boards/ATtiny424.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny424", + "variant": "txy4" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny424", + "upload": { + "maximum_ram_size": 512, + "maximum_size": 4096, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY424", + "vendor": "Microchip" +} diff --git a/boards/ATtiny426.json b/boards/ATtiny426.json new file mode 100644 index 0000000..c820001 --- /dev/null +++ b/boards/ATtiny426.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny426", + "variant": "txy6" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny426", + "upload": { + "maximum_ram_size": 512, + "maximum_size": 4096, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY426", + "vendor": "Microchip" +} diff --git a/boards/ATtiny427.json b/boards/ATtiny427.json new file mode 100644 index 0000000..acc2eb4 --- /dev/null +++ b/boards/ATtiny427.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny427", + "variant": "txy7" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny427", + "upload": { + "maximum_ram_size": 512, + "maximum_size": 4096, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY427", + "vendor": "Microchip" +} diff --git a/boards/ATtiny824.json b/boards/ATtiny824.json new file mode 100644 index 0000000..1bf7603 --- /dev/null +++ b/boards/ATtiny824.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny824", + "variant": "txy4" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny824", + "upload": { + "maximum_ram_size": 1024, + "maximum_size": 8192, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY824", + "vendor": "Microchip" +} diff --git a/boards/ATtiny826.json b/boards/ATtiny826.json new file mode 100644 index 0000000..4187c74 --- /dev/null +++ b/boards/ATtiny826.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny826", + "variant": "txy6" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny826", + "upload": { + "maximum_ram_size": 1024, + "maximum_size": 8192, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY826", + "vendor": "Microchip" +} diff --git a/boards/ATtiny827.json b/boards/ATtiny827.json new file mode 100644 index 0000000..aa7e563 --- /dev/null +++ b/boards/ATtiny827.json @@ -0,0 +1,24 @@ +{ + "build": { + "core": "megatinycore", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "f_cpu": "16000000L", + "mcu": "attiny827", + "variant": "txy7" + }, + "hardware": { + "oscillator": "internal" + }, + "frameworks": [ + "arduino" + ], + "name": "ATtiny827", + "upload": { + "maximum_ram_size": 1024, + "maximum_size": 8192, + "protocol": "jtag2updi", + "speed": 115200 + }, + "url": "https://www.microchip.com/wwwproducts/en/ATTINY827", + "vendor": "Microchip" +} From f77d65abe12dc181dbc5eb66b7be5567121eaeec Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Wed, 19 Jan 2022 11:48:26 +0200 Subject: [PATCH 10/21] Tidy up fuses script --- builder/fuses.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/builder/fuses.py b/builder/fuses.py index dbea0c4..adb651b 100644 --- a/builder/fuses.py +++ b/builder/fuses.py @@ -20,7 +20,7 @@ def get_bodcfg_fuse(bod): return 0x34 elif bod == "1.9v": return 0x14 - else: # bod disabled + else: # bod disabled return 0x00 elif core in ("MegaCoreX", "megatinycore"): if bod == "4.3v": @@ -29,7 +29,7 @@ def get_bodcfg_fuse(bod): return 0x54 elif bod == "1.8v": return 0x14 - else: # bod disabled + else: # bod disabled return 0x00 @@ -69,6 +69,9 @@ def get_syscfg0_fuse(eesave, pin, uart): updipin_bits = 2 return 0xC0 | updipin_bits << 2 | eesave_bit + sys.stderr.write("Error: Couldn't calculate SYSCFG0 fuse for %s\n" % target) + env.Exit(1) + # Handle AVR-DB's differently since these has MVIO pins def get_syscfg1_fuse(mvio): @@ -80,6 +83,9 @@ def get_syscfg1_fuse(mvio): else: return 0x06 + sys.stderr.write("Error: Couldn't calculate SYSCFG1 fuse for %s\n" % target) + env.Exit(1) + # Called CODESIZE on AVR-Dx def get_append_fuse(): @@ -90,18 +96,24 @@ def get_append_fuse(): def get_bootend_fuse(uart): if uart == "no_bootloader": return 0x00 - else: + else: if core in ("MegaCoreX", "megatinycore"): return 0x02 elif core == "dxcore": return 0x01 + sys.stderr.write("Error: Couldn't calculate bootend for %s\n" % target) + env.Exit(1) + def get_lockbit_fuse(): if core in ("MegaCoreX", "megatinycore"): return 0xC5 elif core == "dxcore": return 0x5CC5C55C + else: + sys.stderr.write("Error: Couldn't calculate lockbit for %s\n" % target) + env.Exit(1) def print_fuses_info(fuse_values, fuse_names, lock_fuse): @@ -118,7 +130,6 @@ def print_fuses_info(fuse_values, fuse_names, lock_fuse): def calculate_fuses(board_config, predefined_fuses): - megaavr_fuses = [] f_cpu = board_config.get("build.f_cpu", "16000000L").upper() oscillator = board_config.get("hardware.oscillator", "internal").lower() bod = board_config.get("hardware.bod", "2.6v").lower() @@ -147,7 +158,6 @@ def calculate_fuses(board_config, predefined_fuses): "Reset pin mode" if core in ("MegaCoreX", "dxcore") else "UPDI pin mode", pin)) print("-------------------------") - return ( predefined_fuses[0] or "0x%.2X" % get_wdtcfg_fuse(), predefined_fuses[1] or "0x%.2X" % get_bodcfg_fuse(bod), @@ -184,7 +194,7 @@ def calculate_fuses(board_config, predefined_fuses): "tcd0cfg", "syscfg0", "syscfg1", - "append" if core in ("MegaCoreX", "megatinycore") else "codesize", + "append" if core in ("MegaCoreX", "megatinycore") else "codesize", "bootend" if core in ("MegaCoreX", "megatinycore") else "bootsize" ) From de9877bcbee576284eda0ac12c01f8404c5157c5 Mon Sep 17 00:00:00 2001 From: Hans Date: Thu, 20 Jan 2022 10:48:41 +0100 Subject: [PATCH 11/21] Add support for 1200bps touch when programming fuses (#37) --- boards/nano_every.json | 1 + builder/fuses.py | 12 +++++++----- builder/main.py | 14 +++++++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/boards/nano_every.json b/boards/nano_every.json index 68f3653..402430d 100644 --- a/boards/nano_every.json +++ b/boards/nano_every.json @@ -27,6 +27,7 @@ "maximum_ram_size": 6144, "maximum_size": 48640, "protocol": "jtag2updi", + "use_1200bps_touch": true, "speed": 115200 }, "url": "https://www.arduino.cc/en/Guide/NANOEvery", diff --git a/builder/fuses.py b/builder/fuses.py index adb651b..b98ba42 100644 --- a/builder/fuses.py +++ b/builder/fuses.py @@ -107,7 +107,7 @@ def get_bootend_fuse(uart): def get_lockbit_fuse(): - if core in ("MegaCoreX", "megatinycore"): + if core in ("arduino", "MegaCoreX", "megatinycore"): return 0xC5 elif core == "dxcore": return 0x5CC5C55C @@ -244,12 +244,14 @@ def calculate_fuses(board_config, predefined_fuses): if int(ARGUMENTS.get("PIOVERBOSE", 0)): env.Append(FUSESUPLOADERFLAGS=["-v"]) -if not env.BoardConfig().get("upload", {}).get("require_upload_port", False): - # upload methods via USB - env.Append(FUSESUPLOADERFLAGS=["-P", "usb"]) -else: +# Add upload serial port to Avrdude flags list if a jtag2updi programmer +if env.subst("$UPLOAD_PROTOCOL") in ("jtag2updi", "serialupdi"): env.AutodetectUploadPort() env.Append(FUSESUPLOADERFLAGS=["-P", '"$UPLOAD_PORT"']) +else: + # upload methods via USB + env.Append(FUSESUPLOADERFLAGS=["-P", "usb"]) + if env.subst("$UPLOAD_PROTOCOL") != "custom": env.Append(FUSESUPLOADERFLAGS=["-c", "$UPLOAD_PROTOCOL"]) diff --git a/builder/main.py b/builder/main.py index 01c725a..d6df7e4 100644 --- a/builder/main.py +++ b/builder/main.py @@ -169,10 +169,13 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 # Target: Setup fuses # -fuses_action = None +fuses_actions = None if "fuses" in COMMAND_LINE_TARGETS: - fuses_action = env.SConscript("fuses.py", exports="env") -env.AddPlatformTarget("fuses", None, fuses_action, "Set Fuses") + fuses_actions = [ + env.VerboseAction(BeforeUpload, "Looking for port..."), + env.SConscript("fuses.py", exports="env") + ] +env.AddPlatformTarget("fuses", None, fuses_actions, "Set Fuses") # # Target: Upload bootloader @@ -198,11 +201,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 ] upload_options = env.BoardConfig().get("upload", {}) - # jtag2updi seems to be the only protocol that requires serial port - if upload_protocol == "jtag2updi": + if upload_protocol in ("jtag2updi", "serialupdi"): upload_options["require_upload_port"] = True - upload_options["use_1200bps_touch"] = True - upload_options["wait_for_upload_port"] = False elif upload_protocol == "arduino": upload_options["require_upload_port"] = True upload_options["use_1200bps_touch"] = False From abbc9699c7c8f587842eb7c9d29eb61096f715c1 Mon Sep 17 00:00:00 2001 From: Hans Date: Tue, 8 Feb 2022 20:25:37 +0100 Subject: [PATCH 12/21] Fix millis for all tinyAVR-2 targets (#39) Timer TCD0 doesn't exist on these parts. Use the default megaTinyCore timer instead, TCB1 --- boards/ATtiny1624.json | 2 +- boards/ATtiny1626.json | 2 +- boards/ATtiny1627.json | 2 +- boards/ATtiny3224.json | 2 +- boards/ATtiny3226.json | 2 +- boards/ATtiny3227.json | 2 +- boards/ATtiny424.json | 2 +- boards/ATtiny426.json | 2 +- boards/ATtiny427.json | 2 +- boards/ATtiny824.json | 2 +- boards/ATtiny826.json | 2 +- boards/ATtiny827.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/boards/ATtiny1624.json b/boards/ATtiny1624.json index bc22256..bc331c0 100644 --- a/boards/ATtiny1624.json +++ b/boards/ATtiny1624.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny1624", "variant": "txy4" diff --git a/boards/ATtiny1626.json b/boards/ATtiny1626.json index 2c4d51b..2578fc5 100644 --- a/boards/ATtiny1626.json +++ b/boards/ATtiny1626.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny1626", "variant": "txy6" diff --git a/boards/ATtiny1627.json b/boards/ATtiny1627.json index a9d8291..a2ff6a6 100644 --- a/boards/ATtiny1627.json +++ b/boards/ATtiny1627.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny1627", "variant": "txy7" diff --git a/boards/ATtiny3224.json b/boards/ATtiny3224.json index b633cf0..0cfff8f 100644 --- a/boards/ATtiny3224.json +++ b/boards/ATtiny3224.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny3224", "variant": "txy4" diff --git a/boards/ATtiny3226.json b/boards/ATtiny3226.json index 756d792..a5bd929 100644 --- a/boards/ATtiny3226.json +++ b/boards/ATtiny3226.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny3226", "variant": "txy6" diff --git a/boards/ATtiny3227.json b/boards/ATtiny3227.json index 92d6bb6..f4f99e5 100644 --- a/boards/ATtiny3227.json +++ b/boards/ATtiny3227.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny3227", "variant": "txy7" diff --git a/boards/ATtiny424.json b/boards/ATtiny424.json index ccb0876..4123e81 100644 --- a/boards/ATtiny424.json +++ b/boards/ATtiny424.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny424", "variant": "txy4" diff --git a/boards/ATtiny426.json b/boards/ATtiny426.json index c820001..53928be 100644 --- a/boards/ATtiny426.json +++ b/boards/ATtiny426.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny426", "variant": "txy6" diff --git a/boards/ATtiny427.json b/boards/ATtiny427.json index acc2eb4..88ba112 100644 --- a/boards/ATtiny427.json +++ b/boards/ATtiny427.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny427", "variant": "txy7" diff --git a/boards/ATtiny824.json b/boards/ATtiny824.json index 1bf7603..ee57034 100644 --- a/boards/ATtiny824.json +++ b/boards/ATtiny824.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy4 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny824", "variant": "txy4" diff --git a/boards/ATtiny826.json b/boards/ATtiny826.json index 4187c74..4ef917e 100644 --- a/boards/ATtiny826.json +++ b/boards/ATtiny826.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy6 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny826", "variant": "txy6" diff --git a/boards/ATtiny827.json b/boards/ATtiny827.json index aa7e563..63fd1bf 100644 --- a/boards/ATtiny827.json +++ b/boards/ATtiny827.json @@ -1,7 +1,7 @@ { "build": { "core": "megatinycore", - "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERD0 -DUARTBAUD5V", + "extra_flags": "-DARDUINO_attinyxy7 -DMILLIS_USE_TIMERB1 -DUARTBAUD5V", "f_cpu": "16000000L", "mcu": "attiny827", "variant": "txy7" From 667652e7704ba6030e868b689e8ff585b91b2ed7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 Mar 2022 14:19:35 +0300 Subject: [PATCH 13/21] Switch docs to HTTPs --- README.md | 8 ++++---- examples/arduino-blink/README.md | 2 +- examples/arduino-blink/platformio.ini | 2 +- examples/arduino-external-libs/README.md | 2 +- examples/arduino-external-libs/platformio.ini | 2 +- examples/arduino-internal-libs/README.md | 2 +- examples/arduino-internal-libs/platformio.ini | 2 +- examples/native-blink/README.md | 2 +- examples/native-blink/platformio.ini | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 83d534e..577726d 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Microchip's megaAVR is suitable for applications requiring large amounts of code and offers substantial program and data memories with performance up to 20 MIPS. Based on industry-leading, proven technology, the megaAVR family offers Microchip's widest selection of devices in terms of memories, pin counts, and peripherals. -* [Home](http://platformio.org/platforms/atmelmegaavr) (home page in PlatformIO Platform Registry) -* [Documentation](http://docs.platformio.org/page/platforms/atmelmegaavr.html) (advanced usage, packages, boards, frameworks, etc.) +* [Home](https://registry.platformio.org/platforms/platformio/atmelmegaavr) (home page in the PlatformIO Registry) +* [Documentation](https://docs.platformio.org/page/platforms/atmelmegaavr.html) (advanced usage, packages, boards, frameworks, etc.) # Usage 1. [Install PlatformIO](http://platformio.org) -2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: +2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version @@ -32,4 +32,4 @@ board = ... # Configuration -Please navigate to [documentation](http://docs.platformio.org/page/platforms/atmelmegaavr.html). +Please navigate to [documentation](https://docs.platformio.org/page/platforms/atmelmegaavr.html). diff --git a/examples/arduino-blink/README.md b/examples/arduino-blink/README.md index e2149eb..7de2553 100644 --- a/examples/arduino-blink/README.md +++ b/examples/arduino-blink/README.md @@ -12,7 +12,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index ed1ca29..c868aa7 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:uno_wifi_rev2] platform = atmelmegaavr diff --git a/examples/arduino-external-libs/README.md b/examples/arduino-external-libs/README.md index 87a1e72..d35d04b 100644 --- a/examples/arduino-external-libs/README.md +++ b/examples/arduino-external-libs/README.md @@ -12,7 +12,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-external-libs/platformio.ini b/examples/arduino-external-libs/platformio.ini index be840b8..8546278 100644 --- a/examples/arduino-external-libs/platformio.ini +++ b/examples/arduino-external-libs/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [common] lib_deps = diff --git a/examples/arduino-internal-libs/README.md b/examples/arduino-internal-libs/README.md index 0e8460c..af49f24 100644 --- a/examples/arduino-internal-libs/README.md +++ b/examples/arduino-internal-libs/README.md @@ -12,7 +12,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-internal-libs/platformio.ini b/examples/arduino-internal-libs/platformio.ini index 1dc2a68..8a5bbcf 100644 --- a/examples/arduino-internal-libs/platformio.ini +++ b/examples/arduino-internal-libs/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:uno_wifi_rev2] platform = atmelmegaavr diff --git a/examples/native-blink/README.md b/examples/native-blink/README.md index e411f35..3fce3f2 100644 --- a/examples/native-blink/README.md +++ b/examples/native-blink/README.md @@ -12,7 +12,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-atmelmegaavr/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/native-blink/platformio.ini b/examples/native-blink/platformio.ini index 4a89f14..158e8f3 100644 --- a/examples/native-blink/platformio.ini +++ b/examples/native-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:uno_wifi_rev2] platform = atmelmegaavr From 98ff5db7cb2b5c1b2417df12334a4ac2b9d87dcf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 4 Apr 2022 12:05:13 +0300 Subject: [PATCH 14/21] Use the latest Github OS images --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 547b9fc..237d982 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.7] example: - "examples/arduino-blink" From e87a4fe99c88a578fa09f7e8b1ee188fc4717566 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 8 Apr 2022 12:54:26 +0300 Subject: [PATCH 15/21] Symlink dev-platform --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 237d982..79a48e3 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -27,7 +27,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip - platformio platform install file://. + pio pkg install --global --platform symlink://. - name: Build examples run: | platformio run -d ${{ matrix.example }} From 625e1eeb3037e8e34fae55738f6fcd21285e8c50 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 15:34:28 +0300 Subject: [PATCH 16/21] Remove unnecessary files --- builder/compat.py | 38 ------------ builder/main.py | 1 - examples/arduino-blink/.travis.yml | 67 ---------------------- examples/arduino-external-libs/.travis.yml | 67 ---------------------- examples/arduino-internal-libs/.travis.yml | 67 ---------------------- examples/native-blink/.travis.yml | 67 ---------------------- 6 files changed, 307 deletions(-) delete mode 100644 builder/compat.py delete mode 100644 examples/arduino-blink/.travis.yml delete mode 100644 examples/arduino-external-libs/.travis.yml delete mode 100644 examples/arduino-internal-libs/.travis.yml delete mode 100644 examples/native-blink/.travis.yml diff --git a/builder/compat.py b/builder/compat.py deleted file mode 100644 index b8dfe3d..0000000 --- a/builder/compat.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014-present PlatformIO -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from SCons.Script import AlwaysBuild, Import - - -Import("env") - - -# Added in PIO Core 4.4.0 -if not hasattr(env, "AddPlatformTarget"): - - def AddPlatformTarget( - env, - name, - dependencies, - actions, - title=None, - description=None, - always_build=True, - ): - target = env.Alias(name, dependencies, actions) - if always_build: - AlwaysBuild(target) - return target - - env.AddMethod(AddPlatformTarget) diff --git a/builder/main.py b/builder/main.py index d6df7e4..5d58f03 100644 --- a/builder/main.py +++ b/builder/main.py @@ -51,7 +51,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 env = DefaultEnvironment() -env.SConscript("compat.py", exports="env") env.Replace( AR="avr-gcc-ar", diff --git a/examples/arduino-blink/.travis.yml b/examples/arduino-blink/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-blink/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/arduino-external-libs/.travis.yml b/examples/arduino-external-libs/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-external-libs/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/arduino-internal-libs/.travis.yml b/examples/arduino-internal-libs/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-internal-libs/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/native-blink/.travis.yml b/examples/native-blink/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/native-blink/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N From 64347b5c4339472a76b05d9dbc876aa1bf64f1ab Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 15:34:53 +0300 Subject: [PATCH 17/21] Improve support for assembly programming --- builder/frameworks/_bare.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/builder/frameworks/_bare.py b/builder/frameworks/_bare.py index 2d24b52..161cf80 100644 --- a/builder/frameworks/_bare.py +++ b/builder/frameworks/_bare.py @@ -20,21 +20,27 @@ Import("env") +machine_flags = [ + "-mmcu=$BOARD_MCU", +] + env.Append( - ASFLAGS=["-x", "assembler-with-cpp"], + ASFLAGS=machine_flags, + ASPPFLAGS=[ + "-x", "assembler-with-cpp", + ], CFLAGS=[ "-std=gnu11", "-fno-fat-lto-objects" ], - CCFLAGS=[ + CCFLAGS=machine_flags + [ "-Os", "-w", "-ffunction-sections", "-fdata-sections", "-flto", - "-mmcu=$BOARD_MCU" ], CPPDEFINES=[ @@ -49,10 +55,9 @@ "-Wno-error=narrowing" ], - LINKFLAGS=[ + LINKFLAGS=machine_flags + [ "-Os", "-flto", - "-mmcu=$BOARD_MCU", "-Wl,--gc-sections", "-Wl,--section-start=.text=%s" % ( @@ -65,6 +70,3 @@ LIBS=["m"] ) - -# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) -env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) From 8b7ff4e0063ea1662ffa478ce9dbf9ea4a671395 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 15:40:29 +0300 Subject: [PATCH 18/21] Add compatibility with PIO Core 6.0 --- .github/workflows/examples.yml | 10 ++++------ README.md | 4 ++-- builder/main.py | 4 ++-- platform.json | 2 +- platform.py | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 79a48e3..9290fc9 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,7 +8,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.7] example: - "examples/arduino-blink" - "examples/arduino-external-libs" @@ -16,16 +15,15 @@ jobs: - "examples/native-blink" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - name: Set up Python + uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip pio pkg install --global --platform symlink://. - name: Build examples diff --git a/README.md b/README.md index 577726d..410d3d8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Atmel megaAVR: development platform for [PlatformIO](http://platformio.org) +# Atmel megaAVR: development platform for [PlatformIO](https://platformio.org) [![Build Status](https://github.com/platformio/platform-atmelmegaavr/workflows/Examples/badge.svg)](https://github.com/platformio/platform-atmelmegaavr/actions) @@ -9,7 +9,7 @@ Microchip's megaAVR is suitable for applications requiring large amounts of code # Usage -1. [Install PlatformIO](http://platformio.org) +1. [Install PlatformIO](https://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version diff --git a/builder/main.py b/builder/main.py index 5d58f03..06970d8 100644 --- a/builder/main.py +++ b/builder/main.py @@ -18,7 +18,7 @@ from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, DefaultEnvironment) -from platformio.util import get_serial_ports +from platformio.public import list_serial_ports def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 @@ -41,7 +41,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 env.AutodetectUploadPort() env.Append(UPLOADERFLAGS=["-P", '"$UPLOAD_PORT"']) - before_ports = get_serial_ports() + before_ports = list_serial_ports() if upload_options.get("use_1200bps_touch", False): env.TouchSerialPort("$UPLOAD_PORT", 1200) diff --git a/platform.json b/platform.json index f075e70..7d6c666 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "8-bit" ], "engines": { - "platformio": "^5" + "platformio": "^6" }, "repository": { "type": "git", diff --git a/platform.py b/platform.py index 468bd41..4ae4b8e 100644 --- a/platform.py +++ b/platform.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from platformio.managers.platform import PlatformBase +from platformio.public import PlatformBase class AtmelmegaavrPlatform(PlatformBase): def configure_default_packages(self, variables, targets): if not variables.get("board"): - return super(AtmelmegaavrPlatform, self).configure_default_packages( + return super().configure_default_packages( variables, targets) build_core = variables.get( @@ -39,5 +39,5 @@ def configure_default_packages(self, variables, targets): if any(t in targets for t in ("fuses", "bootloader")): self.packages["tool-avrdude-megaavr"]["optional"] = False - return super(AtmelmegaavrPlatform, self).configure_default_packages( + return super().configure_default_packages( variables, targets) From c7c72fef9219e7da25926325565090dc86fbb860 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 17:33:51 +0300 Subject: [PATCH 19/21] Use 'pio' alias --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 9290fc9..69030d6 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -28,4 +28,4 @@ jobs: pio pkg install --global --platform symlink://. - name: Build examples run: | - platformio run -d ${{ matrix.example }} + pio run -d ${{ matrix.example }} From 78520abf317f145a38bce0d9f3a240d789afbf6a Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Fri, 27 May 2022 19:52:39 +0300 Subject: [PATCH 20/21] Update MegaCoreX to the latest v1.0.10 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 7d6c666..0d12a33 100644 --- a/platform.json +++ b/platform.json @@ -42,7 +42,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~1.0.7" + "version": "~1.0.10" }, "framework-arduino-megaavr-megatinycore": { "type": "framework", From 49c9986d5e12a6731b80df25f92573ba904480d7 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Mon, 30 May 2022 12:55:04 +0300 Subject: [PATCH 21/21] Bump version to 1.6.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 0d12a33..32f740e 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/platformio/platform-atmelmegaavr.git" }, - "version": "1.5.0", + "version": "1.6.0", "frameworks": { "arduino": { "package": "framework-arduino-megaavr",