Add new platforms and boards: Freescale, Nordic, NXP and etc.

This commit is contained in:
Valeriy Koval
2015-03-09 12:27:30 +02:00
parent 5fa0a176a7
commit 4a8cd9914b
15 changed files with 985 additions and 3 deletions

View File

@ -0,0 +1,104 @@
.. _platform_freescalekinetis:
Platform ``freescalekinetis``
=============================
`Freescale Kinetis Microcontrollers <http://www.freescale.com/webapp/sps/site/homepage.jsp?code=KINETIS>`_ 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 <https://launchpad.net/gcc-arm-embedded>`_,
`GDB <http://www.gnu.org/software/gdb/>`_
* - ``framework-mbed``
-
- See below in :ref:`freescalekinetis_frameworks`
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/ivankravets/platformio/blob/develop/scripts/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 <http://mbed.org>`__
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 <https://developer.mbed.org/platforms/FRDM-KL05Z/>`_
- MKL05Z32VFM4 ``cortex-m0plus``
- 48 MHz ``48000000L``
- 32 Kb
- 4 Kb
* - ``frdm_kl25z``
- `Freescale Kinetis FRDM-KL25Z <https://developer.mbed.org/platforms/KL25Z/>`_
- MKL25Z128VLK4 ``cortex-m0plus``
- 48 MHz ``48000000L``
- 128 Kb
- 16 Kb
* - ``frdm_kl46z``
- `Freescale Kinetis FRDM-KL46Z <https://developer.mbed.org/platforms/FRDM-KL46Z/>`_
- MKL46Z256Vll4 ``cortex-m0plus``
- 48 MHz ``48000000L``
- 256 Kb
- 32 Kb
* - ``frdm_k22f``
- `Freescale Kinetis FRDM-K22F <https://developer.mbed.org/platforms/FRDM-K22F/>`_
- MK22FN512VLH12 ``cortex-m4``
- 120 MHz ``120000000L``
- 512 Kb
- 128 Kb
* - ``frdm_k64f``
- `Freescale Kinetis FRDM-K64F <https://developer.mbed.org/platforms/FRDM-K64F/>`_
- MK64fN1M0VLL12 ``cortex-m4``
- 120 MHz ``120000000L``
- 1 Mb
- 256 Kb
* - ``frdm_k20d50m``
- `Freescale Kinetis FRDM-K20D50M <https://developer.mbed.org/platforms/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 <https://developer.mbed.org/platforms/?tvend=4>`_.

View File

@ -16,6 +16,9 @@ MCU, upload protocol or etc. Please use ``board`` option.
atmelavr
atmelsam
freescalekinetis
nordicnrf51
nxplpc
ststm32
teensy
timsp430

View File

@ -0,0 +1,110 @@
.. _platform_nordicnrf51:
Platform ``nordicnrf51``
========================
`The Nordic nRF51 Series <https://www.nordicsemi.com/eng/Products/nRF51-Series-SoC>`_ 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 <https://launchpad.net/gcc-arm-embedded>`_,
`GDB <http://www.gnu.org/software/gdb/>`_
* - ``framework-mbed``
-
- See below in :ref:`nordicnrf51_frameworks`
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/ivankravets/platformio/blob/develop/scripts/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 <http://mbed.org>`__
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 <http://developer.mbed.org/platforms/Nordic-nRF51822/>`_
- nrf51822 ``cortex-m0``
- 16 MHz ``16000000L``
- 128 Kb
- 16 Kb
* - ``nrf51_dongle``
- `Nordic nRF51-Dongle <https://developer.mbed.org/platforms/Nordic-nRF51-Dongle/>`_
- nrf51822/nrf51422 ``cortex-m0``
- 32 MHz ``32000000L``
- 256 Kb
- 16 Kb
* - ``nrf51_dk``
- `Nordic nRF51-DK <https://developer.mbed.org/platforms/Nordic-nRF51-DK/>`_
- nrf51822/nrf51422 ``cortex-m0``
- 32 MHz ``32000000L``
- 256 Kb
- 16 Kb
* - ``redBearLab``
- `RedBearLab nRF51822 <https://developer.mbed.org/platforms/RedBearLab-nRF51822/>`_
- nrf51822 ``cortex-m0``
- 16 MHz ``16000000L``
- 256 Kb
- 16 Kb
* - ``redBearLabBLENano``
- `RedBearLab BLE Nano <https://developer.mbed.org/platforms/RedBearLab-BLE-Nano/>`_
- nrf51822 ``cortex-m0``
- 16 MHz ``16000000L``
- 256 Kb
- 16 Kb
* - ``wallBotBLE``
- `JKSoft Wallbot BLE <https://developer.mbed.org/platforms/JKSoft-Wallbot-BLE/>`_
- nrf51822 ``cortex-m0``
- 16 MHz ``16000000L``
- 128 Kb
- 16 Kb
* - ``hrm1017``
- `Switch Science mbed HRM1017 <https://developer.mbed.org/platforms/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 <http://developer.mbed.org/platforms/?tvend=11>`_.

146
docs/platforms/nxplpc.rst Normal file
View File

@ -0,0 +1,146 @@
.. _platform_nxplpc:
Platform ``nxplpc``
===================
`The NXP LPC <http://www.nxp.com/products/microcontrollers/>`_ 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 <https://launchpad.net/gcc-arm-embedded>`_,
`GDB <http://www.gnu.org/software/gdb/>`_
* - ``framework-mbed``
-
- See below in :ref:`nxplpc_frameworks`
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/ivankravets/platformio/blob/develop/scripts/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 <http://mbed.org>`__
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 <https://developer.mbed.org/platforms/LPCXpresso1549/>`_
- LPC1549 ``cortex-m3``
- 72 MHz ``72000000L``
- 256 Kb
- 36 Kb
* - ``lpc1768``
- `mbed LPC1768 <http://developer.mbed.org/platforms/mbed-LPC1768/>`_
- LPC1768 ``cortex-m3``
- 96 MHz ``96000000L``
- 512 Kb
- 32 Kb
* - ``seeeduinoArchPro``
- `Seeeduino-Arch-Pro <https://developer.mbed.org/platforms/Seeeduino-Arch-Pro/>`_
- LPC1768 ``cortex-m3``
- 96 MHz ``96000000L``
- 512 Kb
- 32 Kb
* - ``ubloxc027``
- `U-blox C027 <https://developer.mbed.org/platforms/u-blox-C027/>`_
- LPC1768 ``cortex-m3``
- 96 MHz ``96000000L``
- 512 Kb
- 32 Kb
* - ``lpc1114fn28``
- `mbed LPC1114FN28 <https://developer.mbed.org/platforms/LPC1114FN28/>`_
- LPC1114FN28 ``cortex-m0``
- 48 MHz ``48000000L``
- 32 Kb
- 4 Kb
* - ``lpc11u24``
- `mbed LPC11U24 <https://developer.mbed.org/platforms/mbed-LPC11U24/>`_
- LPC11U24 ``cortex-m0``
- 48 MHz ``48000000L``
- 32 Kb
- 8 Kb
* - ``dipcortexm0``
- `DipCortex M0 <https://developer.mbed.org/platforms/DipCortex-M0/>`_
- LPC11U24 ``cortex-m0``
- 50 MHz ``50000000L``
- 32 Kb
- 8 Kb
* - ``blueboard_lpc11u24``
- `BlueBoard-LPC11U24 <https://developer.mbed.org/platforms/BlueBoard-LPC11U24/>`_
- LPC11U24 ``cortex-m0``
- 48 MHz ``48000000L``
- 32 Kb
- 8 Kb
* - ``mbuino``
- `Outrageous Circuits mBuino <https://developer.mbed.org/platforms/Outrageous-Circuits-mBuino/>`_
- LPC11U24 ``cortex-m0``
- 50 MHz ``50000000L``
- 32 Kb
- 8 Kb
* - ``lpc11u35``
- `EA LPC11U35 QuickStart Board <https://developer.mbed.org/platforms/EA-LPC11U35/>`_
- LPC11U35 ``cortex-m0``
- 48 MHz ``48000000L``
- 64 Kb
- 10 Kb
* - ``lpc11u35_501``
- `TG-LPC11U35-501 QuickStart Board <https://developer.mbed.org/platforms/TG-LPC11U35-501/>`_
- LPC11U35 ``cortex-m0``
- 48 MHz ``48000000L``
- 64 Kb
- 10 Kb
* - ``lpc4088``
- `EA LPC4088 QuickStart Board <https://developer.mbed.org/platforms/EA-LPC4088/>`_
- LPC4088 ``cortex-m4``
- 120 MHz ``120000000L``
- 512 Kb
- 96 Kb
* - ``lpc4088_dm``
- `EA LPC4088 Display Module <https://developer.mbed.org/platforms/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 <http://developer.mbed.org/platforms/?tvend=3>`_.

View File

@ -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,

View File

@ -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
}
}
}

View File

@ -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
}
}
}

View File

@ -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
}
}
}

View File

@ -0,0 +1,59 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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])

View File

@ -0,0 +1,59 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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])

View File

@ -0,0 +1,59 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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])

View File

@ -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 = {}

View File

@ -0,0 +1,23 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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
}
}

View File

@ -0,0 +1,23 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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
}
}

View File

@ -0,0 +1,23 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# 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
}
}