From 4a8cd9914b0fbe68fa0d01f40a5cda25b0431690 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 9 Mar 2015 12:27:30 +0200 Subject: [PATCH] Add new platforms and boards: Freescale, Nordic, NXP and etc. --- docs/platforms/freescalekinetis.rst | 104 ++++++++++ docs/platforms/index.rst | 3 + docs/platforms/nordicnrf51.rst | 110 +++++++++++ docs/platforms/nxplpc.rst | 146 ++++++++++++++ platformio/boards/adafruit.json | 4 +- platformio/boards/freescalekinetis.json | 87 +++++++++ platformio/boards/nordicnrf51.json | 102 ++++++++++ platformio/boards/nxplpc.json | 184 ++++++++++++++++++ .../builder/scripts/freescalekinetis.py | 59 ++++++ platformio/builder/scripts/nordicnrf51.py | 59 ++++++ platformio/builder/scripts/nxplpc.py | 59 ++++++ platformio/commands/boards.py | 2 +- platformio/platforms/freescalekinetis.py | 23 +++ platformio/platforms/nordicnrf51.py | 23 +++ platformio/platforms/nxplpc.py | 23 +++ 15 files changed, 985 insertions(+), 3 deletions(-) create mode 100644 docs/platforms/freescalekinetis.rst create mode 100644 docs/platforms/nordicnrf51.rst create mode 100644 docs/platforms/nxplpc.rst create mode 100644 platformio/boards/freescalekinetis.json create mode 100644 platformio/boards/nordicnrf51.json create mode 100644 platformio/boards/nxplpc.json create mode 100644 platformio/builder/scripts/freescalekinetis.py create mode 100644 platformio/builder/scripts/nordicnrf51.py create mode 100644 platformio/builder/scripts/nxplpc.py create mode 100644 platformio/platforms/freescalekinetis.py create mode 100644 platformio/platforms/nordicnrf51.py create mode 100644 platformio/platforms/nxplpc.py diff --git a/docs/platforms/freescalekinetis.rst b/docs/platforms/freescalekinetis.rst new file mode 100644 index 00000000..de5f7aa4 --- /dev/null +++ b/docs/platforms/freescalekinetis.rst @@ -0,0 +1,104 @@ +.. _platform_freescalekinetis: + +Platform ``freescalekinetis`` +============================= + +`Freescale Kinetis Microcontrollers `_ is family of multiple hardware- and software-compatible ARM® Cortex®-M0+, Cortex-M4 and Cortex-M7-based MCU series. Kinetis MCUs offer exceptional low-power performance, scalability and feature integration. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Alias + - Contents + * - ``toolchain-gccarmnoneeabi`` + - toolchain + - `gcc-arm-embedded `_, + `GDB `_ + * - ``framework-mbed`` + - + - See below in :ref:`freescalekinetis_frameworks` + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + +.. _freescalekinetis_frameworks: + +Frameworks +---------- + +.. list-table:: + :header-rows: 1 + + * - Type ``framework`` + - Name + - Reference + * - ``mbed`` + - MBED Framework + - `Documentation `__ + + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command + * For more detailed ``board`` information please scroll tables below by + horizontal. + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller ``board_mcu`` + - Frequency ``board_f_cpu`` + - Flash + - RAM + * - ``frdm_kl05z`` + - `Freescale Kinetis FRDM-KL05Z `_ + - MKL05Z32VFM4 ``cortex-m0plus`` + - 48 MHz ``48000000L`` + - 32 Kb + - 4 Kb + * - ``frdm_kl25z`` + - `Freescale Kinetis FRDM-KL25Z `_ + - MKL25Z128VLK4 ``cortex-m0plus`` + - 48 MHz ``48000000L`` + - 128 Kb + - 16 Kb + * - ``frdm_kl46z`` + - `Freescale Kinetis FRDM-KL46Z `_ + - MKL46Z256Vll4 ``cortex-m0plus`` + - 48 MHz ``48000000L`` + - 256 Kb + - 32 Kb + * - ``frdm_k22f`` + - `Freescale Kinetis FRDM-K22F `_ + - MK22FN512VLH12 ``cortex-m4`` + - 120 MHz ``120000000L`` + - 512 Kb + - 128 Kb + * - ``frdm_k64f`` + - `Freescale Kinetis FRDM-K64F `_ + - MK64fN1M0VLL12 ``cortex-m4`` + - 120 MHz ``120000000L`` + - 1 Mb + - 256 Kb + * - ``frdm_k20d50m`` + - `Freescale Kinetis FRDM-K20D50M `_ + - MK20DX128VLH5 ``cortex-m4`` + - 48 MHz ``48000000L`` + - 128 Kb + - 16 Kb + + +More detailed information you can find here +`Freescale Kinetis platforms with support MBED framework `_. diff --git a/docs/platforms/index.rst b/docs/platforms/index.rst index ee95d183..220c3a67 100644 --- a/docs/platforms/index.rst +++ b/docs/platforms/index.rst @@ -16,6 +16,9 @@ MCU, upload protocol or etc. Please use ``board`` option. atmelavr atmelsam + freescalekinetis + nordicnrf51 + nxplpc ststm32 teensy timsp430 diff --git a/docs/platforms/nordicnrf51.rst b/docs/platforms/nordicnrf51.rst new file mode 100644 index 00000000..6241ee64 --- /dev/null +++ b/docs/platforms/nordicnrf51.rst @@ -0,0 +1,110 @@ +.. _platform_nordicnrf51: + +Platform ``nordicnrf51`` +======================== + +`The Nordic nRF51 Series `_ is a family of highly flexible, multi-protocol, system-on-chip (SoC) devices for ultra-low power wireless applications. nRF51 Series devices support a range of protocol stacks including Bluetooth Smart (previously called Bluetooth low energy), ANT and proprietary 2.4GHz protocols such as Gazell. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Alias + - Contents + * - ``toolchain-gccarmnoneeabi`` + - toolchain + - `gcc-arm-embedded `_, + `GDB `_ + * - ``framework-mbed`` + - + - See below in :ref:`nordicnrf51_frameworks` + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + +.. _nordicnrf51_frameworks: + +Frameworks +---------- + +.. list-table:: + :header-rows: 1 + + * - Type ``framework`` + - Name + - Reference + * - ``mbed`` + - MBED Framework + - `Documentation `__ + + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command + * For more detailed ``board`` information please scroll tables below by + horizontal. + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller ``board_mcu`` + - Frequency ``board_f_cpu`` + - Flash + - RAM + * - ``nrf51_mkit`` + - `Nordic nRF51822-mKIT `_ + - nrf51822 ``cortex-m0`` + - 16 MHz ``16000000L`` + - 128 Kb + - 16 Kb + * - ``nrf51_dongle`` + - `Nordic nRF51-Dongle `_ + - nrf51822/nrf51422 ``cortex-m0`` + - 32 MHz ``32000000L`` + - 256 Kb + - 16 Kb + * - ``nrf51_dk`` + - `Nordic nRF51-DK `_ + - nrf51822/nrf51422 ``cortex-m0`` + - 32 MHz ``32000000L`` + - 256 Kb + - 16 Kb + * - ``redBearLab`` + - `RedBearLab nRF51822 `_ + - nrf51822 ``cortex-m0`` + - 16 MHz ``16000000L`` + - 256 Kb + - 16 Kb + * - ``redBearLabBLENano`` + - `RedBearLab BLE Nano `_ + - nrf51822 ``cortex-m0`` + - 16 MHz ``16000000L`` + - 256 Kb + - 16 Kb + * - ``wallBotBLE`` + - `JKSoft Wallbot BLE `_ + - nrf51822 ``cortex-m0`` + - 16 MHz ``16000000L`` + - 128 Kb + - 16 Kb + * - ``hrm1017`` + - `Switch Science mbed HRM1017 `_ + - nrf51822 ``cortex-m0`` + - 16 MHz ``16000000L`` + - 128 Kb + - 16 Kb + + +More detailed information you can find here +`nRF51 platforms with support MBED framework `_. diff --git a/docs/platforms/nxplpc.rst b/docs/platforms/nxplpc.rst new file mode 100644 index 00000000..d8dcff37 --- /dev/null +++ b/docs/platforms/nxplpc.rst @@ -0,0 +1,146 @@ +.. _platform_nxplpc: + +Platform ``nxplpc`` +=================== + +`The NXP LPC `_ is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Alias + - Contents + * - ``toolchain-gccarmnoneeabi`` + - toolchain + - `gcc-arm-embedded `_, + `GDB `_ + * - ``framework-mbed`` + - + - See below in :ref:`nxplpc_frameworks` + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + +.. _nxplpc_frameworks: + +Frameworks +---------- + +.. list-table:: + :header-rows: 1 + + * - Type ``framework`` + - Name + - Reference + * - ``mbed`` + - MBED Framework + - `Documentation `__ + + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command + * For more detailed ``board`` information please scroll tables below by + horizontal. + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller ``board_mcu`` + - Frequency ``board_f_cpu`` + - Flash + - RAM + * - ``lpc1549`` + - `LPCXpresso1549 `_ + - LPC1549 ``cortex-m3`` + - 72 MHz ``72000000L`` + - 256 Kb + - 36 Kb + * - ``lpc1768`` + - `mbed LPC1768 `_ + - LPC1768 ``cortex-m3`` + - 96 MHz ``96000000L`` + - 512 Kb + - 32 Kb + * - ``seeeduinoArchPro`` + - `Seeeduino-Arch-Pro `_ + - LPC1768 ``cortex-m3`` + - 96 MHz ``96000000L`` + - 512 Kb + - 32 Kb + * - ``ubloxc027`` + - `U-blox C027 `_ + - LPC1768 ``cortex-m3`` + - 96 MHz ``96000000L`` + - 512 Kb + - 32 Kb + * - ``lpc1114fn28`` + - `mbed LPC1114FN28 `_ + - LPC1114FN28 ``cortex-m0`` + - 48 MHz ``48000000L`` + - 32 Kb + - 4 Kb + * - ``lpc11u24`` + - `mbed LPC11U24 `_ + - LPC11U24 ``cortex-m0`` + - 48 MHz ``48000000L`` + - 32 Kb + - 8 Kb + * - ``dipcortexm0`` + - `DipCortex M0 `_ + - LPC11U24 ``cortex-m0`` + - 50 MHz ``50000000L`` + - 32 Kb + - 8 Kb + * - ``blueboard_lpc11u24`` + - `BlueBoard-LPC11U24 `_ + - LPC11U24 ``cortex-m0`` + - 48 MHz ``48000000L`` + - 32 Kb + - 8 Kb + * - ``mbuino`` + - `Outrageous Circuits mBuino `_ + - LPC11U24 ``cortex-m0`` + - 50 MHz ``50000000L`` + - 32 Kb + - 8 Kb + * - ``lpc11u35`` + - `EA LPC11U35 QuickStart Board `_ + - LPC11U35 ``cortex-m0`` + - 48 MHz ``48000000L`` + - 64 Kb + - 10 Kb + * - ``lpc11u35_501`` + - `TG-LPC11U35-501 QuickStart Board `_ + - LPC11U35 ``cortex-m0`` + - 48 MHz ``48000000L`` + - 64 Kb + - 10 Kb + * - ``lpc4088`` + - `EA LPC4088 QuickStart Board `_ + - LPC4088 ``cortex-m4`` + - 120 MHz ``120000000L`` + - 512 Kb + - 96 Kb + * - ``lpc4088_dm`` + - `EA LPC4088 Display Module `_ + - LPC4088 ``cortex-m4`` + - 120 MHz ``120000000L`` + - 512 Kb + - 96 Kb + + +More detailed information you can find here +`NXP platforms with support MBED framework `_. diff --git a/platformio/boards/adafruit.json b/platformio/boards/adafruit.json index 4e7832d0..3ace87a3 100644 --- a/platformio/boards/adafruit.json +++ b/platformio/boards/adafruit.json @@ -34,7 +34,7 @@ "variant": "tiny8" }, "framework": "arduino", - "name": "Adafruit Trinket 8MHz", + "name": "Adafruit Trinket 3V/8MHz", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, @@ -52,7 +52,7 @@ "variant": "tiny8" }, "framework": "arduino", - "name": "Adafruit Trinket 16MHz", + "name": "Adafruit Trinket 5V/16MHz", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, diff --git a/platformio/boards/freescalekinetis.json b/platformio/boards/freescalekinetis.json new file mode 100644 index 00000000..9eb9a25e --- /dev/null +++ b/platformio/boards/freescalekinetis.json @@ -0,0 +1,87 @@ +{ + "frdm_kl25z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl25z128vlk4" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-KL25Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + } + }, + "frdm_kl46z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl46z256vll4" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-KL46Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 262144 + } + }, + "frdm_k64f": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "mk64fn1m0vll12" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-K64F", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 262144, + "maximum_size": 1048567 + } + }, + "frdm_kl05z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl05z32vfm4" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-KL05Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768 + } + }, + "frdm_k20d50m": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m4", + "mcu": "mk20dx128vlh5" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-K20D50M", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + } + } + , + "frdm_k22f": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "mk22fn512vlh12" + }, + "framework": "mbed", + "name": "Freescale Kinetis FRDM-K22F", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288 + } + } +} \ No newline at end of file diff --git a/platformio/boards/nordicnrf51.json b/platformio/boards/nordicnrf51.json new file mode 100644 index 00000000..f7202b31 --- /dev/null +++ b/platformio/boards/nordicnrf51.json @@ -0,0 +1,102 @@ +{ + "nrf51_mkit": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "Nordic nRF51822-mKIT", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + } + }, + "hrm1017": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "Switch Science mbed HRM1017", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + } + }, + "redBearLab": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "RedBearLab nRF51822", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + } + }, + "nrf51_dk": { + "build": { + "f_cpu": "32000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "Nordic nRF51-DK", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 32384, + "maximum_size": 262144 + } + }, + "redBearLabBLENano": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "RedBearLab BLE Nano", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + } + }, + "nrf51_dongle": { + "build": { + "f_cpu": "32000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "Nordic nRF51-Dongle", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 32384, + "maximum_size": 262144 + } + } + , + "wallBotBLE": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "framework": "mbed", + "name": "JKSoft Wallbot BLE", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + } + } + +} \ No newline at end of file diff --git a/platformio/boards/nxplpc.json b/platformio/boards/nxplpc.json new file mode 100644 index 00000000..de012c48 --- /dev/null +++ b/platformio/boards/nxplpc.json @@ -0,0 +1,184 @@ +{ + "lpc1768": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "framework": "mbed", + "name": "mbed LPC1768", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + } + }, + "lpc11u24": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "framework": "mbed", + "name": "mbed LPC11U24", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + } + }, + "lpc4088": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "lpc4088" + }, + "framework": "mbed", + "name": "EA LPC4088 QuickStart Board", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 98304, + "maximum_size": 524288 + } + }, + "dipcortexm0": { + "build": { + "f_cpu": "50000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "framework": "mbed", + "name": "DipCortex M0", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + } + }, + "blueboard_lpc11u24": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "framework": "mbed", + "name": "BlueBoard-LPC11U24", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + } + }, + "seeeduinoArchPro": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "framework": "mbed", + "name": "Seeeduino-Arch-Pro", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + } + }, + "ubloxc027": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "framework": "mbed", + "name": "u-blox C027", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + } + }, + "lpc1114fn28": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc1114fn28" + }, + "framework": "mbed", + "name": "mbed LPC1114FN28", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768 + } + }, + "lpc11u35": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u35" + }, + "framework": "mbed", + "name": "EA LPC11U35 QuickStart Board", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 10240, + "maximum_size": 65536 + } + }, + "lpc11u35_501": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u35" + }, + "framework": "mbed", + "name": "TG-LPC11U35-501", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 10240, + "maximum_size": 65536 + } + }, + "lpc1549": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m3", + "mcu": "lpc1549" + }, + "framework": "mbed", + "name": "LPCXpresso1549", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 36864, + "maximum_size": 262144 + } + }, + "mbuino": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "framework": "mbed", + "name": "Outrageous Circuits mBuino", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + } + }, + "lpc4088_dm": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "lpc4088" + }, + "framework": "mbed", + "name": "EA LPC4088 Display Module", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 98304, + "maximum_size": 524288 + } + } +} \ No newline at end of file diff --git a/platformio/builder/scripts/freescalekinetis.py b/platformio/builder/scripts/freescalekinetis.py new file mode 100644 index 00000000..bb5f7048 --- /dev/null +++ b/platformio/builder/scripts/freescalekinetis.py @@ -0,0 +1,59 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" + Builder for Freescale Kinetis series ARM microcontrollers. +""" + +from os.path import join +from shutil import copyfile + +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, + DefaultEnvironment, SConscript) + + +def UploadToDisk(target, source, env): # pylint: disable=W0613,W0621 + env.AutodetectUploadPort() + copyfile(join(env.subst("$BUILD_DIR"), "firmware.bin"), + join(env.subst("$UPLOAD_PORT"), "firmware.bin")) + print ("Firmware has been successfully uploaded.\n" + "Please restart your board.") + +env = DefaultEnvironment() + +SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) + +# +# Target: Build executable and linkable firmware +# + +target_elf = env.BuildFirmware() + +# +# Target: Build the .bin file +# + +if "uploadlazy" in COMMAND_LINE_TARGETS: + target_firm = join("$BUILD_DIR", "firmware.bin") +else: + target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) + +# +# Target: Print binary size +# + +target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD") +AlwaysBuild(target_size) + +# +# Target: Upload by default .bin file +# + +upload = env.Alias(["upload", "uploadlazy"], target_firm, UploadToDisk) +AlwaysBuild(upload) + +# +# Target: Define targets +# + +Default([target_firm, target_size]) diff --git a/platformio/builder/scripts/nordicnrf51.py b/platformio/builder/scripts/nordicnrf51.py new file mode 100644 index 00000000..1460b81d --- /dev/null +++ b/platformio/builder/scripts/nordicnrf51.py @@ -0,0 +1,59 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" + Builder for Nordic nRF51 series ARM microcontrollers. +""" + +from os.path import join +from shutil import copyfile + +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, + DefaultEnvironment, SConscript) + + +def UploadToDisk(target, source, env): # pylint: disable=W0613,W0621 + env.AutodetectUploadPort() + copyfile(join(env.subst("$BUILD_DIR"), "firmware.bin"), + join(env.subst("$UPLOAD_PORT"), "firmware.bin")) + print ("Firmware has been successfully uploaded.\n" + "Please restart your board.") + +env = DefaultEnvironment() + +SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) + +# +# Target: Build executable and linkable firmware +# + +target_elf = env.BuildFirmware() + +# +# Target: Build the .bin file +# + +if "uploadlazy" in COMMAND_LINE_TARGETS: + target_firm = join("$BUILD_DIR", "firmware.bin") +else: + target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) + +# +# Target: Print binary size +# + +target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD") +AlwaysBuild(target_size) + +# +# Target: Upload by default .bin file +# + +upload = env.Alias(["upload", "uploadlazy"], target_firm, UploadToDisk) +AlwaysBuild(upload) + +# +# Target: Define targets +# + +Default([target_firm, target_size]) diff --git a/platformio/builder/scripts/nxplpc.py b/platformio/builder/scripts/nxplpc.py new file mode 100644 index 00000000..4782c81e --- /dev/null +++ b/platformio/builder/scripts/nxplpc.py @@ -0,0 +1,59 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" + Builder for NXP LPC series ARM microcontrollers. +""" + +from os.path import join +from shutil import copyfile + +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, + DefaultEnvironment, SConscript) + + +def UploadToDisk(target, source, env): # pylint: disable=W0613,W0621 + env.AutodetectUploadPort() + copyfile(join(env.subst("$BUILD_DIR"), "firmware.bin"), + join(env.subst("$UPLOAD_PORT"), "firmware.bin")) + print ("Firmware has been successfully uploaded.\n" + + "Please restart your board.") + +env = DefaultEnvironment() + +SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) + +# +# Target: Build executable and linkable firmware +# + +target_elf = env.BuildFirmware() + +# +# Target: Build the .bin file +# + +if "uploadlazy" in COMMAND_LINE_TARGETS: + target_firm = join("$BUILD_DIR", "firmware.bin") +else: + target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) + +# +# Target: Print binary size +# + +target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD") +AlwaysBuild(target_size) + +# +# Target: Upload by default .bin file +# + +upload = env.Alias(["upload", "uploadlazy"], target_firm, UploadToDisk) +AlwaysBuild(upload) + +# +# Target: Define targets +# + +Default([target_firm, target_size]) diff --git a/platformio/commands/boards.py b/platformio/commands/boards.py index 400a4ae4..1bb89f21 100644 --- a/platformio/commands/boards.py +++ b/platformio/commands/boards.py @@ -16,7 +16,7 @@ def cli(query, json_output): # pylint: disable=R0912 if json_output: return ouput_boards_json(query) - BOARDLIST_TPL = ("{type:<30} {mcu:<13} {frequency:<8} " + BOARDLIST_TPL = ("{type:<30} {mcu:<14} {frequency:<8} " " {flash:<7} {ram:<6} {name}") grpboards = {} diff --git a/platformio/platforms/freescalekinetis.py b/platformio/platforms/freescalekinetis.py new file mode 100644 index 00000000..09243ec8 --- /dev/null +++ b/platformio/platforms/freescalekinetis.py @@ -0,0 +1,23 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class FreescalekinetisPlatform(BasePlatform): + + """ + An embedded platform for Freescale Kinetis series ARM microcontrollers + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + } diff --git a/platformio/platforms/nordicnrf51.py b/platformio/platforms/nordicnrf51.py new file mode 100644 index 00000000..17126aac --- /dev/null +++ b/platformio/platforms/nordicnrf51.py @@ -0,0 +1,23 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class Nordicnrf51Platform(BasePlatform): + + """ + An embedded platform for Nordic nRF51 series ARM microcontrollers + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + } diff --git a/platformio/platforms/nxplpc.py b/platformio/platforms/nxplpc.py new file mode 100644 index 00000000..9c9e3152 --- /dev/null +++ b/platformio/platforms/nxplpc.py @@ -0,0 +1,23 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class NxplpcPlatform(BasePlatform): + + """ + An embedded platform for NXP LPC series ARM microcontrollers + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + }