diff --git a/HISTORY.rst b/HISTORY.rst index 57d5783a..cd912885 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,38 @@ Release History =============== +1.2.0 (2015-03-20) +------------------ + +* Added full support of `mbed `__ + framework including libraries: *RTOS, Ethernet, DSP, FAT, USB*. +* Added `freescalekinetis `_ + development platform with Freescale Kinetis Freedom boards +* Added `nordicnrf51 `_ + development platform with supported boards from *JKSoft, Nordic, RedBearLab, + Switch Science* +* Added `nxplpc `_ + development platform with supported boards from *CQ Publishing, Embedded + Artists, NGX Technologies, NXP, Outrageous Circuits, SeeedStudio, + Solder Splash Labs, Switch Science, u-blox* +* Added support for *ST Nucleo* boards to + `ststm32 `__ + development platform +* Created new `Frameworks `__ + page in documentation and added to `PlatformIO Web Site `_ + (`issue #115 `_) +* Introduced online `Embedded Boards Explorer `_ +* Automatically append define ``-DPLATFORMIO=%version%`` to + builder (`issue #105 `_) +* Renamed ``stm32`` development platform to + `ststm32 `__ +* Renamed ``opencm3`` framework to + `libopencm3 `__ +* Fixed uploading for `atmelsam `__ + development platform +* Fixed re-arranging the ``*.ino/pde`` files when converting to ``*.cpp`` + (`issue #100 `_) + 1.1.0 (2015-03-05) ------------------ @@ -25,13 +57,13 @@ Release History **PlatformIO 1.0 - recommended for production** * Changed development status from ``beta`` to ``Production/Stable`` -* Added support for *ARM*-based credit-card computers: +* Added support for *ARM*-based credit-card sized computers: `Raspberry Pi `_, `BeagleBone `_ and `CubieBoard `_ -* Added `atmelsam `_ +* Added `atmelsam `__ development platform with supported boards: *Arduino Due and Digistump DigiX* (`issue #71 `_) -* Added `stm32 `_ +* Added `ststm32 `__ development platform with supported boards: *Discovery kit for STM32L151/152, STM32F303xx, STM32F407/417 lines* and `libOpenCM3 Framework `_ (`issue #73 `_) diff --git a/README.rst b/README.rst index 31522103..cde9bb2e 100644 --- a/README.rst +++ b/README.rst @@ -32,6 +32,7 @@ and the missing library manager. * `Get Started `_ * `Web 2.0 Library Search `_ * `Development Platforms `_ +* `Frameworks `_ * `Embedded Boards `_ * `Library Manager `_ * `User Guide `_ @@ -47,7 +48,9 @@ Use whenever. *Run everywhere.* *PlatformIO* is written in pure *Python* and **doesn't depend** on any additional libraries/tools from an operation system. It allows you to use *PlatformIO* beginning from *PC (Mac, Linux, Win)* and ending with credit-card -sized computers (like *Raspberry Pi*). +sized computers (`Raspberry Pi `_, +`BeagleBone `_, +`CubieBoard `_). Embedded Development. *Easier Than Ever.* ----------------------------------------- @@ -59,7 +62,7 @@ settings for most popular `Embedded Boards `_. * Configurable `build -flags/-options `_ * Automatic **firmware uploading** * Integration with `development environments (IDE) `_ -* Ready for **cloud compilers** +* Ready for **Cloud Compiling** and **Continuous Integration** * Pre-built tool chains, frameworks for the popular `Hardware Platforms `_ .. image:: https://raw.githubusercontent.com/ivankravets/platformio-web/develop/app/images/platformio-embedded-development.png @@ -112,18 +115,24 @@ more). It has support for the most popular embedded platforms: -* ``atmelavr`` `Atmel AVR `_ - (including *Arduino*-based boards, *Microduino, Raspduino, Teensy*) -* ``atmelsam`` `Atmel SAM `_ - (including *Arduino*-based boards, *Digistump DigiX*) -* ``stm32`` `STM32 `_ - (including *STM32 Discovery* Kits, CMSIS, SPL, libOpenCM3) -* ``teensy`` `Teensy `_ - (including *Teensy 2 and 3* USB boards) -* ``timsp430`` `TI MSP430 `_ - (including *MSP430* LaunchPads) -* ``titiva`` `TI TIVA C `_ - (including *TIVA C* Series LaunchPads) +* `Atmel AVR `_ +* `Atmel SAM `_ +* `Freescale Kinetis `_ +* `Nordic nRF51 `_ +* `NXP LPC. `_ +* `ST STM32 `_ +* `Teensy `_ +* `TI MSP430 `_ +* `TI TIVA C `_ + +Frameworks: + +* `Arduino `_ +* `CMSIS `_ +* `libOpenCM3 `_ +* `Energia `_ +* `SPL `_ +* `mbed `_ Licence diff --git a/docs/envvars.rst b/docs/envvars.rst index ec8fd586..765ec0a3 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -85,36 +85,36 @@ Allows to override PlatformIO settings. You can manage them via PLATFORMIO_SETTING_AUTO_UPDATE_LIBRARIES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`auto_update_libraries`. +Allows to override setting :ref:`setting_auto_update_libraries`. PLATFORMIO_SETTING_AUTO_UPDATE_PLATFORMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`auto_update_platforms`. +Allows to override setting :ref:`setting_auto_update_platforms`. PLATFORMIO_SETTING_CHECK_LIBRARIES_INTERVAL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`check_libraries_interval`. +Allows to override setting :ref:`setting_check_libraries_interval`. PLATFORMIO_SETTING_CHECK_PLATFORMIO_INTERVAL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`check_platformio_interval`. +Allows to override setting :ref:`setting_check_platformio_interval`. PLATFORMIO_SETTING_CHECK_PLATFORMS_INTERVAL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`check_platforms_interval`. +Allows to override setting :ref:`setting_check_platforms_interval`. .. _envvar_PLATFORMIO_SETTING_ENABLE_PROMPTS: PLATFORMIO_SETTING_ENABLE_PROMPTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`enable_prompts`. +Allows to override setting :ref:`setting_enable_prompts`. PLATFORMIO_SETTING_ENABLE_TELEMETRY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Allows to override setting :option:`enable_telemetry`. +Allows to override setting :ref:`setting_enable_telemetry`. diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst new file mode 100644 index 00000000..6215048c --- /dev/null +++ b/docs/frameworks/arduino.rst @@ -0,0 +1,602 @@ +.. _framework_arduino: + +Framework ``arduino`` +===================== +Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`platform_atmelavr` + - Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming. + + * - :ref:`platform_atmelsam` + - Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix. + + * - :ref:`platform_teensy` + - Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port. + + * - :ref:`platform_timsp430` + - MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-based, mixed-signal processors designed for ultra-low power. These MCUs offer the lowest power consumption and the perfect mix of integrated peripherals for thousands of applications. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +Adafruit +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``flora8`` + - `Adafruit Flora `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + + * - ``protrinket3`` + - `Pro Trinket 3V/12MHz (USB) `_ + - ATMEGA328P + - 12 MHz + - 32 Kb + - 2 Kb + + * - ``protrinket3ftdi`` + - `Pro Trinket 3V/12MHz (FTDI) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``protrinket5`` + - `Pro Trinket 5V/16MHz (USB) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``protrinket5ftdi`` + - `Pro Trinket 5V/16MHz (USB) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``trinket3`` + - `Adafruit Trinket 3V/8MHz `_ + - ATTINY85 + - 8 MHz + - 8 Kb + - 0.5 Kb + + * - ``trinket5`` + - `Adafruit Trinket 5V/16MHz `_ + - ATTINY85 + - 16 MHz + - 8 Kb + - 0.5 Kb + +Arduino +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``LilyPadUSB`` + - `LilyPad Arduino USB `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + + * - ``atmegangatmega168`` + - `Arduino NG or older ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``atmegangatmega8`` + - `Arduino NG or older ATmega8 `_ + - ATMEGA8 + - 16 MHz + - 8 Kb + - 1 Kb + + * - ``btatmega168`` + - `Arduino BT ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``btatmega328`` + - `Arduino BT ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``diecimilaatmega168`` + - `Arduino Duemilanove or Diecimila ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``diecimilaatmega328`` + - `Arduino Duemilanove or Diecimila ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``due`` + - `Arduino Due (Programming Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + + * - ``dueUSB`` + - `Arduino Due (USB Native Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + + * - ``esplora`` + - `Arduino Esplora `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``ethernet`` + - `Arduino Ethernet `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``fio`` + - `Arduino Fio `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``leonardo`` + - `Arduino Leonardo `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``lilypadatmega168`` + - `LilyPad Arduino ATmega168 `_ + - ATMEGA168 + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``lilypadatmega328`` + - `LilyPad Arduino ATmega328 `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``megaADK`` + - `Arduino Mega ADK `_ + - ATMEGA2560 + - 16 MHz + - 256 Kb + - 8 Kb + + * - ``megaatmega1280`` + - `Arduino Mega or Mega 2560 ATmega1280 `_ + - ATMEGA1280 + - 16 MHz + - 128 Kb + - 8 Kb + + * - ``megaatmega2560`` + - `Arduino Mega or Mega 2560 ATmega2560 (Mega 2560) `_ + - ATMEGA2560 + - 16 MHz + - 256 Kb + - 8 Kb + + * - ``micro`` + - `Arduino Micro `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``miniatmega168`` + - `Arduino Mini ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``miniatmega328`` + - `Arduino Mini ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``nanoatmega168`` + - `Arduino Nano ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``nanoatmega328`` + - `Arduino Nano ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``pro16MHzatmega168`` + - `Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz) `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``pro16MHzatmega328`` + - `Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``pro8MHzatmega168`` + - `Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz) `_ + - ATMEGA168 + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``pro8MHzatmega328`` + - `Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz) `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``robotControl`` + - `Arduino Robot Control `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``robotMotor`` + - `Arduino Robot Motor `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``uno`` + - `Arduino Uno `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``yun`` + - `Arduino Yun `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + +BitWizard +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``raspduino`` + - `Raspduino `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + +Digistump +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``digispark-pro`` + - `Digispark Pro (Default 16 MHz) `_ + - ATTINY167 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``digispark-pro32`` + - `Digispark Pro (16 MHz) (32 byte buffer) `_ + - ATTINY167 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``digispark-pro64`` + - `Digispark Pro (16 MHz) (64 byte buffer) `_ + - ATTINY167 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``digispark-tiny`` + - `Digispark (Default - 16 MHz) `_ + - ATTINY85 + - 16 MHz + - 8 Kb + - 0.5 Kb + + * - ``digix`` + - `Digistump DigiX `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 28 Kb + +Engduino +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``engduinov1`` + - `Engduino 1 `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + + * - ``engduinov2`` + - `Engduino 2 `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + + * - ``engduinov3`` + - `Engduino 3 `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + +Microduino +~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``1284p16m`` + - `Microduino Core+ (ATmega1284P@16M,5V) `_ + - ATMEGA1284P + - 16 MHz + - 128 Kb + - 16 Kb + + * - ``1284p8m`` + - `Microduino Core+ (ATmega1284P@8M,3.3V) `_ + - ATMEGA1284P + - 8 MHz + - 128 Kb + - 16 Kb + + * - ``168pa16m`` + - `Microduino Core (Atmega168PA@16M,5V) `_ + - ATMEGA168P + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``168pa8m`` + - `Microduino Core (Atmega168PA@8M,3.3V) `_ + - ATMEGA168P + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``328p16m`` + - `Microduino Core (Atmega328P@16M,5V) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``328p8m`` + - `Microduino Core (Atmega328P@8M,3.3V) `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``32u416m`` + - `Microduino Core USB (ATmega32U4@16M,5V) `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``644pa16m`` + - `Microduino Core+ (Atmega644PA@16M,5V) `_ + - ATMEGA644P + - 16 MHz + - 64 Kb + - 4 Kb + + * - ``644pa8m`` + - `Microduino Core+ (Atmega644PA@8M,3.3V) `_ + - ATMEGA644P + - 8 MHz + - 64 Kb + - 4 Kb + +PanStamp +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``panStampAVR`` + - `PanStamp AVR `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``panStampNRG`` + - `PanStamp NRG 1.1 `_ + - CC430F5137 + - 12 MHz + - 32 Kb + - 4 Kb + +SainSmart +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``sainSmartDue`` + - `SainSmart Due (Programming Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + + * - ``sainSmartDueUSB`` + - `SainSmart Due (USB Native Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + +Teensy +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``teensy20`` + - `Teensy 2.0 `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``teensy20pp`` + - `Teensy++ 2.0 `_ + - AT90USB1286 + - 16 MHz + - 128 Kb + - 8 Kb + + * - ``teensy30`` + - `Teensy 3.0 `_ + - MK20DX128 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``teensy31`` + - `Teensy 3.1 `_ + - MK20DX256 + - 72 MHz + - 256 Kb + - 64 Kb diff --git a/docs/frameworks/cmsis.rst b/docs/frameworks/cmsis.rst new file mode 100644 index 00000000..2bdf474e --- /dev/null +++ b/docs/frameworks/cmsis.rst @@ -0,0 +1,62 @@ +.. _framework_cmsis: + +Framework ``cmsis`` +=================== +The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for the Cortex-M processor series and specifies debugger interfaces. The CMSIS enables consistent and simple software interfaces to the processor for interface peripherals, real-time operating systems, and middleware. It simplifies software re-use, reducing the learning curve for new microcontroller developers and cutting the time-to-market for devices. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`platform_ststm32` + - The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +ST +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``disco_f303vc`` + - `STM32F3DISCOVERY `_ + - STM32F303VCT6 + - 72 MHz + - 256 Kb + - 48 Kb + + * - ``disco_f407vg`` + - `STM32F4DISCOVERY `_ + - STM32F407VGT6 + - 168 MHz + - 1024 Kb + - 128 Kb + + * - ``disco_l152rb`` + - `STM32LDISCOVERY `_ + - STM32L152RBT6 + - 32 MHz + - 128 Kb + - 16 Kb diff --git a/docs/frameworks/energia.rst b/docs/frameworks/energia.rst new file mode 100644 index 00000000..56826b10 --- /dev/null +++ b/docs/frameworks/energia.rst @@ -0,0 +1,114 @@ +.. _framework_energia: + +Framework ``energia`` +===================== +Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`platform_timsp430` + - MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-based, mixed-signal processors designed for ultra-low power. These MCUs offer the lowest power consumption and the perfect mix of integrated peripherals for thousands of applications. + + * - :ref:`platform_titiva` + - Texas Instruments TM4C12x MCUs offer the industrys most popular ARM Cortex-M4 core with scalable memory and package options, unparalleled connectivity peripherals, advanced application functions, industry-leading analog integration, and extensive software solutions. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +TI +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lplm4f120h5qr`` + - `LaunchPad (Stellaris) w/ lm4f120 (80MHz) `_ + - LPLM4F120H5QR + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lpmsp430f5529`` + - `LaunchPad w/ msp430f5529 (16MHz) `_ + - MSP430F5529 + - 16 MHz + - 128 Kb + - 1 Kb + + * - ``lpmsp430f5529_25`` + - `LaunchPad w/ msp430f5529 (25MHz) `_ + - MSP430F5529 + - 25 MHz + - 128 Kb + - 1 Kb + + * - ``lpmsp430fr5739`` + - `FraunchPad w/ msp430fr5739 `_ + - MSP430FR5739 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``lpmsp430fr5969`` + - `LaunchPad w/ msp430fr5969 `_ + - MSP430FR5969 + - 8 MHz + - 64 Kb + - 1 Kb + + * - ``lpmsp430g2231`` + - `LaunchPad w/ msp430g2231 (1 MHz) `_ + - MSP430G2231 + - 1 MHz + - 2 Kb + - 0.125 Kb + + * - ``lpmsp430g2452`` + - `LaunchPad w/ msp430g2452 (16MHz) `_ + - MSP430G2452 + - 16 MHz + - 8 Kb + - 0.25 Kb + + * - ``lpmsp430g2553`` + - `LaunchPad w/ msp430g2553 (16MHz) `_ + - MSP430G2553 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``lptm4c1230c3pm`` + - `LaunchPad (Tiva C) w/ tm4c123 (80MHz) `_ + - LPTM4C1230C3PM + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lptm4c1294ncpdt`` + - `LaunchPad (Tiva C) w/ tm4c129 (120MHz) `_ + - LPTM4C1294NCPDT + - 120 MHz + - 1024 Kb + - 256 Kb diff --git a/docs/frameworks/index.rst b/docs/frameworks/index.rst new file mode 100644 index 00000000..9abdf801 --- /dev/null +++ b/docs/frameworks/index.rst @@ -0,0 +1,14 @@ +.. _frameworks: + +Frameworks +========== + +.. toctree:: + :maxdepth: 2 + + arduino + cmsis + energia + libopencm3 + mbed + spl diff --git a/docs/frameworks/libopencm3.rst b/docs/frameworks/libopencm3.rst new file mode 100644 index 00000000..be36dbd9 --- /dev/null +++ b/docs/frameworks/libopencm3.rst @@ -0,0 +1,99 @@ +.. _framework_libopencm3: + +Framework ``libopencm3`` +======================== +The libOpenCM3 framework aims to create a free/libre/open-source firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`platform_ststm32` + - The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. + + * - :ref:`platform_titiva` + - Texas Instruments TM4C12x MCUs offer the industrys most popular ARM Cortex-M4 core with scalable memory and package options, unparalleled connectivity peripherals, advanced application functions, industry-leading analog integration, and extensive software solutions. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +ST +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``disco_f303vc`` + - `STM32F3DISCOVERY `_ + - STM32F303VCT6 + - 72 MHz + - 256 Kb + - 48 Kb + + * - ``disco_f407vg`` + - `STM32F4DISCOVERY `_ + - STM32F407VGT6 + - 168 MHz + - 1024 Kb + - 128 Kb + + * - ``disco_l152rb`` + - `STM32LDISCOVERY `_ + - STM32L152RBT6 + - 32 MHz + - 128 Kb + - 16 Kb + +TI +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lplm4f120h5qr`` + - `LaunchPad (Stellaris) w/ lm4f120 (80MHz) `_ + - LPLM4F120H5QR + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lptm4c1230c3pm`` + - `LaunchPad (Tiva C) w/ tm4c123 (80MHz) `_ + - LPTM4C1230C3PM + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lptm4c1294ncpdt`` + - `LaunchPad (Tiva C) w/ tm4c129 (120MHz) `_ + - LPTM4C1294NCPDT + - 120 MHz + - 1024 Kb + - 256 Kb diff --git a/docs/frameworks/mbed.rst b/docs/frameworks/mbed.rst new file mode 100644 index 00000000..98436f12 --- /dev/null +++ b/docs/frameworks/mbed.rst @@ -0,0 +1,548 @@ +.. _framework_mbed: + +Framework ``mbed`` +================== +The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`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. + + * - :ref:`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. + + * - :ref:`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. + + * - :ref:`platform_ststm32` + - The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +CQ Publishing +~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u35_501`` + - `TG-LPC11U35-501 `_ + - LPC11U35 + - 48 MHz + - 64 Kb + - 10 Kb + +Embedded Artists +~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u35`` + - `EA LPC11U35 QuickStart Board `_ + - LPC11U35 + - 48 MHz + - 64 Kb + - 10 Kb + + * - ``lpc4088`` + - `EA LPC4088 QuickStart Board `_ + - LPC4088 + - 120 MHz + - 512 Kb + - 96 Kb + + * - ``lpc4088_dm`` + - `EA LPC4088 Display Module `_ + - LPC4088 + - 120 MHz + - 512 Kb + - 96 Kb + +Freescale +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``IBMEthernetKit`` + - `Ethernet IoT Starter Kit `_ + - MK64FN1M0VLL12 + - 120 MHz + - 1024 Kb + - 256 Kb + + * - ``frdm_k20d50m`` + - `Freescale Kinetis FRDM-K20D50M `_ + - MK20DX128VLH5 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``frdm_k22f`` + - `Freescale Kinetis FRDM-K22F `_ + - MK22FN512VLH12 + - 120 MHz + - 512 Kb + - 128 Kb + + * - ``frdm_k64f`` + - `Freescale Kinetis FRDM-K64F `_ + - MK64FN1M0VLL12 + - 120 MHz + - 1024 Kb + - 256 Kb + + * - ``frdm_kl05z`` + - `Freescale Kinetis FRDM-KL05Z `_ + - MKL05Z32VFM4 + - 48 MHz + - 32 Kb + - 4 Kb + + * - ``frdm_kl25z`` + - `Freescale Kinetis FRDM-KL25Z `_ + - MKL25Z128VLK4 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``frdm_kl46z`` + - `Freescale Kinetis FRDM-KL46Z `_ + - MKL46Z256VLL4 + - 48 MHz + - 256 Kb + - 32 Kb + +JKSoft +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``wallBotBLE`` + - `JKSoft Wallbot BLE `_ + - NRF51822 + - 16 MHz + - 128 Kb + - 16 Kb + +NGX Technologies +~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``blueboard_lpc11u24`` + - `BlueBoard-LPC11U24 `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + +NXP +~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u24`` + - `mbed LPC11U24 `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + + * - ``lpc1549`` + - `LPCXpresso1549 `_ + - LPC1549 + - 72 MHz + - 256 Kb + - 36 Kb + + * - ``lpc1768`` + - `mbed LPC1768 `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb + +Nordic +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``nrf51_dk`` + - `Nordic nRF51-DK `_ + - NRF51822 + - 32 MHz + - 256 Kb + - 32 Kb + + * - ``nrf51_dongle`` + - `Nordic nRF51-Dongle `_ + - NRF51822 + - 32 MHz + - 256 Kb + - 32 Kb + + * - ``nrf51_mkit`` + - `Nordic nRF51822-mKIT `_ + - NRF51822 + - 16 MHz + - 128 Kb + - 16 Kb + +Outrageous Circuits +~~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``mbuino`` + - `Outrageous Circuits mBuino `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + +RedBearLab +~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``redBearLab`` + - `RedBearLab nRF51822 `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + + * - ``redBearLabBLENano`` + - `RedBearLab BLE Nano `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + +ST +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``disco_f051r8`` + - `STM32F0DISCOVERY `_ + - STM32F051R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``disco_f100rb`` + - `STM32VLDISCOVERY `_ + - STM32F100RBT6 + - 24 MHz + - 128 Kb + - 8 Kb + + * - ``disco_f303vc`` + - `STM32F3DISCOVERY `_ + - STM32F303VCT6 + - 72 MHz + - 256 Kb + - 48 Kb + + * - ``disco_f334c8`` + - `32F3348DISCOVERY `_ + - STM32F334C8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``disco_f401vc`` + - `32F401CDISCOVERY `_ + - STM32F401VCT6 + - 84 MHz + - 256 Kb + - 64 Kb + + * - ``disco_f407vg`` + - `STM32F4DISCOVERY `_ + - STM32F407VGT6 + - 168 MHz + - 1024 Kb + - 128 Kb + + * - ``disco_f429zi`` + - `32F429IDISCOVERY `_ + - STM32F429ZIT6 + - 180 MHz + - 2048 Kb + - 256 Kb + + * - ``nucleo_f030r8`` + - `ST Nucleo F030R8 `_ + - STM32F030R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``nucleo_f070rb`` + - `ST Nucleo F070RB `_ + - STM32F070RBT6 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``nucleo_f072rb`` + - `ST Nucleo F072RB `_ + - STM32F072RBT6 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``nucleo_f091rc`` + - `ST Nucleo F091RC `_ + - STM32F091RCT6 + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``nucleo_f103rb`` + - `ST Nucleo F103RB `_ + - STM32F103RBT6 + - 72 MHz + - 128 Kb + - 20 Kb + + * - ``nucleo_f302r8`` + - `ST Nucleo F302R8 `_ + - STM32F302R8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``nucleo_f303re`` + - `ST Nucleo F303RE `_ + - STM32F303RET6 + - 72 MHz + - 512 Kb + - 64 Kb + + * - ``nucleo_f334r8`` + - `ST Nucleo F334R8 `_ + - STM32F334R8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``nucleo_f401re`` + - `ST Nucleo F401RE `_ + - STM32F401RET6 + - 84 MHz + - 512 Kb + - 96 Kb + + * - ``nucleo_f411re`` + - `ST Nucleo F411RE `_ + - STM32F411RET6 + - 100 MHz + - 512 Kb + - 128 Kb + + * - ``nucleo_l053r8`` + - `ST Nucleo L053R8 `_ + - STM32L053R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``nucleo_l152re`` + - `ST Nucleo L152RE `_ + - STM32L152RET6 + - 32 MHz + - 512 Kb + - 80 Kb + +SeeedStudio +~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``seeedTinyBLE`` + - `Seeed Tiny BLE `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + + * - ``seeeduinoArchPro`` + - `Seeeduino-Arch-Pro `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb + +Solder Splash Labs +~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``dipcortexm0`` + - `DipCortex M0 `_ + - LPC11U24 + - 50 MHz + - 32 Kb + - 8 Kb + +Switch Science +~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``hrm1017`` + - `Switch Science mbed HRM1017 `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + + * - ``lpc1114fn28`` + - `mbed LPC1114FN28 `_ + - LPC1114FN28 + - 48 MHz + - 32 Kb + - 4 Kb + +u-blox +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``ubloxc027`` + - `u-blox C027 `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb diff --git a/docs/frameworks/spl.rst b/docs/frameworks/spl.rst new file mode 100644 index 00000000..fa4e9cdc --- /dev/null +++ b/docs/frameworks/spl.rst @@ -0,0 +1,62 @@ +.. _framework_spl: + +Framework ``spl`` +================= +The ST Standard Peripheral Library provides a set of functions for handling the peripherals on the STM32 Cortex-M3 family. The idea is to save the user (the new user, in particular) having to deal directly with the registers. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`platform_ststm32` + - The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. + +ST +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``disco_f303vc`` + - `STM32F3DISCOVERY `_ + - STM32F303VCT6 + - 72 MHz + - 256 Kb + - 48 Kb + + * - ``disco_f407vg`` + - `STM32F4DISCOVERY `_ + - STM32F407VGT6 + - 168 MHz + - 1024 Kb + - 128 Kb + + * - ``disco_l152rb`` + - `STM32LDISCOVERY `_ + - STM32L152RBT6 + - 32 MHz + - 128 Kb + - 16 Kb diff --git a/docs/ide.rst b/docs/ide.rst index b7d76fa7..a7dd0afc 100644 --- a/docs/ide.rst +++ b/docs/ide.rst @@ -39,9 +39,11 @@ VIM Recommended bundles: * Syntax highlight - `Arduino-syntax-file `_ -* Code Completion - `YouCompleteMe `_ +* Code Completion - `YouCompleteMe `_ (see configuration example by **Anthony Ford** `PlatformIO/YouCompleteMe Integration `_) * Syntax checking - `Syntastic `_ + + Put to the project directory ``Makefile`` wrapper with contents: .. code-block:: make diff --git a/docs/index.rst b/docs/index.rst index 3f7bd777..5cadf2bc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,7 +28,7 @@ Embedded Development. *Easier Than Ever.* * Built-in :ref:`Serial Port Monitor ` * Configurable build :ref:`-flags/-options ` * Integration with :ref:`development environments (IDE) ` -* Pre-built tool chains, frameworks for the popular Hardware Platforms +* Pre-built tool chains, :ref:`frameworks` for the popular Hardware Platforms Smart Code Builder. *Fast and Reliable.* ---------------------------------------- @@ -58,7 +58,8 @@ Contents installation projectconf envvars - platforms/index + Platforms & Boards + frameworks/index librarymanager/index userguide/index ide diff --git a/docs/installation.rst b/docs/installation.rst index d4a4b61a..88d0edd3 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,10 +3,10 @@ Installation ============ -**PlatformIO** is written in `Python `_ and works -on Mac OS X, Linux, Windows OS and *ARM*-based credit-card +**PlatformIO** is written in `Python `_ and +works on Mac OS X, Linux, Windows OS and *ARM*-based credit-card sized computers (`Raspberry Pi `_, -`BeagleBoard `_, +`BeagleBone `_, `CubieBoard `_). .. contents:: diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index cba4eae4..bd8bcead 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -2,12 +2,9 @@ Platform ``atmelavr`` ===================== +Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming. -`Atmel AVR® 8- and 32-bit MCUs `_ -deliver a unique combination of performance, power efficiency and design -flexibility. Optimized to speed time to market—and easily adapt to new -ones—they are based on the industry's most code-efficient architecture for -C and assembly programming. +For more detailed information please visit `vendor site `_. .. contents:: @@ -18,272 +15,46 @@ Packages :header-rows: 1 * - Name - - Alias - Contents - * - ``toolchain-atmelavr`` - - toolchain - - `avr-gcc `_, - `GDB `_, - `AVaRICE `_, - `SimulAVR `_ - * - ``tool-avrdude`` - - uploader - - `AVRDUDE `_ - * - ``tool-micronucleus`` - - uploader - - `Micronucleus `_ - * - ``framework-arduinoavr`` - - - - See below in :ref:`atmelavr_frameworks` + * - ``toolchain-atmelavr`` + - `avr-gcc `_, `GDB `_, `AVaRICE `_, `SimulAVR `_ + + * - ``tool-avrdude`` + - `AVRDUDE `_ + + * - ``framework-arduinoavr`` + - `Arduino Wiring-based Framework (AVR Core, 1.6) `_ + + * - ``tool-micronucleus`` + - `Micronucleus `_ .. warning:: **Linux Users:** Don't forget to install "udev" rules file `99-platformio-udev.rules `_ (an instruction is located in the file). -.. _atmelavr_frameworks: Frameworks ---------- - .. list-table:: :header-rows: 1 - * - Type ``framework`` - - Name - - Reference - * - ``arduino`` - - Arduino Wiring-based Framework (AVR Core, 1.6) - - `Documentation `_ + * - Name + - Description + * - :ref:`framework_arduino` + - Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ * For more detailed ``board`` information please scroll tables below by horizontal. -Arduino -~~~~~~~ - -.. list-table:: - :header-rows: 1 - - * - Type ``board`` - - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` - - Flash - - RAM - * - ``atmegangatmega168`` - - `Arduino NG or older (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``atmegangatmega8`` - - `Arduino Arduino NG or older (ATmega8) - `_ - - ATmega8 ``atmega8`` - - 16 MHz ``16000000L`` - - 8 Kb - - 1 Kb - * - ``btatmega168`` - - `Arduino BT (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``btatmega328`` - - `Arduino BT (ATmega328) - `_ - - ATmega328 ``atmega328`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``diecimilaatmega168`` - - `Arduino Diecimila or Duemilanove (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``diecimilaatmega328`` - - `Arduino Diecimila or Duemilanove (ATmega328) - `_ - - ATmega328 ``atmega328`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``esplora`` - - `Arduino Esplora `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - * - ``ethernet`` - - `Arduino Ethernet - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``fio`` - - `Arduino Fio - `_ - - ATmega328P ``atmega328p`` - - 8 MHz ``8000000L`` - - 32 Kb - - 2 Kb - * - ``leonardo`` - - `Arduino Leonardo `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - * - ``LilyPadUSB`` - - `Arduino LilyPad USB - `_ - - ATmega32u4 ``atmega32u4`` - - 8 MHz ``8000000L`` - - 32 Kb - - 2.5 Kb - * - ``lilypadatmega168`` - - `Arduino LilyPad (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 8 MHz ``8000000L`` - - 16 Kb - - 1 Kb - * - ``lilypadatmega328`` - - `Arduino LilyPad (ATmega328) - `_ - - ATmega328P ``atmega328p`` - - 8 MHz ``8000000L`` - - 32 Kb - - 2 Kb - * - ``megaADK`` - - `Arduino Mega ADK - `_ - - ATmega2560 ``atmega2560`` - - 16 MHz ``16000000L`` - - 256 Kb - - 8 Kb - * - ``megaatmega1280`` - - `Arduino Mega (ATmega1280) - `_ - - ATmega1280 ``atmega1280`` - - 16 MHz ``16000000L`` - - 128 Kb - - 8 Kb - * - ``megaatmega2560`` - - `Arduino Mega (ATmega2560) - `_ - - ATmega2560 ``atmega2560`` - - 16 MHz ``16000000L`` - - 256 Kb - - 8 Kb - * - ``micro`` - - `Arduino Micro - `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - * - ``miniatmega168`` - - `Arduino Mini (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``miniatmega328`` - - `Arduino Mini (ATmega328P) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``nanoatmega168`` - - `Arduino Nano (ATmega168) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``nanoatmega328`` - - `Arduino Nano (ATmega328P) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``pro8MHzatmega168`` - - `Arduino Pro or Pro Mini (ATmega168, 3.3V) - `_ - - ATmega168 ``atmega168`` - - 8 MHz ``8000000L`` - - 16 Kb - - 1 Kb - * - ``pro16MHzatmega168`` - - `Arduino Pro or Pro Mini (ATmega168, 5V) - `_ - - ATmega168 ``atmega168`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``pro8MHzatmega328`` - - `Arduino Pro or Pro Mini (ATmega328P, 3.3V) - `_ - - ATmega328P ``atmega328p`` - - 8 MHz ``8000000L`` - - 32 Kb - - 2 Kb - * - ``pro16MHzatmega328`` - - `Arduino Pro or Pro Mini (ATmega328P, 5V) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``robotControl`` - - `Arduino Robot Control - `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - * - ``robotMotor`` - - `Arduino Robot Motor - `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - * - ``uno`` - - `Arduino Uno - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``yun`` - - `Arduino Yun - `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2.5 Kb - -More detailed information you can find here -`Arduino boards `_. - - Adafruit ~~~~~~~~ @@ -292,65 +63,277 @@ Adafruit * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM + * - ``flora8`` - - `Adafruit Flora - `_ - - ATmega32u4 ``atmega32u4`` - - 8 MHz ``8000000L`` + - `Adafruit Flora `_ + - ATMEGA32U4 + - 8 MHz - 32 Kb - 2.5 Kb - * - ``trinket3`` - - `Adafruit Trinket 8MHz 3.3V LOGIC - `_ - - ATtiny85 ``attiny85`` - - 8 MHz ``8000000L`` - - 8 Kb - - 0.5 Kb - * - ``trinket5`` - - `Adafruit Trinket 16MHz 5V LOGIC - `_ - - ATtiny85 ``ATtiny85`` - - 16 MHz ``16000000L`` - - 8 Kb - - 0.5 Kb + * - ``protrinket3`` - - `Adafruit Pro Trinket 3V/12MHz (USB) - `_ - - ATmega328P ``atmega328p`` - - 12 MHz ``12000000L`` + - `Pro Trinket 3V/12MHz (USB) `_ + - ATMEGA328P + - 12 MHz - 32 Kb - 2 Kb + * - ``protrinket3ftdi`` - - `Adafruit Pro Trinket 3V/12MHz (FTDI) - `_ - - ATmega328P ``atmega328p`` - - 12 MHz ``12000000L`` + - `Pro Trinket 3V/12MHz (FTDI) `_ + - ATMEGA328P + - 16 MHz - 32 Kb - 2 Kb + * - ``protrinket5`` - - `Adafruit Pro Trinket 5V/16MHz (USB) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` + - `Pro Trinket 5V/16MHz (USB) `_ + - ATMEGA328P + - 16 MHz - 32 Kb - 2 Kb + * - ``protrinket5ftdi`` - - `Adafruit Pro Trinket 5V/16MHz (FTDI) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` + - `Pro Trinket 5V/16MHz (USB) `_ + - ATMEGA328P + - 16 MHz - 32 Kb - 2 Kb -More detailed information you can find here -`Adafruits boards `_. + * - ``trinket3`` + - `Adafruit Trinket 3V/8MHz `_ + - ATTINY85 + - 8 MHz + - 8 Kb + - 0.5 Kb + * - ``trinket5`` + - `Adafruit Trinket 5V/16MHz `_ + - ATTINY85 + - 16 MHz + - 8 Kb + - 0.5 Kb -Digispark +Arduino +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``LilyPadUSB`` + - `LilyPad Arduino USB `_ + - ATMEGA32U4 + - 8 MHz + - 32 Kb + - 2.5 Kb + + * - ``atmegangatmega168`` + - `Arduino NG or older ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``atmegangatmega8`` + - `Arduino NG or older ATmega8 `_ + - ATMEGA8 + - 16 MHz + - 8 Kb + - 1 Kb + + * - ``btatmega168`` + - `Arduino BT ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``btatmega328`` + - `Arduino BT ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``diecimilaatmega168`` + - `Arduino Duemilanove or Diecimila ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``diecimilaatmega328`` + - `Arduino Duemilanove or Diecimila ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``esplora`` + - `Arduino Esplora `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``ethernet`` + - `Arduino Ethernet `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``fio`` + - `Arduino Fio `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``leonardo`` + - `Arduino Leonardo `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``lilypadatmega168`` + - `LilyPad Arduino ATmega168 `_ + - ATMEGA168 + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``lilypadatmega328`` + - `LilyPad Arduino ATmega328 `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``megaADK`` + - `Arduino Mega ADK `_ + - ATMEGA2560 + - 16 MHz + - 256 Kb + - 8 Kb + + * - ``megaatmega1280`` + - `Arduino Mega or Mega 2560 ATmega1280 `_ + - ATMEGA1280 + - 16 MHz + - 128 Kb + - 8 Kb + + * - ``megaatmega2560`` + - `Arduino Mega or Mega 2560 ATmega2560 (Mega 2560) `_ + - ATMEGA2560 + - 16 MHz + - 256 Kb + - 8 Kb + + * - ``micro`` + - `Arduino Micro `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``miniatmega168`` + - `Arduino Mini ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``miniatmega328`` + - `Arduino Mini ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``nanoatmega168`` + - `Arduino Nano ATmega168 `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``nanoatmega328`` + - `Arduino Nano ATmega328 `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``pro16MHzatmega168`` + - `Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz) `_ + - ATMEGA168 + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``pro16MHzatmega328`` + - `Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``pro8MHzatmega168`` + - `Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz) `_ + - ATMEGA168 + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``pro8MHzatmega328`` + - `Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz) `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + + * - ``robotControl`` + - `Arduino Robot Control `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``robotMotor`` + - `Arduino Robot Motor `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + + * - ``uno`` + - `Arduino Uno `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``yun`` + - `Arduino Yun `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + +BitWizard ~~~~~~~~~ .. list-table:: @@ -358,31 +341,58 @@ Digispark * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM - * - ``digispark-tiny`` - - `Digispark USB Development Board `_ - - ATtiny85 ``attiny85`` - - 16 MHz ``16000000L`` - - 8 Kb - - 0.5 Kb + + * - ``raspduino`` + - `Raspduino `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + +Digistump +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + * - ``digispark-pro`` - - `Digispark Pro (Default 16 Mhz) `_ - - ATtiny167 ``attiny167`` - - 16 MHz ``16000000L`` + - `Digispark Pro (Default 16 MHz) `_ + - ATTINY167 + - 16 MHz - 16 Kb - 0.5 Kb - * - ``digispark-pro32`` - - `Digispark Pro (16 Mhz) (32 byte buffer) `_ - - ATtiny167 ``attiny167`` - - 16 Mhz ``16000000L`` - - 16 kb - - 0.5 Kb -More detailed information you can find here -`Digistump Development Boards `_. + * - ``digispark-pro32`` + - `Digispark Pro (16 MHz) (32 byte buffer) `_ + - ATTINY167 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``digispark-pro64`` + - `Digispark Pro (16 MHz) (64 byte buffer) `_ + - ATTINY167 + - 16 MHz + - 16 Kb + - 0.5 Kb + + * - ``digispark-tiny`` + - `Digispark (Default - 16 MHz) `_ + - ATTINY85 + - 16 MHz + - 8 Kb + - 0.5 Kb Engduino ~~~~~~~~ @@ -392,33 +402,32 @@ Engduino * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM + * - ``engduinov1`` - `Engduino 1 `_ - - ATmega32u4 ``atmega32u4`` - - 8 MHz ``8000000L`` + - ATMEGA32U4 + - 8 MHz - 32 Kb - 2.5 Kb + * - ``engduinov2`` - `Engduino 2 `_ - - ATmega32u4 ``atmega32u4`` - - 8 MHz ``8000000L`` + - ATMEGA32U4 + - 8 MHz - 32 Kb - 2.5 Kb + * - ``engduinov3`` - `Engduino 3 `_ - - ATmega32u4 ``atmega32u4`` - - 8 MHz ``8000000L`` + - ATMEGA32U4 + - 8 MHz - 32 Kb - 2.5 Kb -More detailed information you can find here -`Engduino Site `_. - - Microduino ~~~~~~~~~~ @@ -427,98 +436,90 @@ Microduino * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM - * - ``168pa8m`` - - `Microduino Core (ATmega168P, 3.3V) - `_ - - ATmega168P ``atmega168p`` - - 8 MHz ``8000000L`` - - 16 Kb - - 1 Kb - * - ``168pa16m`` - - `Microduino Core (ATmega168P, 5V) - `_ - - ATmega168P ``atmega168p`` - - 16 MHz ``16000000L`` - - 16 Kb - - 1 Kb - * - ``328p8m`` - - `Microduino Core (ATmega328P, 3.3V) - `_ - - ATmega328P ``atmega328p`` - - 8 MHz ``8000000L`` - - 32 Kb - - 2 Kb - * - ``328p16m`` - - `Microduino Core (ATmega328P, 5V) - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` - - 32 Kb - - 2 Kb - * - ``644pa8m`` - - `Microduino Core+ (ATmega644PA, 3.3V) - `_ - - ATmega644PA ``atmega644p`` - - 8 MHz ``8000000L`` - - 64 Kb - - 4 Kb - * - ``644pa16m`` - - `Microduino Core+ (ATmega644PA, 5V) - `_ - - ATmega644PA ``atmega644p`` - - 16 MHz ``16000000L`` - - 64 Kb - - 4 Kb - * - ``1284p8m`` - - `Microduino Core+ (Atmega1284P, 3.3V) - `_ - - Atmega1284P ``atmega1284p`` - - 8 MHz ``8000000L`` - - 128 Kb - - 16 Kb + * - ``1284p16m`` - - `Microduino Core+ (Atmega1284P, 5V) - `_ - - Atmega1284P ``atmega1284p`` - - 16 MHz ``16000000L`` + - `Microduino Core+ (ATmega1284P@16M,5V) `_ + - ATMEGA1284P + - 16 MHz - 128 Kb - 16 Kb + + * - ``1284p8m`` + - `Microduino Core+ (ATmega1284P@8M,3.3V) `_ + - ATMEGA1284P + - 8 MHz + - 128 Kb + - 16 Kb + + * - ``168pa16m`` + - `Microduino Core (Atmega168PA@16M,5V) `_ + - ATMEGA168P + - 16 MHz + - 16 Kb + - 1 Kb + + * - ``168pa8m`` + - `Microduino Core (Atmega168PA@8M,3.3V) `_ + - ATMEGA168P + - 8 MHz + - 16 Kb + - 1 Kb + + * - ``328p16m`` + - `Microduino Core (Atmega328P@16M,5V) `_ + - ATMEGA328P + - 16 MHz + - 32 Kb + - 2 Kb + + * - ``328p8m`` + - `Microduino Core (Atmega328P@8M,3.3V) `_ + - ATMEGA328P + - 8 MHz + - 32 Kb + - 2 Kb + * - ``32u416m`` - - `Microduino-Core USB - `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` + - `Microduino Core USB (ATmega32U4@16M,5V) `_ + - ATMEGA32U4 + - 16 MHz - 32 Kb - 2.5 Kb + * - ``644pa16m`` + - `Microduino Core+ (Atmega644PA@16M,5V) `_ + - ATMEGA644P + - 16 MHz + - 64 Kb + - 4 Kb -More detailed information you can find here -`Microduino boards `_. + * - ``644pa8m`` + - `Microduino Core+ (Atmega644PA@8M,3.3V) `_ + - ATMEGA644P + - 8 MHz + - 64 Kb + - 4 Kb - -Raspduino -~~~~~~~~~ +PanStamp +~~~~~~~~ .. list-table:: :header-rows: 1 * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM - * - ``raspduino`` - - `Raspduino - `_ - - ATmega328P ``atmega328p`` - - 16 MHz ``16000000L`` + + * - ``panStampAVR`` + - `PanStamp AVR `_ + - ATMEGA328P + - 8 MHz - 32 Kb - 2 Kb - -More detailed information you can find here -`Wiki `_. diff --git a/docs/platforms/atmelsam.rst b/docs/platforms/atmelsam.rst index 14363615..a8e78bed 100644 --- a/docs/platforms/atmelsam.rst +++ b/docs/platforms/atmelsam.rst @@ -2,11 +2,9 @@ Platform ``atmelsam`` ===================== +Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix. -`Atmel® | SMART `_ -offers Flash- based ARM® products based on the ARM Cortex-®M0+, Cortex-M3 and -Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich -peripheral and feature mix. +For more detailed information please visit `vendor site `_. .. contents:: @@ -17,88 +15,116 @@ Packages :header-rows: 1 * - Name - - Alias - Contents - * - ``toolchain-gccarmnoneeabi`` - - toolchain - - `gcc-arm-embedded `_, - `GDB `_ - * - ``tool-bossac`` - - uploader - - `BOSSA CLI `_ - * - ``framework-arduino`` - - - - See below in :ref:`atmelsam_frameworks` + * - ``framework-arduinosam`` + - `Arduino Wiring-based Framework (SAM Core, 1.6) `_ + + * - ``ldscripts`` + - `Linker Scripts `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + + * - ``tool-bossac`` + - `BOSSA CLI `_ .. warning:: **Linux Users:** Don't forget to install "udev" rules file `99-platformio-udev.rules `_ (an instruction is located in the file). -.. _atmelsam_frameworks: Frameworks ---------- - .. list-table:: :header-rows: 1 - * - Type ``framework`` - - Name - - Reference - * - ``arduino`` - - Arduino Wiring-based Framework (SAM Core, 1.6) - - `Documentation `_ + * - Name + - Description + * - :ref:`framework_arduino` + - Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ * For more detailed ``board`` information please scroll tables below by horizontal. +Arduino +~~~~~~~ + .. list-table:: :header-rows: 1 * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM + * - ``due`` - `Arduino Due (Programming Port) `_ - - at91sam3x8e ``cortex-m3`` - - 84 MHz ``84000000L`` - - 512 Kb - - 32 Kb - * - ``dueUSB`` - - `Arduino Due (USB Native Port) `_ - - at91sam3x8e ``cortex-m3`` - - 84 MHz ``84000000L`` - - 512 Kb - - 32 Kb - * - ``digix`` - - `Digistump DigiX `_ - - at91sam3x8e ``cortex-m3`` - - 84 MHz ``84000000L`` - - 512 kb - - 32 Kb - * - ``sainSmartDue`` - - `SainSmart Due (Programming Port) `_ - - at91sam3x8e ``cortex-m3`` - - 84 MHz ``84000000L`` - - 512 Kb - - 32 Kb - * - ``sainSmartDueUSB`` - - `SainSmart Due (USB Native Port) `_ - - at91sam3x8e ``cortex-m3`` - - 84 MHz ``84000000L`` + - AT91SAM3X8E + - 84 MHz - 512 Kb - 32 Kb -More detailed information you can find here -`Atmel SMART ARM-based MCUs `_. + * - ``dueUSB`` + - `Arduino Due (USB Native Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + +Digistump +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``digix`` + - `Digistump DigiX `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 28 Kb + +SainSmart +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``sainSmartDue`` + - `SainSmart Due (Programming Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb + + * - ``sainSmartDueUSB`` + - `SainSmart Due (USB Native Port) `_ + - AT91SAM3X8E + - 84 MHz + - 512 Kb + - 32 Kb diff --git a/docs/platforms/creating_platform.rst b/docs/platforms/creating_platform.rst index 5347be01..9865beec 100644 --- a/docs/platforms/creating_platform.rst +++ b/docs/platforms/creating_platform.rst @@ -217,6 +217,8 @@ base template of ``test-builder.py``. CPPDEFINES=["DEFINE_1", "DEFINE=2", "DEFINE_N"], + LIBS=["additional", "libs", "here"], + UPLOADER=join("$PIOPACKAGES_DIR", "tool-bar", "uploader"), UPLOADCMD="$UPLOADER $SOURCES" ) @@ -238,12 +240,10 @@ base template of ``test-builder.py``. # The source code of "platformio-build-tool" is here # https://github.com/ivankravets/platformio/blob/develop/platformio/builder/tools/platformio.py - CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # - target_elf = env.BuildFirmware(CORELIBS + ["additional", "libs", "here"]) + target_elf = env.BuildFirmware() # # Target: Build the .bin file diff --git a/docs/platforms/freescalekinetis.rst b/docs/platforms/freescalekinetis.rst new file mode 100644 index 00000000..5f5eed08 --- /dev/null +++ b/docs/platforms/freescalekinetis.rst @@ -0,0 +1,112 @@ +.. _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. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Contents + + * - ``framework-mbed`` + - `mbed Framework `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + + +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`framework_mbed` + - The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by + horizontal. + +Freescale +~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``IBMEthernetKit`` + - `Ethernet IoT Starter Kit `_ + - MK64FN1M0VLL12 + - 120 MHz + - 1024 Kb + - 256 Kb + + * - ``frdm_k20d50m`` + - `Freescale Kinetis FRDM-K20D50M `_ + - MK20DX128VLH5 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``frdm_k22f`` + - `Freescale Kinetis FRDM-K22F `_ + - MK22FN512VLH12 + - 120 MHz + - 512 Kb + - 128 Kb + + * - ``frdm_k64f`` + - `Freescale Kinetis FRDM-K64F `_ + - MK64FN1M0VLL12 + - 120 MHz + - 1024 Kb + - 256 Kb + + * - ``frdm_kl05z`` + - `Freescale Kinetis FRDM-KL05Z `_ + - MKL05Z32VFM4 + - 48 MHz + - 32 Kb + - 4 Kb + + * - ``frdm_kl25z`` + - `Freescale Kinetis FRDM-KL25Z `_ + - MKL25Z128VLK4 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``frdm_kl46z`` + - `Freescale Kinetis FRDM-KL46Z `_ + - MKL46Z256VLL4 + - 48 MHz + - 256 Kb + - 32 Kb diff --git a/docs/platforms/index.rst b/docs/platforms/index.rst index 5aa06bcc..220c3a67 100644 --- a/docs/platforms/index.rst +++ b/docs/platforms/index.rst @@ -16,7 +16,10 @@ MCU, upload protocol or etc. Please use ``board`` option. atmelavr atmelsam - stm32 + freescalekinetis + nordicnrf51 + nxplpc + ststm32 teensy timsp430 titiva diff --git a/docs/platforms/nordicnrf51.rst b/docs/platforms/nordicnrf51.rst new file mode 100644 index 00000000..04ba9de2 --- /dev/null +++ b/docs/platforms/nordicnrf51.rst @@ -0,0 +1,171 @@ +.. _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. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Contents + + * - ``framework-mbed`` + - `mbed Framework `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + + +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`framework_mbed` + - The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by + horizontal. + +JKSoft +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``wallBotBLE`` + - `JKSoft Wallbot BLE `_ + - NRF51822 + - 16 MHz + - 128 Kb + - 16 Kb + +Nordic +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``nrf51_dk`` + - `Nordic nRF51-DK `_ + - NRF51822 + - 32 MHz + - 256 Kb + - 32 Kb + + * - ``nrf51_dongle`` + - `Nordic nRF51-Dongle `_ + - NRF51822 + - 32 MHz + - 256 Kb + - 32 Kb + + * - ``nrf51_mkit`` + - `Nordic nRF51822-mKIT `_ + - NRF51822 + - 16 MHz + - 128 Kb + - 16 Kb + +RedBearLab +~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``redBearLab`` + - `RedBearLab nRF51822 `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + + * - ``redBearLabBLENano`` + - `RedBearLab BLE Nano `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + +SeeedStudio +~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``seeedTinyBLE`` + - `Seeed Tiny BLE `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb + +Switch Science +~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``hrm1017`` + - `Switch Science mbed HRM1017 `_ + - NRF51822 + - 16 MHz + - 256 Kb + - 16 Kb diff --git a/docs/platforms/nxplpc.rst b/docs/platforms/nxplpc.rst new file mode 100644 index 00000000..fd2ed5ff --- /dev/null +++ b/docs/platforms/nxplpc.rst @@ -0,0 +1,258 @@ +.. _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. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Contents + + * - ``framework-mbed`` + - `mbed Framework `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + + +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`framework_mbed` + - The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by + horizontal. + +CQ Publishing +~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u35_501`` + - `TG-LPC11U35-501 `_ + - LPC11U35 + - 48 MHz + - 64 Kb + - 10 Kb + +Embedded Artists +~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u35`` + - `EA LPC11U35 QuickStart Board `_ + - LPC11U35 + - 48 MHz + - 64 Kb + - 10 Kb + + * - ``lpc4088`` + - `EA LPC4088 QuickStart Board `_ + - LPC4088 + - 120 MHz + - 512 Kb + - 96 Kb + + * - ``lpc4088_dm`` + - `EA LPC4088 Display Module `_ + - LPC4088 + - 120 MHz + - 512 Kb + - 96 Kb + +NGX Technologies +~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``blueboard_lpc11u24`` + - `BlueBoard-LPC11U24 `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + +NXP +~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc11u24`` + - `mbed LPC11U24 `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + + * - ``lpc1549`` + - `LPCXpresso1549 `_ + - LPC1549 + - 72 MHz + - 256 Kb + - 36 Kb + + * - ``lpc1768`` + - `mbed LPC1768 `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb + +Outrageous Circuits +~~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``mbuino`` + - `Outrageous Circuits mBuino `_ + - LPC11U24 + - 48 MHz + - 32 Kb + - 8 Kb + +SeeedStudio +~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``seeeduinoArchPro`` + - `Seeeduino-Arch-Pro `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb + +Solder Splash Labs +~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``dipcortexm0`` + - `DipCortex M0 `_ + - LPC11U24 + - 50 MHz + - 32 Kb + - 8 Kb + +Switch Science +~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lpc1114fn28`` + - `mbed LPC1114FN28 `_ + - LPC1114FN28 + - 48 MHz + - 32 Kb + - 4 Kb + +u-blox +~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``ubloxc027`` + - `u-blox C027 `_ + - LPC1768 + - 96 MHz + - 512 Kb + - 32 Kb diff --git a/docs/platforms/stm32.rst b/docs/platforms/stm32.rst deleted file mode 100644 index 4748f6a9..00000000 --- a/docs/platforms/stm32.rst +++ /dev/null @@ -1,104 +0,0 @@ -.. _platform_stm32: - -Platform ``stm32`` -================== - -`The STM32 family of 32-bit Flash MCUs `_ based on the ARM® Cortex®-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. - -The unparalleled and large range of STM32 devices, based on an industry-standard core and accompanied by a vast choice of tools and software, makes this family of products the ideal choice, both for small projects and for entire platform decisions. - -.. contents:: - -Packages --------- - -.. list-table:: - :header-rows: 1 - - * - Name - - Alias - - Contents - * - ``toolchain-gccarmnoneeabi`` - - toolchain - - `gcc-arm-embedded `_, - `GDB `_ - * - ``tool-stlink`` - - uploader - - `STLink `_ - * - ``framework-cmsis`` - - - - See below in :ref:`stm32_frameworks` - * - ``framework-spl`` - - - - See below in :ref:`stm32_frameworks` - * - ``framework-opencm3`` - - - - See below in :ref:`stm32_frameworks` - -.. warning:: - **Linux Users:** Don't forget to install "udev" rules file - `99-platformio-udev.rules `_ (an instruction is located in the file). - - -.. _stm32_frameworks: - -Frameworks ----------- - -.. list-table:: - :header-rows: 1 - - * - Type ``framework`` - - Name - - Reference - * - ``cmsis`` - - Vendor-independent hardware abstraction layer for the Cortex-M processor series - - `Documentation `__ - * - ``spl`` - - Standard Peripheral Library for STM32 MCUs - - `Documentation `__ - * - ``opencm3`` - - libOpenCM3 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 - * - ``stm32ldiscovery`` - - `Discovery kit for STM32L151/152 line `_ - - STM32L152rbt6 ``cortex-m3`` - - 32 MHz ``32000000L`` - - 128 Kb - - 16 Kb - * - ``stm32f3discovery`` - - `Discovery kit for STM32F303xx microcontrollers - `_ - - STM32F303vct6 ``cortex-m4`` - - 72 MHz ``72000000L`` - - 256 Kb - - 48 Kb - * - ``stm32f4discovery`` - - `Discovery kit for STM32F407/417 lines - `_ - - STM32F407vgt6 ``cortex-m4`` - - 168 Mhz ``168000000L`` - - 1 Mb - - 192 Kb - -More detailed information you can find here -`STM32 Discovery kits `_. diff --git a/docs/platforms/ststm32.rst b/docs/platforms/ststm32.rst new file mode 100644 index 00000000..78e3f43f --- /dev/null +++ b/docs/platforms/ststm32.rst @@ -0,0 +1,227 @@ +.. _platform_ststm32: + +Platform ``ststm32`` +==================== +The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. + +For more detailed information please visit `vendor site `_. + +.. contents:: + +Packages +-------- + +.. list-table:: + :header-rows: 1 + + * - Name + - Contents + + * - ``framework-libopencm3`` + - `libOpenCM3 Framework `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + + * - ``tool-stlink`` + - `ST-Link `_ + + * - ``framework-spl`` + - `Standard Peripheral Library for STM32 MCUs `_ + + * - ``framework-cmsis`` + - `Vendor-independent hardware abstraction layer for the Cortex-M processor series `_ + + * - ``framework-mbed`` + - `mbed Framework `_ + + * - ``ldscripts`` + - `Linker Scripts `_ + +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + + + +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description + + * - :ref:`framework_cmsis` + - The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for the Cortex-M processor series and specifies debugger interfaces. The CMSIS enables consistent and simple software interfaces to the processor for interface peripherals, real-time operating systems, and middleware. It simplifies software re-use, reducing the learning curve for new microcontroller developers and cutting the time-to-market for devices. + + * - :ref:`framework_libopencm3` + - The libOpenCM3 framework aims to create a free/libre/open-source firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others. + + * - :ref:`framework_mbed` + - The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community. + + * - :ref:`framework_spl` + - The ST Standard Peripheral Library provides a set of functions for handling the peripherals on the STM32 Cortex-M3 family. The idea is to save the user (the new user, in particular) having to deal directly with the registers. + +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by + horizontal. + +ST +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``disco_f051r8`` + - `STM32F0DISCOVERY `_ + - STM32F051R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``disco_f100rb`` + - `STM32VLDISCOVERY `_ + - STM32F100RBT6 + - 24 MHz + - 128 Kb + - 8 Kb + + * - ``disco_f303vc`` + - `STM32F3DISCOVERY `_ + - STM32F303VCT6 + - 72 MHz + - 256 Kb + - 48 Kb + + * - ``disco_f334c8`` + - `32F3348DISCOVERY `_ + - STM32F334C8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``disco_f401vc`` + - `32F401CDISCOVERY `_ + - STM32F401VCT6 + - 84 MHz + - 256 Kb + - 64 Kb + + * - ``disco_f407vg`` + - `STM32F4DISCOVERY `_ + - STM32F407VGT6 + - 168 MHz + - 1024 Kb + - 128 Kb + + * - ``disco_f429zi`` + - `32F429IDISCOVERY `_ + - STM32F429ZIT6 + - 180 MHz + - 2048 Kb + - 256 Kb + + * - ``disco_l152rb`` + - `STM32LDISCOVERY `_ + - STM32L152RBT6 + - 32 MHz + - 128 Kb + - 16 Kb + + * - ``nucleo_f030r8`` + - `ST Nucleo F030R8 `_ + - STM32F030R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``nucleo_f070rb`` + - `ST Nucleo F070RB `_ + - STM32F070RBT6 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``nucleo_f072rb`` + - `ST Nucleo F072RB `_ + - STM32F072RBT6 + - 48 MHz + - 128 Kb + - 16 Kb + + * - ``nucleo_f091rc`` + - `ST Nucleo F091RC `_ + - STM32F091RCT6 + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``nucleo_f103rb`` + - `ST Nucleo F103RB `_ + - STM32F103RBT6 + - 72 MHz + - 128 Kb + - 20 Kb + + * - ``nucleo_f302r8`` + - `ST Nucleo F302R8 `_ + - STM32F302R8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``nucleo_f303re`` + - `ST Nucleo F303RE `_ + - STM32F303RET6 + - 72 MHz + - 512 Kb + - 64 Kb + + * - ``nucleo_f334r8`` + - `ST Nucleo F334R8 `_ + - STM32F334R8T6 + - 72 MHz + - 64 Kb + - 16 Kb + + * - ``nucleo_f401re`` + - `ST Nucleo F401RE `_ + - STM32F401RET6 + - 84 MHz + - 512 Kb + - 96 Kb + + * - ``nucleo_f411re`` + - `ST Nucleo F411RE `_ + - STM32F411RET6 + - 100 MHz + - 512 Kb + - 128 Kb + + * - ``nucleo_l053r8`` + - `ST Nucleo L053R8 `_ + - STM32L053R8T6 + - 48 MHz + - 64 Kb + - 8 Kb + + * - ``nucleo_l152re`` + - `ST Nucleo L152RE `_ + - STM32L152RET6 + - 32 MHz + - 512 Kb + - 80 Kb diff --git a/docs/platforms/teensy.rst b/docs/platforms/teensy.rst index 37f172c6..52c18e22 100644 --- a/docs/platforms/teensy.rst +++ b/docs/platforms/teensy.rst @@ -2,8 +2,9 @@ Platform ``teensy`` =================== +Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port. -`Teensy `_ is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port. +For more detailed information please visit `vendor site `_. .. contents:: @@ -14,88 +15,86 @@ Packages :header-rows: 1 * - Name - - Alias - Contents - * - ``toolchain-gccarmnoneeabi`` - - toolchain - - `gcc-arm-embedded `_, - `GDB `_ - * - ``toolchain-atmelavr`` - - toolchain - - `avr-gcc `_, - `GDB `_, - `AVaRICE `_, - `SimulAVR `_ - * - ``tool-teensy`` - - uploader - - `Teensy Loader `_ - * - ``framework-arduinoteensy`` - - - - See below in :ref:`teensy_frameworks` + * - ``toolchain-atmelavr`` + - `avr-gcc `_, `GDB `_, `AVaRICE `_, `SimulAVR `_ + + * - ``ldscripts`` + - `Linker Scripts `_ + + * - ``framework-arduinoteensy`` + - `Arduino Wiring-based Framework `_ + + * - ``toolchain-gccarmnoneeabi`` + - `gcc-arm-embedded `_, `GDB `_ + + * - ``tool-teensy`` + - `Teensy Loader `_ .. warning:: **Linux Users:** Don't forget to install "udev" rules file `99-platformio-udev.rules `_ (an instruction is located in the file). -.. _teensy_frameworks: Frameworks ---------- - .. list-table:: :header-rows: 1 - * - Type ``framework`` - - Name - - Reference - * - ``arduino`` - - Arduino Wiring-based Framework - - `Documentation `_ + * - Name + - Description + * - :ref:`framework_arduino` + - Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ * For more detailed ``board`` information please scroll tables below by horizontal. +Teensy +~~~~~~ + .. list-table:: :header-rows: 1 * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM + * - ``teensy20`` - `Teensy 2.0 `_ - - ATmega32u4 ``atmega32u4`` - - 16 MHz ``16000000L`` + - ATMEGA32U4 + - 16 MHz - 32 Kb - 2.5 Kb + * - ``teensy20pp`` - `Teensy++ 2.0 `_ - - AT90USB1289 ``at90usb1286`` - - 16 MHz ``16000000L`` + - AT90USB1286 + - 16 MHz - 128 Kb - 8 Kb + * - ``teensy30`` - `Teensy 3.0 `_ - - MK20DX128 ``cortex-m4`` - - 48 Mhz ``48000000L`` - - 128 kb + - MK20DX128 + - 48 MHz + - 128 Kb - 16 Kb + * - ``teensy31`` - `Teensy 3.1 `_ - - MK20DX256 ``cortex-m4`` - - 72 Mhz ``72000000L`` - - 256 kb + - MK20DX256 + - 72 MHz + - 256 Kb - 64 Kb - -More detailed information you can find here -`Teensy USB Development Boards `_. diff --git a/docs/platforms/timsp430.rst b/docs/platforms/timsp430.rst index 256f9f36..b46b7219 100644 --- a/docs/platforms/timsp430.rst +++ b/docs/platforms/timsp430.rst @@ -2,11 +2,9 @@ Platform ``timsp430`` ===================== +MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are 16-bit, RISC-based, mixed-signal processors designed for ultra-low power. These MCUs offer the lowest power consumption and the perfect mix of integrated peripherals for thousands of applications. -`MSP430 microcontrollers (MCUs) from Texas Instruments (TI) `_ -are 16-bit, RISC-based, mixed-signal processors designed for ultra-low power. -These MCUs offer the lowest power consumption and the perfect mix of integrated -peripherals for thousands of applications. +For more detailed information please visit `vendor site `_. .. contents:: @@ -17,104 +15,127 @@ Packages :header-rows: 1 * - Name - - Alias - Contents - * - ``toolchain-timsp430`` - - toolchain - - `msp-gcc `_, - `GDB `_ - * - ``tool-mspdebug`` - - uploader - - `MSPDebug `_ - * - ``framework-energiamsp430`` - - - - See below in :ref:`timsp430_frameworks` + * - ``toolchain-timsp430`` + - `msp-gcc `_, `GDB `_ + + * - ``tool-mspdebug`` + - `MSPDebug `_ + + * - ``framework-energiamsp430`` + - `Energia Wiring-based Framework (MSP430 Core) `_ + + * - ``framework-arduinomsp430`` + - `Arduino Wiring-based Framework (MSP430 Core) `_ .. warning:: **Linux Users:** Don't forget to install "udev" rules file `99-platformio-udev.rules `_ (an instruction is located in the file). -.. _timsp430_frameworks: Frameworks ---------- - .. list-table:: :header-rows: 1 - * - Type ``framework`` - - Name - - Reference - * - ``energia`` - - Energia Wiring-based Framework (MSP430 Core) - - `Documentation `_ + * - Name + - Description + * - :ref:`framework_arduino` + - Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences. + + * - :ref:`framework_energia` + - Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before. Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ * For more detailed ``board`` information please scroll tables below by horizontal. +PanStamp +~~~~~~~~ + .. list-table:: :header-rows: 1 * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM - * - ``lpmsp430g2231`` - - `MSP430G2231 LaunchPad `_ - - MSP430G2231 ``msp430g2231`` - - 16 MHz ``16000000L`` - - 2 Kb - - 128 B - * - ``lpmsp430g2452`` - - `MSP430G2452 LaunchPad `_ - - MSP430G2452 ``msp430g2452`` - - 16 MHz ``16000000L`` - - 8 Kb - - 256 B - * - ``lpmsp430g2553`` - - `MSP430G2553 LaunchPad `_ - - MSP430G2553 ``msp430g2553`` - - 16 MHz ``16000000L`` - - 16 Kb - - 512 B + + * - ``panStampNRG`` + - `PanStamp NRG 1.1 `_ + - CC430F5137 + - 12 MHz + - 32 Kb + - 4 Kb + +TI +~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + * - ``lpmsp430f5529`` - - `MSP430F5529 LaunchPad (16 Mhz) `_ - - MSP430F5529 ``msp430f5529`` - - 16 MHz ``16000000L`` + - `LaunchPad w/ msp430f5529 (16MHz) `_ + - MSP430F5529 + - 16 MHz - 128 Kb - - 8 KB + - 1 Kb + * - ``lpmsp430f5529_25`` - - `MSP430F5529 LaunchPad (25 Mhz) `_ - - MSP430F5529 ``msp430f5529`` - - 25 MHz ``25000000L`` + - `LaunchPad w/ msp430f5529 (25MHz) `_ + - MSP430F5529 + - 25 MHz - 128 Kb - - 8 KB + - 1 Kb + * - ``lpmsp430fr5739`` - - `MSP430FR5739 Experimenter Board `_ - - MSP430FR5739 ``msp430fr5739`` - - 16 MHz ``16000000L`` + - `FraunchPad w/ msp430fr5739 `_ + - MSP430FR5739 + - 16 MHz - 16 Kb - - 1 KB + - 1 Kb + * - ``lpmsp430fr5969`` - - `MSP430FR5969 LaunchPad `_ - - MSP430FR5969 ``msp430fr5969`` - - 16 MHz ``16000000L`` + - `LaunchPad w/ msp430fr5969 `_ + - MSP430FR5969 + - 8 MHz - 64 Kb - - 2 KB - - -More detailed information you can find here -`MSP430 LaunchPads `_. + - 1 Kb + * - ``lpmsp430g2231`` + - `LaunchPad w/ msp430g2231 (1 MHz) `_ + - MSP430G2231 + - 1 MHz + - 2 Kb + - 0.125 Kb + * - ``lpmsp430g2452`` + - `LaunchPad w/ msp430g2452 (16MHz) `_ + - MSP430G2452 + - 16 MHz + - 8 Kb + - 0.25 Kb + * - ``lpmsp430g2553`` + - `LaunchPad w/ msp430g2553 (16MHz) `_ + - MSP430G2553 + - 16 MHz + - 16 Kb + - 0.5 Kb diff --git a/docs/platforms/titiva.rst b/docs/platforms/titiva.rst index 208742d9..5d172bc2 100644 --- a/docs/platforms/titiva.rst +++ b/docs/platforms/titiva.rst @@ -2,12 +2,9 @@ Platform ``titiva`` =================== +Texas Instruments TM4C12x MCUs offer the industrys most popular ARM Cortex-M4 core with scalable memory and package options, unparalleled connectivity peripherals, advanced application functions, industry-leading analog integration, and extensive software solutions. -`Texas Instruments TM4C12x MCUs `_ -offer the industry’s most popular ARM® -Cortex®-M4 core with scalable memory and package options, unparalleled -connectivity peripherals, advanced application functions, industry-leading -analog integration, and extensive software solutions. +For more detailed information please visit `vendor site `_. .. contents:: @@ -18,83 +15,82 @@ Packages :header-rows: 1 * - Name - - Alias - Contents + + * - ``ldscripts`` + - `Linker Scripts `_ + + * - ``framework-libopencm3`` + - `libOpenCM3 Framework `_ + * - ``toolchain-gccarmnoneeabi`` - - toolchain - - `gcc-arm-embedded `_, - `GDB `_ + - `gcc-arm-embedded `_, `GDB `_ + * - ``tool-lm4flash`` - - uploader - `Flash Programmer `_ + * - ``framework-energiativa`` - - - - See below in :ref:`titiva_frameworks` - * - ``framework-opencm3`` - - - - See below in :ref:`titiva_frameworks` + - `Energia Wiring-based Framework (LM4F Core) `_ .. warning:: **Linux Users:** Don't forget to install "udev" rules file `99-platformio-udev.rules `_ (an instruction is located in the file). -.. _titiva_frameworks: Frameworks ---------- - .. list-table:: :header-rows: 1 - * - Type ``framework`` - - Name - - Reference - * - ``energia`` - - Energia Wiring-based Framework (LM4F Core) - - `Documentation `__ - * - ``opencm3`` - - libOpenCM3 Framework - - `Documentation `__ + * - Name + - Description + * - :ref:`framework_energia` + - Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before. + + * - :ref:`framework_libopencm3` + - The libOpenCM3 framework aims to create a free/libre/open-source firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others. Boards ------ .. note:: - * You can list pre-configured boards by :ref:`cmd_boards` command + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ * For more detailed ``board`` information please scroll tables below by horizontal. +TI +~~ + .. list-table:: :header-rows: 1 * - Type ``board`` - Name - - Microcontroller ``board_mcu`` - - Frequency ``board_f_cpu`` + - Microcontroller + - Frequency - Flash - RAM - * - ``lplm4f120h5qr`` - - `Stellaris LM4F120 LaunchPad `_ - - LM4F120H5QR ``cortex-m4`` - - 80 MHz ``80000000L`` - - 256 Kb - - 32 Kb - * - ``lptm4c1230c3pm`` - - `Tiva C Series TM4C123G LaunchPad - `_ - - TM4C123GH6PM ``cortex-m4`` - - 80 MHz ``80000000L`` - - 256 Kb - - 32 Kb - * - ``lptm4c1294ncpdt`` - - `Tiva C Series TM4C1294 Connected LaunchPad - `_ - - TM4C1294NCPDT ``cortex-m4`` - - 120 Mhz ``120000000L`` - - 1 Mb - - 256 Kb -More detailed information you can find here -`TIVA C Series LaunchPads `_. + * - ``lplm4f120h5qr`` + - `LaunchPad (Stellaris) w/ lm4f120 (80MHz) `_ + - LPLM4F120H5QR + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lptm4c1230c3pm`` + - `LaunchPad (Tiva C) w/ tm4c123 (80MHz) `_ + - LPTM4C1230C3PM + - 80 MHz + - 256 Kb + - 32 Kb + + * - ``lptm4c1294ncpdt`` + - `LaunchPad (Tiva C) w/ tm4c129 (120MHz) `_ + - LPTM4C1294NCPDT + - 120 MHz + - 1024 Kb + - 256 Kb diff --git a/docs/projectconf.rst b/docs/projectconf.rst index bf741fe4..de21b0a6 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -122,7 +122,7 @@ Options ``platform`` ^^^^^^^^^^^^ -:ref:`Platform ` type +:ref:`Platform ` type. .. _projectconf_env_framework: @@ -130,7 +130,9 @@ Options ``framework`` ^^^^^^^^^^^^^ -See ``framework`` type in *Frameworks* section of :ref:`platforms` +:ref:`Framework ` type. + +The multiple frameworks are allowed, split them with comma ``,`` separator. .. _projectconf_env_board: diff --git a/docs/userguide/cmd_boards.rst b/docs/userguide/cmd_boards.rst index d8188832..d5735999 100644 --- a/docs/userguide/cmd_boards.rst +++ b/docs/userguide/cmd_boards.rst @@ -45,7 +45,46 @@ Examples ... -2. Show boards which are based on ``ATmega168`` MCU +2. Show mbed-enabled boards + +.. code-block:: bash + + $ platformio boards mbed + + Platform: freescalekinetis + --------------------------------------------------------------------------- + Type MCU Frequency Flash RAM Name + --------------------------------------------------------------------------- + frdm_k20d50m mk20dx128vlh5 48Mhz 128Kb 16Kb Freescale Kinetis FRDM-K20D50M + frdm_k22f mk22fn512vlh12 120Mhz 512Kb 128Kb Freescale Kinetis FRDM-K22F + ... + + Platform: nordicnrf51 + --------------------------------------------------------------------------- + Type MCU Frequency Flash RAM Name + --------------------------------------------------------------------------- + wallBotBLE nrf51822 16Mhz 128Kb 16Kb JKSoft Wallbot BLE + nrf51_dk nrf51822 32Mhz 256Kb 32Kb Nordic nRF51-DK + ... + + Platform: nxplpc + --------------------------------------------------------------------------- + Type MCU Frequency Flash RAM Name + --------------------------------------------------------------------------- + blueboard_lpc11u24 lpc11u24 48Mhz 32Kb 8Kb BlueBoard-LPC11U24 + dipcortexm0 lpc11u24 50Mhz 32Kb 8Kb DipCortex M0 + lpc11u35 lpc11u35 48Mhz 64Kb 10Kb EA LPC11U35 QuickStart Board + ... + + Platform: ststm32 + --------------------------------------------------------------------------- + Type MCU Frequency Flash RAM Name + --------------------------------------------------------------------------- + disco_f401vc stm32f401vct6 84Mhz 256Kb 64Kb 32F401CDISCOVERY + nucleo_f030r8 stm32f030r8t6 48Mhz 64Kb 8Kb ST Nucleo F030R8 + ... + +3. Show boards which are based on ``ATmega168`` MCU .. code-block:: bash @@ -66,7 +105,7 @@ Examples 168pa16m atmega168p 16Mhz 15Kb 1Kb Microduino Core (Atmega168PA@16M,5V) 168pa8m atmega168p 8Mhz 15Kb 1Kb Microduino Core (Atmega168PA@8M,3.3V) -3. Show boards by :ref:`platform_timsp430` +4. Show boards by :ref:`platform_timsp430` .. code-block:: bash diff --git a/docs/userguide/cmd_search.rst b/docs/userguide/cmd_search.rst index c6b9e743..304c7fc6 100644 --- a/docs/userguide/cmd_search.rst +++ b/docs/userguide/cmd_search.rst @@ -35,27 +35,72 @@ Examples .. code-block:: bash $ platformio search - atmelavr - An embedded platform for Atmel AVR microcontrollers (with Arduino Framework) - atmelsam - An embedded platform for Atmel SAM microcontrollers (with Arduino Framework) - stm32 - An embedded platform for STMicroelectronics ARM microcontrollers - teensy - An embedded platform for Teensy boards (with Arduino Framework) - timsp430 - An embedded platform for TI MSP430 microcontrollers (with Energia Framework) - titiva - An embedded platform for TI TIVA C ARM microcontrollers (with Energia and OpenCM3 Frameworks) - ... + atmelavr (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + -------- + Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance... + + atmelsam (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + -------- + Atmel | SMART offers Flash- based ARM products based on the ... + + freescalekinetis (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ---------------- + Freescale Kinetis Microcontrollers is family of multiple hardware- and ... + + nordicnrf51 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ----------- + The Nordic nRF51 Series is a family of highly flexible, multi-protocol ... + + nxplpc (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------ + The NXP LPC is a family of 32-bit microcontroller integrated circuits ... + + ststm32 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------- + The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M ... + + teensy (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------ + Teensy is a complete USB-based microcontroller development syste ... + + timsp430 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + -------- + MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are ... + + titiva (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------ + Texas Instruments TM4C12x MCUs offer the industrys most popular ... 2. Search for TI development platforms .. code-block:: bash $ platformio search ti - timsp430 - An embedded platform for TI MSP430 microcontrollers (with Energia Framework) - titiva - An embedded platform for TI TIVA C ARM microcontrollers (with Energia Framework) + timsp430 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + -------- + MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are ... -3. Search for development platforms which support "Arduino Framework" + titiva (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------ + Texas Instruments TM4C12x MCUs offer the industrys most popular ... + +3. Search for development platforms which support "mbed Framework" .. code-block:: bash - $ platformio search arduino - atmelavr - An embedded platform for Atmel AVR microcontrollers (with Arduino Framework) - atmelsam - An embedded platform for Atmel SAM microcontrollers (with Arduino Framework) - teensy - An embedded platform for Teensy boards (with Arduino Framework) + $ platformio search mbed + freescalekinetis (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ---------------- + Freescale Kinetis Microcontrollers is family of multiple hardware- and ... + + nordicnrf51 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ----------- + The Nordic nRF51 Series is a family of highly flexible, multi-protocol ... + + nxplpc (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------ + The NXP LPC is a family of 32-bit microcontroller integrated circuits ... + + ststm32 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa) + ------- + The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M ... diff --git a/docs/userguide/cmd_settings.rst b/docs/userguide/cmd_settings.rst index 4fe14304..d1355dcf 100644 --- a/docs/userguide/cmd_settings.rst +++ b/docs/userguide/cmd_settings.rst @@ -23,45 +23,63 @@ Description Get/List existing settings -Options -~~~~~~~ +Settings +~~~~~~~~ -.. option:: auto_update_libraries +.. _setting_auto_update_libraries: + +``auto_update_libraries`` +^^^^^^^^^^^^^^^^^^^^^^^^^ :Default: Yes :Values: Yes/No Automatically update libraries. -.. option:: auto_update_platforms +.. _setting_auto_update_platforms: + +``auto_update_platforms`` +^^^^^^^^^^^^^^^^^^^^^^^^^ :Default: Yes :Values: Yes/No Automatically update platforms. -.. option:: check_libraries_interval +.. _setting_check_libraries_interval: + +``check_libraries_interval`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :Default: 7 :Values: Days (Number) Check for the library updates interval. -.. option:: check_platformio_interval +.. _setting_check_platformio_interval: + +``check_platformio_interval`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :Default: 3 :Values: Days (Number) Check for the new PlatformIO interval. -.. option:: check_platforms_interval +.. _setting_check_platforms_interval: + +``check_platforms_interval`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :Default: 7 :Values: Days (Number) Check for the platform updates interval. -.. option:: enable_prompts +.. _setting_enable_prompts: + +``enable_prompts`` +^^^^^^^^^^^^^^^^^^ :Default: Yes :Values: Yes/No @@ -76,7 +94,10 @@ Can PlatformIO communicate with you via prompts? If you are going to run *PlatformIO* from **subprocess**, you **MUST DISABLE** all prompts. It will allow you to avoid blocking. -.. option:: enable_telemetry +.. _setting_enable_telemetry: + +``enable_telemetry`` +^^^^^^^^^^^^^^^^^^^^ :Default: Yes :Values: Yes/No diff --git a/examples/atmelavr-and-arduino/adafruit-blink/README.rst b/examples/atmelavr-and-arduino/adafruit-blink/README.rst index 290761d5..ffccc76e 100644 --- a/examples/atmelavr-and-arduino/adafruit-blink/README.rst +++ b/examples/atmelavr-and-arduino/adafruit-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/README.rst b/examples/atmelavr-and-arduino/arduino-external-libs/README.rst index 675b2129..634386f8 100644 --- a/examples/atmelavr-and-arduino/arduino-external-libs/README.rst +++ b/examples/atmelavr-and-arduino/arduino-external-libs/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst b/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst index cb17077d..f510bf29 100644 --- a/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst +++ b/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst b/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst index 02a88a40..8c5469cf 100644 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst +++ b/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst b/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst index 14bfc2de..4edae991 100644 --- a/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst +++ b/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/README.rst b/examples/atmelavr-and-arduino/digitstump-mouse/README.rst index f01bea45..0a7076bc 100644 --- a/examples/atmelavr-and-arduino/digitstump-mouse/README.rst +++ b/examples/atmelavr-and-arduino/digitstump-mouse/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst b/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst index 4aed8102..71ef0514 100644 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst +++ b/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/atmelavr-and-arduino/panstamp-blink/README.rst b/examples/atmelavr-and-arduino/panstamp-blink/README.rst new file mode 100644 index 00000000..eb66f295 --- /dev/null +++ b/examples/atmelavr-and-arduino/panstamp-blink/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/atmelavr-and-arduino/panstamp-blink + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini b/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini new file mode 100644 index 00000000..fa51205f --- /dev/null +++ b/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini @@ -0,0 +1,23 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + +[env:panStampAVR] +platform = atmelavr +framework = arduino +board = panStampAVR diff --git a/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino b/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino new file mode 100644 index 00000000..b0db92b8 --- /dev/null +++ b/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino @@ -0,0 +1,29 @@ +/* + Blink + Turns on an LED on for one second, then off for one second, repeatedly. + + Most Arduinos have an on-board LED you can control. On the Uno and + Leonardo, it is attached to digital pin 13. If you're unsure what + pin the on-board LED is connected to on your Arduino model, check + the documentation at http://arduino.cc + + This example code is in the public domain. + + modified 8 May 2014 + by Scott Fitzgerald + */ + + +// the setup function runs once when you press reset or power the board +void setup() { + // initialize digital pin 13 as an output. + pinMode(13, OUTPUT); +} + +// the loop function runs over and over again forever +void loop() { + digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) + delay(1000); // wait for a second + digitalWrite(13, LOW); // turn the LED off by making the voltage LOW + delay(1000); // wait for a second +} diff --git a/examples/mbed/mbed-blink/README.rst b/examples/mbed/mbed-blink/README.rst new file mode 100644 index 00000000..cc6c6377 --- /dev/null +++ b/examples/mbed/mbed-blink/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/mbed/mbed-blink + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/mbed/mbed-blink/platformio.ini b/examples/mbed/mbed-blink/platformio.ini new file mode 100644 index 00000000..f1f25ccb --- /dev/null +++ b/examples/mbed/mbed-blink/platformio.ini @@ -0,0 +1,43 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + + +# NXP LPC Platform +[env:lpc1768] +platform = nxplpc +framework = mbed +board = lpc1768 + +# Nordic nRF51 Platform +[env:nrf51_mkit] +platform = nordicnrf51 +framework = mbed +board = nrf51_mkit + +# Freescale FRDM Platform +[env:frdm_kl25z] +platform = freescalekinetis +framework = mbed +board = frdm_kl25z + +# ST STM32 Platform +[env:nucleo_f401re] +platform = ststm32 +framework = mbed +board = nucleo_f401re diff --git a/examples/mbed/mbed-blink/src/main.cpp b/examples/mbed/mbed-blink/src/main.cpp new file mode 100644 index 00000000..8247a2e9 --- /dev/null +++ b/examples/mbed/mbed-blink/src/main.cpp @@ -0,0 +1,12 @@ +#include "mbed.h" + +DigitalOut myled(LED1); + +int main() { + while(1) { + myled = 1; + wait(1); + myled = 0; + wait(1); + } +} \ No newline at end of file diff --git a/examples/mbed/mbed-dsp/README.rst b/examples/mbed/mbed-dsp/README.rst new file mode 100644 index 00000000..557272de --- /dev/null +++ b/examples/mbed/mbed-dsp/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/mbed/mbed-dsp + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/mbed/mbed-dsp/platformio.ini b/examples/mbed/mbed-dsp/platformio.ini new file mode 100644 index 00000000..f1f25ccb --- /dev/null +++ b/examples/mbed/mbed-dsp/platformio.ini @@ -0,0 +1,43 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + + +# NXP LPC Platform +[env:lpc1768] +platform = nxplpc +framework = mbed +board = lpc1768 + +# Nordic nRF51 Platform +[env:nrf51_mkit] +platform = nordicnrf51 +framework = mbed +board = nrf51_mkit + +# Freescale FRDM Platform +[env:frdm_kl25z] +platform = freescalekinetis +framework = mbed +board = frdm_kl25z + +# ST STM32 Platform +[env:nucleo_f401re] +platform = ststm32 +framework = mbed +board = nucleo_f401re diff --git a/examples/mbed/mbed-dsp/src/data.cpp b/examples/mbed/mbed-dsp/src/data.cpp new file mode 100644 index 00000000..d946b36b --- /dev/null +++ b/examples/mbed/mbed-dsp/src/data.cpp @@ -0,0 +1,94 @@ +#include "arm_math.h" + +/* ---------------------------------------------------------------------- +** Test input signal contains 1000Hz + 15000 Hz +** ------------------------------------------------------------------- */ + +float32_t testInput_f32_1kHz_15kHz[320] = +{ ++0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, +-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, ++0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, ++0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, ++0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, ++0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, +-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, +-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, ++0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, ++0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, +-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, ++0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, +-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, +-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, ++0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, ++0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, ++0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, +}; + +float32_t refOutput[320] = +{ ++0.0000000000f, -0.0010797829f, -0.0007681386f, -0.0001982932f, +0.0000644313f, +0.0020854271f, +0.0036891871f, +0.0015855941f, +-0.0026280805f, -0.0075907658f, -0.0119390538f, -0.0086665968f, +0.0088981202f, +0.0430539279f, +0.0974468742f, +0.1740405600f, ++0.2681416601f, +0.3747720089f, +0.4893362230f, +0.6024154672f, +0.7058740791f, +0.7968348987f, +0.8715901940f, +0.9277881093f, ++0.9682182661f, +0.9934674267f, +1.0012052245f, +0.9925859371f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, -0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, ++0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, +-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, +-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, +-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, ++0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, ++0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f +}; + diff --git a/examples/mbed/mbed-dsp/src/main.cpp b/examples/mbed/mbed-dsp/src/main.cpp new file mode 100644 index 00000000..f6bdb4b7 --- /dev/null +++ b/examples/mbed/mbed-dsp/src/main.cpp @@ -0,0 +1,65 @@ +#include "arm_math.h" +#include "math_helper.h" +#include + +#define BLOCK_SIZE 32 +#define NUM_BLOCKS 10 + +#define TEST_LENGTH_SAMPLES (BLOCK_SIZE * NUM_BLOCKS) + +#define SNR_THRESHOLD_F32 140.0f +#define NUM_TAPS 29 + +/* ------------------------------------------------------------------- + * The input signal and reference output (computed with MATLAB) + * are defined externally in arm_fir_lpf_data.c. + * ------------------------------------------------------------------- */ +extern float32_t testInput_f32_1kHz_15kHz[TEST_LENGTH_SAMPLES]; +extern float32_t refOutput[TEST_LENGTH_SAMPLES]; + +/* ------------------------------------------------------------------- + * Declare State buffer of size (numTaps + blockSize - 1) + * ------------------------------------------------------------------- */ +static float32_t firStateF32[BLOCK_SIZE + NUM_TAPS - 1]; + +/* ---------------------------------------------------------------------- + * FIR Coefficients buffer generated using fir1() MATLAB function. + * fir1(28, 6/24) + * ------------------------------------------------------------------- */ +const float32_t firCoeffs32[NUM_TAPS] = { + -0.0018225230f, -0.0015879294f, +0.0000000000f, +0.0036977508f, +0.0080754303f, + +0.0085302217f, -0.0000000000f, -0.0173976984f, -0.0341458607f, -0.0333591565f, + +0.0000000000f, +0.0676308395f, +0.1522061835f, +0.2229246956f, +0.2504960933f, + +0.2229246956f, +0.1522061835f, +0.0676308395f, +0.0000000000f, -0.0333591565f, + -0.0341458607f, -0.0173976984f, -0.0000000000f, +0.0085302217f, +0.0080754303f, + +0.0036977508f, +0.0000000000f, -0.0015879294f, -0.0018225230f +}; + +/* ---------------------------------------------------------------------- + * FIR LPF Example + * ------------------------------------------------------------------- */ +int main(void) { + /* Call FIR init function to initialize the instance structure. */ + arm_fir_instance_f32 S; + arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], BLOCK_SIZE); + + /* ---------------------------------------------------------------------- + * Call the FIR process function for every blockSize samples + * ------------------------------------------------------------------- */ + for (uint32_t i=0; i < NUM_BLOCKS; i++) { + float32_t* signal = testInput_f32_1kHz_15kHz + (i * BLOCK_SIZE); + arm_fir_f32(&S, signal, signal, BLOCK_SIZE); + } + + /* ---------------------------------------------------------------------- + * Compare the generated output against the reference output computed + * in MATLAB. + * ------------------------------------------------------------------- */ + float32_t snr = arm_snr_f32(refOutput, testInput_f32_1kHz_15kHz, TEST_LENGTH_SAMPLES); + printf("snr: %f\n\r", snr); + if (snr < SNR_THRESHOLD_F32) { + printf("Failed\n\r"); + } else { + printf("Success\n\r"); + } +} diff --git a/examples/mbed/mbed-http-client/README.rst b/examples/mbed/mbed-http-client/README.rst new file mode 100644 index 00000000..c7f23685 --- /dev/null +++ b/examples/mbed/mbed-http-client/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/mbed/mbed-http-client + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp new file mode 100644 index 00000000..0a6abd31 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp @@ -0,0 +1,739 @@ +/* HTTPClient.cpp */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +//Debug is disabled by default +#if 0 +//Enable debug +#include +#define DBG(x, ...) std::printf("[HTTPClient : DBG]"x"\r\n", ##__VA_ARGS__); +#define WARN(x, ...) std::printf("[HTTPClient : WARN]"x"\r\n", ##__VA_ARGS__); +#define ERR(x, ...) std::printf("[HTTPClient : ERR]"x"\r\n", ##__VA_ARGS__); + +#else +//Disable debug +#define DBG(x, ...) +#define WARN(x, ...) +#define ERR(x, ...) + +#endif + +#define HTTP_PORT 80 + +#define OK 0 + +#define MIN(x,y) (((x)<(y))?(x):(y)) +#define MAX(x,y) (((x)>(y))?(x):(y)) + +#define CHUNK_SIZE 256 + +#include + +#include "HTTPClient.h" + +HTTPClient::HTTPClient() : +m_sock(), m_basicAuthUser(NULL), m_basicAuthPassword(NULL), m_httpResponseCode(0) +{ + +} + +HTTPClient::~HTTPClient() +{ + +} + +#if 0 +void HTTPClient::basicAuth(const char* user, const char* password) //Basic Authentification +{ + m_basicAuthUser = user; + m_basicAuthPassword = password; +} +#endif + +HTTPResult HTTPClient::get(const char* url, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking +{ + return connect(url, HTTP_GET, NULL, pDataIn, timeout); +} + +HTTPResult HTTPClient::get(const char* url, char* result, size_t maxResultLen, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking +{ + HTTPText str(result, maxResultLen); + return get(url, &str, timeout); +} + +HTTPResult HTTPClient::post(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking +{ + return connect(url, HTTP_POST, (IHTTPDataOut*)&dataOut, pDataIn, timeout); +} + +HTTPResult HTTPClient::put(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking +{ + return connect(url, HTTP_PUT, (IHTTPDataOut*)&dataOut, pDataIn, timeout); +} + +HTTPResult HTTPClient::del(const char* url, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking +{ + return connect(url, HTTP_DELETE, NULL, pDataIn, timeout); +} + + +int HTTPClient::getHTTPResponseCode() +{ + return m_httpResponseCode; +} + +#define CHECK_CONN_ERR(ret) \ + do{ \ + if(ret) { \ + m_sock.close(); \ + ERR("Connection error (%d)", ret); \ + return HTTP_CONN; \ + } \ + } while(0) + +#define PRTCL_ERR() \ + do{ \ + m_sock.close(); \ + ERR("Protocol error"); \ + return HTTP_PRTCL; \ + } while(0) + +HTTPResult HTTPClient::connect(const char* url, HTTP_METH method, IHTTPDataOut* pDataOut, IHTTPDataIn* pDataIn, int timeout) //Execute request +{ + m_httpResponseCode = 0; //Invalidate code + m_timeout = timeout; + + pDataIn->writeReset(); + if( pDataOut ) + { + pDataOut->readReset(); + } + + char scheme[8]; + uint16_t port; + char host[32]; + char path[64]; + //First we need to parse the url (http[s]://host[:port][/[path]]) -- HTTPS not supported (yet?) + HTTPResult res = parseURL(url, scheme, sizeof(scheme), host, sizeof(host), &port, path, sizeof(path)); + if(res != HTTP_OK) + { + ERR("parseURL returned %d", res); + return res; + } + + if(port == 0) //TODO do handle HTTPS->443 + { + port = 80; + } + + DBG("Scheme: %s", scheme); + DBG("Host: %s", host); + DBG("Port: %d", port); + DBG("Path: %s", path); + + //Connect + DBG("Connecting socket to server"); + int ret = m_sock.connect(host, port); + if (ret < 0) + { + m_sock.close(); + ERR("Could not connect"); + return HTTP_CONN; + } + + //Send request + DBG("Sending request"); + char buf[CHUNK_SIZE]; + const char* meth = (method==HTTP_GET)?"GET":(method==HTTP_POST)?"POST":(method==HTTP_PUT)?"PUT":(method==HTTP_DELETE)?"DELETE":""; + snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\nHost: %s\r\n", meth, path, host); //Write request + ret = send(buf); + if(ret) + { + m_sock.close(); + ERR("Could not write request"); + return HTTP_CONN; + } + + //Send all headers + + //Send default headers + DBG("Sending headers"); + if( pDataOut != NULL ) + { + if( pDataOut->getIsChunked() ) + { + ret = send("Transfer-Encoding: chunked\r\n"); + CHECK_CONN_ERR(ret); + } + else + { + snprintf(buf, sizeof(buf), "Content-Length: %d\r\n", pDataOut->getDataLen()); + ret = send(buf); + CHECK_CONN_ERR(ret); + } + char type[48]; + if( pDataOut->getDataType(type, 48) == HTTP_OK ) + { + snprintf(buf, sizeof(buf), "Content-Type: %s\r\n", type); + ret = send(buf); + CHECK_CONN_ERR(ret); + } + + //Send specific headers + while( pDataOut->getHeader(buf, sizeof(buf) - 3) ) //must have space left for CRLF + 0 terminating char + { + size_t headerlen = strlen(buf); + snprintf(buf + headerlen, sizeof(buf) - headerlen, "\r\n"); + ret = send(buf); + CHECK_CONN_ERR(ret); + } + } + + //Send specific headers + while( pDataIn->getHeader(buf, sizeof(buf) - 3) ) + { + size_t headerlen = strlen(buf); + snprintf(buf + headerlen, sizeof(buf) - headerlen, "\r\n"); + ret = send(buf); + CHECK_CONN_ERR(ret); + } + + //Close headers + DBG("Headers sent"); + ret = send("\r\n"); + CHECK_CONN_ERR(ret); + + size_t trfLen; + + //Send data (if available) + if( pDataOut != NULL ) + { + DBG("Sending data"); + while(true) + { + size_t writtenLen = 0; + pDataOut->read(buf, CHUNK_SIZE, &trfLen); + if( pDataOut->getIsChunked() ) + { + //Write chunk header + char chunkHeader[16]; + snprintf(chunkHeader, sizeof(chunkHeader), "%X\r\n", trfLen); //In hex encoding + ret = send(chunkHeader); + CHECK_CONN_ERR(ret); + } + else if( trfLen == 0 ) + { + break; + } + if( trfLen != 0 ) + { + ret = send(buf, trfLen); + CHECK_CONN_ERR(ret); + } + + if( pDataOut->getIsChunked() ) + { + ret = send("\r\n"); //Chunk-terminating CRLF + CHECK_CONN_ERR(ret); + } + else + { + writtenLen += trfLen; + if( writtenLen >= pDataOut->getDataLen() ) + { + break; + } + } + + if( trfLen == 0 ) + { + break; + } + } + } + + //Receive response + DBG("Receiving response"); + ret = recv(buf, 1, CHUNK_SIZE - 1, &trfLen); //Read n bytes + CHECK_CONN_ERR(ret); + + buf[trfLen] = '\0'; + + //Make sure we got the first response line + char* crlfPtr = NULL; + while( true ) + { + crlfPtr = strstr(buf, "\r\n"); + if(crlfPtr == NULL) + { + if( trfLen < CHUNK_SIZE - 1 ) + { + size_t newTrfLen; + ret = recv(buf + trfLen, 1, CHUNK_SIZE - trfLen - 1, &newTrfLen); + trfLen += newTrfLen; + buf[trfLen] = '\0'; + DBG("Read %d chars; In buf: [%s]", newTrfLen, buf); + CHECK_CONN_ERR(ret); + continue; + } + else + { + PRTCL_ERR(); + } + } + break; + } + + int crlfPos = crlfPtr - buf; + buf[crlfPos] = '\0'; + + //Parse HTTP response + //if( sscanf(buf, "HTTP/%*d.%*d %d %*[^\r\n]", &m_httpResponseCode) != 1 ) + if(crlfPos > 13) + { + buf[13] = '\0'; + } + if( sscanf(buf, "HTTP/%*d.%*d %d", &m_httpResponseCode) != 1 ) //Kludge for newlib nano + { + //Cannot match string, error + ERR("Not a correct HTTP answer : %s\n", buf); + PRTCL_ERR(); + } + + if( (m_httpResponseCode < 200) || (m_httpResponseCode >= 300) ) + { + //Did not return a 2xx code; TODO fetch headers/(&data?) anyway and implement a mean of writing/reading headers + WARN("Response code %d", m_httpResponseCode); + PRTCL_ERR(); + } + + DBG("Reading headers"); + + memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2) + 1); //Be sure to move NULL-terminating char as well + trfLen -= (crlfPos + 2); + + size_t recvContentLength = 0; + bool recvChunked = false; + bool recvLengthUnknown = true; + //Now get headers + while( true ) + { + crlfPtr = strstr(buf, "\r\n"); + if(crlfPtr == NULL) + { + if( trfLen < CHUNK_SIZE - 1 ) + { + size_t newTrfLen; + ret = recv(buf + trfLen, 1, CHUNK_SIZE - trfLen - 1, &newTrfLen); + trfLen += newTrfLen; + buf[trfLen] = '\0'; + DBG("Read %d chars; In buf: [%s]", newTrfLen, buf); + CHECK_CONN_ERR(ret); + continue; + } + else + { + PRTCL_ERR(); + } + } + + crlfPos = crlfPtr - buf; + + if(crlfPos == 0) //End of headers + { + DBG("Headers read"); + memmove(buf, &buf[2], trfLen - 2 + 1); //Be sure to move NULL-terminating char as well + trfLen -= 2; + break; + } + + buf[crlfPos] = '\0'; + + char key[32]; + char value[32]; + + //key[31] = '\0'; + //value[31] = '\0'; + + memset(key, 0, 32); + memset(value, 0, 32); + + //int n = sscanf(buf, "%31[^:]: %31[^\r\n]", key, value); + + int n = 0; + + char* keyEnd = strchr(buf, ':'); + if(keyEnd != NULL) + { + *keyEnd = '\0'; + if(strlen(buf) < 32) + { + strcpy(key, buf); + n++; + char* valueStart = keyEnd + 2; + if( (valueStart - buf) < crlfPos ) + { + if(strlen(valueStart) < 32) + { + strcpy(value, valueStart); + n++; + } + } + } + } + if ( n == 2 ) + { + DBG("Read header : %s: %s\n", key, value); + if( !strcmp(key, "Content-Length") ) + { + sscanf(value, "%d", &recvContentLength); + recvLengthUnknown = false; + pDataIn->setDataLen(recvContentLength); + } + else if( !strcmp(key, "Transfer-Encoding") ) + { + if( !strcmp(value, "Chunked") || !strcmp(value, "chunked") ) + { + recvChunked = true; + recvLengthUnknown = false; + pDataIn->setIsChunked(true); + } + } + else if( !strcmp(key, "Content-Type") ) + { + pDataIn->setDataType(value); + } + + memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2) + 1); //Be sure to move NULL-terminating char as well + trfLen -= (crlfPos + 2); + + } + else + { + ERR("Could not parse header"); + PRTCL_ERR(); + } + + } + + //Receive data + DBG("Receiving data"); + while(true) + { + size_t readLen = 0; + + if( recvChunked ) + { + //Read chunk header + bool foundCrlf; + do + { + foundCrlf = false; + crlfPos=0; + buf[trfLen]=0; + if(trfLen >= 2) + { + for(; crlfPos < trfLen - 2; crlfPos++) + { + if( buf[crlfPos] == '\r' && buf[crlfPos + 1] == '\n' ) + { + foundCrlf = true; + break; + } + } + } + if(!foundCrlf) //Try to read more + { + if( trfLen < CHUNK_SIZE ) + { + size_t newTrfLen; + ret = recv(buf + trfLen, 0, CHUNK_SIZE - trfLen - 1, &newTrfLen); + trfLen += newTrfLen; + CHECK_CONN_ERR(ret); + continue; + } + else + { + PRTCL_ERR(); + } + } + } while(!foundCrlf); + buf[crlfPos] = '\0'; + int n = sscanf(buf, "%x", &readLen); + if(n!=1) + { + ERR("Could not read chunk length"); + PRTCL_ERR(); + } + + memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2)); //Not need to move NULL-terminating char any more + trfLen -= (crlfPos + 2); + + if( readLen == 0 ) + { + //Last chunk + break; + } + } + else + { + readLen = recvContentLength; + } + + DBG("Retrieving %d bytes (%d bytes in buffer)", readLen, trfLen); + + do + { + if(recvLengthUnknown ) + { + readLen = trfLen; + } + pDataIn->write(buf, MIN(trfLen, readLen)); + if(!recvLengthUnknown) + { + if( trfLen > readLen ) + { + memmove(buf, &buf[readLen], trfLen - readLen); + trfLen -= readLen; + readLen = 0; + } + else + { + readLen -= trfLen; + } + } + else + { + trfLen = 0; + } + + if(readLen || recvLengthUnknown) + { + ret = recv(buf, 1, CHUNK_SIZE - trfLen - 1, &trfLen); + if(recvLengthUnknown && (ret == HTTP_CLOSED)) + { + //Write and exit + pDataIn->write(buf, trfLen); + break; + } + CHECK_CONN_ERR(ret); + if(recvLengthUnknown && (trfLen == 0)) + { + break; + } + } + } while(readLen || recvLengthUnknown); + + if( recvChunked ) + { + if(trfLen < 2) + { + size_t newTrfLen; + //Read missing chars to find end of chunk + ret = recv(buf + trfLen, 2 - trfLen, CHUNK_SIZE - trfLen - 1, &newTrfLen); + CHECK_CONN_ERR(ret); + trfLen += newTrfLen; + } + if( (buf[0] != '\r') || (buf[1] != '\n') ) + { + ERR("Format error"); + PRTCL_ERR(); + } + memmove(buf, &buf[2], trfLen - 2); + trfLen -= 2; + } + else + { + break; + } + + } + + m_sock.close(); + DBG("Completed HTTP transaction"); + + return HTTP_OK; +} + +HTTPResult HTTPClient::recv(char* buf, size_t minLen, size_t maxLen, size_t* pReadLen) //0 on success, err code on failure +{ + DBG("Trying to read between %d and %d bytes", minLen, maxLen); + size_t readLen = 0; + + if(!m_sock.is_connected()) + { + WARN("Connection was closed by server"); + return HTTP_CLOSED; //Connection was closed by server + } + + int ret; + while(readLen < maxLen) + { + if(readLen < minLen) + { + DBG("Trying to read at most %d bytes [Blocking]", minLen - readLen); + m_sock.set_blocking(false, m_timeout); + ret = m_sock.receive_all(buf + readLen, minLen - readLen); + } + else + { + DBG("Trying to read at most %d bytes [Not blocking]", maxLen - readLen); + m_sock.set_blocking(false, 0); + ret = m_sock.receive(buf + readLen, maxLen - readLen); + } + + if( ret > 0) + { + readLen += ret; + } + else if( ret == 0 ) + { + break; + } + else + { + if(!m_sock.is_connected()) + { + ERR("Connection error (recv returned %d)", ret); + *pReadLen = readLen; + return HTTP_CONN; + } + else + { + break; + } + } + + if(!m_sock.is_connected()) + { + break; + } + } + DBG("Read %d bytes", readLen); + *pReadLen = readLen; + return HTTP_OK; +} + +HTTPResult HTTPClient::send(char* buf, size_t len) //0 on success, err code on failure +{ + if(len == 0) + { + len = strlen(buf); + } + DBG("Trying to write %d bytes", len); + size_t writtenLen = 0; + + if(!m_sock.is_connected()) + { + WARN("Connection was closed by server"); + return HTTP_CLOSED; //Connection was closed by server + } + + m_sock.set_blocking(false, m_timeout); + int ret = m_sock.send_all(buf, len); + if(ret > 0) + { + writtenLen += ret; + } + else if( ret == 0 ) + { + WARN("Connection was closed by server"); + return HTTP_CLOSED; //Connection was closed by server + } + else + { + ERR("Connection error (send returned %d)", ret); + return HTTP_CONN; + } + + DBG("Written %d bytes", writtenLen); + return HTTP_OK; +} + +HTTPResult HTTPClient::parseURL(const char* url, char* scheme, size_t maxSchemeLen, char* host, size_t maxHostLen, uint16_t* port, char* path, size_t maxPathLen) //Parse URL +{ + char* schemePtr = (char*) url; + char* hostPtr = (char*) strstr(url, "://"); + if(hostPtr == NULL) + { + WARN("Could not find host"); + return HTTP_PARSE; //URL is invalid + } + + if( maxSchemeLen < hostPtr - schemePtr + 1 ) //including NULL-terminating char + { + WARN("Scheme str is too small (%d >= %d)", maxSchemeLen, hostPtr - schemePtr + 1); + return HTTP_PARSE; + } + memcpy(scheme, schemePtr, hostPtr - schemePtr); + scheme[hostPtr - schemePtr] = '\0'; + + hostPtr+=3; + + size_t hostLen = 0; + + char* portPtr = strchr(hostPtr, ':'); + if( portPtr != NULL ) + { + hostLen = portPtr - hostPtr; + portPtr++; + if( sscanf(portPtr, "%hu", port) != 1) + { + WARN("Could not find port"); + return HTTP_PARSE; + } + } + else + { + *port=0; + } + char* pathPtr = strchr(hostPtr, '/'); + if( hostLen == 0 ) + { + hostLen = pathPtr - hostPtr; + } + + if( maxHostLen < hostLen + 1 ) //including NULL-terminating char + { + WARN("Host str is too small (%d >= %d)", maxHostLen, hostLen + 1); + return HTTP_PARSE; + } + memcpy(host, hostPtr, hostLen); + host[hostLen] = '\0'; + + size_t pathLen; + char* fragmentPtr = strchr(hostPtr, '#'); + if(fragmentPtr != NULL) + { + pathLen = fragmentPtr - pathPtr; + } + else + { + pathLen = strlen(pathPtr); + } + + if( maxPathLen < pathLen + 1 ) //including NULL-terminating char + { + WARN("Path str is too small (%d >= %d)", maxPathLen, pathLen + 1); + return HTTP_PARSE; + } + memcpy(path, pathPtr, pathLen); + path[pathLen] = '\0'; + + return HTTP_OK; +} diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h new file mode 100644 index 00000000..25301c36 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h @@ -0,0 +1,159 @@ +/* HTTPClient.h */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** \file +HTTP Client header file +*/ + +#ifndef HTTP_CLIENT_H +#define HTTP_CLIENT_H + +#include "TCPSocketConnection.h" + +#define HTTP_CLIENT_DEFAULT_TIMEOUT 15000 + +class HTTPData; + +#include "IHTTPData.h" +#include "mbed.h" + +///HTTP client results +enum HTTPResult +{ + HTTP_PROCESSING, /// + +using std::size_t; + +class IHTTPData +{ + protected: + /** Get a specific header + * + */ + virtual bool getHeader(char* header, size_t maxHeaderLen) { return false; } +}; + +///This is a simple interface for HTTP data storage (impl examples are Key/Value Pairs, File, etc...) +class IHTTPDataOut : public IHTTPData +{ +protected: + friend class HTTPClient; + + /** Reset stream to its beginning + * Called by the HTTPClient on each new request + */ + virtual void readReset() = 0; + + /** Read a piece of data to be transmitted + * @param buf Pointer to the buffer on which to copy the data + * @param len Length of the buffer + * @param pReadLen Pointer to the variable on which the actual copied data length will be stored + */ + virtual int read(char* buf, size_t len, size_t* pReadLen) = 0; + + /** Get MIME type + * @param type Internet media type from Content-Type header + */ + virtual int getDataType(char* type, size_t maxTypeLen) = 0; //Internet media type for Content-Type header + + /** Determine whether the HTTP client should chunk the data + * Used for Transfer-Encoding header + */ + virtual bool getIsChunked() = 0; + + /** If the data is not chunked, get its size + * Used for Content-Length header + */ + virtual size_t getDataLen() = 0; + +}; + +///This is a simple interface for HTTP data storage (impl examples are Key/Value Pairs, File, etc...) +class IHTTPDataIn : public IHTTPData +{ +protected: + friend class HTTPClient; + + /** Reset stream to its beginning + * Called by the HTTPClient on each new request + */ + virtual void writeReset() = 0; + + /** Write a piece of data transmitted by the server + * @param buf Pointer to the buffer from which to copy the data + * @param len Length of the buffer + */ + virtual int write(const char* buf, size_t len) = 0; + + /** Set MIME type + * @param type Internet media type from Content-Type header + */ + virtual void setDataType(const char* type) = 0; + + /** Determine whether the data is chunked + * Recovered from Transfer-Encoding header + */ + virtual void setIsChunked(bool chunked) = 0; + + /** If the data is not chunked, set its size + * From Content-Length header + */ + virtual void setDataLen(size_t len) = 0; + +}; + +#endif diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp new file mode 100644 index 00000000..5eb4c52e --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp @@ -0,0 +1,200 @@ +/* HTTPMap.cpp */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "HTTPMap.h" + +#include + +#include + +#define OK 0 + +using std::strncpy; + +HTTPMap::HTTPMap() : m_pos(0), m_count(0) +{ + +} + +void HTTPMap::put(const char* key, const char* value) +{ + if(m_count >= HTTPMAP_TABLE_SIZE) + { + return; + } + m_keys[m_count] = key; + m_values[m_count] = value; + m_count++; +} + +void HTTPMap::clear() +{ + m_count = 0; + m_pos = 0; +} + +/*virtual*/ void HTTPMap::readReset() +{ + m_pos = 0; +} + +/*virtual*/ int HTTPMap::read(char* buf, size_t len, size_t* pReadLen) +{ + if(m_pos >= m_count) + { + *pReadLen = 0; + m_pos = 0; + return OK; + } + + //URL encode + char* out = buf; + const char* in = m_keys[m_pos]; + if( (m_pos != 0) && (out - buf < len - 1) ) + { + *out='&'; + out++; + } + + while( (*in != '\0') && (out - buf < len - 3) ) + { + if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') + { + *out = *in; + out++; + } + else if( *in == ' ' ) + { + *out='+'; + out++; + } + else + { + char hex[] = "0123456789abcdef"; + *out='%'; + out++; + *out=hex[(*in>>4)&0xf]; + out++; + *out=hex[(*in)&0xf]; + out++; + } + in++; + } + + if( out - buf < len - 1 ) + { + *out='='; + out++; + } + + in = m_values[m_pos]; + while( (*in != '\0') && (out - buf < len - 3) ) + { + if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') + { + *out = *in; + out++; + } + else if( *in == ' ' ) + { + *out='+'; + out++; + } + else + { + char hex[] = "0123456789abcdef"; + *out='%'; + out++; + *out=hex[(*in>>4)&0xf]; + out++; + *out=hex[(*in)&0xf]; + out++; + } + in++; + } + + *pReadLen = out - buf; + + m_pos++; + return OK; +} + +/*virtual*/ int HTTPMap::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header +{ + strncpy(type, "application/x-www-form-urlencoded", maxTypeLen-1); + type[maxTypeLen-1] = '\0'; + return OK; +} + +/*virtual*/ bool HTTPMap::getIsChunked() //For Transfer-Encoding header +{ + return false; ////Data is computed one key/value pair at a time +} + +/*virtual*/ size_t HTTPMap::getDataLen() //For Content-Length header +{ + size_t count = 0; + for(size_t i = 0; i< m_count; i++) + { + //URL encode + const char* in = m_keys[i]; + if( i != 0 ) + { + count++; + } + + while( (*in != '\0') ) + { + if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') + { + count++; + } + else if( *in == ' ' ) + { + count++; + } + else + { + count+=3; + } + in++; + } + + count ++; + + in = m_values[i]; + while( (*in != '\0') ) + { + if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') + { + count++; + } + else if( *in == ' ' ) + { + count++; + } + else + { + count+=3; + } + in++; + } + } + return count; +} diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h new file mode 100644 index 00000000..c8433778 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h @@ -0,0 +1,71 @@ +/* HTTPMap.h */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef HTTPMAP_H_ +#define HTTPMAP_H_ + +#include "../IHTTPData.h" + +#define HTTPMAP_TABLE_SIZE 32 + +/** Map of key/value pairs + * Used to transmit POST data using the application/x-www-form-urlencoded encoding + */ +class HTTPMap: public IHTTPDataOut +{ +public: + /** + Instantiates HTTPMap + It supports at most 32 key/values pairs + */ + HTTPMap(); + + /** Put Key/Value pair + The references to the parameters must remain valid as long as the clear() function is not called + @param key The key to use + @param value The corresponding value + */ + void put(const char* key, const char* value); + + /** Clear table + */ + void clear(); + +protected: + //IHTTPDataIn + virtual void readReset(); + + virtual int read(char* buf, size_t len, size_t* pReadLen); + + virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header + + virtual bool getIsChunked(); //For Transfer-Encoding header + + virtual size_t getDataLen(); //For Content-Length header + +private: + const char* m_keys[HTTPMAP_TABLE_SIZE]; + const char* m_values[HTTPMAP_TABLE_SIZE]; + + size_t m_pos; + size_t m_count; +}; + +#endif /* HTTPMAP_H_ */ diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp new file mode 100644 index 00000000..18cd4207 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp @@ -0,0 +1,104 @@ +/* HTTPText.cpp */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "HTTPText.h" + +#include + +#define OK 0 + +using std::memcpy; +using std::strncpy; +using std::strlen; + +#define MIN(x,y) (((x)<(y))?(x):(y)) + +HTTPText::HTTPText(char* str) : m_str(str), m_pos(0) +{ + m_size = strlen(str) + 1; +} + +HTTPText::HTTPText(char* str, size_t size) : m_str(str), m_size(size), m_pos(0) +{ + +} + +//IHTTPDataIn +/*virtual*/ void HTTPText::readReset() +{ + m_pos = 0; +} + +/*virtual*/ int HTTPText::read(char* buf, size_t len, size_t* pReadLen) +{ + *pReadLen = MIN(len, m_size - 1 - m_pos); + memcpy(buf, m_str + m_pos, *pReadLen); + m_pos += *pReadLen; + return OK; +} + +/*virtual*/ int HTTPText::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header +{ + strncpy(type, "text/plain", maxTypeLen-1); + type[maxTypeLen-1] = '\0'; + return OK; +} + +/*virtual*/ bool HTTPText::getIsChunked() //For Transfer-Encoding header +{ + return false; +} + +/*virtual*/ size_t HTTPText::getDataLen() //For Content-Length header +{ + return m_size - 1; +} + +//IHTTPDataOut +/*virtual*/ void HTTPText::writeReset() +{ + m_pos = 0; +} + +/*virtual*/ int HTTPText::write(const char* buf, size_t len) +{ + size_t writeLen = MIN(len, m_size - 1 - m_pos); + memcpy(m_str + m_pos, buf, writeLen); + m_pos += writeLen; + m_str[m_pos] = '\0'; + return OK; +} + +/*virtual*/ void HTTPText::setDataType(const char* type) //Internet media type from Content-Type header +{ + +} + +/*virtual*/ void HTTPText::setIsChunked(bool chunked) //From Transfer-Encoding header +{ + +} + +/*virtual*/ void HTTPText::setDataLen(size_t len) //From Content-Length header, or if the transfer is chunked, next chunk length +{ + +} + + + diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h new file mode 100644 index 00000000..f55ff762 --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h @@ -0,0 +1,72 @@ +/* HTTPText.h */ +/* Copyright (C) 2012 mbed.org, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef HTTPTEXT_H_ +#define HTTPTEXT_H_ + +#include "../IHTTPData.h" + +/** A data endpoint to store text +*/ +class HTTPText : public IHTTPDataIn, public IHTTPDataOut +{ +public: + /** Create an HTTPText instance for output + * @param str String to be transmitted + */ + HTTPText(char* str); + + /** Create an HTTPText instance for input + * @param str Buffer to store the incoming string + * @param size Size of the buffer + */ + HTTPText(char* str, size_t size); + +protected: + //IHTTPDataIn + virtual void readReset(); + + virtual int read(char* buf, size_t len, size_t* pReadLen); + + virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header + + virtual bool getIsChunked(); //For Transfer-Encoding header + + virtual size_t getDataLen(); //For Content-Length header + + //IHTTPDataOut + virtual void writeReset(); + + virtual int write(const char* buf, size_t len); + + virtual void setDataType(const char* type); //Internet media type from Content-Type header + + virtual void setIsChunked(bool chunked); //From Transfer-Encoding header + + virtual void setDataLen(size_t len); //From Content-Length header, or if the transfer is chunked, next chunk length + +private: + char* m_str; + size_t m_size; + + size_t m_pos; +}; + +#endif /* HTTPTEXT_H_ */ diff --git a/examples/mbed/mbed-http-client/platformio.ini b/examples/mbed/mbed-http-client/platformio.ini new file mode 100644 index 00000000..65c87729 --- /dev/null +++ b/examples/mbed/mbed-http-client/platformio.ini @@ -0,0 +1,25 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + + +# NXP LPC Platform +[env:lpc1768] +platform = nxplpc +framework = mbed +board = lpc1768 diff --git a/examples/mbed/mbed-http-client/src/main.cpp b/examples/mbed/mbed-http-client/src/main.cpp new file mode 100644 index 00000000..2e69c69a --- /dev/null +++ b/examples/mbed/mbed-http-client/src/main.cpp @@ -0,0 +1,79 @@ +#include "mbed.h" +#include "EthernetInterface.h" +#include "HTTPClient.h" + +EthernetInterface eth; +HTTPClient http; +char str[512]; + +int main() +{ + eth.init(); //Use DHCP + + eth.connect(); + + //GET data + printf("\nTrying to fetch page...\n"); + int ret = http.get("http://mbed.org/media/uploads/donatien/hello.txt", str, 128); + if (!ret) + { + printf("Page fetched successfully - read %d characters\n", strlen(str)); + printf("Result: %s\n", str); + } + else + { + printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); + } + + //POST data + HTTPMap map; + HTTPText inText(str, 512); + map.put("Hello", "World"); + map.put("test", "1234"); + printf("\nTrying to post data...\n"); + ret = http.post("http://httpbin.org/post", map, &inText); + if (!ret) + { + printf("Executed POST successfully - read %d characters\n", strlen(str)); + printf("Result: %s\n", str); + } + else + { + printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); + } + + //PUT data + strcpy(str, "This is a PUT test!"); + HTTPText outText(str); + //HTTPText inText(str, 512); + printf("\nTrying to put resource...\n"); + ret = http.put("http://httpbin.org/put", outText, &inText); + if (!ret) + { + printf("Executed PUT successfully - read %d characters\n", strlen(str)); + printf("Result: %s\n", str); + } + else + { + printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); + } + + //DELETE data + //HTTPText inText(str, 512); + printf("\nTrying to delete resource...\n"); + ret = http.del("http://httpbin.org/delete", &inText); + if (!ret) + { + printf("Executed DELETE successfully - read %d characters\n", strlen(str)); + printf("Result: %s\n", str); + } + else + { + printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); + } + + eth.disconnect(); + + while(1) { + } +} diff --git a/examples/mbed/mbed-rtos/README.rst b/examples/mbed/mbed-rtos/README.rst new file mode 100644 index 00000000..6411da4b --- /dev/null +++ b/examples/mbed/mbed-rtos/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +==================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/mbed/mbed-rtos + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/mbed/mbed-rtos/platformio.ini b/examples/mbed/mbed-rtos/platformio.ini new file mode 100644 index 00000000..cb93e0e6 --- /dev/null +++ b/examples/mbed/mbed-rtos/platformio.ini @@ -0,0 +1,37 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + + +# NXP LPC Platform +[env:lpc1768] +platform = nxplpc +framework = mbed +board = lpc1768 + +# Freescale FRDM Platform +[env:frdm_kl25z] +platform = freescalekinetis +framework = mbed +board = frdm_kl25z + +# ST STM32 Platform +[env:nucleo_f401re] +platform = ststm32 +framework = mbed +board = nucleo_f401re diff --git a/examples/mbed/mbed-rtos/src/main.cpp b/examples/mbed/mbed-rtos/src/main.cpp new file mode 100644 index 00000000..a1aa46d1 --- /dev/null +++ b/examples/mbed/mbed-rtos/src/main.cpp @@ -0,0 +1,38 @@ +#include "mbed.h" +#include "rtos.h" + +/* + * The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and + * the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes + * and for ARM_MICRO 512. Because of reduce RAM size some targets need a reduced stacksize. + */ +#if defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) +#define STACK_SIZE DEFAULT_STACK_SIZE/4 +#else +#define STACK_SIZE DEFAULT_STACK_SIZE +#endif + +void print_char(char c = '*') { + printf("%c", c); + fflush(stdout); +} + +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +void led2_thread(void const *argument) { + while (true) { + led2 = !led2; + Thread::wait(1000); + print_char(); + } +} + +int main() { + Thread thread(led2_thread, NULL, osPriorityNormal, STACK_SIZE); + + while (true) { + led1 = !led1; + Thread::wait(500); + } +} diff --git a/examples/mbed/mbed-serial/README.rst b/examples/mbed/mbed-serial/README.rst new file mode 100644 index 00000000..7f1feb4a --- /dev/null +++ b/examples/mbed/mbed-serial/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/mbed/mbed-serial + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/mbed/mbed-serial/platformio.ini b/examples/mbed/mbed-serial/platformio.ini new file mode 100644 index 00000000..f1f25ccb --- /dev/null +++ b/examples/mbed/mbed-serial/platformio.ini @@ -0,0 +1,43 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + + +# NXP LPC Platform +[env:lpc1768] +platform = nxplpc +framework = mbed +board = lpc1768 + +# Nordic nRF51 Platform +[env:nrf51_mkit] +platform = nordicnrf51 +framework = mbed +board = nrf51_mkit + +# Freescale FRDM Platform +[env:frdm_kl25z] +platform = freescalekinetis +framework = mbed +board = frdm_kl25z + +# ST STM32 Platform +[env:nucleo_f401re] +platform = ststm32 +framework = mbed +board = nucleo_f401re diff --git a/examples/mbed/mbed-serial/src/main.cpp b/examples/mbed/mbed-serial/src/main.cpp new file mode 100644 index 00000000..132ba174 --- /dev/null +++ b/examples/mbed/mbed-serial/src/main.cpp @@ -0,0 +1,10 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); // tx, rx + +int main() { + pc.printf("Hello World!\n\r"); + while(1) { + pc.putc(pc.getc() + 1); // echo input back to terminal + } +} \ No newline at end of file diff --git a/examples/stm32/stm32-cmsis-blink/README.rst b/examples/stm32/stm32-cmsis-blink/README.rst index e6cac2a7..0c1b987b 100644 --- a/examples/stm32/stm32-cmsis-blink/README.rst +++ b/examples/stm32/stm32-cmsis-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/stm32/stm32-cmsis-blink/platformio.ini b/examples/stm32/stm32-cmsis-blink/platformio.ini index c90f099e..d19acf8d 100644 --- a/examples/stm32/stm32-cmsis-blink/platformio.ini +++ b/examples/stm32/stm32-cmsis-blink/platformio.ini @@ -17,17 +17,17 @@ # Automatic targets - enable auto-uploading # targets = upload -[env:stm32f4discovery] -platform = stm32 +[env:disco_f407vg] +platform = ststm32 framework = cmsis -board = stm32f4discovery +board = disco_f407vg -[env:stm32ldiscovery] -platform = stm32 +[env:disco_l152rb] +platform = ststm32 framework = cmsis -board = stm32ldiscovery +board = disco_l152rb -[env:stm32f3discovery] -platform = stm32 +[env:disco_f303vc] +platform = ststm32 framework = cmsis -board = stm32f3discovery +board = disco_f303vc \ No newline at end of file diff --git a/examples/stm32/stm32-opencm3-blink/README.rst b/examples/stm32/stm32-opencm3-blink/README.rst index 579fdcab..b2df8478 100644 --- a/examples/stm32/stm32-opencm3-blink/README.rst +++ b/examples/stm32/stm32-opencm3-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/stm32/stm32-opencm3-blink/platformio.ini b/examples/stm32/stm32-opencm3-blink/platformio.ini index 3c472f00..2c04a6da 100644 --- a/examples/stm32/stm32-opencm3-blink/platformio.ini +++ b/examples/stm32/stm32-opencm3-blink/platformio.ini @@ -17,17 +17,17 @@ # Automatic targets - enable auto-uploading # targets = upload -[env:stm32f4discovery] -platform = stm32 -framework = opencm3 -board = stm32f4discovery +[env:disco_f407vg] +platform = ststm32 +framework = libopencm3 +board = disco_f407vg -[env:stm32ldiscovery] -platform = stm32 -framework = opencm3 -board = stm32ldiscovery +[env:disco_l152rb] +platform = ststm32 +framework = libopencm3 +board = disco_l152rb -[env:stm32f3discovery] -platform = stm32 -framework = opencm3 -board = stm32f3discovery +[env:disco_f303vc] +platform = ststm32 +framework = libopencm3 +board = disco_f303vc diff --git a/examples/stm32/stm32-spl-blink/README.rst b/examples/stm32/stm32-spl-blink/README.rst index 72a568be..8ed58571 100644 --- a/examples/stm32/stm32-spl-blink/README.rst +++ b/examples/stm32/stm32-spl-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/stm32/stm32-spl-blink/platformio.ini b/examples/stm32/stm32-spl-blink/platformio.ini index 6ba5b0c1..1324053c 100644 --- a/examples/stm32/stm32-spl-blink/platformio.ini +++ b/examples/stm32/stm32-spl-blink/platformio.ini @@ -17,17 +17,17 @@ # Automatic targets - enable auto-uploading # targets = upload -[env:stm32f4discovery] -platform = stm32 +[env:disco_f407vg] +platform = ststm32 framework = cmsis,spl -board = stm32f4discovery +board = disco_f407vg -[env:stm32ldiscovery] -platform = stm32 +[env:disco_l152rb] +platform = ststm32 framework = cmsis,spl -board = stm32ldiscovery +board = disco_l152rb -[env:stm32f3discovery] -platform = stm32 +[env:disco_f303vc] +platform = ststm32 framework = cmsis,spl -board = stm32f3discovery +board = disco_f303vc diff --git a/examples/teensy/teensy-internal-libs/README.rst b/examples/teensy/teensy-internal-libs/README.rst index 5cea44c9..e1a1cc9a 100644 --- a/examples/teensy/teensy-internal-libs/README.rst +++ b/examples/teensy/teensy-internal-libs/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/timsp430/panstamp-blink/README.rst b/examples/timsp430/panstamp-blink/README.rst new file mode 100644 index 00000000..6e7c06b7 --- /dev/null +++ b/examples/timsp430/panstamp-blink/README.rst @@ -0,0 +1,21 @@ +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO `_ +2. Download `source code with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-develop/examples/timsp430/panstamp-blink + + # Process example project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/timsp430/panstamp-blink/platformio.ini b/examples/timsp430/panstamp-blink/platformio.ini new file mode 100644 index 00000000..c273de4a --- /dev/null +++ b/examples/timsp430/panstamp-blink/platformio.ini @@ -0,0 +1,23 @@ +# +# Project Configuration File +# +# A detailed documentation with the EXAMPLES is located here: +# http://docs.platformio.org/en/latest/projectconf.html +# + +# A sign `#` at the beginning of the line indicates a comment +# Comment lines are ignored. + +# Simple and base environment +# [env:mybaseenv] +# platform = %INSTALLED_PLATFORM_NAME_HERE% +# framework = +# board = +# +# Automatic targets - enable auto-uploading +# targets = upload + +[env:panStampNRG] +platform = timsp430 +framework = arduino +board = panStampNRG diff --git a/examples/timsp430/panstamp-blink/src/Blink.ino b/examples/timsp430/panstamp-blink/src/Blink.ino new file mode 100644 index 00000000..b0db92b8 --- /dev/null +++ b/examples/timsp430/panstamp-blink/src/Blink.ino @@ -0,0 +1,29 @@ +/* + Blink + Turns on an LED on for one second, then off for one second, repeatedly. + + Most Arduinos have an on-board LED you can control. On the Uno and + Leonardo, it is attached to digital pin 13. If you're unsure what + pin the on-board LED is connected to on your Arduino model, check + the documentation at http://arduino.cc + + This example code is in the public domain. + + modified 8 May 2014 + by Scott Fitzgerald + */ + + +// the setup function runs once when you press reset or power the board +void setup() { + // initialize digital pin 13 as an output. + pinMode(13, OUTPUT); +} + +// the loop function runs over and over again forever +void loop() { + digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) + delay(1000); // wait for a second + digitalWrite(13, LOW); // turn the LED off by making the voltage LOW + delay(1000); // wait for a second +} diff --git a/examples/timsp430/timsp430-energia-blink/README.rst b/examples/timsp430/timsp430-energia-blink/README.rst index 67c8f443..7ad63a62 100644 --- a/examples/timsp430/timsp430-energia-blink/README.rst +++ b/examples/timsp430/timsp430-energia-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/timsp430/timsp430-native-blink/README.rst b/examples/timsp430/timsp430-native-blink/README.rst index 341ecf7e..5014d0ce 100644 --- a/examples/timsp430/timsp430-native-blink/README.rst +++ b/examples/timsp430/timsp430-native-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/titiva/titiva-energia-blink/README.rst b/examples/titiva/titiva-energia-blink/README.rst index e8b4caaf..3f182624 100644 --- a/examples/titiva/titiva-energia-blink/README.rst +++ b/examples/titiva/titiva-energia-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/titiva/titiva-native-blink/README.rst b/examples/titiva/titiva-native-blink/README.rst index 52e59f63..109f2ebb 100644 --- a/examples/titiva/titiva-native-blink/README.rst +++ b/examples/titiva/titiva-native-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/titiva/titiva-opencm3-blink/README.rst b/examples/titiva/titiva-opencm3-blink/README.rst index d98ff383..d3a83202 100644 --- a/examples/titiva/titiva-opencm3-blink/README.rst +++ b/examples/titiva/titiva-opencm3-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/examples/titiva/titiva-opencm3-blink/platformio.ini b/examples/titiva/titiva-opencm3-blink/platformio.ini index 67df2d05..0e46c4a8 100644 --- a/examples/titiva/titiva-opencm3-blink/platformio.ini +++ b/examples/titiva/titiva-opencm3-blink/platformio.ini @@ -19,15 +19,15 @@ [env:LaunchPad_lm4f120h5qr] platform = titiva -framework = opencm3 +framework = libopencm3 board = lplm4f120h5qr [env:LaunchPad_tm4c1230c3pm] platform = titiva -framework = opencm3 +framework = libopencm3 board = lptm4c1230c3pm [env:LaunchPad_tm4c1294ncpdt] platform = titiva -framework = opencm3 +framework = libopencm3 board = lptm4c1294ncpdt diff --git a/examples/wiring-blink/README.rst b/examples/wiring-blink/README.rst index 551f4d73..8dbda11e 100644 --- a/examples/wiring-blink/README.rst +++ b/examples/wiring-blink/README.rst @@ -1,5 +1,5 @@ -How to buid PlatformIO based project -==================================== +How to build PlatformIO based project +===================================== 1. `Install PlatformIO `_ 2. Download `source code with examples `_ diff --git a/platformio/__init__.py b/platformio/__init__.py index 4d895b31..f40ab4c5 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,12 +1,14 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (1, 1, 0) +VERSION = (1, 2, 0) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" -__description__ = ("A cross-platform code builder and " - "the missing library manager") +__description__ = ("A cross-platform code builder and the missing library " + "manager (Atmel AVR & SAM, Freescale Kinetis, " + "Nordic nRF51, NXP LPC, ST STM32, TI MSP430 & Tiva, " + "Teensy, Arduino, mbed, libOpenCM3, etc.)") __url__ = "http://platformio.org" __author__ = "Ivan Kravets" diff --git a/platformio/__main__.py b/platformio/__main__.py index d0685188..fbd34974 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -7,6 +7,7 @@ from sys import exit as sys_exit from traceback import format_exc import click +import requests from platformio import __version__, exception, maintenance from platformio.util import get_source_dir @@ -49,6 +50,10 @@ def process_result(ctx, result): def main(): try: + # https://urllib3.readthedocs.org + # /en/latest/security.html#insecureplatformwarning + requests.packages.urllib3.disable_warnings() + cli(None) except Exception as e: # pylint: disable=W0703 if not isinstance(e, exception.ReturnErrorCode): diff --git a/platformio/boards/adafruit.json b/platformio/boards/adafruit.json index 4e7832d0..aa2e4dfa 100644 --- a/platformio/boards/adafruit.json +++ b/platformio/boards/adafruit.json @@ -1,7 +1,7 @@ { "flora8": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "8000000L", "mcu": "atmega32u4", @@ -10,7 +10,7 @@ "variant": "flora", "vid": "0x239A" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Adafruit Flora", "platform": "atmelavr", "upload": { @@ -22,116 +22,130 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": false - } + }, + "url": "http://www.adafruit.com/product/659", + "vendor": "Adafruit" }, "trinket3": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "8000000L", "mcu": "attiny85", "variant": "tiny8" }, - "framework": "arduino", - "name": "Adafruit Trinket 8MHz", + "frameworks": ["arduino"], + "name": "Adafruit Trinket 3V/8MHz", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 8192, "protocol": "usbtiny" - } + }, + "url": "http://www.adafruit.com/products/1500", + "vendor": "Adafruit" }, "trinket5": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "16000000L", "mcu": "attiny85", "variant": "tiny8" }, - "framework": "arduino", - "name": "Adafruit Trinket 16MHz", + "frameworks": ["arduino"], + "name": "Adafruit Trinket 5V/16MHz", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 8192, - "protocol": "usbtiny" - } + "protocol": "usbtiny" + }, + "url": "http://www.adafruit.com/products/1501", + "vendor": "Adafruit" }, "protrinket3": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "12000000L", "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Pro Trinket 3V/12MHz (USB)", "platform": "atmelavr", "upload": { "maximum_ram_size": 2048, "maximum_size": 28672, "protocol": "usbtiny" - } + }, + "url": "http://www.adafruit.com/products/2010", + "vendor": "Adafruit" }, "protrinket5": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "16000000L", "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Pro Trinket 5V/16MHz (USB)", "platform": "atmelavr", "upload": { "maximum_ram_size": 2048, "maximum_size": 28672, "protocol": "usbtiny" - } + }, + "url": "http://www.adafruit.com/products/2000", + "vendor": "Adafruit" }, "protrinket3ftdi": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "16000000L", "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Pro Trinket 3V/12MHz (FTDI)", "platform": "atmelavr", "upload": { "maximum_ram_size": 2048, "maximum_size": 28672, - "protocol": "arduino", + "protocol": ["arduino"], "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://www.adafruit.com/products/2010", + "vendor": "Adafruit" }, "protrinket5ftdi": { "build": { - "core": "arduino", + "core": ["arduino"], "extra_flags": "-DARDUINO_ARCH_AVR", "f_cpu": "16000000L", "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Pro Trinket 5V/16MHz (USB)", "platform": "atmelavr", "upload": { "maximum_ram_size": 2048, "maximum_size": 28672, - "protocol": "arduino", + "protocol": ["arduino"], "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://www.adafruit.com/products/2000", + "vendor": "Adafruit" } -} \ No newline at end of file +} diff --git a/platformio/boards/arduino.json b/platformio/boards/arduino.json index 43779bc1..8d84f93e 100644 --- a/platformio/boards/arduino.json +++ b/platformio/boards/arduino.json @@ -10,7 +10,7 @@ "variant": "leonardo", "vid": "0x1B4F" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "LilyPad Arduino USB", "platform": "atmelavr", "upload": { @@ -22,7 +22,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardLilyPadUSB", + "vendor": "Arduino" }, "atmegangatmega168": { "build": { @@ -32,7 +34,7 @@ "mcu": "atmega168", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino NG or older ATmega168", "platform": "atmelavr", "upload": { @@ -41,7 +43,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/main/boards", + "vendor": "Arduino" }, "atmegangatmega8": { "build": { @@ -51,7 +55,7 @@ "mcu": "atmega8", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino NG or older ATmega8", "platform": "atmelavr", "upload": { @@ -60,7 +64,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/main/boards", + "vendor": "Arduino" }, "btatmega168": { "build": { @@ -70,7 +76,7 @@ "mcu": "atmega168", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino BT ATmega168", "platform": "atmelavr", "upload": { @@ -80,7 +86,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/main/boards", + "vendor": "Arduino" }, "btatmega328": { "build": { @@ -90,7 +98,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino BT ATmega328", "platform": "atmelavr", "upload": { @@ -100,7 +108,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/main/boards", + "vendor": "Arduino" }, "diecimilaatmega168": { "build": { @@ -110,7 +120,7 @@ "mcu": "atmega168", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Duemilanove or Diecimila ATmega168", "platform": "atmelavr", "upload": { @@ -119,7 +129,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardDiecimila", + "vendor": "Arduino" }, "diecimilaatmega328": { "build": { @@ -129,7 +141,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Duemilanove or Diecimila ATmega328", "platform": "atmelavr", "upload": { @@ -138,7 +150,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardDiecimila", + "vendor": "Arduino" }, "esplora": { "build": { @@ -151,7 +165,7 @@ "variant": "leonardo", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Esplora", "platform": "atmelavr", "upload": { @@ -163,7 +177,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardEsplora", + "vendor": "Arduino" }, "ethernet": { "build": { @@ -173,7 +189,7 @@ "mcu": "atmega328p", "variant": "ethernet" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Ethernet", "platform": "atmelavr", "upload": { @@ -182,7 +198,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardEthernet", + "vendor": "Arduino" }, "fio": { "build": { @@ -192,7 +210,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Fio", "platform": "atmelavr", "upload": { @@ -201,7 +219,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardFio", + "vendor": "Arduino" }, "leonardo": { "build": { @@ -214,7 +234,7 @@ "variant": "leonardo", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Leonardo", "platform": "atmelavr", "upload": { @@ -226,7 +246,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/arduinoBoardLeonardo", + "vendor": "Arduino" }, "lilypadatmega168": { "build": { @@ -236,7 +258,7 @@ "mcu": "atmega168", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "LilyPad Arduino ATmega168", "platform": "atmelavr", "upload": { @@ -245,7 +267,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardLilyPad", + "vendor": "Arduino" }, "lilypadatmega328": { "build": { @@ -255,7 +279,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "LilyPad Arduino ATmega328", "platform": "atmelavr", "upload": { @@ -264,7 +288,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardLilyPad", + "vendor": "Arduino" }, "megaADK": { "build": { @@ -274,7 +300,7 @@ "mcu": "atmega2560", "variant": "mega" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Mega ADK", "platform": "atmelavr", "upload": { @@ -283,7 +309,9 @@ "protocol": "wiring", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardMegaADK", + "vendor": "Arduino" }, "megaatmega1280": { "build": { @@ -293,7 +321,7 @@ "mcu": "atmega1280", "variant": "mega" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Mega or Mega 2560 ATmega1280", "platform": "atmelavr", "upload": { @@ -302,7 +330,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/arduinoBoardMega", + "vendor": "Arduino" }, "megaatmega2560": { "build": { @@ -312,7 +342,7 @@ "mcu": "atmega2560", "variant": "mega" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)", "platform": "atmelavr", "upload": { @@ -321,7 +351,9 @@ "protocol": "wiring", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://arduino.cc/en/Main/arduinoBoardMega2560", + "vendor": "Arduino" }, "micro": { "build": { @@ -334,7 +366,7 @@ "variant": "micro", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Micro", "platform": "atmelavr", "upload": { @@ -346,7 +378,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardMicro", + "vendor": "Arduino" }, "miniatmega168": { "build": { @@ -356,7 +390,7 @@ "mcu": "atmega168", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Mini ATmega168", "platform": "atmelavr", "upload": { @@ -365,7 +399,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardMini", + "vendor": "Arduino" }, "miniatmega328": { "build": { @@ -375,7 +411,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Mini ATmega328", "platform": "atmelavr", "upload": { @@ -384,7 +420,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardMini", + "vendor": "Arduino" }, "nanoatmega168": { "build": { @@ -394,7 +432,7 @@ "mcu": "atmega168", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Nano ATmega168", "platform": "atmelavr", "upload": { @@ -403,7 +441,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardNano", + "vendor": "Arduino" }, "nanoatmega328": { "build": { @@ -413,7 +453,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Nano ATmega328", "platform": "atmelavr", "upload": { @@ -422,7 +462,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardNano", + "vendor": "Arduino" }, "pro16MHzatmega168": { "build": { @@ -432,7 +474,7 @@ "mcu": "atmega168", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz)", "platform": "atmelavr", "upload": { @@ -441,7 +483,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardProMini", + "vendor": "Arduino" }, "pro16MHzatmega328": { "build": { @@ -451,7 +495,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz)", "platform": "atmelavr", "upload": { @@ -460,7 +504,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardProMini", + "vendor": "Arduino" }, "pro8MHzatmega168": { "build": { @@ -470,7 +516,7 @@ "mcu": "atmega168", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz)", "platform": "atmelavr", "upload": { @@ -479,7 +525,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 19200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardProMini", + "vendor": "Arduino" }, "pro8MHzatmega328": { "build": { @@ -489,7 +537,7 @@ "mcu": "atmega328p", "variant": "eightanaloginputs" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz)", "platform": "atmelavr", "upload": { @@ -498,7 +546,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardProMini", + "vendor": "Arduino" }, "robotControl": { "build": { @@ -511,7 +561,7 @@ "variant": "robot_control", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Robot Control", "platform": "atmelavr", "upload": { @@ -523,7 +573,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/Robot", + "vendor": "Arduino" }, "robotMotor": { "build": { @@ -536,7 +588,7 @@ "variant": "robot_motor", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Robot Motor", "platform": "atmelavr", "upload": { @@ -548,7 +600,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/Robot", + "vendor": "Arduino" }, "uno": { "build": { @@ -558,7 +612,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Uno", "platform": "atmelavr", "upload": { @@ -567,7 +621,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardUno", + "vendor": "Arduino" }, "yun": { "build": { @@ -580,7 +636,7 @@ "variant": "yun", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Yun", "platform": "atmelavr", "upload": { @@ -593,7 +649,9 @@ "use_1200bps_touch": true, "via_ssh": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/ArduinoBoardYun", + "vendor": "Arduino" }, "due": { "build": { @@ -608,18 +666,20 @@ "vid": "0x2341", "ldscript": "sam3x8e.ld" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Due (Programming Port)", "platform": "atmelsam", "upload": { "disable_flushing": true, - "maximum_ram_size": 28672, + "maximum_ram_size": 32768, "maximum_size": 524288, "protocol": "sam-ba", - "require_upload_port" : true, + "require_upload_port" : true, "use_1200bps_touch": true, - "wait_for_upload_port": true - } + "wait_for_upload_port": false + }, + "url": "http://arduino.cc/en/Main/arduinoBoardDue", + "vendor": "Arduino" }, "dueUSB": { "build": { @@ -634,17 +694,19 @@ "vid": "0x2341", "ldscript": "sam3x8e.ld" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Arduino Due (USB Native Port)", "platform": "atmelsam", "upload": { "disable_flushing": true, - "maximum_ram_size": 28672, + "maximum_ram_size": 32768, "maximum_size": 524288, "protocol": "sam-ba", - "require_upload_port" : true, + "require_upload_port" : true, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://arduino.cc/en/Main/arduinoBoardDue", + "vendor": "Arduino" } } diff --git a/platformio/boards/digistump.json b/platformio/boards/digistump.json index 8e0dc576..c03d3680 100644 --- a/platformio/boards/digistump.json +++ b/platformio/boards/digistump.json @@ -7,14 +7,16 @@ "mcu": "attiny85", "variant": "digispark_tiny" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Digispark (Default - 16 MHz)", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 6012, "protocol": "digispark" - } + }, + "url": "http://digistump.com/products/1", + "vendor": "Digistump" }, "digispark-pro": { "build": { @@ -24,14 +26,16 @@ "mcu": "attiny167", "variant": "digispark_pro" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Digispark Pro (Default 16 MHz)", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 14844, "protocol": "digispark" - } + }, + "url": "http://digistump.com/products/109", + "vendor": "Digistump" }, "digispark-pro32": { "build": { @@ -41,14 +45,16 @@ "mcu": "attiny167", "variant": "digispark_pro32" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Digispark Pro (16 MHz) (32 byte buffer)", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 14844, "protocol": "digispark" - } + }, + "url": "http://digistump.com/products/109", + "vendor": "Digistump" }, "digispark-pro64": { "build": { @@ -58,14 +64,16 @@ "mcu": "attiny167", "variant": "digispark_pro64" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Digispark Pro (16 MHz) (64 byte buffer)", "platform": "atmelavr", "upload": { "maximum_ram_size": 512, "maximum_size": 14844, "protocol": "digispark" - } + }, + "url": "http://digistump.com/products/109", + "vendor": "Digistump" }, "digix": { "build": { @@ -80,7 +88,7 @@ "variant": "digispark_digix", "vid": "0x16D0" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Digistump DigiX", "platform": "atmelsam", "upload": { @@ -91,6 +99,8 @@ "require_upload_port" : true, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://digistump.com/products/50", + "vendor": "Digistump" } } \ No newline at end of file diff --git a/platformio/boards/engduino.json b/platformio/boards/engduino.json index 32235a93..a08639cf 100644 --- a/platformio/boards/engduino.json +++ b/platformio/boards/engduino.json @@ -10,7 +10,7 @@ "variant": "engduinov1", "vid": "0x1B4F" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Engduino 1", "platform": "atmelavr", "upload": { @@ -22,7 +22,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://www.engduino.org", + "vendor": "Engduino" }, "engduinov2": { "build": { @@ -35,7 +37,7 @@ "variant": "engduinov2", "vid": "0x1B4F" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Engduino 2", "platform": "atmelavr", "upload": { @@ -47,7 +49,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://www.engduino.org", + "vendor": "Engduino" }, "engduinov3": { "build": { @@ -60,7 +64,7 @@ "variant": "engduinov3", "vid": "0x1B4F" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Engduino 3", "platform": "atmelavr", "upload": { @@ -72,6 +76,8 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://www.engduino.org", + "vendor": "Engduino" } } \ No newline at end of file diff --git a/platformio/boards/freescalekinetis.json b/platformio/boards/freescalekinetis.json new file mode 100644 index 00000000..869a977a --- /dev/null +++ b/platformio/boards/freescalekinetis.json @@ -0,0 +1,114 @@ +{ + "frdm_kl25z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl25z128vlk4" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-KL25Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/KL25Z/", + "vendor": "Freescale" + }, + "frdm_kl46z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl46z256vll4" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-KL46Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/FRDM-KL46Z/", + "vendor": "Freescale" + }, + "frdm_k64f": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "mk64fn1m0vll12" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-K64F", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 262144, + "maximum_size": 1048576 + }, + "url": "https://developer.mbed.org/platforms/FRDM-K64F/", + "vendor": "Freescale" + }, + "frdm_kl05z": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0plus", + "mcu": "mkl05z32vfm4" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-KL05Z", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/FRDM-KL05Z/", + "vendor": "Freescale" + }, + "frdm_k20d50m": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m4", + "mcu": "mk20dx128vlh5" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-K20D50M", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/FRDM-K20D50M/", + "vendor": "Freescale" + }, + "frdm_k22f": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "mk22fn512vlh12" + }, + "frameworks": ["mbed"], + "name": "Freescale Kinetis FRDM-K22F", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/FRDM-K22F/", + "vendor": "Freescale" + }, + "IBMEthernetKit": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "mk64fn1m0vll12" + }, + "frameworks": ["mbed"], + "name": "Ethernet IoT Starter Kit", + "platform": "freescalekinetis", + "upload": { + "maximum_ram_size": 262144, + "maximum_size": 1048576 + }, + "url": "http://developer.mbed.org/platforms/IBMEthernetKit/", + "vendor": "Freescale" + } +} \ No newline at end of file diff --git a/platformio/boards/microduino.json b/platformio/boards/microduino.json index 86d09dcf..3336fc2e 100644 --- a/platformio/boards/microduino.json +++ b/platformio/boards/microduino.json @@ -7,7 +7,7 @@ "mcu": "atmega1284p", "variant": "plus" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core+ (ATmega1284P@16M,5V)", "platform": "atmelavr", "upload": { @@ -16,7 +16,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core%2B", + "vendor": "Microduino" }, "1284p8m": { "build": { @@ -26,7 +28,7 @@ "mcu": "atmega1284p", "variant": "plus" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core+ (ATmega1284P@8M,3.3V)", "platform": "atmelavr", "upload": { @@ -35,7 +37,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core%2B", + "vendor": "Microduino" }, "168pa16m": { "build": { @@ -45,7 +49,7 @@ "mcu": "atmega168p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core (Atmega168PA@16M,5V)", "platform": "atmelavr", "upload": { @@ -54,7 +58,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core", + "vendor": "Microduino" }, "168pa8m": { "build": { @@ -64,7 +70,7 @@ "mcu": "atmega168p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core (Atmega168PA@8M,3.3V)", "platform": "atmelavr", "upload": { @@ -73,7 +79,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core", + "vendor": "Microduino" }, "328p16m": { "build": { @@ -83,7 +91,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core (Atmega328P@16M,5V)", "platform": "atmelavr", "upload": { @@ -92,7 +100,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core", + "vendor": "Microduino" }, "328p8m": { "build": { @@ -102,7 +112,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core (Atmega328P@8M,3.3V)", "platform": "atmelavr", "upload": { @@ -111,7 +121,9 @@ "require_upload_port" : true, "protocol": "arduino", "speed": 57600 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core", + "vendor": "Microduino" }, "32u416m": { "build": { @@ -123,7 +135,7 @@ "variant": "32u4", "vid": "0x2341" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core USB (ATmega32U4@16M,5V)", "platform": "atmelavr", "upload": { @@ -135,7 +147,9 @@ "speed": 57600, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-CoreUSB", + "vendor": "Microduino" }, "644pa16m": { "build": { @@ -145,7 +159,7 @@ "mcu": "atmega644p", "variant": "plus" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core+ (Atmega644PA@16M,5V)", "platform": "atmelavr", "upload": { @@ -154,7 +168,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 115200 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core%2B", + "vendor": "Microduino" }, "644pa8m": { "build": { @@ -164,7 +180,7 @@ "mcu": "atmega644p", "variant": "plus" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Microduino Core+ (Atmega644PA@8M,3.3V)", "platform": "atmelavr", "upload": { @@ -173,6 +189,8 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "https://www.microduino.cc/wiki/index.php?title=Microduino-Core%2B", + "vendor": "Microduino" } } \ No newline at end of file diff --git a/platformio/boards/misc.json b/platformio/boards/misc.json index 8c1e85a0..ac796695 100644 --- a/platformio/boards/misc.json +++ b/platformio/boards/misc.json @@ -7,7 +7,7 @@ "mcu": "atmega328p", "variant": "standard" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Raspduino", "platform": "atmelavr", "upload": { @@ -16,7 +16,9 @@ "protocol": "arduino", "require_upload_port" : true, "speed": 57600 - } + }, + "url": "http://www.bitwizard.nl/wiki/index.php/Raspduino", + "vendor": "BitWizard" }, "sainSmartDue": { "build": { @@ -31,18 +33,20 @@ "vid": "0x2341", "ldscript": "sam3x8e.ld" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "SainSmart Due (Programming Port)", "platform": "atmelsam", "upload": { "disable_flushing": true, - "maximum_ram_size": 28672, + "maximum_ram_size": 32768, "maximum_size": 524288, "protocol": "sam-ba", - "require_upload_port" : true, + "require_upload_port" : true, "use_1200bps_touch": true, - "wait_for_upload_port": true - } + "wait_for_upload_port": false + }, + "url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html", + "vendor": "SainSmart" }, "sainSmartDueUSB": { "build": { @@ -57,17 +61,58 @@ "vid": "0x2341", "ldscript": "sam3x8e.ld" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "SainSmart Due (USB Native Port)", "platform": "atmelsam", "upload": { "disable_flushing": true, - "maximum_ram_size": 28672, + "maximum_ram_size": 32768, "maximum_size": 524288, "protocol": "sam-ba", - "require_upload_port" : true, + "require_upload_port" : true, "use_1200bps_touch": true, "wait_for_upload_port": true - } + }, + "url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html", + "vendor": "SainSmart" + }, + "panStampAVR": { + "build": { + "core": "panstamp", + "extra_flags": "-DPANSTAMP_AVR", + "f_cpu": "8000000L", + "mcu": "atmega328p", + "variant": "panstamp" + }, + "frameworks": ["arduino"], + "name": "PanStamp AVR", + "platform": "atmelavr", + "upload": { + "maximum_ram_size": 2048, + "maximum_size": 32256, + "protocol": "arduino", + "require_upload_port" : true, + "speed": 57600 + }, + "url": "http://www.panstamp.com/product/panstamp-avr/", + "vendor": "PanStamp" + }, + "panStampNRG": { + "build": { + "core": "panstamp", + "f_cpu": "12000000L", + "mcu": "cc430f5137", + "variant": "panstamp_nrg_1.1" + }, + "frameworks": ["arduino"], + "name": "PanStamp NRG 1.1", + "platform": "timsp430", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32640, + "protocol": "flash-bsl" + }, + "url": "http://www.panstamp.com/product/197/", + "vendor": "PanStamp" } -} \ No newline at end of file +} diff --git a/platformio/boards/nordicnrf51.json b/platformio/boards/nordicnrf51.json new file mode 100644 index 00000000..abe44026 --- /dev/null +++ b/platformio/boards/nordicnrf51.json @@ -0,0 +1,130 @@ +{ + "nrf51_mkit": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "Nordic nRF51822-mKIT", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "http://developer.mbed.org/platforms/Nordic-nRF51822/", + "vendor": "Nordic" + }, + "hrm1017": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "Switch Science mbed HRM1017", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/mbed-HRM1017/", + "vendor": "Switch Science" + }, + "redBearLab": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "RedBearLab nRF51822", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/RedBearLab-nRF51822/", + "vendor": "RedBearLab" + }, + "nrf51_dk": { + "build": { + "f_cpu": "32000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "Nordic nRF51-DK", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/Nordic-nRF51-DK/", + "vendor": "Nordic" + }, + "redBearLabBLENano": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "RedBearLab BLE Nano", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/RedBearLab-BLE-Nano/", + "vendor": "RedBearLab" + }, + "nrf51_dongle": { + "build": { + "f_cpu": "32000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "Nordic nRF51-Dongle", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/Nordic-nRF51-Dongle/", + "vendor": "Nordic" + }, + "wallBotBLE": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "JKSoft Wallbot BLE", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/JKSoft-Wallbot-BLE/", + "vendor": "JKSoft" + }, + "seeedTinyBLE": { + "build": { + "f_cpu": "16000000L", + "cpu": "cortex-m0", + "mcu": "nrf51822" + }, + "frameworks": ["mbed"], + "name": "Seeed Tiny BLE", + "platform": "nordicnrf51", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 262144 + }, + "url": "http://developer.mbed.org/platforms/Seeed-Tiny-BLE/", + "vendor": "SeeedStudio" + } +} \ No newline at end of file diff --git a/platformio/boards/nxplpc.json b/platformio/boards/nxplpc.json new file mode 100644 index 00000000..67392e27 --- /dev/null +++ b/platformio/boards/nxplpc.json @@ -0,0 +1,210 @@ +{ + "lpc1768": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "frameworks": ["mbed"], + "name": "mbed LPC1768", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + }, + "url": "http://developer.mbed.org/platforms/mbed-LPC1768/", + "vendor": "NXP" + }, + "lpc11u24": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "frameworks": ["mbed"], + "name": "mbed LPC11U24", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/mbed-LPC11U24/", + "vendor": "NXP" + }, + "lpc4088": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "lpc4088" + }, + "frameworks": ["mbed"], + "name": "EA LPC4088 QuickStart Board", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 98304, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/EA-LPC4088/", + "vendor": "Embedded Artists" + }, + "dipcortexm0": { + "build": { + "f_cpu": "50000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "frameworks": ["mbed"], + "name": "DipCortex M0", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/DipCortex-M0/", + "vendor": "Solder Splash Labs" + }, + "blueboard_lpc11u24": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "frameworks": ["mbed"], + "name": "BlueBoard-LPC11U24", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/BlueBoard-LPC11U24/", + "vendor": "NGX Technologies" + }, + "seeeduinoArchPro": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "frameworks": ["mbed"], + "name": "Seeeduino-Arch-Pro", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/Seeeduino-Arch-Pro/", + "vendor": "SeeedStudio" + }, + "ubloxc027": { + "build": { + "f_cpu": "96000000L", + "cpu": "cortex-m3", + "mcu": "lpc1768" + }, + "frameworks": ["mbed"], + "name": "u-blox C027", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/u-blox-C027/", + "vendor": "u-blox" + }, + "lpc1114fn28": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc1114fn28" + }, + "frameworks": ["mbed"], + "name": "mbed LPC1114FN28", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 4096, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/LPC1114FN28/", + "vendor": "Switch Science" + }, + "lpc11u35": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u35" + }, + "frameworks": ["mbed"], + "name": "EA LPC11U35 QuickStart Board", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 10240, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/EA-LPC11U35/", + "vendor": "Embedded Artists" + }, + "lpc11u35_501": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u35" + }, + "frameworks": ["mbed"], + "name": "TG-LPC11U35-501", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 10240, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/TG-LPC11U35-501/", + "vendor": "CQ Publishing" + }, + "lpc1549": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m3", + "mcu": "lpc1549" + }, + "frameworks": ["mbed"], + "name": "LPCXpresso1549", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 36864, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/LPCXpresso1549/", + "vendor": "NXP" + }, + "mbuino": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "lpc11u24" + }, + "frameworks": ["mbed"], + "name": "Outrageous Circuits mBuino", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 32768 + }, + "url": "https://developer.mbed.org/platforms/Outrageous-Circuits-mBuino/", + "vendor": "Outrageous Circuits" + }, + "lpc4088_dm": { + "build": { + "f_cpu": "120000000L", + "cpu": "cortex-m4", + "mcu": "lpc4088" + }, + "frameworks": ["mbed"], + "name": "EA LPC4088 Display Module", + "platform": "nxplpc", + "upload": { + "maximum_ram_size": 98304, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/EA-LPC4088-Display-Module/", + "vendor": "Embedded Artists" + } +} \ No newline at end of file diff --git a/platformio/boards/stm32.json b/platformio/boards/stm32.json deleted file mode 100644 index 2dae3544..00000000 --- a/platformio/boards/stm32.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "stm32f4discovery": { - "build": { - "core": "stm32", - "extra_flags": "-DSTM32F40_41xxx", - "f_cpu": "168000000L", - "ldscript": "stm32f405x6.ld", - "cpu": "cortex-m4", - "mcu": "stm32f407vgt6", - "variant": "stm32f4" - }, - "framework": "cmsis", - "name": "STM32F4Discovery (168 MHz) with digital accelerometer, digital microphone, audio DAC", - "platform": "stm32", - "upload": { - "maximum_ram_size": 131071, - "maximum_size": 1048575 - } - }, - "stm32ldiscovery": { - "build": { - "core": "stm32", - "extra_flags": "-DSTM32L1XX_MD", - "f_cpu": "32000000L", - "ldscript": "stm32l15xx6.ld", - "cpu": "cortex-m3", - "mcu": "stm32l152rbt6", - "variant": "stm32l1" - }, - "framework": "cmsis", - "name": "STM32LDiscovery (32 MHz) ultra low-power development kit", - "platform": "stm32", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 131072 - } - }, - "stm32f3discovery": { - "build": { - "core": "stm32", - "extra_flags": "-DSTM32F303xC", - "f_cpu": "72000000L", - "ldscript": "stm32f30xx.ld", - "cpu": "cortex-m4", - "mcu": "stm32f303vct6", - "variant": "stm32f3" - }, - "framework": "cmsis", - "name": "STM32F3Discovery (72 MHz) with accelerometer, gyroscope and e-compass", - "platform": "stm32", - "upload": { - "maximum_ram_size": 262144, - "maximum_size": 131072 - } - } -} \ No newline at end of file diff --git a/platformio/boards/ststm32.json b/platformio/boards/ststm32.json new file mode 100644 index 00000000..8b45b992 --- /dev/null +++ b/platformio/boards/ststm32.json @@ -0,0 +1,334 @@ +{ + "disco_f407vg": { + "build": { + "core": "stm32", + "extra_flags": "-DSTM32F40_41xxx", + "f_cpu": "168000000L", + "ldscript": "stm32f405x6.ld", + "cpu": "cortex-m4", + "mcu": "stm32f407vgt6", + "variant": "stm32f4" + }, + "frameworks": ["cmsis", "spl", "libopencm3", "mbed"], + "name": "STM32F4DISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 1048576 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF252419", + "vendor": "ST" + }, + "disco_l152rb": { + "build": { + "core": "stm32", + "extra_flags": "-DSTM32L1XX_MD", + "f_cpu": "32000000L", + "ldscript": "stm32l15xx6.ld", + "cpu": "cortex-m3", + "mcu": "stm32l152rbt6", + "variant": "stm32l1" + }, + "frameworks": ["cmsis","spl","libopencm3"], + "name": "STM32LDISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF258515", + "vendor": "ST" + }, + "disco_f303vc": { + "build": { + "core": "stm32", + "extra_flags": "-DSTM32F303xC", + "f_cpu": "72000000L", + "ldscript": "stm32f30xx.ld", + "cpu": "cortex-m4", + "mcu": "stm32f303vct6", + "variant": "stm32f3" + }, + "frameworks": ["cmsis", "spl", "libopencm3", "mbed"], + "name": "STM32F3DISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 49152, + "maximum_size": 262144 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF254044", + "vendor": "ST" + }, + "disco_f100rb": { + "build": { + "f_cpu": "24000000L", + "cpu": "cortex-m3", + "mcu": "stm32f100rbt6" + }, + "frameworks": ["mbed"], + "name": "STM32VLDISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 131072 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF250863", + "vendor": "ST" + }, + "disco_f051r8": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32f051r8t6" + }, + "frameworks": ["mbed"], + "name": "STM32F0DISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF253215", + "vendor": "ST" + }, + "disco_f334c8": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m4", + "mcu": "stm32f334c8t6" + }, + "frameworks": ["mbed"], + "name": "32F3348DISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 65536 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF260318", + "vendor": "ST" + }, + "disco_f401vc": { + "build": { + "f_cpu": "84000000L", + "cpu": "cortex-m4", + "mcu": "stm32f401vct6" + }, + "frameworks": ["mbed"], + "name": "32F401CDISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 65536, + "maximum_size": 262144 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259098", + "vendor": "ST" + }, + "disco_f429zi": { + "build": { + "f_cpu": "180000000L", + "cpu": "cortex-m4", + "mcu": "stm32f429zit6" + }, + "frameworks": ["mbed"], + "name": "32F429IDISCOVERY", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 262144, + "maximum_size": 2097152 + }, + "url": "http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259090", + "vendor": "ST" + }, + "nucleo_f030r8": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32f030r8t6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F030R8", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F030R8/", + "vendor": "ST" + }, + "nucleo_f070rb": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32f070rbt6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F070RB", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F070RB/", + "vendor": "ST" + }, + "nucleo_f072rb": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32f072rbt6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F072RB", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F072RB/", + "vendor": "ST" + }, + "nucleo_f091rc": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32f091rct6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F091RC", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 262144 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F091RC/", + "vendor": "ST" + }, + "nucleo_f103rb": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m3", + "mcu": "stm32f103rbt6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F103RB", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 20480, + "maximum_size": 131072 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F103RB/", + "vendor": "ST" + }, + "nucleo_f302r8": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m4", + "mcu": "stm32f302r8t6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F302R8", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F302R8/", + "vendor": "ST" + }, + "nucleo_f303re": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m4", + "mcu": "stm32f303ret6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F303RE", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 65536, + "maximum_size": 524288 + }, + "url": "http://developer.mbed.org/platforms/ST-Nucleo-F303RE/", + "vendor": "ST" + }, + "nucleo_f334r8": { + "build": { + "f_cpu": "72000000L", + "cpu": "cortex-m4", + "mcu": "stm32f334r8t6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F334R8", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 16384, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F334R8/", + "vendor": "ST" + }, + "nucleo_f401re": { + "build": { + "f_cpu": "84000000L", + "cpu": "cortex-m4", + "mcu": "stm32f401ret6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F401RE", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 98304, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F401RE/", + "vendor": "ST" + }, + "nucleo_f411re": { + "build": { + "f_cpu": "100000000L", + "cpu": "cortex-m4", + "mcu": "stm32f411ret6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo F411RE", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-F411RE/", + "vendor": "ST" + }, + "nucleo_l053r8": { + "build": { + "f_cpu": "48000000L", + "cpu": "cortex-m0", + "mcu": "stm32l053r8t6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo L053R8", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 8192, + "maximum_size": 65536 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-L053R8/", + "vendor": "ST" + }, + "nucleo_l152re": { + "build": { + "f_cpu": "32000000L", + "cpu": "cortex-m3", + "mcu": "stm32l152ret6" + }, + "frameworks": ["mbed"], + "name": "ST Nucleo L152RE", + "platform": "ststm32", + "upload": { + "maximum_ram_size": 81920, + "maximum_size": 524288 + }, + "url": "https://developer.mbed.org/platforms/ST-Nucleo-L152RE/", + "vendor": "ST" + } +} \ No newline at end of file diff --git a/platformio/boards/teensy.json b/platformio/boards/teensy.json index 49403ecb..bb3b4a88 100644 --- a/platformio/boards/teensy.json +++ b/platformio/boards/teensy.json @@ -5,13 +5,15 @@ "f_cpu": "16000000L", "mcu": "atmega32u4" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Teensy 2.0", "platform": "teensy", "upload": { "maximum_ram_size": 2560, "maximum_size": 32256 - } + }, + "url": "https://www.pjrc.com/store/teensy.html", + "vendor": "Teensy" }, "teensy20pp": { @@ -20,13 +22,15 @@ "f_cpu": "16000000L", "mcu": "at90usb1286" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Teensy++ 2.0", "platform": "teensy", "upload": { "maximum_ram_size": 8192, "maximum_size": 130048 - } + }, + "url": "https://www.pjrc.com/store/teensypp.html", + "vendor": "Teensy" }, "teensy30": { @@ -38,13 +42,15 @@ "mcu": "mk20dx128", "cpu": "cortex-m4" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Teensy 3.0", "platform": "teensy", "upload": { "maximum_ram_size": 16384, "maximum_size": 131072 - } + }, + "url": "https://www.pjrc.com/store/teensy3.html", + "vendor": "Teensy" }, "teensy31": { @@ -56,12 +62,14 @@ "mcu": "mk20dx256", "cpu": "cortex-m4" }, - "framework": "arduino", + "frameworks": ["arduino"], "name": "Teensy 3.1", "platform": "teensy", "upload": { "maximum_ram_size": 65536, "maximum_size": 262144 - } + }, + "url": "https://www.pjrc.com/store/teensy31.html", + "vendor": "Teensy" } } diff --git a/platformio/boards/timsp430.json b/platformio/boards/timsp430.json index a8d2b46f..88731614 100644 --- a/platformio/boards/timsp430.json +++ b/platformio/boards/timsp430.json @@ -6,14 +6,16 @@ "mcu": "msp430f5529", "variant": "launchpad_f5529" }, - "framework": "energia", + "frameworks": ["energia"], "name": "LaunchPad w/ msp430f5529 (16MHz)", "platform": "timsp430", "upload": { "maximum_ram_size": 1024, "maximum_size": 131072, "protocol": "tilib" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430f5529lp.html", + "vendor": "TI" }, "lpmsp430f5529_25": { "build": { @@ -22,14 +24,16 @@ "mcu": "msp430f5529", "variant": "launchpad_f5529" }, - "framework": "energia", + "frameworks": ["energia"], "name": "LaunchPad w/ msp430f5529 (25MHz)", "platform": "timsp430", "upload": { "maximum_ram_size": 1024, "maximum_size": 131072, "protocol": "tilib" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430f5529lp.html", + "vendor": "TI" }, "lpmsp430fr5739": { "build": { @@ -38,14 +42,16 @@ "mcu": "msp430fr5739", "variant": "fraunchpad" }, - "framework": "energia", + "frameworks": ["energia"], "name": "FraunchPad w/ msp430fr5739", "platform": "timsp430", "upload": { "maximum_ram_size": 1024, "maximum_size": 15872, "protocol": "rf2500" - } + }, + "url": "http://www.ti.com/tool/msp-exp430fr5739", + "vendor": "TI" }, "lpmsp430fr5969": { "build": { @@ -54,14 +60,16 @@ "mcu": "msp430fr5969", "variant": "launchpad_fr5969" }, - "framework": "energia", + "frameworks": ["energia"], "name": "LaunchPad w/ msp430fr5969", "platform": "timsp430", "upload": { "maximum_ram_size": 1024, "maximum_size": 65536, "protocol": "tilib" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430fr5969.html", + "vendor": "TI" }, "lpmsp430g2231": { "build": { @@ -70,14 +78,16 @@ "mcu": "msp430g2231", "variant": "launchpad" }, - "framework": "energia", - "name": "LaunchPad w/ msp430g2231 (1MHz)", + "frameworks": ["energia"], + "name": "LaunchPad w/ msp430g2231 (1 MHz)", "platform": "timsp430", "upload": { "maximum_ram_size": 128, "maximum_size": 2048, "protocol": "rf2500" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html", + "vendor": "TI" }, "lpmsp430g2452": { "build": { @@ -86,14 +96,16 @@ "mcu": "msp430g2452", "variant": "launchpad" }, - "framework": "energia", + "frameworks": ["energia"], "name": "LaunchPad w/ msp430g2452 (16MHz)", "platform": "timsp430", "upload": { "maximum_ram_size": 256, "maximum_size": 8192, "protocol": "rf2500" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html", + "vendor": "TI" }, "lpmsp430g2553": { "build": { @@ -102,13 +114,15 @@ "mcu": "msp430g2553", "variant": "launchpad" }, - "framework": "energia", + "frameworks": ["energia"], "name": "LaunchPad w/ msp430g2553 (16MHz)", "platform": "timsp430", "upload": { "maximum_ram_size": 512, "maximum_size": 16384, "protocol": "rf2500" - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html", + "vendor": "TI" } } \ No newline at end of file diff --git a/platformio/boards/titiva.json b/platformio/boards/titiva.json index 757ee6fa..69a8d9be 100644 --- a/platformio/boards/titiva.json +++ b/platformio/boards/titiva.json @@ -8,13 +8,15 @@ "mcu": "lplm4f120h5qr", "variant": "stellarpad" }, - "framework": "energia", + "frameworks": ["energia", "libopencm3"], "name": "LaunchPad (Stellaris) w/ lm4f120 (80MHz)", "platform": "titiva", "upload": { "maximum_ram_size": 32768, "maximum_size": 262144 - } + }, + "url": "http://www.ti.com/tool/ek-lm4f120xl", + "vendor": "TI" }, "lptm4c1230c3pm": { "build": { @@ -25,13 +27,15 @@ "mcu": "lptm4c1230c3pm", "variant": "stellarpad" }, - "framework": "energia", + "frameworks": ["energia", "libopencm3"], "name": "LaunchPad (Tiva C) w/ tm4c123 (80MHz)", "platform": "titiva", "upload": { "maximum_ram_size": 32768, "maximum_size": 262144 - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c123gxl.html", + "vendor": "TI" }, "lptm4c1294ncpdt": { "build": { @@ -42,12 +46,14 @@ "mcu": "lptm4c1294ncpdt", "variant": "launchpad_129" }, - "framework": "energia", + "frameworks": ["energia", "libopencm3"], "name": "LaunchPad (Tiva C) w/ tm4c129 (120MHz)", "platform": "titiva", "upload": { "maximum_ram_size": 262144, "maximum_size": 1048576 - } + }, + "url": "http://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c1294xl.html", + "vendor": "TI" } } \ No newline at end of file diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index c32fe8b1..eacb925b 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -82,13 +82,11 @@ else: UPLOADEEPCMD='"$UPLOADER" $UPLOADERFLAGS -U eeprom:w:$SOURCES:i' ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["m"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Extract EEPROM data (from EEMEM directive) to .eep file diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index 347cb75a..083f4136 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -5,7 +5,7 @@ Builder for Atmel SAM series of microcontrollers """ -from os.path import join +from os.path import basename, join from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, DefaultEnvironment, SConscript) @@ -20,8 +20,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 env.Append( UPLOADERFLAGS=[ "-U", - "true" if "usb" in board_type.lower( - ) or board_type == "digix" else "false" + "true" if ("usb" in board_type.lower( + ) or board_type == "digix") else "false" ]) upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {}) @@ -37,6 +37,10 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 if upload_options.get("wait_for_upload_port", False): env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports)) + # use only port name for BOSSA + if "/" in env.subst("$UPLOAD_PORT"): + env.Replace(UPLOAD_PORT=basename(env.subst("$UPLOAD_PORT"))) + env = DefaultEnvironment() @@ -46,7 +50,6 @@ env.Replace( UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"), UPLOADERFLAGS=[ "--info", - "--debug", "--port", "$UPLOAD_PORT", "--erase", "--write", @@ -59,7 +62,9 @@ env.Replace( env.Append( CPPDEFINES=[ - "printf=iprintf" + "printf=iprintf", + "USBCON", + 'USB_MANUFACTURER="PlatformIO"' ], LINKFLAGS=[ @@ -68,13 +73,11 @@ env.Append( ] ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["m", "gcc"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Build the .bin file diff --git a/platformio/builder/scripts/basearm.py b/platformio/builder/scripts/basearm.py index 0cb81b83..9ae00990 100644 --- a/platformio/builder/scripts/basearm.py +++ b/platformio/builder/scripts/basearm.py @@ -50,16 +50,15 @@ env.Replace( "-mcpu=${BOARD_OPTIONS['build']['cpu']}" ], + LIBS=["c", "gcc", "m"], + SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES' ) -if env.get("BOARD_OPTIONS", {}).get("build", {}).get("cpu", "")[-2:] == "m4": +if env.get("BOARD_OPTIONS", {}).get("build", {}).get( + "cpu", "")[-2:] == "m4" and env.get("BOARD") != "frdm_k20d50m": env.Append( - ASFLAGS=[ - "-mfloat-abi=hard", - "-mfpu=fpv4-sp-d16" - ], - CCFLAGS=[ + CPPFLAGS=[ "-mfloat-abi=hard", "-mfpu=fpv4-sp-d16", "-fsingle-precision-constant" diff --git a/platformio/builder/scripts/baseavr.py b/platformio/builder/scripts/baseavr.py index bfe19df8..8a0384f1 100644 --- a/platformio/builder/scripts/baseavr.py +++ b/platformio/builder/scripts/baseavr.py @@ -47,6 +47,8 @@ env.Replace( "-Wl,--gc-sections" ], + LIBS=["m"], + SIZEPRINTCMD='"$SIZETOOL" --mcu=$BOARD_MCU -C -d $SOURCES' ) diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 77ef6c88..0821fe75 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -2,13 +2,19 @@ # See LICENSE for details. """ - Build script for Arduino Framework (based on Wiring). +Arduino + +Arduino Framework allows writing cross-platform software to control +devices attached to a wide range of Arduino boards to create all +kinds of creative coding, interactive objects, spaces or physical experiences. + +http://arduino.cc/en/Reference/HomePage """ from os import listdir, walk from os.path import isfile, join -from SCons.Script import DefaultEnvironment, Return +from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -23,12 +29,17 @@ BOARD_BUILDOPTS = BOARD_OPTS.get("build", {}) PLATFORMFW_DIR = join("$PIOPACKAGES_DIR", "framework-arduino${PLATFORM.replace('atmel', '')}") -if env.get("PLATFORM") == "digistump": +if "digispark" in BOARD_BUILDOPTS.get("core"): PLATFORMFW_DIR = join( "$PIOPACKAGES_DIR", "framework-arduino%s" % ( "sam" if BOARD_BUILDOPTS.get("cpu") == "cortex-m3" else "avr") ) +elif env.get("PLATFORM") == "timsp430": + PLATFORMFW_DIR = join( + "$PIOPACKAGES_DIR", + "framework-arduinomsp430" + ) env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR) @@ -86,7 +97,7 @@ if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam": env.VariantDir( join("$BUILD_DIR", "FrameworkArduinoInc"), - join("$PLATFORMFW_DIR", "cores", "digix") + join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}") ) env.Append( CPPPATH=[ @@ -146,7 +157,6 @@ if BOARD_BUILDOPTS.get("core", None) == "teensy": # Target: Build Core Library # - libs = [] if "variant" in BOARD_BUILDOPTS: @@ -168,14 +178,19 @@ libs.append(envsafe.BuildLibrary( )) if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam": + + env.Append( + LIBPATH=[ + join("$PLATFORMFW_DIR", "variants", + "${BOARD_OPTIONS['build']['variant']}") + ] + ) + envsafe.Append( CFLAGS=[ "-std=gnu99" ] ) - libs.append(envsafe.BuildLibrary( - join("$BUILD_DIR", "SamLib"), - join("$PLATFORMFW_DIR", "system", "libsam", "source") - )) + libs.append("sam_sam3x8e_gcc_rel") -Return("libs") +env.Append(LIBS=libs) diff --git a/platformio/builder/scripts/frameworks/cmsis.py b/platformio/builder/scripts/frameworks/cmsis.py index 4af5b98a..6410c10f 100644 --- a/platformio/builder/scripts/frameworks/cmsis.py +++ b/platformio/builder/scripts/frameworks/cmsis.py @@ -2,12 +2,22 @@ # See LICENSE for details. """ - Build script for CMSIS Framework. +CMSIS + +The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a +vendor-independent hardware abstraction layer for the Cortex-M processor +series and specifies debugger interfaces. The CMSIS enables consistent and +simple software interfaces to the processor for interface peripherals, +real-time operating systems, and middleware. It simplifies software +re-use, reducing the learning curve for new microcontroller developers +and cutting the time-to-market for devices. + +http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php """ from os.path import join -from SCons.Script import DefaultEnvironment, Return +from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -39,4 +49,4 @@ libs.append(envsafe.BuildLibrary( join("$PLATFORMFW_DIR", "variants", "${BOARD_OPTIONS['build']['variant']}") )) -Return("libs") +env.Append(LIBS=libs) diff --git a/platformio/builder/scripts/frameworks/energia.py b/platformio/builder/scripts/frameworks/energia.py index a4f72a63..67b4cc10 100644 --- a/platformio/builder/scripts/frameworks/energia.py +++ b/platformio/builder/scripts/frameworks/energia.py @@ -2,12 +2,20 @@ # See LICENSE for details. """ - Build script for Energia Framework (based on Wiring). +Energia + +Energia framework enables pretty much anyone to start easily creating +microcontroller-based projects and applications. Its easy-to-use libraries +and functions provide developers of all experience levels to start +blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever +before. + +http://energia.nu/reference/ """ from os.path import join -from SCons.Script import DefaultEnvironment, Return +from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -52,4 +60,4 @@ libs.append(env.BuildLibrary( join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}") )) -Return("libs") +env.Append(LIBS=libs) diff --git a/platformio/builder/scripts/frameworks/opencm3.py b/platformio/builder/scripts/frameworks/libopencm3.py similarity index 83% rename from platformio/builder/scripts/frameworks/opencm3.py rename to platformio/builder/scripts/frameworks/libopencm3.py index 5742429c..a0336e77 100644 --- a/platformio/builder/scripts/frameworks/opencm3.py +++ b/platformio/builder/scripts/frameworks/libopencm3.py @@ -2,21 +2,28 @@ # See LICENSE for details. """ - Build script for OpenCM3 Framework. +libOpenCM3 + +The libOpenCM3 framework aims to create a free/libre/open-source +firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, +including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, +17xx parts, Atmel SAM3, Energy Micro EFM32 and others. + +http://www.libopencm3.org/wiki/Main_Page """ import re from os import listdir, sep, walk from os.path import isfile, join, normpath -from SCons.Script import DefaultEnvironment, Return +from SCons.Script import DefaultEnvironment from platformio.util import exec_command env = DefaultEnvironment() env.Replace( - PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "framework-opencm3") + PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "framework-libopencm3") ) BOARD_BUILDOPTS = env.get("BOARD_OPTIONS", {}).get("build", {}) @@ -96,7 +103,7 @@ def get_source_files(src_dir): for search_path in mkdata['vpath']: src_path = normpath(join(src_dir, search_path, src_file)) if isfile(src_path): - sources.append(join("$BUILD_DIR", "FrameworkOpenCM3", + sources.append(join("$BUILD_DIR", "FrameworkLibOpenCM3", src_path.replace(lib_root + sep, ""))) break return sources @@ -132,14 +139,14 @@ if BOARD_BUILDOPTS.get("core") == "lm4f": ) env.VariantDir( - join("$BUILD_DIR", "FrameworkOpenCM3Variant"), + join("$BUILD_DIR", "FrameworkLibOpenCM3Variant"), join("$PLATFORMFW_DIR", "include") ) env.Append( CPPPATH=[ - join("$BUILD_DIR", "FrameworkOpenCM3"), - join("$BUILD_DIR", "FrameworkOpenCM3Variant") + join("$BUILD_DIR", "FrameworkLibOpenCM3"), + join("$BUILD_DIR", "FrameworkLibOpenCM3Variant") ] ) @@ -152,7 +159,7 @@ ldscript_path = find_ldscript(root_dir) merge_ld_scripts(ldscript_path) generate_nvic_files() -# override ldscript by opencm3 +# override ldscript by libopencm3 assert "LDSCRIPT_PATH" in env env.Replace( LDSCRIPT_PATH=ldscript_path @@ -160,12 +167,12 @@ env.Replace( libs = [] env.VariantDir( - join("$BUILD_DIR", "FrameworkOpenCM3"), + join("$BUILD_DIR", "FrameworkLibOpenCM3"), "$PLATFORMFW_DIR" ) libs.append(env.Library( - join("$BUILD_DIR", "FrameworkOpenCM3"), + join("$BUILD_DIR", "FrameworkLibOpenCM3"), get_source_files(root_dir) )) -Return("libs") +env.Append(LIBS=libs) diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py new file mode 100644 index 00000000..191e04d1 --- /dev/null +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -0,0 +1,238 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" +mbed + +The mbed framework The mbed SDK has been designed to provide enough +hardware abstraction to be intuitive and concise, yet powerful enough to +build complex projects. It is built on the low-level ARM CMSIS APIs, +allowing you to code down to the metal if needed. In addition to RTOS, +USB and Networking libraries, a cookbook of hundreds of reusable +peripheral and module libraries have been built on top of the SDK by +the mbed Developer Community. + +http://mbed.org/ +""" + +import re +import xml.etree.ElementTree as ElementTree +from binascii import crc32 +from os import walk +from os.path import basename, isfile, join, normpath + +from SCons.Script import DefaultEnvironment, Exit + +env = DefaultEnvironment() + +BOARD_OPTS = env.get("BOARD_OPTIONS", {}).get("build", {}) + +env.Replace( + PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "framework-mbed") +) + +MBED_VARIANTS = { + "stm32f3discovery": "DISCO_F303VC", + "stm32f4discovery": "DISCO_F407VG", + "stm32f429discovery": "DISCO_F429ZI", + "blueboard_lpc11u24": "LPC11U24", + "dipcortexm0": "LPC11U24", + "seeeduinoArchPro": "ARCH_PRO", + "ubloxc027": "UBLOX_C027", + "lpc1114fn28": "LPC1114", + "lpc11u35": "LPC11U35_401", + "mbuino": "LPC11U24", + "nrf51_mkit": "NRF51822", + "seeedTinyBLE": "SEEED_TINY_BLE", + "redBearLab": "RBLAB_NRF51822", + "nrf51-dt": "NRF51_DK", + "redBearLabBLENano": "RBLAB_NRF51822", + "wallBotBLE": "NRF51822", + "frdm_kl25z": "KL25Z", + "frdm_kl46z": "KL46Z", + "frdm_k64f": "K64F", + "frdm_kl05z": "KL05Z", + "frdm_k20d50m": "K20D50M", + "frdm_k22f": "K22F" +} + +MBED_LIBS_MAP = { + "dsp": {"ar": ["dsp", "cmsis_dsp"]}, + "eth": {"ar": ["eth"], "deps": ["rtos"]}, + "fat": {"ar": ["fat"]}, + "rtos": {"ar": ["rtos", "rtx"]}, + "usb": {"ar": ["USBDevice"]}, + "usb_host": {"ar": ["USBHost"]} +} + + +def get_mbedlib_includes(): + result = [] + for lib in MBED_LIBS_MAP.keys(): + includes = [] + lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", lib) + for _, _, files in walk(lib_dir): + for libfile in files: + if libfile.endswith(".h"): + includes.append(libfile) + result.append((lib, set(includes))) + return result + + +def get_used_mbedlibs(): + re_includes = re.compile(r"^(#include\s+(?:\<|\")([^\r\n\"]+))", + re.M | re.I) + srcincs = [] + for root, _, files in walk(env.get("PROJECTSRC_DIR")): + for pfile in files: + if not any([pfile.endswith(ext) for ext in (".h", ".c", ".cpp")]): + continue + with open(join(root, pfile)) as fp: + srcincs.extend([i[1] for i in re_includes.findall(fp.read())]) + srcincs = set(srcincs) + + result = {} + for libname, libincs in get_mbedlib_includes(): + if libincs & srcincs and libname not in result: + result[libname] = MBED_LIBS_MAP[libname] + + return result + + +def add_mbedlib(libname, libar): + if libar in env.get("LIBS"): + return + + lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", libname) + if not isfile(join(lib_dir, "TARGET_%s" % variant, + "TOOLCHAIN_GCC_ARM", "lib%s.a" % libar)): + Exit("Error: %s board doesn't support %s library!" % + (env.get("BOARD"), libname)) + + env.Append( + LIBPATH=[ + join(env.subst("$PLATFORMFW_DIR"), "libs", libname, + "TARGET_%s" % variant, "TOOLCHAIN_GCC_ARM") + ], + LIBS=[libar] + ) + + sysincdirs = ( + "eth", + "include", + "ipv4", + "lwip-eth", + "lwip-sys" + ) + + for root, _, files in walk(lib_dir): + if (not any(f.endswith(".h") for f in files) and + basename(root) not in sysincdirs): + continue + var_dir = join("$BUILD_DIR", "FrameworkMbed%sInc%d" % + (libname.upper(), crc32(root))) + if var_dir in env.get("CPPPATH"): + continue + env.VariantDir(var_dir, root) + env.Append(CPPPATH=[var_dir]) + + +def parse_eix_file(filename): + result = {} + paths = ( + ("CFLAGS", "./Target/Source/CC/Switch"), + ("CXXFLAGS", "./Target/Source/CPPC/Switch"), + ("CPPDEFINES", "./Target/Source/Symbols/Symbol"), + ("FILES", "./Target/Files/File"), + ("LINKFLAGS", "./Target/Source/LD/Switch"), + ("OBJFILES", "./Target/Source/Addobjects/Addobject"), + ("LIBPATH", "./Target/Linker/Librarypaths/Librarypath"), + ("STDLIBS", "./Target/Source/Syslibs/Library"), + ("LDSCRIPT_PATH", "./Target/Source/Scriptfile"), + ("CPPPATH", "./Target/Compiler/Includepaths/Includepath") + ) + + tree = ElementTree.parse(filename) + + for (key, path) in paths: + if key not in result: + result[key] = [] + + for node in tree.findall(path): + _nkeys = node.keys() + result[key].append( + node.get(_nkeys[0]) if len(_nkeys) == 1 else node.attrib) + + return result + + +def get_build_flags(data): + flags = {} + cflags = set(data.get("CFLAGS", [])) + cxxflags = set(data.get("CXXFLAGS", [])) + cppflags = set(cflags & cxxflags) + flags['CPPFLAGS'] = list(cppflags) + flags['CXXFLAGS'] = list(cxxflags - cppflags) + flags['CFLAGS'] = list(cflags - cppflags) + return flags + + +board_type = env.subst("$BOARD") +variant = MBED_VARIANTS[ + board_type] if board_type in MBED_VARIANTS else board_type.upper() +eixdata = parse_eix_file( + join(env.subst("$PLATFORMFW_DIR"), "variant", variant, "%s.eix" % variant)) + +build_flags = get_build_flags(eixdata) +variant_dir = join("$PLATFORMFW_DIR", "variant", variant) + +env.Replace( + CPPFLAGS=build_flags.get("CPPFLAGS", []), + CFLAGS=build_flags.get("CFLAGS", []), + CXXFLAGS=build_flags.get("CXXFLAGS", []), + LINKFLAGS=eixdata.get("LINKFLAGS", []), + CPPDEFINES=[define for define in eixdata.get("CPPDEFINES", [])], + LDSCRIPT_PATH=normpath( + join(variant_dir, eixdata.get("LDSCRIPT_PATH")[0])) +) + +# Hook for K64F and K22F +if board_type in ("frdm_k22f", "frdm_k64f"): + env.Append( + LINKFLAGS=["-Wl,--start-group"] + ) + +for lib_path in eixdata.get("CPPPATH"): + _vdir = join("$BUILD_DIR", "FrameworkMbedInc%d" % crc32(lib_path)) + env.VariantDir(_vdir, join(variant_dir, lib_path)) + env.Append(CPPPATH=[_vdir]) + +env.Append( + LIBPATH=[join(variant_dir, lib_path) + for lib_path in eixdata.get("LIBPATH", []) + if lib_path.startswith("mbed")] +) + +# +# Target: Build mbed Library +# + +libs = [l for l in eixdata.get("STDLIBS", []) if l not in env.get("LIBS")] +libs.extend(["mbed", "c", "gcc"]) + +libs.append(env.Library( + join("$BUILD_DIR", "FrameworkMbed"), + [join(variant_dir, f) + for f in eixdata.get("OBJFILES", [])] +)) + +env.Append(LIBS=libs) + +for _libname, _libdata in get_used_mbedlibs().iteritems(): + for _libar in _libdata['ar']: + add_mbedlib(_libname, _libar) + if "deps" not in _libdata: + continue + for libdep in _libdata['deps']: + for _libar in MBED_LIBS_MAP[libdep]['ar']: + add_mbedlib(libdep, _libar) diff --git a/platformio/builder/scripts/frameworks/spl.py b/platformio/builder/scripts/frameworks/spl.py index ee19fc0c..fb7abbbb 100644 --- a/platformio/builder/scripts/frameworks/spl.py +++ b/platformio/builder/scripts/frameworks/spl.py @@ -2,12 +2,19 @@ # See LICENSE for details. """ - Build script for SPL Framework +SPL + +The ST Standard Peripheral Library provides a set of functions for +handling the peripherals on the STM32 Cortex-M3 family. +The idea is to save the user (the new user, in particular) having to deal +directly with the registers. + +http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743?sc=stm32embeddedsoftware """ from os.path import join -from SCons.Script import DefaultEnvironment, Return +from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -61,4 +68,4 @@ libs.append(envsafe.BuildLibrary( ignore_files )) -Return("libs") +env.Append(LIBS=libs) diff --git a/platformio/builder/scripts/freescalekinetis.py b/platformio/builder/scripts/freescalekinetis.py new file mode 100644 index 00000000..c80d7134 --- /dev/null +++ b/platformio/builder/scripts/freescalekinetis.py @@ -0,0 +1,50 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" + Builder for Freescale Kinetis series ARM microcontrollers. +""" + +from os.path import join + +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, + DefaultEnvironment, SConscript) + +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, env.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..15e67cc2 --- /dev/null +++ b/platformio/builder/scripts/nordicnrf51.py @@ -0,0 +1,50 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +""" + Builder for Nordic nRF51 series ARM microcontrollers. +""" + +from os.path import join + +from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, + DefaultEnvironment, SConscript) + +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, env.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..39b9dfd9 --- /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/builder/scripts/stm32.py b/platformio/builder/scripts/ststm32.py similarity index 74% rename from platformio/builder/scripts/stm32.py rename to platformio/builder/scripts/ststm32.py index 4cd991af..7b4d80e3 100644 --- a/platformio/builder/scripts/stm32.py +++ b/platformio/builder/scripts/ststm32.py @@ -2,10 +2,10 @@ # See LICENSE for details. """ - Builder for STMicroelectronics - STM32 Series ARM microcontrollers. + Builder for ST STM32 Series ARM microcontrollers. """ +import platform from os.path import join from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, @@ -38,13 +38,11 @@ env.Append( ] ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["c", "gcc", "m", "nosys"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Build the .bin file @@ -66,7 +64,13 @@ AlwaysBuild(target_size) # Target: Upload by default .bin file # -upload = env.Alias(["upload", "uploadlazy"], target_firm, "$UPLOADCMD") +disable_msd = (platform.system() == "Darwin" and + platform.release().startswith("14.")) +if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: + upload = env.Alias(["upload", "uploadlazy"], + target_firm, env.UploadToDisk) +else: + upload = env.Alias(["upload", "uploadlazy"], target_firm, "$UPLOADCMD") AlwaysBuild(upload) # diff --git a/platformio/builder/scripts/teensy.py b/platformio/builder/scripts/teensy.py index a6f9837c..140fa8fd 100644 --- a/platformio/builder/scripts/teensy.py +++ b/platformio/builder/scripts/teensy.py @@ -53,13 +53,11 @@ else: UPLOADHEXCMD='"$UPLOADER" $UPLOADERFLAGS' ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["m"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Build the firmware file diff --git a/platformio/builder/scripts/timsp430.py b/platformio/builder/scripts/timsp430.py index 98fbd1d1..90507539 100644 --- a/platformio/builder/scripts/timsp430.py +++ b/platformio/builder/scripts/timsp430.py @@ -48,6 +48,8 @@ env.Replace( "-Wl,-gc-sections,-u,main" ], + LIBS=["m"], + SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES', UPLOADER=join("$PIOPACKAGES_DIR", "tool-mspdebug", "mspdebug"), @@ -74,13 +76,11 @@ env.Append( ) ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["m"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Build the .hex diff --git a/platformio/builder/scripts/titiva.py b/platformio/builder/scripts/titiva.py index b96d4b70..db14ecdf 100644 --- a/platformio/builder/scripts/titiva.py +++ b/platformio/builder/scripts/titiva.py @@ -27,13 +27,11 @@ env.Append( ] ) -CORELIBS = env.ProcessGeneral() - # # Target: Build executable and linkable firmware # -target_elf = env.BuildFirmware(["c", "gcc", "m"] + CORELIBS) +target_elf = env.BuildFirmware() # # Target: Build the .bin file diff --git a/platformio/builder/tools/pioar.py b/platformio/builder/tools/pioar.py index e3b2fed4..c98fa6c0 100644 --- a/platformio/builder/tools/pioar.py +++ b/platformio/builder/tools/pioar.py @@ -1,29 +1,21 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -import atexit -from os import remove -from tempfile import mkstemp +from hashlib import md5 +from os.path import join +from tempfile import gettempdir MAX_SOURCES_LENGTH = 8000 # Windows CLI has limit with command length to 8192 -def _remove_tmpfile(path): - try: - remove(path) - except WindowsError: # pylint: disable=E0602 - pass - - def _huge_sources_hook(sources): - if len(str(sources)) < MAX_SOURCES_LENGTH: + _sources = str(sources).replace("\\", "/") + if len(str(_sources)) < MAX_SOURCES_LENGTH: return sources - _, tmp_file = mkstemp() + tmp_file = join(gettempdir(), "pioarargs-%s" % md5(_sources).hexdigest()) with open(tmp_file, "w") as f: - f.write(str(sources).replace("\\", "/")) - - atexit.register(_remove_tmpfile, tmp_file) + f.write(_sources) return "@%s" % tmp_file diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 130fd22f..84e72f01 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -1,13 +1,14 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -import platform +from os.path import join +from shutil import copyfile from time import sleep from SCons.Script import Exit from serial import Serial -from platformio.util import get_serialports +from platformio.util import get_logicaldisks, get_serialports def FlushSerialBuffer(env, port): @@ -23,9 +24,9 @@ def FlushSerialBuffer(env, port): def TouchSerialPort(env, port, baudrate): s = Serial(port=env.subst(port), baudrate=baudrate) + s.setDTR(False) s.close() - if platform.system() != "Darwin": - sleep(0.3) + sleep(0.4) def WaitForNewSerialPort(_, before): @@ -52,16 +53,38 @@ def WaitForNewSerialPort(_, before): def AutodetectUploadPort(env): - if "UPLOAD_PORT" not in env: + if "UPLOAD_PORT" in env: + return + + if env.subst("$FRAMEWORK") == "mbed": + msdlabels = ("mbed", "nucleo", "frdm") + for item in get_logicaldisks(): + if (not item['name'] or + not any([l in item['name'].lower() for l in msdlabels])): + continue + print "Auto-detected UPLOAD_PORT/DISK: %s" % item['disk'] + env.Replace(UPLOAD_PORT=item['disk']) + break + else: for item in get_serialports(): - if "VID:PID" in item['hwid']: - print "Auto-detected UPLOAD_PORT: %s" % item['port'] - env.Replace(UPLOAD_PORT=item['port']) - break + if "VID:PID" not in item['hwid']: + continue + print "Auto-detected UPLOAD_PORT: %s" % item['port'] + env.Replace(UPLOAD_PORT=item['port']) + break if "UPLOAD_PORT" not in env: Exit("Error: Please specify `upload_port` for environment or use " - "global `--upload-port` option.\n") + "global `--upload-port` option.\n" + "For the some development platforms it can be USB flash drive\n") + + +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.") def exists(_): @@ -73,4 +96,5 @@ def generate(env): env.AddMethod(TouchSerialPort) env.AddMethod(WaitForNewSerialPort) env.AddMethod(AutodetectUploadPort) + env.AddMethod(UploadToDisk) return env diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 37931953..a27d8654 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -6,11 +6,14 @@ import re from os import getenv, listdir, remove, sep, walk from os.path import basename, dirname, isdir, isfile, join, normpath -from SCons.Script import SConscript, SConscriptChdir +from SCons.Script import Exit, SConscript, SConscriptChdir from SCons.Util import case_sensitive_suffixes +from platformio.util import pioversion_to_intstr + + +def BuildFirmware(env): -def ProcessGeneral(env): # fix ASM handling under non-casitive OS if not case_sensitive_suffixes('.s', '.S'): env.Replace( @@ -24,20 +27,8 @@ def ProcessGeneral(env): if "BUILD_FLAGS" in env: env.MergeFlags(env['BUILD_FLAGS']) - corelibs = [] - if "FRAMEWORK" in env: - if env['FRAMEWORK'] in ("arduino", "energia"): - env.ConvertInoToCpp() - for f in env['FRAMEWORK'].split(","): - SConscriptChdir(0) - corelibs += SConscript( - env.subst(join("$PIOBUILDER_DIR", "scripts", "frameworks", - "%s.py" % f.strip().lower())) - ) - return corelibs + env.BuildFramework() - -def BuildFirmware(env, corelibs): firmenv = env.Clone() vdirs = firmenv.VariantDirRecursive( join("$BUILD_DIR", "src"), "$PROJECTSRC_DIR") @@ -59,13 +50,21 @@ def BuildFirmware(env, corelibs): _LIBFLAGS=" -Wl,--end-group" ) - firmenv.MergeFlags(getenv("PLATFORMIO_SRCBUILD_FLAGS", "$SRCBUILD_FLAGS")) + _srcbuild_flags = getenv("PLATFORMIO_SRCBUILD_FLAGS", + env.subst("$SRCBUILD_FLAGS")) + if _srcbuild_flags: + firmenv.MergeFlags(_srcbuild_flags) + + firmenv.Append( + CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format( + *pioversion_to_intstr())] + ) return firmenv.Program( join("$BUILD_DIR", "firmware"), [firmenv.GlobCXXFiles(vdir) for vdir in vdirs], - LIBS=corelibs + deplibs, - LIBPATH="$BUILD_DIR", + LIBS=env.get("LIBS", []) + deplibs, + LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"], PROGSUFFIX=".elf" ) @@ -95,6 +94,26 @@ def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True, return variants +def BuildFramework(env): + if "FRAMEWORK" not in env: + return + + if env['FRAMEWORK'].lower() in ("arduino", "energia"): + env.ConvertInoToCpp() + + for f in env['FRAMEWORK'].split(","): + framework = f.strip().lower() + if framework in env.get("BOARD_OPTIONS", {}).get("frameworks"): + SConscriptChdir(0) + SConscript( + env.subst(join("$PIOBUILDER_DIR", "scripts", "frameworks", + "%s.py" % framework)) + ) + else: + Exit("Error: This board doesn't support %s framework!" % + framework) + + def BuildLibrary(env, variant_dir, library_dir, ignore_files=None): lib = env.Clone() vdirs = lib.VariantDirRecursive( @@ -157,7 +176,11 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914 for ld in listdir(lsd_dir): inc_path = normpath(join(lsd_dir, ld, self.name)) - lib_dir = inc_path[:inc_path.index(sep, len(lsd_dir) + 1)] + try: + lib_dir = inc_path[:inc_path.index( + sep, len(lsd_dir) + 1)] + except ValueError: + continue lib_name = basename(lib_dir) # ignore user's specified libs @@ -265,9 +288,6 @@ def ConvertInoToCpp(env): continue ino_contents = item.get_text_contents() - re_includes = re.compile(r"^(#include\s+(?:\<|\")[^\r\n]+)", - re.M | re.I) - includes = re_includes.findall(ino_contents) prototypes = re.findall( r"""^( (?:\s*[a-z_\d]+){1,2} # return type @@ -278,19 +298,15 @@ def ConvertInoToCpp(env): ino_contents, re.X | re.M | re.I ) - # print includes, prototypes - - # disable previous includes - ino_contents = re_includes.sub(r"//\1", ino_contents) + prototypes = [p.strip() for p in prototypes] + # print prototypes # create new temporary C++ valid file with open(cppfile, "w") as f: f.write("#include \n") - if includes: - f.write("%s\n" % "\n".join(includes)) if prototypes: f.write("%s;\n" % ";\n".join(prototypes)) - f.write("#line 1 \"%s\"\n" % basename(item.path)) + f.write('#line 1 "%s"\n' % basename(item.path)) f.write(ino_contents) tmpcpp.append(cppfile) @@ -303,10 +319,10 @@ def exists(_): def generate(env): - env.AddMethod(ProcessGeneral) env.AddMethod(BuildFirmware) env.AddMethod(GlobCXXFiles) env.AddMethod(VariantDirRecursive) + env.AddMethod(BuildFramework) env.AddMethod(BuildLibrary) env.AddMethod(BuildDependentLibraries) env.AddMethod(ConvertInoToCpp) 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/commands/init.py b/platformio/commands/init.py index c5f58aaa..1c32ecca 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -94,11 +94,11 @@ def fill_project_envs(project_file, board_types, disable_auto_uploading): data = builtin_boards[type_] # find default framework for board - framework = data.get("framework", None) + frameworks = data.get("frameworks") content.append("[env:autogen_%s]" % type_) content.append("platform = %s" % data['platform']) - if framework: - content.append("framework = %s" % framework) + if frameworks: + content.append("framework = %s" % frameworks[0]) content.append("board = %s" % type_) content.append("%stargets = upload" % ("# " if disable_auto_uploading diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index cb6e89a1..91c8dced 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -169,7 +169,7 @@ def lib_list(json_output): return echo_liblist_header() - for item in items: + for item in sorted(items, key=lambda i: i['id']): item['authornames'] = [i['name'] for i in item['authors']] echo_liblist_item(item) diff --git a/platformio/commands/search.py b/platformio/commands/search.py index 3af2aa5b..d3b7d69a 100644 --- a/platformio/commands/search.py +++ b/platformio/commands/search.py @@ -18,24 +18,29 @@ def cli(query, json_output): platforms.sort() for platform in platforms: p = PlatformFactory.newPlatform(platform) - name = p.get_name() - info = p.get_short_info() + type_ = p.get_type() + description = p.get_description() if query == "all": query = "" - search_data = "%s %s" % (name, info) + search_data = "%s %s %s" % (type_, description, p.get_packages()) if query and query.lower() not in search_data.lower(): continue data.append({ - "name": name, - "info": info + "type": type_, + "description": description, + "packages": p.get_packages() }) if json_output: click.echo(json.dumps(data)) else: for item in data: - click.echo("{name:<20} - {info}".format( - name=click.style(item['name'], fg="cyan"), info=item['info'])) + click.secho(item['type'], fg="cyan", nl=False) + click.echo(" (available packages: %s)" % ", ".join( + p.get_packages().keys())) + click.secho("-" * len(item['type']), fg="cyan") + click.echo(item['description']) + click.echo() diff --git a/platformio/commands/show.py b/platformio/commands/show.py index 989b9aaf..f0913ff9 100644 --- a/platformio/commands/show.py +++ b/platformio/commands/show.py @@ -12,7 +12,7 @@ from platformio.pkgmanager import PackageManager from platformio.platforms.base import PlatformFactory -@click.command("show", short_help="Show details about installed platforms") +@click.command("show", short_help="Show details about installed platform") @click.argument("platform") @click.pass_context def cli(ctx, platform): @@ -29,8 +29,9 @@ def cli(ctx, platform): raise PlatformNotInstalledYet(platform) p = PlatformFactory.newPlatform(platform) - click.echo("{name:<20} - {info}".format( - name=click.style(p.get_name(), fg="cyan"), info=p.get_short_info())) + click.echo("{name:<20} - {description} [ {url} ]".format( + name=click.style(p.get_type(), fg="cyan"), + description=p.get_description(), url=p.get_vendor_url())) installed_packages = PackageManager.get_installed() for name in p.get_installed_packages(): diff --git a/platformio/exception.py b/platformio/exception.py index 5646befe..451e7761 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -44,6 +44,11 @@ class UnknownBoard(PlatformioException): MESSAGE = "Unknown board type '%s'" +class UnknownFramework(PlatformioException): + + MESSAGE = "Unknown framework '%s'" + + class UnknownPackage(PlatformioException): MESSAGE = "Detected unknown package '%s'" diff --git a/platformio/pkgmanager.py b/platformio/pkgmanager.py index 757031e3..bd0e816f 100644 --- a/platformio/pkgmanager.py +++ b/platformio/pkgmanager.py @@ -28,7 +28,7 @@ class PackageManager(object): try: return cls._cached_manifest except AttributeError: - cls._cached_manifest = get_api_result("/packages") + cls._cached_manifest = get_api_result("/packages/manifest") return cls._cached_manifest @staticmethod diff --git a/platformio/platforms/atmelavr.py b/platformio/platforms/atmelavr.py index f8b34bb9..9c7bc243 100644 --- a/platformio/platforms/atmelavr.py +++ b/platformio/platforms/atmelavr.py @@ -8,8 +8,13 @@ from platformio.util import get_boards class AtmelavrPlatform(BasePlatform): """ - An embedded platform for Atmel AVR microcontrollers - (with Arduino Framework) + Atmel AVR 8- and 32-bit MCUs deliver a unique combination of + performance, power efficiency and design flexibility. Optimized to + speed time to market-and easily adapt to new ones-they are based on + the industrys most code-efficient architecture for C and assembly + programming. + + http://www.atmel.com/products/microcontrollers/avr/default.aspx """ PACKAGES = { @@ -32,6 +37,9 @@ class AtmelavrPlatform(BasePlatform): } } + def get_name(self): + return "Atmel AVR" + def on_run_err(self, line): # pylint: disable=R0201 # fix STDERR "flash written" for avrdude if "avrdude" in line: diff --git a/platformio/platforms/atmelsam.py b/platformio/platforms/atmelsam.py index f5913ce9..e11d98a4 100644 --- a/platformio/platforms/atmelsam.py +++ b/platformio/platforms/atmelsam.py @@ -7,8 +7,11 @@ from platformio.platforms.base import BasePlatform class AtmelsamPlatform(BasePlatform): """ - An embedded platform for Atmel SAM microcontrollers - (with Arduino Framework) + Atmel | SMART offers Flash- based ARM products based on the ARM + Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB + to 2MB of Flash including a rich peripheral and feature mix. + + http://www.atmel.com/products/microcontrollers/arm/default.aspx """ PACKAGES = { @@ -31,3 +34,6 @@ class AtmelsamPlatform(BasePlatform): "default": True } } + + def get_name(self): + return "Atmel SAM" diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index dcfef9d9..72f7c77d 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -12,21 +12,109 @@ from platformio import exception, util from platformio.app import get_state_item, set_state_item from platformio.pkgmanager import PackageManager +PLATFORM_PACKAGES = { + + "framework-arduinoavr": [ + ("Arduino Wiring-based Framework (AVR Core, 1.6)", + "http://arduino.cc/en/Reference/HomePage") + ], + "framework-arduinosam": [ + ("Arduino Wiring-based Framework (SAM Core, 1.6)", + "http://arduino.cc/en/Reference/HomePage") + ], + "framework-arduinoteensy": [ + ("Arduino Wiring-based Framework", + "http://arduino.cc/en/Reference/HomePage") + ], + "framework-arduinomsp430": [ + ("Arduino Wiring-based Framework (MSP430 Core)", + "http://arduino.cc/en/Reference/HomePage") + ], + "framework-energiamsp430": [ + ("Energia Wiring-based Framework (MSP430 Core)", + "http://energia.nu/reference/") + ], + "framework-energiativa": [ + ("Energia Wiring-based Framework (LM4F Core)", + "http://energia.nu/reference/") + ], + "framework-cmsis": [ + ("Vendor-independent hardware abstraction layer for the Cortex-M " + "processor series", + "http://www.arm.com/products/processors/" + "cortex-m/cortex-microcontroller-software-interface-standard.php") + ], + "framework-spl": [ + ("Standard Peripheral Library for STM32 MCUs", + "http://www.st.com" + "/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257890") + ], + "framework-libopencm3": [ + ("libOpenCM3 Framework", "http://www.libopencm3.org/") + ], + "framework-mbed": [ + ("mbed Framework", "http://mbed.org") + ], + "ldscripts": [ + ("Linker Scripts", + "https://sourceware.org/binutils/docs/ld/Scripts.html") + ], + "toolchain-atmelavr": [ + ("avr-gcc", "https://gcc.gnu.org/wiki/avr-gcc"), + ("GDB", "http://www.gnu.org/software/gdb/"), + ("AVaRICE", "http://avarice.sourceforge.net/"), + ("SimulAVR", "http://www.nongnu.org/simulavr/") + ], + "toolchain-gccarmnoneeabi": [ + ("gcc-arm-embedded", "https://launchpad.net/gcc-arm-embedded"), + ("GDB", "http://www.gnu.org/software/gdb/") + ], + "toolchain-timsp430": [ + ("msp-gcc", "http://sourceforge.net/projects/mspgcc/"), + ("GDB", "http://www.gnu.org/software/gdb/") + ], + "tool-avrdude": [ + ("AVRDUDE", "http://www.nongnu.org/avrdude/") + ], + "tool-micronucleus": [ + ("Micronucleus", "https://github.com/micronucleus/micronucleus") + ], + "tool-bossac": [ + ("BOSSA CLI", "https://sourceforge.net/projects/b-o-s-s-a/") + ], + "tool-stlink": [ + ("ST-Link", "https://github.com/texane/stlink") + ], + "tool-teensy": [ + ("Teensy Loader", "https://www.pjrc.com/teensy/loader.html") + ], + "tool-lm4flash": [ + ("Flash Programmer", "http://www.ti.com/tool/lmflashprogrammer") + ], + "tool-mspdebug": [ + ("MSPDebug", "http://mspdebug.sourceforge.net/") + ] +} + + +def get_packages(): + return PLATFORM_PACKAGES + class PlatformFactory(object): @staticmethod - def get_clsname(name): - return "%sPlatform" % name.title() + def get_clsname(type_): + return "%sPlatform" % type_.title() @staticmethod - def load_module(name, path): + def load_module(type_, path): module = None try: module = load_source( - "platformio.platforms.%s" % name, path) + "platformio.platforms.%s" % type_, path) except ImportError: - raise exception.UnknownPlatform(name) + raise exception.UnknownPlatform(type_) return module @classmethod @@ -39,15 +127,15 @@ class PlatformFactory(object): for p in listdir(pdir): if p in ("__init__.py", "base.py") or not p.endswith(".py"): continue - name = p[:-3] + type_ = p[:-3] path = join(pdir, p) try: isplatform = hasattr( - cls.load_module(name, path), - cls.get_clsname(name) + cls.load_module(type_, path), + cls.get_clsname(type_) ) if isplatform: - platforms[name] = path + platforms[type_] = path except exception.UnknownPlatform: pass @@ -55,20 +143,20 @@ class PlatformFactory(object): return platforms installed_platforms = {} - for name in get_state_item("installed_platforms", []): - if name in platforms: - installed_platforms[name] = platforms[name] + for type_ in get_state_item("installed_platforms", []): + if type_ in platforms: + installed_platforms[type_] = platforms[type_] return installed_platforms @classmethod - def newPlatform(cls, name): + def newPlatform(cls, type_): platforms = cls.get_platforms() - if name not in platforms: - raise exception.UnknownPlatform(name) + if type_ not in platforms: + raise exception.UnknownPlatform(type_) _instance = getattr( - cls.load_module(name, platforms[name]), - cls.get_clsname(name) + cls.load_module(type_, platforms[type_]), + cls.get_clsname(type_) )() assert isinstance(_instance, BasePlatform) return _instance @@ -82,20 +170,30 @@ class BasePlatform(object): def __init__(self): self._found_error = False - def get_name(self): + def get_type(self): return self.__class__.__name__[:-8].lower() + def get_name(self): + return self.get_type().title() + def get_build_script(self): builtin = join(util.get_source_dir(), "builder", "scripts", "%s.py" % - self.get_name()) + self.get_type()) if isfile(builtin): return builtin raise NotImplementedError() - def get_short_info(self): + def get_description(self): if self.__doc__: - doclines = [l.strip() for l in self.__doc__.splitlines()] - return " ".join(doclines).strip() + doclines = [l.strip() for l in self.__doc__.splitlines() if + l.strip()] + return " ".join(doclines[:-1]).strip() + else: + raise NotImplementedError() + + def get_vendor_url(self): + if self.__doc__ and "http" in self.__doc__: + return self.__doc__[self.__doc__.index("http"):].strip() else: raise NotImplementedError() @@ -144,14 +242,14 @@ class BasePlatform(object): # register installed platform data = get_state_item("installed_platforms", []) - if self.get_name() not in data: - data.append(self.get_name()) + if self.get_type() not in data: + data.append(self.get_type()) set_state_item("installed_platforms", data) return len(requirements) def uninstall(self): - platform = self.get_name() + platform = self.get_type() installed_platforms = PlatformFactory.get_platforms( installed=True).keys() @@ -195,8 +293,8 @@ class BasePlatform(object): installed=True).keys() installed_packages = PackageManager.get_installed() - if self.get_name() not in installed_platforms: - raise exception.PlatformNotInstalledYet(self.get_name()) + if self.get_type() not in installed_platforms: + raise exception.PlatformNotInstalledYet(self.get_type()) if "clean" in targets: targets.remove("clean") diff --git a/platformio/platforms/freescalekinetis.py b/platformio/platforms/freescalekinetis.py new file mode 100644 index 00000000..56239f17 --- /dev/null +++ b/platformio/platforms/freescalekinetis.py @@ -0,0 +1,31 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class FreescalekinetisPlatform(BasePlatform): + + """ + 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. + + http://www.freescale.com/webapp/sps/site/homepage.jsp?code=KINETIS + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + } + + def get_name(self): + return "Freescale Kinetis" diff --git a/platformio/platforms/nordicnrf51.py b/platformio/platforms/nordicnrf51.py new file mode 100644 index 00000000..e3a09a0d --- /dev/null +++ b/platformio/platforms/nordicnrf51.py @@ -0,0 +1,33 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class Nordicnrf51Platform(BasePlatform): + + """ + 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. + + https://www.nordicsemi.com/eng/Products/nRF51-Series-SoC + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + } + + def get_name(self): + return "Nordic nRF51" diff --git a/platformio/platforms/nxplpc.py b/platformio/platforms/nxplpc.py new file mode 100644 index 00000000..b165731f --- /dev/null +++ b/platformio/platforms/nxplpc.py @@ -0,0 +1,33 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class NxplpcPlatform(BasePlatform): + + """ + 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. + + http://www.nxp.com/products/microcontrollers/ + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "framework-mbed": { + "default": True + } + } + + def get_name(self): + return "NXP LPC" diff --git a/platformio/platforms/stm32.py b/platformio/platforms/stm32.py deleted file mode 100644 index 63607d95..00000000 --- a/platformio/platforms/stm32.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) Ivan Kravets -# See LICENSE for details. - -from platformio.platforms.base import BasePlatform - - -class Stm32Platform(BasePlatform): - - """ - An embedded platform for STMicroelectronics ARM microcontrollers - """ - - PACKAGES = { - - "toolchain-gccarmnoneeabi": { - "alias": "toolchain", - "default": True - }, - - "ldscripts": { - "default": True - }, - - "tool-stlink": { - "alias": "uploader", - "default": True - }, - - "framework-cmsis": { - "default": True - }, - - "framework-spl": { - "default": True - }, - - "framework-opencm3": { - "default": True - } - } diff --git a/platformio/platforms/ststm32.py b/platformio/platforms/ststm32.py new file mode 100644 index 00000000..45c029a9 --- /dev/null +++ b/platformio/platforms/ststm32.py @@ -0,0 +1,54 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from platformio.platforms.base import BasePlatform + + +class Ststm32Platform(BasePlatform): + + """ + The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M + processor is designed to offer new degrees of freedom to MCU users. + It offers a 32-bit product range that combines very high performance, + real-time capabilities, digital signal processing, and low-power, + low-voltage operation, while maintaining full integration and ease of + development. + + http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32 + """ + + PACKAGES = { + + "toolchain-gccarmnoneeabi": { + "alias": "toolchain", + "default": True + }, + + "ldscripts": { + "default": True + }, + + "tool-stlink": { + "alias": "uploader", + "default": True + }, + + "framework-cmsis": { + "default": True + }, + + "framework-spl": { + "default": True + }, + + "framework-libopencm3": { + "default": True + }, + + "framework-mbed": { + "default": True + } + } + + def get_name(self): + return "ST STM32" diff --git a/platformio/platforms/teensy.py b/platformio/platforms/teensy.py index 8e0f2179..cc79c3ee 100644 --- a/platformio/platforms/teensy.py +++ b/platformio/platforms/teensy.py @@ -8,8 +8,13 @@ from platformio.util import get_boards class TeensyPlatform(BasePlatform): """ - An embedded platform for Teensy boards - (with Arduino Framework) + Teensy is a complete USB-based microcontroller development system, in + a very small footprint, capable of implementing many types of projects. + All programming is done via the USB port. No special programmer is + needed, only a standard "Mini-B" USB cable and a PC or Macintosh with + a USB port. + + https://www.pjrc.com/teensy """ PACKAGES = { @@ -36,6 +41,9 @@ class TeensyPlatform(BasePlatform): } } + def get_name(self): + return "Teensy" + def run(self, variables, targets): for v in variables: if "BOARD=" not in v: diff --git a/platformio/platforms/timsp430.py b/platformio/platforms/timsp430.py index ae17a121..8973cded 100644 --- a/platformio/platforms/timsp430.py +++ b/platformio/platforms/timsp430.py @@ -5,9 +5,14 @@ from platformio.platforms.base import BasePlatform class Timsp430Platform(BasePlatform): + """ - An embedded platform for TI MSP430 microcontrollers - (with Energia Framework) + MSP430 microcontrollers (MCUs) from Texas Instruments (TI) + are 16-bit, RISC-based, mixed-signal processors designed for ultra-low + power. These MCUs offer the lowest power consumption and the perfect + mix of integrated peripherals for thousands of applications. + + http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/msp/overview.page """ PACKAGES = { @@ -24,5 +29,12 @@ class Timsp430Platform(BasePlatform): "framework-energiamsp430": { "default": True + }, + + "framework-arduinomsp430": { + "default": True } } + + def get_name(self): + return "TI MSP430" diff --git a/platformio/platforms/titiva.py b/platformio/platforms/titiva.py index 657cffa9..ffb7e58b 100644 --- a/platformio/platforms/titiva.py +++ b/platformio/platforms/titiva.py @@ -7,8 +7,12 @@ from platformio.platforms.base import BasePlatform class TitivaPlatform(BasePlatform): """ - An embedded platform for TI TIVA C ARM microcontrollers - (with Energia and OpenCM3 Frameworks) + Texas Instruments TM4C12x MCUs offer the industrys most popular + ARM Cortex-M4 core with scalable memory and package options, unparalleled + connectivity peripherals, advanced application functions, industry-leading + analog integration, and extensive software solutions. + + http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/c2000_performance/control_automation/tm4c12x/overview.page """ PACKAGES = { @@ -31,7 +35,10 @@ class TitivaPlatform(BasePlatform): "default": True }, - "framework-opencm3": { + "framework-libopencm3": { "default": True } } + + def get_name(self): + return "TI TIVA" diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 6bd014dc..55b26f21 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -89,6 +89,7 @@ class MeasurementProtocol(TelemetryBase): self['cd1'] = get_systype() self['cd2'] = "Python/%s %s" % (platform.python_version(), platform.platform()) + self['cd4'] = 1 if app.get_setting("enable_prompts") else 0 def _prefill_screen_name(self): args = [str(s).lower() for s in sys_argv[1:]] diff --git a/platformio/util.py b/platformio/util.py index b4f0473c..82582573 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -3,8 +3,10 @@ import json import os +import re import subprocess -from os.path import abspath, dirname, expanduser, isdir, isfile, join, realpath +from os.path import (abspath, basename, dirname, expanduser, isdir, isfile, + join, realpath) from platform import system, uname from threading import Thread @@ -56,6 +58,12 @@ def get_systype(): return ("%s_%s" % (data[0], data[4])).lower() +def pioversion_to_intstr(): + vermatch = re.match(r"^([\d\.]+)", __version__) + assert vermatch + return [int(i) for i in vermatch.group(1).split(".")[:3]] + + def _get_projconf_option_dir(name, default=None): _env_name = "PLATFORMIO_%s" % name.upper() if _env_name in os.environ: @@ -173,7 +181,30 @@ def get_serialports(): from serial.tools.list_ports_posix import comports else: raise exception.GetSerialPortsError(os.name) - return[{"port": p, "description": d, "hwid": h} for p, d, h in comports()] + return [{"port": p, "description": d, "hwid": h} for p, d, h in comports()] + + +def get_logicaldisks(): + disks = [] + if system() == "Windows": + result = exec_command( + ["wmic", "logicaldisk", "get", "name,VolumeName"]).get("out") + disknamere = re.compile(r"^([A-Z]{1}\:)\s*(\S+)?") + for line in result.split("\n"): + match = disknamere.match(line.strip()) + if not match: + continue + disks.append({"disk": match.group(1), "name": match.group(2)}) + else: + result = exec_command(["df"]).get("out") + disknamere = re.compile(r"\d+\%\s+([a-z\d\-_/]+)$", flags=re.I) + for line in result.split("\n"): + match = disknamere.search(line.strip()) + if not match: + continue + disks.append({"disk": match.group(1), + "name": basename(match.group(1))}) + return disks def get_api_result(path, params=None, data=None): @@ -181,7 +212,6 @@ def get_api_result(path, params=None, data=None): r = None try: - requests.packages.urllib3.disable_warnings() headers = {"User-Agent": "PlatformIO/%s %s" % ( __version__, requests.utils.default_user_agent())} @@ -232,3 +262,41 @@ def get_boards(type_=None): if type_ not in boards: raise exception.UnknownBoard(type_) return boards[type_] + + +def get_frameworks(type_=None): + frameworks = {} + + try: + frameworks = get_frameworks._cache # pylint: disable=W0212 + except AttributeError: + frameworks_path = join( + get_source_dir(), "builder", "scripts", "frameworks") + + frameworks_list = [f[:-3] for f in os.listdir(frameworks_path) + if not f.startswith("__") and f.endswith(".py")] + for _type in frameworks_list: + script_path = join(frameworks_path, "%s.py" % _type) + with open(script_path) as f: + fcontent = f.read() + assert '"""' in fcontent + _doc_start = fcontent.index('"""') + 3 + fdoc = fcontent[ + _doc_start:fcontent.index('"""', _doc_start)].strip() + doclines = [l.strip() for l in fdoc.splitlines() if l.strip()] + frameworks[_type] = { + "name": doclines[0], + "description": " ".join(doclines[1:-1]), + "url": doclines[-1], + "script": script_path + } + get_frameworks._cache = frameworks # pylint: disable=W0212 + + if type_ is None: + return frameworks + else: + if type_ not in frameworks: + raise exception.UnknownFramework(type_) + return frameworks[type_] + + return frameworks diff --git a/requirements.txt b/requirements.txt index e663d162..6a5ccae6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ click==3.3 colorama==0.3.3 pyserial==2.7 -requests==2.5.3 +requests==2.6.0 scons==2.3.0 diff --git a/scripts/docspregen.py b/scripts/docspregen.py new file mode 100644 index 00000000..d07afb95 --- /dev/null +++ b/scripts/docspregen.py @@ -0,0 +1,252 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +from math import ceil +from os.path import dirname, join, realpath +from sys import exit as sys_exit +from sys import path + +path.append("..") + +from platformio import util +from platformio.platforms.base import PlatformFactory, get_packages + + +def is_compat_platform_and_framework(platform, framework): + p = PlatformFactory.newPlatform(platform) + for pkg in p.get_packages().keys(): + if pkg.startswith("framework-%s" % framework): + return True + return False + + +def generate_boards(boards): + + def _round_memory_size(size): + size = ceil(size) + for b in (64, 32, 16, 8, 4, 2, 1): + if b < size: + return int(ceil(size / b) * b) + assert NotImplemented() + + lines = [] + + lines.append(""" +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM""") + + for board in sorted(boards): + for type_, data in board.iteritems(): + assert type_ in util.get_boards() + board_ram = float(data['upload']['maximum_ram_size']) / 1024 + lines.append(""" + * - ``{type}`` + - `{name} <{url}>`_ + - {mcu} + - {f_cpu:d} MHz + - {rom} Kb + - {ram} Kb""".format( + type=type_, + name=data['name'], + url=data['url'], + mcu=data['build']['mcu'].upper(), + f_cpu=int((data['build']['f_cpu'][:-1])) / 1000000, + ram=int(board_ram) if board_ram % 1 == 0 else board_ram, + rom=_round_memory_size( + data['upload']['maximum_size'] / 1024) + )) + + return "\n".join(lines + [""]) + + +def generate_packages(packages): + allpackages = get_packages() + lines = [] + lines.append(""".. list-table:: + :header-rows: 1 + + * - Name + - Contents""") + for type_, data in packages.iteritems(): + assert type_ in allpackages + contitems = [ + "`%s <%s>`_" % (name, url) + for name, url in allpackages[type_] + ] + lines.append(""" + * - ``{type_}`` + - {contents}""".format( + type_=type_, + contents=", ".join(contitems))) + + lines.append(""" +.. warning:: + **Linux Users:** Don't forget to install "udev" rules file + `99-platformio-udev.rules `_ (an instruction is located in the file). + +""") + return "\n".join(lines) + + +def generate_platform(name): + print "Processing platform: %s" % name + lines = [] + + lines.append(".. _platform_%s:" % name) + lines.append("") + + _title = "Platform ``%s``" % name + lines.append(_title) + lines.append("=" * len(_title)) + + p = PlatformFactory.newPlatform(name) + lines.append(p.get_description()) + lines.append(""" +For more detailed information please visit `vendor site <%s>`_.""" % + p.get_vendor_url()) + lines.append(""" +.. contents::""") + lines.append(""" +Packages +-------- +""") + lines.append(generate_packages(p.get_packages())) + + lines.append(""" +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description""") + + _frameworks = util.get_frameworks() + for framework in sorted(_frameworks.keys()): + if not is_compat_platform_and_framework(name, framework): + continue + lines.append(""" + * - :ref:`framework_{type_}` + - {description}""".format( + type_=framework, + description=_frameworks[framework]['description'])) + + lines.append(""" +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by + horizontal. +""") + + vendors = {} + for board, data in util.get_boards().items(): + platform = data['platform'] + vendor = data['vendor'] + if name in platform: + if vendor in vendors: + vendors[vendor].append({board: data}) + else: + vendors[vendor] = [{board: data}] + for vendor, boards in sorted(vendors.iteritems()): + lines.append(str(vendor)) + lines.append("~" * len(vendor)) + lines.append(generate_boards(boards)) + return "\n".join(lines) + + +def update_platform_docs(): + for name in PlatformFactory.get_platforms().keys(): + rst_path = join( + dirname(realpath(__file__)), "..", "docs", "platforms", + "%s.rst" % name) + with open(rst_path, "w") as f: + f.write(generate_platform(name)) + + +def generate_framework(type_, data): + print "Processing framework: %s" % type_ + lines = [] + + lines.append(".. _framework_%s:" % type_) + lines.append("") + + _title = "Framework ``%s``" % type_ + lines.append(_title) + lines.append("=" * len(_title)) + lines.append(data['description']) + lines.append(""" +For more detailed information please visit `vendor site <%s>`_. +""" % data['url']) + + lines.append(".. contents::") + + lines.append(""" +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description""") + + for platform in sorted(PlatformFactory.get_platforms().keys()): + if not is_compat_platform_and_framework(platform, type_): + continue + p = PlatformFactory.newPlatform(platform) + lines.append(""" + * - :ref:`platform_{type_}` + - {description}""".format( + type_=platform, + description=p.get_description())) + + lines.append(""" +Boards +------ + +.. note:: + * You can list pre-configured boards by :ref:`cmd_boards` command or + `PlatformIO Boards Explorer `_ + * For more detailed ``board`` information please scroll tables below by horizontal. +""") + + vendors = {} + for board, data in util.get_boards().items(): + frameworks = data['frameworks'] + vendor = data['vendor'] + if type_ in frameworks: + if vendor in vendors: + vendors[vendor].append({board: data}) + else: + vendors[vendor] = [{board: data}] + for vendor, boards in sorted(vendors.iteritems()): + lines.append(str(vendor)) + lines.append("~" * len(vendor)) + lines.append(generate_boards(boards)) + return "\n".join(lines) + + +def update_framework_docs(): + for name, data in util.get_frameworks().items(): + rst_path = join(util.get_source_dir(), "..", "docs", "frameworks", + "%s.rst" % name) + with open(rst_path, "w") as f: + f.write(generate_framework(name, data)) + + +def main(): + update_platform_docs() + update_framework_docs() + +if __name__ == "__main__": + sys_exit(main()) diff --git a/scripts/get-platformio.py b/scripts/get-platformio.py index 16c7cd1d..47d34bc7 100644 --- a/scripts/get-platformio.py +++ b/scripts/get-platformio.py @@ -99,7 +99,7 @@ def main(): ("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []), ("Installing Python Package Manager", install_pip, []), ("Installing PlatformIO and dependencies", install_pypi_packages, [ - [["platformio"], [ + [["setuptools"], ["platformio"], [ "--egg", "http://sourceforge.net/projects/scons/files/latest/download" ]] diff --git a/scripts/mbed_to_package.py b/scripts/mbed_to_package.py new file mode 100644 index 00000000..3e13e460 --- /dev/null +++ b/scripts/mbed_to_package.py @@ -0,0 +1,109 @@ +# Copyright (C) Ivan Kravets +# See LICENSE for details. + +import argparse +import zipfile +from os import getcwd, listdir, makedirs, mkdir, rename +from os.path import isdir, isfile, join +from shutil import move, rmtree +from sys import exit as sys_exit +from sys import path + +path.append("..") + +from platformio.util import exec_command, get_home_dir + + +def _unzip_generated_file(mbed_dir, output_dir, mcu): + filename = join( + mbed_dir, "build", "export", "MBED_A1_emblocks_%s.zip" % mcu) + variant_dir = join(output_dir, "variant", mcu) + if isfile(filename): + with zipfile.ZipFile(filename) as zfile: + mkdir(variant_dir) + zfile.extractall(variant_dir) + for f in listdir(join(variant_dir, "MBED_A1")): + if not f.lower().startswith("mbed"): + continue + move(join(variant_dir, "MBED_A1", f), variant_dir) + rename(join(variant_dir, "MBED_A1.eix"), + join(variant_dir, "%s.eix" % mcu)) + rmtree(join(variant_dir, "MBED_A1")) + else: + print "Warning! Skipped board: %s" % mcu + + +def buildlib(mbed_dir, mcu, lib="mbed"): + build_command = [ + "python", + join(mbed_dir, "workspace_tools", "build.py"), + "--mcu", mcu, + "-t", "GCC_ARM" + ] + if lib is not "mbed": + build_command.append(lib) + build_result = exec_command(build_command, cwd=getcwd()) + if build_result['returncode'] != 0: + print "* %s doesn't support %s library!" % (mcu, lib) + + +def copylibs(mbed_dir, output_dir): + libs = ["dsp", "fat", "net", "rtos", "usb", "usb_host"] + libs_dir = join(output_dir, "libs") + makedirs(libs_dir) + + print "Moving generated libraries to framework dir..." + for lib in libs: + if lib == "net": + move(join(mbed_dir, "build", lib, "eth"), libs_dir) + continue + move(join(mbed_dir, "build", lib), libs_dir) + + +def main(mbed_dir, output_dir): + print "Starting..." + + path.append(mbed_dir) + from workspace_tools.export import gccarm + + if isdir(output_dir): + print "Deleting previous framework dir..." + rmtree(output_dir) + + settings_file = join(mbed_dir, "workspace_tools", "private_settings.py") + if not isfile(settings_file): + with open(settings_file, "w") as f: + f.write("GCC_ARM_PATH = '%s'" % + join(get_home_dir(), "packages", "toolchain-gccarmnoneeabi", + "bin")) + + makedirs(join(output_dir, "variant")) + mbed_libs = ["--rtos", "--dsp", "--fat", "--eth", "--usb", "--usb_host"] + + for mcu in set(gccarm.GccArm.TARGETS): + print "Processing board: %s" % mcu + buildlib(mbed_dir, mcu) + for lib in mbed_libs: + buildlib(mbed_dir, mcu, lib) + result = exec_command( + ["python", join(mbed_dir, "workspace_tools", "project.py"), + "--mcu", mcu, "-i", "emblocks", "-p", "0", "-b"], cwd=getcwd() + ) + if result['returncode'] != 0: + print "Unable to build the project for %s" % mcu + continue + _unzip_generated_file(mbed_dir, output_dir, mcu) + copylibs(mbed_dir, output_dir) + + with open(join(output_dir, "boards.txt"), "w") as fp: + fp.write("\n".join(sorted(listdir(join(output_dir, "variant"))))) + + print "Complete!" + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--mbed', help="The path to mbed framework") + parser.add_argument('--output', help="The path to output directory") + args = vars(parser.parse_args()) + sys_exit(main(args["mbed"], args["output"])) diff --git a/setup.py b/setup.py index 6d5fb2ce..299e25e0 100644 --- a/setup.py +++ b/setup.py @@ -42,6 +42,7 @@ setup( "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Compilers" ], - keywords=("builder library manager atmel avr sam teensy stm32 " - "ti msp430 tiva mbed arduino opencm3") + keywords=("builder library manager atmel avr sam freescale kinetis nordic" + "nrf51 nxp lpc st stm32 ti msp430 tiva teensy arduino mbed" + "libopencm3") ) diff --git a/tests/commands/test_boards.py b/tests/commands/test_boards.py index 3dfd1a11..4a96d2e5 100644 --- a/tests/commands/test_boards.py +++ b/tests/commands/test_boards.py @@ -34,9 +34,9 @@ def test_board_options(platformio_setup, clirunner, validate_cliresult): search_result = json.loads(result.output) assert isinstance(search_result, list) assert len(search_result) - platforms = [item['name'] for item in search_result] + platforms = [item['type'] for item in search_result] - for name, opts in util.get_boards().iteritems(): + for _, opts in util.get_boards().iteritems(): assert required_opts.issubset(set(opts)) assert opts['platform'] in platforms @@ -44,7 +44,7 @@ def test_board_options(platformio_setup, clirunner, validate_cliresult): def test_board_ldscripts(platformio_setup, clirunner, validate_cliresult): result = clirunner.invoke( install_cli, [ - "stm32", + "ststm32", "--skip-default-package", "--with-package=ldscripts" ]) diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index 3dd9e318..0d816ff2 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -41,7 +41,7 @@ def test_init_special_board(platformio_setup, clirunner, validate_cliresult): config = util.get_project_config() expected_result = [ ("platform", str(uno['platform'])), - ("framework", str(uno['framework'])), + ("framework", str(uno['frameworks'][0])), ("board", "uno"), ("targets", "upload") ] diff --git a/tests/commands/test_search.py b/tests/commands/test_search.py index 8864d7b9..4179f1b2 100644 --- a/tests/commands/test_search.py +++ b/tests/commands/test_search.py @@ -12,7 +12,7 @@ def test_search_json_output(clirunner, validate_cliresult): search_result = json.loads(result.output) assert isinstance(search_result, list) assert len(search_result) - platforms = [item['name'] for item in search_result] + platforms = [item['type'] for item in search_result] assert "atmelsam" in platforms diff --git a/tests/test_pkgmanifest.py b/tests/test_pkgmanifest.py index 25bddfd2..1493813a 100644 --- a/tests/test_pkgmanifest.py +++ b/tests/test_pkgmanifest.py @@ -29,7 +29,7 @@ def sfpkglist(): def pytest_generate_tests(metafunc): if "package_data" not in metafunc.fixturenames: return - pkgs_manifest = get_api_result("/packages") + pkgs_manifest = get_api_result("/packages/manifest") assert isinstance(pkgs_manifest, dict) packages = [] for _, variants in pkgs_manifest.iteritems():