Compare commits

..

95 Commits

Author SHA1 Message Date
Ivan Kravets
a87c0c8a7a Merge branch 'release/v2.11.2' 2016-08-02 21:25:50 +03:00
Ivan Kravets
f15bb1d545 Version bump to 2.11.2 (issues #500, #533, #732, #731, #737, #733, #438, #722, #52, #725) 2016-08-02 21:25:28 +03:00
Ivan Kravets
0b0064afd0 Update project configuration template 2016-08-02 21:21:08 +03:00
Ivan Kravets
4f2c207bb3 Use stable docs 2016-08-02 21:13:58 +03:00
Ivan Kravets
9d1128af51 Implement firmware merging with base firmware for Nordic nRF51 development platform // Resolve #500 , Resolve #533 2016-08-02 21:06:50 +03:00
Ivan Kravets
855c28d956 Fix firmware uploading to Atmel SAMD21-XPRO board using ARM mbed framework // Resolve #732 2016-08-02 21:02:39 +03:00
Valeriy Koval
a588e88fec Add firmware merging process for nordicnrf51 // Issue #533, #500 2016-08-02 17:32:48 +03:00
Valeriy Koval
ca2adbac13 Add OpenOCD as an alternative upload method for atmelsam platform // Issue #732 2016-08-02 14:07:12 +03:00
Ivan Kravets
df0373c4fa Sync flags parser with PlatformIO 3.0 branch // Resolve #738 2016-07-31 20:49:59 +03:00
Ivan Kravets
4c10c85937 Update `udev` rules for the new STM32F407DISCOVERY boards // Resolve #731 2016-07-31 20:21:55 +03:00
Ivan Kravets
e6d3f6bc3f Add explanation about "Failed to find MSBuild toolsets directory" 2016-07-30 14:10:15 +03:00
Ivan Kravets
e821a438fe Add support for local "--echo" for Serial Port Monitor // Resolve #733 2016-07-28 23:08:42 +03:00
Ivan Kravets
5c53b93a49 Update history 2016-07-28 18:49:22 +03:00
Ivan Kravets
c61ff611fb Improve support for Microchip PIC32 development platform and ChipKIT boards // Resolve #438 2016-07-28 18:47:20 +03:00
Ivan Kravets
ef9e1a0170 Fix Project Generator for ESP8266 and ARM mbed based projects 2016-07-28 18:44:29 +03:00
Valeriy Koval
98f8c6b25a Switch to gcc-built LwIP library for espressif platform 2016-07-27 14:59:00 +03:00
Ivan Kravets
262b12524b Push 2.11.2.dev2 2016-07-26 20:45:00 +03:00
Valeriy Koval
826b518048 Fix linking process for microchippic32 platfrom // Issue #438 2016-07-26 20:11:50 +03:00
Ivan Kravets
dfc594fc39 Improve Project Generator for PlatformIO IDE (fixes incorrect linter errors) 2016-07-23 23:11:50 +03:00
Ivan Kravets
0b862735b2 Push 2.11.2.dev0 2016-07-22 17:23:49 +03:00
Valeriy Koval
a1d9bc7cee Fix ElfToHex builder for microchippic32 2016-07-22 16:43:02 +03:00
Ivan Kravets
f16c05c429 Update docs for Teensy USB Features // Issue #722 2016-07-18 22:20:04 +03:00
Ivan Kravets
d7fa255166 Implement Teensy 2.0 USB functionality (HID, SERIAL_HID, DISK, MIDI, etc.) // Resolve #722 2016-07-18 21:06:45 +03:00
Ivan Kravets
60b3fef37a Add support for Pinoccio Scout board // Resolve #52 2016-07-18 20:39:04 +03:00
Ivan Kravets
7b8fb77250 Fix broken LD Script for Element14 chipKIT Pi board // Resolve #725 Resolve #726 2016-07-18 20:36:24 +03:00
Valeriy Koval
79a4a943dc Fix USB flags processing for teensy platform // Issue #722 2016-07-18 14:52:25 +03:00
Valeriy Koval
7ad8d08037 Add Pinoccio board // Issue #52 2016-07-18 12:14:48 +03:00
Ivan Kravets
4f57cc52d4 Minor improvements for CLion docs 2016-07-13 11:56:20 +03:00
Ivan Kravets
ba23475425 Improved docs for integration with CLion IDE 2016-07-13 11:49:52 +03:00
Ivan Kravets
f88466f3cd Merge branch 'release/v2.11.1' 2016-07-12 19:37:00 +03:00
Ivan Kravets
60be939a1f Merge branch 'release/v2.11.1' into develop 2016-07-12 19:37:00 +03:00
Ivan Kravets
2dd01247e1 Version bump to 2.11.1 (issues #472, #629, #710, #711, #712, #713, #718) 2016-07-12 19:34:14 +03:00
Ivan Kravets
77a4d3f773 Typo fix 2016-07-12 19:29:49 +03:00
Ivan Kravets
6cbd286836 Add "udev" rules for OpenOCD CMSIS-DAP adapters // Resolve #718 2016-07-12 19:26:33 +03:00
Ivan Kravets
b447e0aeab Update history 2016-07-11 23:08:08 +03:00
Ivan Kravets
b165c3f543 Ignore "[platformio]" section from custom project configuration CI 2016-07-11 22:40:37 +03:00
Ivan Kravets
d246ef9a2e Bump to 2.11.1b1 2016-07-11 21:04:40 +03:00
Ivan Kravets
8fd553fbfc Add Arduino M0 Pro and Tian to the examples // Issue #472 2016-07-11 19:52:47 +03:00
Ivan Kravets
f4cebfdbae Fix issue when pioenvs folder doesn't exist 2016-07-11 19:44:36 +03:00
Ivan Kravets
2fdc57055b Add more info about .pioenvs directory 2016-07-11 19:34:36 +03:00
Valeriy Koval
03b0b61aa1 Improve CMSIS selection for SAMD21 boards 2016-07-11 19:26:07 +03:00
Valeriy Koval
3984f80bae Improve support for SAMD21 based boards 2016-07-11 19:12:10 +03:00
Ivan Kravets
581fd356cd Add contributing guidelines 2016-07-10 19:15:55 +03:00
Ivan Kravets
0056651447 Remove debug info 2016-07-09 18:49:35 +03:00
Ivan Kravets
a0d9173b4f Add "Rebuild C/C++ Project Index" target to CLion and Eclipse IDEs 2016-07-09 18:44:45 +03:00
Ivan Kravets
f12c721f44 Iterating the dictionary directly instead of calling .keys() 2016-07-09 15:26:38 +03:00
Ivan Kravets
a73a710364 Iterating the dictionary directly instead of calling .keys() 2016-07-09 15:16:42 +03:00
Ivan Kravets
e33e950712 Add example dynamic build_flags 2016-07-09 14:38:49 +03:00
Ivan Kravets
f767feeef9 Add new articles 2016-07-07 00:26:33 +03:00
Ivan Kravets
fd924f29f3 Update examples 2016-07-06 15:28:39 +03:00
Ivan Kravets
7f47a2fd25 Update boards list 2016-07-06 13:27:36 +03:00
Valeriy Koval
8fe8318c77 Add Arduino M0 as a separate board 2016-07-06 11:02:36 +03:00
Ivan Kravets
ae81ec043d Update history 2016-07-05 17:40:00 +03:00
Valeriy Koval
9ba96d3673 Update microchippic32 platform and boards 2016-07-05 17:06:14 +03:00
Ivan Kravets
db204941ed Fix PyLint warning 2016-07-05 13:28:22 +03:00
Ivan Kravets
5cd3f9d84d Keep user changes for ".gitignore" file when re-generate/update project data 2016-07-05 13:18:31 +03:00
Ivan Kravets
9160e61ac7 Documented uploading of EEPROM data 2016-07-05 12:34:37 +03:00
Ivan Kravets
63ae732e72 Push 2.11.1.dev1 2016-07-05 00:14:00 +03:00
Ivan Kravets
ac9c3f88f9 Automatically install dependent upload tools // Issue #472 2016-07-05 00:11:48 +03:00
Ivan Kravets
52f1502051 Split source files to HEADERS and SOURCES when generate project for Qt Creator IDE // Resolve #713 2016-07-04 23:42:19 +03:00
Ivan Kravets
e8acc9ca39 Improve project generator for CLion IDE 2016-07-04 23:30:34 +03:00
Ivan Kravets
935f7cd5c3 Fix missing trailing `\` for the source files list when generate project for Qt Creator IDE // Resolve #711 2016-07-04 20:36:02 +03:00
Ivan Kravets
e8290054c2 * Fix missed `--boot` flag for the firmware uploader for ATSAM3X8E Cortex-M3 MCU based boards (Arduino Due, etc) // Resolve #710 2016-07-04 20:35:29 +03:00
Valeriy Koval
2c7c74743d Initial support for Arduino M0/Tian boards // Issue #472 2016-07-04 19:28:02 +03:00
Valeriy Koval
4dd90d5493 Update project template for Qt Creator // Issue #711 2016-07-04 18:01:49 +03:00
Valeriy Koval
241ad8174f Fix missed --boot flag for sam3x uploader // Issue # 710 2016-07-04 13:40:43 +03:00
Ivan Kravets
98f5f73a41 Auto-remove project cache when PlatformIO is upgraded 2016-06-29 13:17:06 +03:00
Ivan Kravets
62ad72fb11 Merge branch 'release/v2.11.0' 2016-06-28 18:04:20 +03:00
Ivan Kravets
4552931b95 Merge branch 'release/v2.11.0' into develop 2016-06-28 18:04:20 +03:00
Ivan Kravets
39f9789fa1 Version bump to 2.11.0 (issues #472, #520, #614, #620, #685, #698, #699) 2016-06-28 18:04:08 +03:00
Ivan Kravets
8d7ff7f37e Update history 2016-06-28 18:01:08 +03:00
Valeriy Koval
59606410f4 Update espressif platform according to the new framework version 2016-06-28 14:10:18 +03:00
Valeriy Koval
486529b112 Add initial support for Arduino M0 Pro board // Issue #472 2016-06-28 11:27:49 +03:00
Ivan Kravets
b16938937b Merge pull request #706 from jphollanti/doc_updates
Doc updates
2016-06-26 21:43:22 +03:00
jphollanti
2ba3603a3d add command example to create library examples 2016-06-26 11:29:46 +03:00
jphollanti
f6b9fd02b2 Added mention about building docs to README.rst 2016-06-26 11:19:13 +03:00
jphollanti
85becf861f Add a mention about library managers 24 hour update cycle 2016-06-26 11:12:02 +03:00
Ivan Kravets
1d919e5874 New articles 2016-06-23 20:21:48 +03:00
Ivan Kravets
1089c55b26 Update history 2016-06-23 17:34:00 +03:00
Valeriy Koval
51dd86e6da Add new SAMD21 boards // Issue #520, #620 2016-06-21 15:03:09 +03:00
Ivan Kravets
748437ef7a Use env.Flatten to manipulate with CPPDEFINES 2016-06-18 23:37:58 +03:00
Ivan Kravets
d219999892 Update name of the OpenEnergyMonitor board // Resolve #699 2016-06-18 13:26:04 +03:00
Ivan Kravets
53bd1df8e5 Fix PyLint warning 2016-06-18 01:15:15 +03:00
Ivan Kravets
2b88ef134b Remove duplicated flags // Issue #698 2016-06-18 00:56:04 +03:00
Ivan Kravets
2eca835ec7 Disable dependancy info 2016-06-18 00:53:23 +03:00
Ivan Kravets
8d94a62b9c Revert back previous LINKFLAGS 2016-06-18 00:52:46 +03:00
Ivan Kravets
4035b9ac6c Better removing unnecessary flags using `build_unflags` option // Resolve #698 2016-06-18 00:38:00 +03:00
Valerii Koval
31a110c37f Fix unnecessary uppercase for target includes 2016-06-15 20:55:45 +03:00
Ivan Kravets
47c238b1eb Fix issue with `platformio init --ide` command for Python 2.6 2016-06-15 19:30:37 +03:00
Ivan Kravets
72c4db25f0 Merge branch 'release/v2.10.3' into develop 2016-06-15 18:46:57 +03:00
Ivan Kravets
50f9186682 Merge branch 'release/v2.10.3' 2016-06-15 18:46:56 +03:00
Ivan Kravets
2cd22f725e Version bump to 2.10.3 2016-06-15 18:46:41 +03:00
Ivan Kravets
1cab0c168e Fix issue with appending PIO version to Build Defines 2016-06-15 18:42:56 +03:00
Ivan Kravets
5dac4e3af6 Add test for init --ide eclipse 2016-06-15 18:42:25 +03:00
Ivan Kravets
48a8086519 Merge branch 'release/v2.10.2' into develop 2016-06-15 17:57:39 +03:00
72 changed files with 1647 additions and 416 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@
docs/_build
dist
build
.cache

21
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,21 @@
Contributing
------------
To get started, <a href="https://www.clahub.com/agreements/platformio/platformio">sign the Contributor License Agreement</a>.
1. Fork the repository on GitHub.
2. Make a branch off of ``develop``
3. Run ``pip install tox``
4. Go to the root of project where is located ``tox.ini`` and run ``tox -e develop``
5. Activate current development environment:
* Windows: ``.tox\develop\Scripts\activate``
* Bash/ZSH: ``source .tox/develop/bin/activate``
* Fish: ``source .tox/bin/activate.fish``
6. Make changes to code, documentation, etc.
7. Lint source code ``tox -e lint``
8. Run the tests ``tox -e py27``
9. Build documentation ``tox -e docs`` (creates a directory _build under docs where you can find the html)
10. Commit changes to your forked repository
11. Submit a Pull Request on GitHub.

View File

@@ -4,6 +4,80 @@ Release Notes
PlatformIO 2.0
--------------
2.11.2 (2016-08-02)
~~~~~~~~~~~~~~~~~~~
* Improved support for `Microchip PIC32 <http://docs.platformio.org/en/latest/platforms/microchippic32.html>`__ development platform and ChipKIT boards
(`issue #438 <https://github.com/platformio/platformio/issues/438>`_)
* Added support for Pinoccio Scout board
(`issue #52 <https://github.com/platformio/platformio/issues/52>`_)
* Added support for `Teensy USB Features <http://docs.platformio.org/en/latest/platforms/teensy.html#usb-features>`__
(HID, SERIAL_HID, DISK, DISK_SDFLASH, MIDI, etc.)
(`issue #722 <https://github.com/platformio/platformio/issues/722>`_)
* Switched to built-in GCC LwIP library for Espressif development platform
* Added support for local ``--echo`` for Serial Port Monitor
(`issue #733 <https://github.com/platformio/platformio/issues/733>`_)
* Updated ``udev`` rules for the new STM32F407DISCOVERY boards
(`issue #731 <https://github.com/platformio/platformio/issues/731>`_)
* Implemented firmware merging with base firmware for Nordic nRF51 development platform
(`issue #500 <https://github.com/platformio/platformio/issues/500>`_,
`issue #533 <https://github.com/platformio/platformio/issues/533>`_)
* Fixed Project Generator for ESP8266 and ARM mbed based projects
(resolves incorrect linter errors)
* Fixed broken LD Script for Element14 chipKIT Pi board
(`issue #725 <https://github.com/platformio/platformio/issues/725>`_)
* Fixed firmware uploading to Atmel SAMD21-XPRO board using ARM mbed framework
(`issue #732 <https://github.com/platformio/platformio/issues/732>`_)
2.11.1 (2016-07-12)
~~~~~~~~~~~~~~~~~~~
* Added support for Arduino M0, M0 Pro and Tian boards
(`issue #472 <https://github.com/platformio/platformio/issues/472>`_)
* Added support for Microchip chipKIT Lenny board
* Updated Microchip PIC32 Arduino framework to v1.2.1
* Documented `uploading of EEPROM data <http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-eeprom-data>`__
(from EEMEM directive)
* Added ``Rebuild C/C++ Project Index`` target to CLion and Eclipse IDEs
* Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
* Added ``udev`` rules for OpenOCD CMSIS-DAP adapters
(`issue #718 <https://github.com/platformio/platformio/issues/718>`_)
* Auto-remove project cache when PlatformIO is upgraded
* Keep user changes for ``.gitignore`` file when re-generate/update project data
* Ignore ``[platformio]`` section from custom project configuration file when
`platformio ci --project-conf <http://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__
command is used
* Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E
Cortex-M3 MCU based boards (Arduino Due, etc)
(`issue #710 <https://github.com/platformio/platformio/issues/710>`_)
* Fixed missing trailing ``\`` for the source files list when generate project
for `Qt Creator IDE <http://docs.platformio.org/en/latest/ide/qtcreator.html>`__
(`issue #711 <https://github.com/platformio/platformio/issues/711>`_)
* Split source files to ``HEADERS`` and ``SOURCES`` when generate project
for `Qt Creator IDE <http://docs.platformio.org/en/latest/ide/qtcreator.html>`__
(`issue #713 <https://github.com/platformio/platformio/issues/713>`_)
2.11.0 (2016-06-28)
~~~~~~~~~~~~~~~~~~~
* New ESP8266-based boards: Generic ESP8285 Module, Phoenix 1.0 & 2.0, WifInfo
* Added support for Arduino M0 Pro board
(`issue #472 <https://github.com/platformio/platformio/issues/472>`_)
* Added support for Arduino MKR1000 board
(`issue #620 <https://github.com/platformio/platformio/issues/620>`_)
* Added support for Adafruit Feather M0, SparkFun SAMD21 and SparkFun SAMD21
Mini Breakout boards
(`issue #520 <https://github.com/platformio/platformio/issues/520>`_)
* Updated Arduino ESP8266 core for Espressif platform to 2.3.0
* Better removing unnecessary flags using ``build_unflags`` option
(`issue #698 <https://github.com/platformio/platformio/issues/698>`_)
* Fixed issue with ``platformio init --ide`` command for Python 2.6
2.10.3 (2016-06-15)
~~~~~~~~~~~~~~~~~~~
* Fixed issue with ``platformio init --ide`` command
2.10.2 (2016-06-15)
~~~~~~~~~~~~~~~~~~~

View File

@@ -185,26 +185,12 @@ For further details, please refer to `What is PlatformIO? <http://docs.platformi
Contributing
------------
1. Fork the repository on GitHub.
2. Make a branch off of ``develop``
3. Run ``pip install tox``
4. Go to the root of project where is located ``tox.ini`` and run ``tox -e develop``
5. Activate current development environment:
See `contributing guidelines <https://github.com/platformio/platformio/blob/develop/CONTRIBUTING.md>`_.
* Windows: ``.tox\develop\Scripts\activate``
* Bash/ZSH: ``source .tox/develop/bin/activate``
* Fish: ``source .tox/bin/activate.fish``
6. Make changes to code, documentation, etc.
7. Lint source code ``tox -e lint``
8. Run the tests ``tox -e py27``
9. Commit changes to your forked repository
10. Submit a Pull Request on GitHub.
Licence
License
-------
Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
The PlatformIO is licensed under the permissive Apache 2.0 licence,
The PlatformIO is licensed under the permissive Apache 2.0 license,
so you can use it in both commercial and personal projects with confidence.

View File

@@ -23,6 +23,13 @@ Here are recent articles about PlatformIO:
2016
^^^^
* Jul 5, 2016 - **Ivan Kravets, Ph.D.** - `Explore the new development instruments for Arduino with PlatformIO ecosystem <http://www.slideshare.net/ivankravets/explore-the-new-development-instruments-for-arduino-with-platformio-ecosystem>`_
* Jul 5, 2016 - **Belinda** - `Monte Bianco Arduino Developer Summit <http://www.arduino.org/blog/arduino-developer-summit>`_
* Jul 1, 2016 - **Tam Hanna** - `Mikrocontroller-Gipfel in den Alpen: Arduino Developer Summit, Tag eins (Microcontroller peaks in the Alps: Arduino Developer Summit, Day One, German) <http://www.heise.de/make/meldung/Mikrocontroller-Gipfel-in-den-Alpen-Arduino-Developer-Summit-Tag-eins-3252421.html>`_
* Jun 14, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 2/3: Firmware Continuous Test & Build <https://blog.openenergymonitor.org/2016/06/auto-build-continuous-test-firmware/>`_
* Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github <http://blog.squix.org/2016/06/new-weather-station-demo-on-github.html>`_
* Jun 12, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 1/3: PlatformIO open-source embedded development ecosystem <https://blog.openenergymonitor.org/2016/06/platformio/>`_
* Jun 12, 2016 - **Uli Wolf** - `Nutzung von PlatformIO im Atom Editor zur Entwicklung von Arduino Code (Use PlatformIO and Atom Editor to develop Arduino code, German) <https://wolf-u.li/5668/nutzung-von-platform-io-im-atom-editor-zur-entwicklung-von-arduino-code/>`_
* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline Push To Production <http://blog.squix.org/2016/06/esp8266-continuous-delivery-pipeline-push-to-production.html>`_
* May 30, 2016 - **Ron Moerman** - `IoT Development with PlatformIO <https://electronicsworkbench.io/blog/platformio>`_
* May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! <http://www.instructables.com/id/Reverse-Engineer-RF-Remote-Controller-for-IoT/?ALLSTEPS>`_

View File

@@ -92,6 +92,13 @@ Adafruit
- Flash
- RAM
* - ``adafruit_feather_m0_usb``
- `Adafruit Feather M0 <https://www.adafruit.com/product/2772>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``bluefruitmicro``
- `Adafruit Bluefruit Micro <https://www.adafruit.com/products/2661>`_
- ATMEGA32U4
@@ -377,6 +384,34 @@ Arduino
- 32 Kb
- 2 Kb
* - ``mkr1000USB``
- `Arduino MKR1000 <https://www.arduino.cc/en/Main/ArduinoMKR1000>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroUSB``
- `Arduino M0 <http://www.arduino.org/products/boards/arduino-m0>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeropro``
- `Arduino M0 Pro (Programming Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroproUSB``
- `Arduino M0 Pro (Native USB Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``nanoatmega168``
- `Arduino Nano ATmega168 <http://www.arduino.org/products/boards/4-arduino-boards/arduino-nano>`_
- ATMEGA168
@@ -433,6 +468,13 @@ Arduino
- 32 Kb
- 2.5 Kb
* - ``tian``
- `Arduino Tian <http://www.arduino.org/products/boards/arduino-tian>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``uno``
- `Arduino Uno <http://www.arduino.org/products/boards/4-arduino-boards/arduino-uno>`_
- ATMEGA328P
@@ -802,6 +844,13 @@ Espressif
- 4096 Kb
- 80 Kb
* - ``esp8285``
- `Generic ESP8285 Module <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
* - ``esp_wroom_02``
- `ESP-WROOM-02 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
@@ -809,6 +858,27 @@ Espressif
- 4096 Kb
- 50 Kb
* - ``phoenix_v1``
- `Phoenix 1.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``phoenix_v2``
- `Phoenix 2.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``wifinfo``
- `WifInfo <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
Fubarino
~~~~~~~~
@@ -1211,7 +1281,7 @@ OpenEnergyMonitor
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- `OpenEnergyMonitor emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
@@ -1271,6 +1341,26 @@ PanStamp
- 32 Kb
- 4 Kb
Pinoccio
~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``pinoccio``
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
- ATMEGA256RFR2
- 16 MHz
- 256 Kb
- 32 Kb
Punch Through
~~~~~~~~~~~~~
@@ -1563,6 +1653,20 @@ SparkFun
- 32 Kb
- 2 Kb
* - ``sparkfun_samd21_dev_usb``
- `SparkFun SAMD21 Dev Breakout <https://www.sparkfun.com/products/13672>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``sparkfun_samd21_mini_usb``
- `SparkFun SAMD21 Mini Breakout <https://www.sparkfun.com/products/13664>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``thing``
- `SparkFun ESP8266 Thing <https://www.sparkfun.com/products/13231>`_
- ESP8266
@@ -1780,6 +1884,26 @@ Wicked Device
- 128 Kb
- 16 Kb
chipKIT
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``lenny``
- `chipKIT Lenny <http://chipkit.net/tag/lenny/>`_
- 32MX270F256D
- 40 MHz
- 128 Kb
- 32 Kb
element14
~~~~~~~~~

View File

@@ -37,7 +37,7 @@ can customize to do anything but also use productively without ever touching a
config file.
.. image:: ../_static/ide-atom-platformio.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio.png
.. contents::
@@ -71,9 +71,10 @@ on the "Customize" stage, otherwise ``python`` command will not be available.
2. Clang for Intelligent Code Autocompletion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PlatformIO IDE uses `clang <http://clang.llvm.org>`_ for the Intelligent Code Autocompletion.
To check that ``clang`` is available in your system, please open
Terminal and run ``clang --version``. If ``clang`` is not installed, then install it:
PlatformIO IDE uses `clang <http://clang.llvm.org>`_ for the Intelligent Code
Autocompletion. To check that ``clang`` is available in your system, please
open Terminal and run ``clang --version``. If ``clang`` is not installed,
then install it and restart Atom:
- **Mac OS X**: `Install the latest Xcode <https://developer.apple.com/xcode/download/>`_
along with the latest Command Line Tools
@@ -84,6 +85,12 @@ Terminal and run ``clang --version``. If ``clang`` is not installed, then instal
.. image:: ../_static/clang-installer-add-path.png
.. warning::
If you see ``Failed to find MSBuild toolsets directory`` error in
the installation console, please ignore it and press any key to close
this window. PlatformIO IDE uses only Clang completion engine that
should work after it without any problems.
- **Linux**: Using package managers: ``apt-get install clang`` or ``yum install clang``.
- **Other Systems**: Download the latest `Clang for the other systems <http://llvm.org/releases/download.html>`_.
@@ -137,30 +144,30 @@ Setting Up the Project
the corresponding icon in the PlatformIO toolbar as shown in the image below:
.. image:: ../_static/ide-atom-platformio-quick-start-1.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-1.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-1.png
2. In the "New Project Menu" choose desired boards (more than one board is
allowed) and select a project directory. Then press "Initialize" button:
.. image:: ../_static/ide-atom-platformio-quick-start-2.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-2.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-2.png
3. If everything is fine, you should see the success message and project tree
in the left panel:
.. image:: ../_static/ide-atom-platformio-quick-start-3.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-3.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-3.png
4. Now, let's create the first project source file: right-click on the folder
``src`` and choose ``New File``:
.. image:: ../_static/ide-atom-platformio-quick-start-4.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-4.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-4.png
Enter filename ``main.cpp``:
.. image:: ../_static/ide-atom-platformio-quick-start-5.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-5.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-5.png
Copy the next source code to the just created file ``main.cpp``:
@@ -202,13 +209,13 @@ upload firmware, run other targets) using:
- :ref:`ide_atom_building_targets` and hotkeys
.. image:: ../_static/ide-atom-platformio-quick-start-6.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-6.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-6.png
5. Run ``Build`` and you should see green "success" result in the building
panel:
.. image:: ../_static/ide-atom-platformio-quick-start-7.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-7.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-7.png
To upload firmware to the board run ``Upload``.
@@ -217,39 +224,39 @@ To upload firmware to the board run ``Upload``.
or call targets list from the status bar (bottom, left corner):
.. image:: ../_static/ide-atom-platformio-quick-start-8.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-8.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-8.png
And select desired target:
.. image:: ../_static/ide-atom-platformio-quick-start-9.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-9.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-9.png
7. To run built-in terminal interface choose ``Menu: PlatformIO > Terminal`` or
press the corresponding icon in the PlatformIO toolbar:
.. image:: ../_static/ide-atom-platformio-quick-start-10.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-10.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-10.png
It provides you fast access to all set of powerful PlatformIO CLI commands:
.. image:: ../_static/ide-atom-platformio-quick-start-11.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-11.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-11.png
8. To run built-in "Serial Monitor" choose ``Menu: PlatformIO > Serial Monitor``
or press the corresponding icon in the PlatformIO toolbar:
.. image:: ../_static/ide-atom-platformio-quick-start-12.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-12.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-12.png
It has several settings to adjust your connection:
.. image:: ../_static/ide-atom-platformio-quick-start-13.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-13.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-13.png
And allows you to communicate with your board in an easy way:
.. image:: ../_static/ide-atom-platformio-quick-start-14.png
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-14.png
:target: http://docs.platformio.org/en/stable/_images/ide-atom-platformio-quick-start-14.png
User Guide

View File

@@ -24,7 +24,7 @@ Refer to the `CLion Documentation <https://www.jetbrains.com/clion/documentation
page for more detailed information.
.. image:: ../_static/ide-platformio-clion.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-clion.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-clion.png
.. contents::
@@ -43,41 +43,94 @@ command and generate project via :option:`platformio init --ide` command:
Then:
1. Import this project via ``Menu: File > Import Project``
1. Place source files (``*.c, *.cpp, *.h, *.hpp``) to ``src`` directory
2. Import this project via ``Menu: File > Import Project``
and specify root directory where is located :ref:`projectconf`
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
3. Build project (*DO NOT RUN*): ``Menu: Run > Build``.
3. Open source file from ``src`` directory
4. Build project (*DO NOT RUN*): ``Menu: Run > Build``.
.. warning::
See know issue: :ref:`ide_clion_knownissues_inopde_not_supported` and how
to resolve it.
There are 6 predefined targets for building (*NOT FOR RUNNING*, see marks on
the screenshot below):
* ``PLATFORMIO_BUILD`` - Build project without auto-uploading
* ``PLATFORMIO_UPLOAD`` - Build and upload (if no errors).
* ``PLATFORMIO_CLEAN`` - Clean compiled objects.
* ``PLATFORMIO_PROGRAM`` - Build and upload using external programmer (if no errors), see :ref:`atmelavr_upload_via_programmer`.
* ``PLATFORMIO_UPLOADFS`` - Upload files to file system SPIFFS, see :ref:`platform_espressif_uploadfs`.
* ``PLATFORMIO_UPDATE`` - Update installed platforms and libraries via :ref:`cmd_update`.
* ``PLATFORMIO_UPLOAD`` - Build and upload (if no errors)
* ``PLATFORMIO_CLEAN`` - Clean compiled objects
* ``PLATFORMIO_PROGRAM`` - Build and upload using external programmer
(if no errors), see :ref:`atmelavr_upload_via_programmer`
* ``PLATFORMIO_UPLOADFS`` - Upload files to file system SPIFFS,
see :ref:`platform_espressif_uploadfs`
* ``PLATFORMIO_UPDATE`` - Update installed platforms and libraries via :ref:`cmd_update`
* ``PLATFORMIO_REBUILD_PROJECT_INDEX`` - Rebuild C/C++ Index for the Project.
Allows to fix code completion and code linting issues.
.. warning::
The libraries which are added, installed or used in the project
after generating process wont be reflected in IDE. To fix it you
need to reinitialize project using :ref:`cmd_init` (repeat it).
after generating process wont be reflected in IDE. To fix it please run
``PLATFORMIO_REBUILD_PROJECT_INDEX`` target.
.. warning::
PlatformIO generates empty project by default and **code auto-completion
will not work!** To enable auto-completion please choose one of:
Known issues
------------
* Add source files ``*.c, *.cpp, etc`` to ``src`` directory and re-initialize
project with command above
* Manually correct ``add_executable`` command in ``CMakeLists.txt`` file
(will be created in project directory after initialization).
.. _ide_clion_knownissues_inopde_not_supported:
``*.ino`` file isn't acceptable for ``add_executable`` command. You should
convert it manually to ``*.cpp``. See `project example <https://github.com/platformio/platformio-examples/tree/develop/ide/clion>`_.
Arduino ``.ino`` files are not supported
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CLion uses "CMake" tool for code completion and code linting. As result, it
doesn't support Arduino files (``*.ino`` and ``.pde``) because they are
not valid C/C++ based source files:
1. Missing includes such as ``#include <Arduino.h>``
2. Function declarations are omitted.
Convert Arduino file to C++ manually
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For example, we have the next ``Demo.ino`` file:
.. code-block:: cpp
void function setup () {
someFunction(13);
}
void function loop() {
delay(1000);
}
void someFunction(int num) {
}
Let's convert it to ``Demo.cpp``:
1. Add ``#include <Arduino.h>`` at the top of the source file
2. Declare each custom function (excluding built-in, such as ``setup`` and ``loop``)
before it will be called.
The final ``Demo.cpp``:
.. code-block:: cpp
#include <Arduino.h>
void someFunction(int num);
void function setup () {
someFunction(13);
}
void function loop() {
delay(1000);
}
void someFunction(int num) {
}
More info `CLion issue #CPP-3977 <https://youtrack.jetbrains.com/issue/CPP-3977>`_.
Active discussion is located in
`PlatformIO issue #132 <https://github.com/platformio/platformio/issues/132>`_.
Articles / Manuals
------------------
@@ -92,6 +145,6 @@ Examples
--------
"Blink" Project
^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~
Source code of `CLion "Blink" Project <https://github.com/platformio/platformio-examples/tree/develop/ide/clion>`_.

View File

@@ -14,16 +14,16 @@
CodeBlocks
==========
Code::Blocks is a free, open-source cross-platform IDE that supports multiple
compilers including GCC, Clang and Visual C++. It is developed in C++ using
wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities
and features are defined by the provided plugins. Currently, Code::Blocks is
Code::Blocks is a free, open-source cross-platform IDE that supports multiple
compilers including GCC, Clang and Visual C++. It is developed in C++ using
wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities
and features are defined by the provided plugins. Currently, Code::Blocks is
oriented towards C, C++, and Fortran.
CodeBlocks IDE can be downloaded from `here <http://www.codeblocks.org/downloads>`_.
.. image:: ../_static/ide-platformio-codeblocks.png
:target: http://docs.platformio.org/en/latest/_images/ide-platformio-codeblocks.png
:target: http://docs.platformio.org/en/stable/_images/ide-platformio-codeblocks.png
.. contents::

View File

@@ -28,7 +28,7 @@ Refer to the `CDT Documentation <https://eclipse.org/cdt/documentation.php>`_
page for more detailed information.
.. image:: ../_static/ide-platformio-eclipse.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-eclipse.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-eclipse.png
.. contents::
@@ -51,7 +51,7 @@ Then:
``Menu: File > Import... > General > Existing Projects into Workspace > Next``
and specify root directory where is located :ref:`projectconf`
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
3. Build project using ``Menu: Project > Build Project`` or preconfigured
3. Build project using ``Menu: Project > Build Project`` or pre-configured
Make Targets (see screenshot below):
+ ``PlatformIO: Build`` - Build project without auto-uploading
@@ -59,17 +59,24 @@ Then:
+ ``PlatformIO: Upload`` - Build and upload (if no errors)
+ ``PlatformIO: Upload using Programmer`` see :ref:`atmelavr_upload_via_programmer`
+ ``PlatformIO: Upload SPIFFS image`` see :ref:`platform_espressif_uploadfs`
+ ``PlatformIO: Update platforms and libraries`` - Update installed platforms and libraries via :ref:`cmd_update`.
+ ``PlatformIO: Update platforms and libraries`` - Update installed
platforms and libraries via :ref:`cmd_update`
+ ``PlatformIO: Rebuild C/C++ Project Index`` - Rebuild C/C++ Index for the Project.
Allows to fix code completion and code linting issues.
If you have some problems with unresolved includes, defines, etc., then
* Restart Eclipse IDE
* Rebuild index using ``Menu: Project > C/C++ Index > Rebuild``.
1. Rebuild PlatformIO Project Index:
``PlatformIO: Rebuild C/C++ Project Index`` target
2. Rebuild Eclipse Project Index: ``Menu: Project > C/C++ Index > Rebuild``
3. Refresh Project, right click on the project ``Project > Refresh`` (F5) or
restart Eclipse IDE.
.. warning::
The libraries which are added, installed or used in the project
after generating process wont be reflected in IDE. To fix it you
need to reinitialize project using :ref:`cmd_init` (repeat it).
after generating process wont be reflected in IDE. To fix it please run
``PlatformIO: Rebuild C/C++ Project Index`` target and right click on the
project and ``Project > Refresh`` (F5).
Live Integration
----------------

View File

@@ -23,7 +23,7 @@ Refer to the `Emacs Documentation <https://www.gnu.org/software/emacs/#Manuals>`
page for more detailed information.
.. image:: ../_static/ide-platformio-emacs.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-emacs.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-emacs.png
.. contents::

View File

@@ -26,7 +26,7 @@ Just make sure you download the C/C++ version (or if you already use NetBeans,
install the C/C++ development plugins).
.. image:: ../_static/ide-platformio-netbeans.png
:target: http://docs.platformio.org/en/latest/_images/ide-platformio-netbeans.png
:target: http://docs.platformio.org/en/stable/_images/ide-platformio-netbeans.png
.. contents::

View File

@@ -20,7 +20,7 @@ Refer to the `Qt-creator Manual <http://doc.qt.io/qtcreator/>`_
page for more detailed information.
.. image:: ../_static/ide-platformio-qtcreator-7.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-7.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-7.png
.. contents::
@@ -83,7 +83,7 @@ Then:
8. Build project: ``Menu: Build > Build All``.
.. image:: ../_static/ide-platformio-qtcreator-3.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-3.png
.. warning::
The libraries which are added, installed or used in the project
@@ -99,7 +99,7 @@ Setup New Project
First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File > New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project > Empty Qt Project``), fill ``Name``, ``Create in``.
.. image:: ../_static/ide-platformio-qtcreator-1.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-1.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-1.png
On the next steps select any available kit and click Finish button.
@@ -108,7 +108,7 @@ On the next steps select any available kit and click Finish button.
Secondly, we need to delete default build and clean steps and configure project with PlatformIO Build System (click on Projects label on left menu or ``Ctrl+5`` shortcut):
.. image:: ../_static/ide-platformio-qtcreator-3.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-3.png
Thirdly, change project file by adding path to directories with header files. Please edit project file to match the following contents:
@@ -125,7 +125,7 @@ Thirdly, change project file by adding path to directories with header files. Pl
INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/avr/include"
.. image:: ../_static/ide-platformio-qtcreator-4.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-4.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-4.png
First program in Qt Creator
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -136,7 +136,7 @@ Simple "Blink" project will consist from two files:
Let's create new text file named ``main.c`` using ``Menu: New File or Project > General > Text File``:
.. image:: ../_static/ide-platformio-qtcreator-5.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-5.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-5.png
Copy the source code which is described below to file ``main.c``.
@@ -161,22 +161,19 @@ Copy the source code which is described below to file ``main.c``.
3. Locate the project configuration file named ``platformio.ini`` at the root of the project directory and open it.
.. image:: ../_static/ide-platformio-qtcreator-6.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-6.png
:target: http://docs.platformio.org/en/stable/_static/ide-platformio-qtcreator-6.png
Edit the content to match the code described below.
.. code-block:: none
#
# Project Configuration File
# PlatformIO Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
[env:arduino_uno]
platform = atmelavr
framework = arduino

View File

@@ -167,15 +167,12 @@ Copy the source code which is described below to it.
.. code-block:: none
#
# Project Configuration File
# PlatformIO Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
[env:arduino_uno]
platform = atmelavr
framework = arduino

View File

@@ -20,7 +20,7 @@ Refer to the `Visual Studio Documentation <https://msdn.microsoft.com/library/vs
page for more detailed information.
.. image:: ../_static/ide-vs-platformio-newproject-8.png
:target: http://docs.platformio.org/en/latest/_static/ide-vs-platformio-newproject-8.png
:target: http://docs.platformio.org/en/stable/_static/ide-vs-platformio-newproject-8.png
.. contents::
@@ -127,15 +127,12 @@ Copy the source code which is described below to it.
.. code-block:: none
#
# Project Configuration File
# PlatformIO Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
[env:arduino_uno]
platform = atmelavr
framework = arduino
@@ -175,4 +172,4 @@ disable IntelliSense error reporting at all.
See details in `issue #543 <https://github.com/platformio/platformio/issues/543>`_
.. image:: ../_static/ide-vs-platformio-newproject-9.png
:target: http://docs.platformio.org/en/latest/_static/ide-vs-platformio-newproject-9.png
:target: http://docs.platformio.org/en/stable/_static/ide-vs-platformio-newproject-9.png

View File

@@ -20,6 +20,9 @@ source code structure. The only one requirement is library's manifest file -
:ref:`library_config`. It can be located inside your library or in the another
location where |PIOAPICR| will have *HTTP* access.
Updates to existing libraries are done every 24 hours. In case a more urgent
update is required, you can post a request on PlatformIO `community <https://community.platformio.org/>`_.
.. contents::
Source Code Location
@@ -152,6 +155,12 @@ to :ref:`install <cmd_lib_install>` it.
Examples
--------
Command:
.. code-block:: bash
$ platformio lib register http://my.example.com/library.json
* `GitHub + fixed release <http://platformio.org/lib/show/552/ACNoblex>`_
* `Dependencies by author and framework <http://platformio.org/lib/show/3/PID-AutoTune>`_
* `Multiple libraries in the one repository <https://github.com/jrowberg/i2cdevlib/tree/master/Arduino>`_

View File

@@ -43,16 +43,6 @@ Packages
* - ``tool-micronucleus``
- `Micronucleus <https://github.com/micronucleus/micronucleus>`_
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
**Windows Users:** Please check that you have correctly installed USB
driver from board manufacturer
Frameworks
----------
.. list-table::
@@ -826,7 +816,7 @@ OpenEnergyMonitor
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- `OpenEnergyMonitor emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
@@ -852,6 +842,26 @@ PanStamp
- 32 Kb
- 2 Kb
Pinoccio
~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``pinoccio``
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
- ATMEGA256RFR2
- 16 MHz
- 256 Kb
- 32 Kb
Punch Through
~~~~~~~~~~~~~

View File

@@ -95,6 +95,13 @@ Configuration for the programmers:
upload_port = SERIAL_PORT_HERE
upload_speed = 19200
Upload EEPROM data
------------------
To upload EEPROM data (from EEMEM directive) you need to use ``uploadeep``
target instead ``upload`` for :option:`platformio run --target` command.
For example, ``platformio run -t uploadeep``.
Articles
--------

View File

@@ -28,23 +28,26 @@ Packages
* - Name
- Contents
* - ``framework-mbed``
- `mbed Framework <http://mbed.org>`_
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``framework-arduinosam``
- `Arduino Wiring-based Framework (SAM Core, 1.6) <http://arduino.cc/en/Reference/HomePage>`_
* - ``ldscripts``
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
* - ``framework-simba``
- `Simba Framework <https://github.com/eerimoq/simba>`_
* - ``tool-openocd``
- `OpenOCD <http://openocd.org>`_
* - ``framework-mbed``
- `mbed Framework <http://mbed.org>`_
* - ``ldscripts``
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
* - ``tool-avrdude``
- `AVRDUDE <http://www.nongnu.org/avrdude/>`_
* - ``tool-bossac``
- `BOSSA CLI <https://sourceforge.net/projects/b-o-s-s-a/>`_
@@ -85,6 +88,26 @@ Boards
* For more detailed ``board`` information please scroll tables below by
horizontal.
Adafruit
~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``adafruit_feather_m0_usb``
- `Adafruit Feather M0 <https://www.adafruit.com/product/2772>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
Arduino
~~~~~~~
@@ -112,6 +135,41 @@ Arduino
- 512 Kb
- 32 Kb
* - ``mkr1000USB``
- `Arduino MKR1000 <https://www.arduino.cc/en/Main/ArduinoMKR1000>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroUSB``
- `Arduino M0 <http://www.arduino.org/products/boards/arduino-m0>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeropro``
- `Arduino M0 Pro (Programming Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroproUSB``
- `Arduino M0 Pro (Native USB Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``tian``
- `Arduino Tian <http://www.arduino.org/products/boards/arduino-tian>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``zero``
- `Arduino Zero (Programming Port) <https://www.arduino.cc/en/Main/ArduinoBoardZero>`_
- SAMD21G18A
@@ -206,3 +264,30 @@ SainSmart
- 84 MHz
- 512 Kb
- 32 Kb
SparkFun
~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``sparkfun_samd21_dev_usb``
- `SparkFun SAMD21 Dev Breakout <https://www.sparkfun.com/products/13672>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``sparkfun_samd21_mini_usb``
- `SparkFun SAMD21 Mini Breakout <https://www.sparkfun.com/products/13664>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb

View File

@@ -143,6 +143,9 @@ Packages
* - ``tool-scons``
- `SCons software construction tool <http://www.scons.org>`_
* - ``tool-sreccat``
- `Merging tool <https://github.com/marcows/SRecord>`_
* - ``tool-stlink``
- `ST-Link <https://github.com/texane/stlink>`_

View File

@@ -78,6 +78,13 @@ Adafruit
- Flash
- RAM
* - ``adafruit_feather_m0_usb``
- `Adafruit Feather M0 <https://www.adafruit.com/product/2772>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``bluefruitmicro``
- `Adafruit Bluefruit Micro <https://www.adafruit.com/products/2661>`_
- ATMEGA32U4
@@ -363,6 +370,34 @@ Arduino
- 32 Kb
- 2 Kb
* - ``mkr1000USB``
- `Arduino MKR1000 <https://www.arduino.cc/en/Main/ArduinoMKR1000>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroUSB``
- `Arduino M0 <http://www.arduino.org/products/boards/arduino-m0>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeropro``
- `Arduino M0 Pro (Programming Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``mzeroproUSB``
- `Arduino M0 Pro (Native USB Port) <http://www.arduino.org/products/boards/arduino-m0-pro>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``nanoatmega168``
- `Arduino Nano ATmega168 <http://www.arduino.org/products/boards/4-arduino-boards/arduino-nano>`_
- ATMEGA168
@@ -419,6 +454,13 @@ Arduino
- 32 Kb
- 2.5 Kb
* - ``tian``
- `Arduino Tian <http://www.arduino.org/products/boards/arduino-tian>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``uno``
- `Arduino Uno <http://www.arduino.org/products/boards/4-arduino-boards/arduino-uno>`_
- ATMEGA328P
@@ -957,6 +999,13 @@ Espressif
- 4096 Kb
- 80 Kb
* - ``esp8285``
- `Generic ESP8285 Module <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
* - ``esp_wroom_02``
- `ESP-WROOM-02 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
@@ -964,6 +1013,27 @@ Espressif
- 4096 Kb
- 50 Kb
* - ``phoenix_v1``
- `Phoenix 1.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``phoenix_v2``
- `Phoenix 2.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``wifinfo``
- `WifInfo <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
Freescale
~~~~~~~~~
@@ -1576,7 +1646,7 @@ OpenEnergyMonitor
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- `OpenEnergyMonitor emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
@@ -1656,6 +1726,26 @@ PanStamp
- 32 Kb
- 4 Kb
Pinoccio
~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``pinoccio``
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
- ATMEGA256RFR2
- 16 MHz
- 256 Kb
- 32 Kb
Punch Through
~~~~~~~~~~~~~
@@ -2322,6 +2412,20 @@ SparkFun
- 32 Kb
- 2 Kb
* - ``sparkfun_samd21_dev_usb``
- `SparkFun SAMD21 Dev Breakout <https://www.sparkfun.com/products/13672>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``sparkfun_samd21_mini_usb``
- `SparkFun SAMD21 Mini Breakout <https://www.sparkfun.com/products/13664>`_
- SAMD21G18A
- 48 MHz
- 256 Kb
- 32 Kb
* - ``thing``
- `SparkFun ESP8266 Thing <https://www.sparkfun.com/products/13231>`_
- ESP8266
@@ -2663,6 +2767,26 @@ Wicked Device
- 128 Kb
- 16 Kb
chipKIT
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``lenny``
- `chipKIT Lenny <http://chipkit.net/tag/lenny/>`_
- 32MX270F256D
- 40 MHz
- 128 Kb
- 32 Kb
element14
~~~~~~~~~

View File

@@ -210,6 +210,13 @@ Espressif
- 4096 Kb
- 80 Kb
* - ``esp8285``
- `Generic ESP8285 Module <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
* - ``esp_wroom_02``
- `ESP-WROOM-02 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
@@ -217,6 +224,27 @@ Espressif
- 4096 Kb
- 50 Kb
* - ``phoenix_v1``
- `Phoenix 1.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``phoenix_v2``
- `Phoenix 2.0 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 1024 Kb
- 80 Kb
* - ``wifinfo``
- `WifInfo <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
- ESP8266
- 80 MHz
- 448 Kb
- 80 Kb
NodeMCU
~~~~~~~

View File

@@ -240,6 +240,7 @@ Using Arduino Framework with Staging version
Articles
--------
* Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github <http://blog.squix.org/2016/06/new-weather-station-demo-on-github.html>`_
* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline Push To Production <http://blog.squix.org/2016/06/esp8266-continuous-delivery-pipeline-push-to-production.html>`_
* May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! <http://www.instructables.com/id/Reverse-Engineer-RF-Remote-Controller-for-IoT/?ALLSTEPS>`_
* May 22, 2016 - **Pedro Minatel** - `Estação meteorológica com ESP8266 (Weather station with ESP8266, Portuguese) <http://pedrominatel.com.br/esp8266/estacao-meteorologica-com-esp8266/>`_

View File

@@ -332,6 +332,26 @@ UBW32
- 512 Kb
- 128 Kb
chipKIT
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``lenny``
- `chipKIT Lenny <http://chipkit.net/tag/lenny/>`_
- 32MX270F256D
- 40 MHz
- 128 Kb
- 32 Kb
element14
~~~~~~~~~

View File

@@ -37,6 +37,9 @@ Packages
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``tool-sreccat``
- `Merging tool <https://github.com/marcows/SRecord>`_
* - ``framework-arduinonordicnrf51``
- `Arduino Wiring-based Framework (RFduino Core) <https://github.com/RFduino/RFduino>`_

View File

@@ -9,6 +9,33 @@
See the License for the specific language governing permissions and
limitations under the License.
USB Features
------------
If you want to use Teensy USB Features, you need to add special
acros/define using :ref:`projectconf_build_flags`:
* ``-D USB_HID``
* ``-D USB_SERIAL_HID``
* ``-D USB_DISK``
* ``-D USB_DISK_SDFLASH``
* ``-D USB_MIDI``
* ``-D USB_RAWHID``
* ``-D USB_FLIGHTSIM``
* ``-D USB_DISABLED``
Example:
.. code-block:: ini
[env:teensy_hid_device]
platform = teensy
framework = arduino
board = teensy20
build_flags = -D USB_RAWHID
See `Teensy USB Examples <https://www.pjrc.com/teensy/usb_debug_only.html>`_.
Examples
--------

View File

@@ -97,7 +97,11 @@ This option can be overridden by global environment variable
``envs_dir``
^^^^^^^^^^^^
This is a cache directory. *PlatformIO Build System* uses this folder for project
.. warning::
**PLEASE DO NOT EDIT FILES IN THIS FOLDER**. PlatformIO will overwrite
your changes on the next build. **THIS IS A CACHE DIRECTORY**.
*PlatformIO Build System* uses this folder for project
environments to store compiled object files, static libraries, firmwares and
other cached information. It allows PlatformIO to build source code extremely
fast!
@@ -351,6 +355,10 @@ Example:
[env:specific_ld_script]
build_flags = -Wl,-T/path/to/ld_script.ld
[env:exec_command]
# get VCS revision "on-the-fly"
build_flags = !echo "-DPIO_SRC_REV="$(git rev-parse HEAD)
For more detailed information about available flags/options go to:

View File

@@ -147,24 +147,12 @@ The result of just generated ``platformio.ini``:
.. code-block:: ini
#
# Project Configuration File
# PlatformIO Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/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:uno]
platform = atmelavr
framework = arduino

View File

@@ -207,14 +207,11 @@ default ``20`` (DEC)
Diagnostics: suppress non-error messages, default ``Off``
.. option::
--echo
Enable local echo, default ``Off``
**REMOVED**: Is not available in Miniterm/PySerial 3.0
.. option::
--cr

View File

@@ -14,7 +14,7 @@
import sys
VERSION = (2, 10, 2)
VERSION = (2, 11, 2)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@@ -122,7 +122,7 @@ An unexpected error occurred. Further steps:
`pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
http://docs.platformio.org/en/latest/faq.html
http://docs.platformio.org/en/stable/faq.html
* Report this problem to the developers
https://github.com/platformio/platformio/issues

View File

@@ -46,7 +46,7 @@ DEFAULT_SETTINGS = {
},
"enable_telemetry": {
"description": (
"Telemetry service <http://docs.platformio.org/en/latest/"
"Telemetry service <http://docs.platformio.org/en/stable/"
"userguide/cmd_settings.html?#enable-telemetry> (Yes/No)"),
"value": True
},

View File

@@ -248,5 +248,35 @@
},
"url": "http://www.adafruit.com/products/2000",
"vendor": "Adafruit"
},
"adafruit_feather_m0_usb": {
"build": {
"core": "arduino_zero",
"extra_flags": "-DARDUINO_SAMD_FEATHER_M0 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Adafruit Feather M0",
"variant": "arduino_zero",
"ldscript": "flash_with_bootloader.ld",
"hwids": [
["0x239A", "0x800B"],
["0x239A", "0x000B"]
]
},
"frameworks": ["arduino"],
"name": "Adafruit Feather M0",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "sam-ba",
"require_upload_port" : true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.adafruit.com/product/2772",
"vendor": "Adafruit"
}
}

View File

@@ -881,14 +881,18 @@
"frameworks": ["arduino"],
"name": "Arduino Zero (Programming Port)",
"platform": "atmelsam",
"debug": {
"openocdcfg": "arduino_zero.cfg"
},
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "sam-ba",
"protocol": "openocd",
"require_upload_port" : false,
"use_1200bps_touch": false,
"wait_for_upload_port": false
"wait_for_upload_port": false,
"section_start": "0x2000"
},
"url": "https://www.arduino.cc/en/Main/ArduinoBoardZero",
"vendor": "Arduino"
@@ -923,5 +927,167 @@
},
"url": "https://www.arduino.cc/en/Main/ArduinoBoardZero",
"vendor": "Arduino"
},
"mkr1000USB": {
"build": {
"core": "arduino_zero",
"extra_flags": "-DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino MKR1000",
"variant": "mkr1000",
"ldscript": "flash_with_bootloader.ld",
"hwids": [
["0x2341", "0x804E"],
["0x2341", "0x004E"],
["0x2341", "0x824E"],
["0x2341", "0x024E"]
]
},
"frameworks": ["arduino"],
"name": "Arduino MKR1000",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "sam-ba",
"require_upload_port" : true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.arduino.cc/en/Main/ArduinoMKR1000",
"vendor": "Arduino"
},
"mzeropro": {
"build": {
"core": "arduino_zero_org",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino M0 Pro",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x804F"],
["0x03EB", "0x2111"]
]
},
"frameworks": ["arduino"],
"name": "Arduino M0 Pro (Programming Port)",
"platform": "atmelsam",
"debug": {
"openocdcfg": "arduino_zero_org.cfg"
},
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "openocd",
"require_upload_port" : false,
"use_1200bps_touch": false,
"wait_for_upload_port": false,
"section_start": "0x4000"
},
"url": "http://www.arduino.org/products/boards/arduino-m0-pro",
"vendor": "Arduino"
},
"mzeroproUSB": {
"build": {
"core": "arduino_zero_org",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino M0 Pro",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x804F"],
["0x2A03", "0x004F"]
]
},
"frameworks": ["arduino"],
"name": "Arduino M0 Pro (Native USB Port)",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 57600,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"section_start": "0x4000"
},
"url": "http://www.arduino.org/products/boards/arduino-m0-pro",
"vendor": "Arduino"
},
"mzeroUSB": {
"build": {
"core": "arduino_zero_org",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino M0",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x804E"],
["0x2A03", "0x004E"]
]
},
"frameworks": ["arduino"],
"name": "Arduino M0",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 57600,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"section_start": "0x4000"
},
"url": "http://www.arduino.org/products/boards/arduino-m0",
"vendor": "Arduino"
},
"tian": {
"build": {
"core": "arduino_zero_org",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "Arduino Tian",
"variant": "arduino_zero_org",
"ldscript": "samd21g18a_bootloader_org.ld",
"hwids": [
["0x2A03", "0x8052"],
["0x10C4", "0xEA70"]
]
},
"frameworks": ["arduino"],
"name": "Arduino Tian",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 57600,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"section_start": "0x4000"
},
"url": "http://www.arduino.org/products/boards/arduino-tian",
"vendor": "Arduino"
}
}

View File

@@ -8,7 +8,11 @@
"frameworks": ["mbed"],
"name": "Atmel ATSAMR21-XPRO",
"platform": "atmelsam",
"debug": {
"openocdcfg": "atmel_samr21_xplained_pro.cfg"
},
"upload": {
"protocol": "openocd",
"maximum_ram_size": 32768,
"maximum_size": 262144
},
@@ -24,7 +28,11 @@
"frameworks": ["mbed"],
"name": "Atmel SAML21-XPRO-B",
"platform": "atmelsam",
"debug": {
"openocdcfg": "atmel_saml21_xplained_pro.cfg"
},
"upload": {
"protocol": "openocd",
"maximum_ram_size": 32768,
"maximum_size": 262144
},
@@ -40,7 +48,11 @@
"frameworks": ["mbed"],
"name": "Atmel SAMD21-XPRO",
"platform": "atmelsam",
"debug": {
"openocdcfg": "atmel_samd21_xplained_pro.cfg"
},
"upload": {
"protocol": "openocd",
"maximum_ram_size": 32768,
"maximum_size": 262144
},

View File

@@ -358,7 +358,7 @@
"d1": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_WEMOS_D1MINI",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
@@ -383,7 +383,7 @@
"d1_mini": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_NODEMCU",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_WEMOS_D1MINI",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
@@ -478,5 +478,105 @@
},
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
"vendor": "Espressif"
},
"esp8285": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_ESP01",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dout",
"ldscript": "esp8266.flash.1m256.ld",
"mcu": "esp8266",
"variant": "generic"
},
"frameworks": ["arduino"],
"name": "Generic ESP8285 Module",
"platform": "espressif",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 434160,
"resetmethod": "ck",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
"vendor": "Espressif"
},
"phoenix_v1": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_PHOENIX_V1",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"ldscript": "esp8266.flash.4m1m.ld",
"mcu": "esp8266",
"variant": "phoenix_v1"
},
"frameworks": ["arduino"],
"name": "Phoenix 1.0",
"platform": "espressif",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 1044464,
"resetmethod": "nodemcu",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
"vendor": "Espressif"
},
"phoenix_v2": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266_PHOENIX_V2",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "dio",
"ldscript": "esp8266.flash.4m1m.ld",
"mcu": "esp8266",
"variant": "phoenix_v2"
},
"frameworks": ["arduino"],
"name": "Phoenix 2.0",
"platform": "espressif",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 1044464,
"resetmethod": "ck",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
"vendor": "Espressif"
},
"wifinfo": {
"build": {
"core": "esp8266",
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DWIFINFO",
"f_cpu": "80000000L",
"f_flash": "40000000L",
"flash_mode": "qio",
"ldscript": "esp8266.flash.1m256.ld",
"mcu": "esp8266",
"variant": "wifinfo"
},
"frameworks": ["arduino"],
"name": "WifInfo",
"platform": "espressif",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 434160,
"resetmethod": "nodemcu",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family",
"vendor": "Espressif"
}
}

View File

@@ -119,7 +119,7 @@
"core": "pic32",
"extra_flags": "-D_BOARD_CHIPKIT_PI_",
"f_cpu": "40000000L",
"ldscript": "cchipKIT-application-32MX250F128.ld",
"ldscript": "chipKIT-application-32MX250F128.ld",
"mcu": "32MX250F128B",
"variant": "ChipKIT_Pi"
},
@@ -236,7 +236,7 @@
"f_cpu": "80000000L",
"ldscript": "chipKIT-application-32MX440F512.ld",
"mcu": "32MX440F512H",
"variant": "Default_64"
"variant": "PONTECH_UAV100"
},
"frameworks": ["arduino"],
"name": "PONTECH UAV100",
@@ -510,7 +510,7 @@
"core": "pic32",
"extra_flags": "-D_BOARD_OPENSCOPE_",
"f_cpu": "200000000L",
"ldscript": "MZ-application-32MZ2048ECX.ld",
"ldscript": "OpenScope.ld",
"mcu": "32MZ2048EFG124",
"variant": "OpenScope"
},
@@ -549,5 +549,28 @@
},
"url": "http://shop.openbci.com/",
"vendor": "OpenBCI"
},
"lenny": {
"build": {
"core": "pic32",
"extra_flags": "-D_BOARD_LENNY_ -D_USE_USB_FOR_SERIAL_",
"f_cpu": "40000000L",
"ldscript": "chipKIT-application-32MX270F256.ld",
"mcu": "32MX270F256D",
"variant": "Lenny"
},
"frameworks": ["arduino"],
"name": "chipKIT Lenny",
"platform": "microchippic32",
"upload": {
"maximum_ram_size": 32768,
"maximum_size": 122880,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://chipkit.net/tag/lenny/",
"vendor": "chipKIT"
}
}

View File

@@ -52,7 +52,7 @@
"variant": "standard"
},
"frameworks": ["arduino"],
"name": "emonPi",
"name": "OpenEnergyMonitor emonPi",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 2048,
@@ -820,5 +820,27 @@
},
"url": "https://www.arduboy.com",
"vendor": "Arduboy"
},
"pinoccio": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_PINOCCIO -D__PROG_TYPES_COMPAT__",
"f_cpu": "16000000L",
"mcu": "atmega256rfr2",
"variant": "pinoccio"
},
"frameworks": ["arduino"],
"name": "Pinoccio Scout",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 32768,
"maximum_size": 253952,
"protocol": "wiring",
"require_upload_port" : true,
"speed": 115200
},
"url": "https://www.crowdsupply.com/pinoccio/mesh-sensor-network",
"vendor": "Pinoccio"
}
}

View File

@@ -238,5 +238,67 @@
},
"url": "https://www.sparkfun.com/products/12923",
"vendor": "SparkFun"
},
"sparkfun_samd21_dev_usb": {
"build": {
"core": "arduino_zero",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "SparkFun SAMD21",
"variant": "arduino_zero",
"ldscript": "flash_with_bootloader.ld",
"hwids": [
["0x1B4F", "0x8D21"],
["0x1B4F", "0x0D21"]
]
},
"frameworks": ["arduino"],
"name": "SparkFun SAMD21 Dev Breakout",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "sam-ba",
"require_upload_port" : true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.sparkfun.com/products/13672",
"vendor": "SparkFun"
},
"sparkfun_samd21_mini_usb": {
"build": {
"core": "arduino_zero",
"extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__",
"f_cpu": "48000000L",
"mcu": "samd21g18a",
"cpu": "cortex-m0plus",
"usb_product": "SparkFun SAMD21",
"variant": "SparkFun_SAMD_Mini",
"ldscript": "flash_with_bootloader.ld",
"hwids": [
["0x1B4F", "0x8D21"],
["0x1B4F", "0x0D21"]
]
},
"frameworks": ["arduino"],
"name": "SparkFun SAMD21 Mini Breakout",
"platform": "atmelsam",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 32768,
"maximum_size": 262144,
"protocol": "sam-ba",
"require_upload_port" : true,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.sparkfun.com/products/13664",
"vendor": "SparkFun"
}
}
}

View File

@@ -18,21 +18,13 @@
from os.path import basename, join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
DefaultEnvironment, SConscript)
from platformio.util import get_serialports
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
board_type = env.subst("$BOARD")
if "zero" not in board_type:
env.Append(
UPLOADERFLAGS=[
"-U",
"true" if ("usb" in board_type.lower(
) or board_type == "digix") else "false"
])
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
@@ -48,7 +40,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
# use only port name for BOSSA
if "/" in env.subst("$UPLOAD_PORT"):
if ("/" in env.subst("$UPLOAD_PORT") and
env.subst("$UPLOAD_PROTOCOL") == "sam-ba"):
env.Replace(UPLOAD_PORT=basename(env.subst("$UPLOAD_PORT")))
@@ -56,41 +49,8 @@ env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
if env.subst("$BOARD") == "zero":
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-openocd", "bin", "openocd"),
UPLOADERFLAGS=[
"-d2",
"-s",
join(
"$PIOPACKAGES_DIR",
"tool-openocd", "share", "openocd", "scripts"),
"-f",
join(
"$PLATFORMFW_DIR", "variants",
"${BOARD_OPTIONS['build']['variant']}", "openocd_scripts",
"${BOARD_OPTIONS['build']['variant']}.cfg"
),
"-c", "\"telnet_port", "disabled;",
"program", "{{$SOURCES}}",
"verify", "reset", "0x00002000;", "shutdown\""
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
)
else:
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
UPLOADERFLAGS=[
"--info",
"--port", '"$UPLOAD_PORT"',
"--erase",
"--write",
"--verify",
"--reset",
"--debug"
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES'
)
BOARD_OPTIONS = env.get("BOARD_OPTIONS", {})
env.Append(
@@ -120,8 +80,21 @@ env.Append(
]
)
user_code_section = BOARD_OPTIONS.get("upload", {}).get("section_start", False)
if "sam3x8e" in env.get("BOARD_OPTIONS", {}).get("build", {}).get("mcu", None):
if user_code_section:
env.Append(
CPPDEFINES=[
"printf=iprintf"
],
LINKFLAGS=[
"-Wl,--entry=Reset_Handler",
"-Wl,--section-start=.text=%s" % user_code_section
]
)
if "sam3x8e" in BOARD_OPTIONS.get("build", {}).get("mcu", ""):
env.Append(
CPPDEFINES=[
"printf=iprintf"
@@ -130,14 +103,10 @@ if "sam3x8e" in env.get("BOARD_OPTIONS", {}).get("build", {}).get("mcu", None):
LINKFLAGS=[
"-Wl,--entry=Reset_Handler",
"-Wl,--start-group"
],
UPLOADERFLAGS=[
"--boot",
]
)
elif "zero" in env.subst("$BOARD"):
elif "samd" in BOARD_OPTIONS.get("build", {}).get("mcu", ""):
env.Append(
LINKFLAGS=[
"--specs=nosys.specs",
@@ -145,6 +114,100 @@ elif "zero" in env.subst("$BOARD"):
]
)
upload_protocol = BOARD_OPTIONS.get("upload", {}).get("protocol", None)
if upload_protocol == "openocd":
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-openocd", "bin", "openocd"),
UPLOADERFLAGS=[
"-d2",
"-f", join(BOARD_OPTIONS.get("debug", {}).get("openocdcfg", "")),
"-s", join("$PIOPACKAGES_DIR", "tool-openocd",
"share", "openocd", "scripts"),
"-s", join("$PIOPACKAGES_DIR", "tool-openocd",
"share", "openocd", "scripts", "board")
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
)
if "zero" in env.subst("$BOARD"):
env.Append(
UPLOADERFLAGS=[
"-s", join("$PLATFORMFW_DIR", "variants",
"${BOARD_OPTIONS['build']['variant']}",
"openocd_scripts")
]
)
env.Append(
UPLOADERFLAGS=[
"-c", "\"telnet_port", "disabled;",
"program", "{{$SOURCES}}",
"verify", "reset",
"%s;" % user_code_section if user_code_section else "",
"shutdown\""
]
)
elif upload_protocol == "sam-ba":
board_type = env.subst("$BOARD")
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
UPLOADERFLAGS=[
"--info",
"--port", '"$UPLOAD_PORT"',
"--erase",
"--write",
"--verify",
"--reset",
"--debug",
"-U",
"true" if ("usb" in board_type.lower(
) or board_type == "digix") else "false"
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES'
)
if "sam3x8e" in BOARD_OPTIONS.get("build", {}).get("mcu", ""):
env.Append(UPLOADERFLAGS=["--boot"])
elif upload_protocol == "stk500v2":
env.Append(
BUILDERS=dict(
ElfToHex=Builder(
action=" ".join([
"$OBJCOPY",
"-O",
"ihex",
"-R",
".eeprom",
"$SOURCES",
"$TARGET"]),
suffix=".hex"
)
)
)
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
UPLOADERFLAGS=[
"-C", '"%s"' % join("$PIOPACKAGES_DIR",
"tool-avrdude", "avrdude.conf"),
"-v",
"-p", "atmega2560", # Arduino M0/Tian upload hook
"-c", "$UPLOAD_PROTOCOL",
"-P", '"$UPLOAD_PORT"',
"-b", "$UPLOAD_SPEED"
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS -U flash:w:$SOURCES:i'
)
#
# Target: Build executable and linkable firmware
#
@@ -157,6 +220,8 @@ target_elf = env.BuildProgram()
if "uploadlazy" in COMMAND_LINE_TARGETS:
target_firm = join("$BUILD_DIR", "firmware.bin")
elif upload_protocol == "stk500v2":
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
else:
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
@@ -171,7 +236,7 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file
#
if env.subst("$BOARD") == "zero":
if upload_protocol == "openocd":
upload = env.Alias(["upload", "uploadlazy"], target_firm, "$UPLOADCMD")
else:
upload = env.Alias(

View File

@@ -82,8 +82,7 @@ env.Replace(
"-falign-functions=4",
"-U__STRICT_ANSI__",
"-ffunction-sections",
"-fdata-sections",
"-MMD" # output dependancy info
"-fdata-sections"
],
CXXFLAGS=[

View File

@@ -55,13 +55,17 @@ elif env.get("PLATFORM") == "timsp430":
)
elif env.get("PLATFORM") == "espressif":
env.Prepend(
CPPDEFINES=["LWIP_OPEN_SRC"],
CPPPATH=[
join("$PLATFORMFW_DIR", "tools", "sdk", "include"),
join("$PLATFORMFW_DIR", "tools", "sdk", "lwip", "include")
],
LIBPATH=[join("$PLATFORMFW_DIR", "tools", "sdk", "lib")],
LIBS=["mesh", "wpa2", "smartconfig", "pp", "main", "wpa", "lwip",
"net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc", "m"]
LIBS=[
"mesh", "wpa2", "smartconfig", "pp", "main", "wpa", "lwip_gcc",
"net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc",
"m", "stdc++"
]
)
env.VariantDirWrap(
join("$BUILD_DIR", "generic"),
@@ -112,7 +116,10 @@ elif env.get("PLATFORM") == "microchippic32":
"$PLATFORMFW_DIR", "variants",
"${BOARD_OPTIONS['build']['variant']}"
)
]
],
CPPDEFINES=["ARDUINO_ARCH_PIC32"]
)
elif "intel" in env.get("PLATFORM"):
@@ -192,6 +199,20 @@ if env.get("PLATFORM") == "teensy":
"ARDUINO=10600",
"TEENSYDUINO=%d" % ARDUINO_VERSION
]
USB_FLAGS = (
"USB_HID",
"USB_SERIAL_HID",
"USB_DISK",
"USB_DISK_SDFLASH",
"USB_MIDI",
"USB_RAWHID",
"USB_FLIGHTSIM",
"USB_DISABLED"
)
if not any(f in env.get("BUILD_FLAGS", []) for f in USB_FLAGS):
env.Append(CPPDEFINES=["USB_SERIAL"])
else:
ARDUINO_USBDEFINES += ["ARDUINO=%d" % ARDUINO_VERSION]
@@ -210,11 +231,21 @@ env.Append(
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkCMSISInc"),
join("$PLATFORMFW_DIR", "system", "CMSIS", "CMSIS", "Include")
join(
"$PLATFORMFW_DIR", "system",
"CMSIS%s" % (
"_ORG" if BOARD_CORELIBDIRNAME.endswith("_org") else ""),
"CMSIS", "Include"
)
)
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkDeviceInc"),
join("$PLATFORMFW_DIR", "system", "CMSIS", "Device", "ATMEL")
join(
"$PLATFORMFW_DIR", "system",
"CMSIS%s" % (
"_ORG" if BOARD_CORELIBDIRNAME.endswith("_org") else ""),
"Device", "ATMEL"
)
)
env.VariantDirWrap(
join("$BUILD_DIR", "FrameworkLibSam"),
@@ -294,6 +325,8 @@ if BOARD_BUILDOPTS.get("core", None) == "teensy":
with open(file_path, "w") as fp:
fp.write(content)
env.Append(CPPPATH=[join("$PLATFORMFW_DIR", "cores")])
#
# Target: Build Core Library
#

View File

@@ -28,6 +28,7 @@ http://mbed.org/
from __future__ import print_function
import json
import re
import sys
import xml.etree.ElementTree as ElementTree
@@ -86,7 +87,7 @@ MBED_LIBS_MAP = {
def get_mbedlib_includes():
result = []
for lib in MBED_LIBS_MAP.keys():
for lib in MBED_LIBS_MAP:
includes = []
lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", lib)
for _, _, files in walk(lib_dir):
@@ -163,7 +164,7 @@ def add_mbedlib(libname, libar):
continue
if "TARGET_" in root:
if all([p not in root.upper() for p in target_includes]):
if all([p not in root for p in target_includes]):
continue
var_dir = join("$BUILD_DIR", "FrameworkMbed%sInc%d" %
@@ -251,6 +252,37 @@ eixdata = parse_eix_file(
build_flags = get_build_flags(eixdata)
variant_dir = join("$PLATFORMFW_DIR", "variant", variant)
def _find_soft_device_hex():
if not isfile(join(env.subst("$PLATFORMFW_DIR"), "targets.json")):
return None
with open(join(env.subst("$PLATFORMFW_DIR"), "targets.json")) as fp:
data = json.load(fp)
def _find_hex(target_name):
assert isinstance(data, dict)
if target_name not in data:
return None
target = data[target_name]
if "EXPECTED_SOFTDEVICES_WITH_OFFSETS" not in target:
try:
return _find_hex(target.get("inherits", [])[0])
except IndexError:
return None
else:
return target['EXPECTED_SOFTDEVICES_WITH_OFFSETS'][0]['name']
softdevice_name = _find_hex(variant)
if softdevice_name:
for root, _, files in walk(env.subst(variant_dir)):
if softdevice_name in files:
return join(root, softdevice_name)
env.Exit("Error: Cannot find SoftDevice binary file for your board!")
env.Replace(
_mbed_whole_archive_hook=_mbed_whole_archive_hook,
_LIBFLAGS="${_mbed_whole_archive_hook(%s)}" % env.get("_LIBFLAGS")[2:-1],
@@ -263,14 +295,17 @@ env.Replace(
join(variant_dir, eixdata.get("LDSCRIPT_PATH")[0]))
)
if env.get("PLATFORM") == "nordicnrf51":
env.Append(SOFTDEVICEHEX=_find_soft_device_hex())
# restore external build flags
env.ProcessFlags([
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags")
])
env.ProcessFlags(
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"))
# remove base flags
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
# apply user flags
env.ProcessFlags([env.get("BUILD_FLAGS")])
env.ProcessFlags(env.get("BUILD_FLAGS"))
# Hook for K64F and K22F
if board_type in ("frdm_k22f", "frdm_k64f"):

View File

@@ -71,7 +71,19 @@ env.Replace(
"-mprocessor=$BOARD_MCU",
"-mno-peripheral-libs",
"-nostartfiles",
"-Wl,--gc-sections"
"-Wl,--gc-sections",
join(
"$PLATFORMFW_DIR",
"cores",
"${BOARD_OPTIONS['build']['core']}",
"cpp-startup.S"
),
join(
"$PLATFORMFW_DIR",
"cores",
"${BOARD_OPTIONS['build']['core']}",
"crti.S"
)
],
LIBS=["m"],
@@ -92,6 +104,7 @@ env.Replace(
if int(env.get("BOARD_OPTIONS", {}).get(
"upload", {}).get("maximum_ram_size", 0)) < 65535:
env.Append(
ASFLAGS=["-G1024"],
CCFLAGS=["-G1024"]
)
@@ -115,15 +128,7 @@ env.Append(
),
ElfToHex=Builder(
action=" ".join([
"$OBJCOPY",
"-O",
"ihex",
"-R",
".eeprom",
"$SOURCES",
"$TARGET"]),
suffix=".hex"
action=" ".join(["pic32-bin2hex", "-a", "$SOURCES"]), suffix=".hex"
)
)
)
@@ -161,7 +166,7 @@ env.Append(
if "uploadlazy" in COMMAND_LINE_TARGETS:
target_firm = join("$BUILD_DIR", "firmware.hex")
else:
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
target_firm = env.ElfToHex(target_elf)
#
# Target: Print binary size

View File

@@ -18,7 +18,7 @@
from os.path import join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
DefaultEnvironment, SConscript)
env = DefaultEnvironment()
@@ -35,6 +35,25 @@ if env.subst("$BOARD") == "rfduino":
UPLOADERFLAGS=["-q", '"$UPLOAD_PORT"'],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES'
)
else:
env.Append(
BUILDERS=dict(
MergeHex=Builder(
action=" ".join([
join("$PIOPACKAGES_DIR", "tool-sreccat", "srec_cat"),
"$SOFTDEVICEHEX",
"-intel",
"$SOURCES",
"-intel",
"-o",
"$TARGET",
"-intel",
"--line-length=44"
]),
suffix=".hex"
)
)
)
#
# Target: Build executable and linkable firmware
@@ -49,7 +68,13 @@ target_elf = env.BuildProgram()
if "uploadlazy" in COMMAND_LINE_TARGETS:
target_firm = join("$BUILD_DIR", "firmware.hex")
else:
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
if env.subst("$BOARD") == "rfduino":
target_firm = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
else:
target_firm = env.MergeHex(
join("$BUILD_DIR", "firmware"),
env.ElfToHex(join("$BUILD_DIR", "userfirmware"), target_elf)
)
#
# Target: Print binary size

View File

@@ -40,7 +40,6 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
env.Append(
CPPDEFINES=[
"USB_SERIAL",
"LAYOUT_US_ENGLISH"
],

View File

@@ -122,8 +122,8 @@ def ConvertInoToCpp(env):
remove(file_)
except: # pylint: disable=bare-except
if isfile(file_):
print ("Warning: Could not remove temporary file '%s'. "
"Please remove it manually." % file_)
print("Warning: Could not remove temporary file '%s'. "
"Please remove it manually." % file_)
ino_nodes = (env.Glob(join("$PROJECTSRC_DIR", "*.ino")) +
env.Glob(join("$PROJECTSRC_DIR", "*.pde")))
@@ -147,17 +147,15 @@ def DumpIDEData(env):
def get_includes(env_):
includes = []
# includes from used framework and libs
for item in env_.get("VARIANT_DIRS", []):
if "$BUILDSRC_DIR" in item[0]:
continue
includes.append(env_.subst(item[1]))
# custom includes
for item in env_.get("CPPPATH", []):
if item.startswith("$BUILD_DIR"):
continue
includes.append(env_.subst(item))
invardir = False
for vardiritem in env_.get("VARIANT_DIRS", []):
if item == vardiritem[0]:
includes.append(env_.subst(vardiritem[1]))
invardir = True
break
if not invardir:
includes.append(env_.subst(item))
# installed libs
for d in env_.get("LIBSOURCE_DIRS", []):
@@ -203,7 +201,7 @@ def DumpIDEData(env):
defines = []
# global symbols
for item in env_.get("CPPDEFINES", []):
if isinstance(item, list):
if isinstance(item, list) or isinstance(item, tuple):
item = "=".join(item)
defines.append(env_.subst(item).replace('\\"', '"'))
@@ -226,6 +224,8 @@ def DumpIDEData(env):
"includes": get_includes(env_),
"cc_flags": env_.subst(LINTCCOM),
"cxx_flags": env_.subst(LINTCXXCOM),
"cc_path": where_is_program(
env_.subst("$CC"), env_.subst("${ENV['PATH']}")),
"cxx_path": where_is_program(
env_.subst("$CXX"), env_.subst("${ENV['PATH']}"))
}
@@ -233,7 +233,7 @@ def DumpIDEData(env):
# https://github.com/platformio/platformio-atom-ide/issues/34
_new_defines = []
for item in env_.get("CPPDEFINES", []):
if isinstance(item, list):
if isinstance(item, list) or isinstance(item, tuple):
item = "=".join(item)
item = item.replace('\\"', '"')
if " " in item:

View File

@@ -39,15 +39,12 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
port = env.subst(port)
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
if system() != "Windows":
try:
s = Serial(port)
s.close()
except: # pylint: disable=W0702
pass
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
try:
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
except: # pylint: disable=W0702
pass
sleep(0.4)

View File

@@ -38,8 +38,7 @@ def BuildProgram(env):
def _append_pio_macros():
env.AppendUnique(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())],
)
*pioversion_to_intstr())])
_append_pio_macros()
@@ -51,13 +50,12 @@ def BuildProgram(env):
)
# process extra flags from board
env.ProcessFlags([
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags")
])
env.ProcessFlags(
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"))
# remove base flags
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
# apply user flags
env.ProcessFlags([env.get("BUILD_FLAGS")])
env.ProcessFlags(env.get("BUILD_FLAGS"))
if env.get("FRAMEWORK"):
env.BuildFrameworks([
@@ -86,7 +84,7 @@ def BuildProgram(env):
)
# Handle SRC_BUILD_FLAGS
env.ProcessFlags([env.get("SRC_BUILD_FLAGS", None)])
env.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
env.Append(
CPPPATH=["$PROJECTSRC_DIR"],
@@ -115,18 +113,19 @@ def BuildProgram(env):
def ProcessFlags(env, flags):
for f in flags:
if not f:
if not flags:
return
if isinstance(flags, list):
flags = " ".join(flags)
parsed_flags = env.ParseFlags(str(flags))
for flag in parsed_flags.pop("CPPDEFINES"):
if not isinstance(flag, list):
env.Append(CPPDEFINES=flag)
continue
parsed_flags = env.ParseFlags(str(f))
for flag in parsed_flags.pop("CPPDEFINES"):
if not isinstance(flag, list):
env.Append(CPPDEFINES=flag)
continue
if '\"' in flag[1]:
flag[1] = flag[1].replace('\"', '\\\"')
env.Append(CPPDEFINES=[flag])
env.Append(**parsed_flags)
if '\"' in flag[1]:
flag[1] = flag[1].replace('\"', '\\\"')
env.Append(CPPDEFINES=[flag])
env.Append(**parsed_flags)
# fix relative CPPPATH & LIBPATH
for k in ("CPPPATH", "LIBPATH"):
@@ -151,10 +150,19 @@ def ProcessFlags(env, flags):
def ProcessUnFlags(env, flags):
if not flags:
return
for var, values in env.ParseFlags(flags).items():
for v in values:
if v in env[var]:
env[var].remove(v)
if isinstance(flags, list):
flags = " ".join(flags)
parsed_flags = env.ParseFlags(str(flags))
all_flags = []
for items in parsed_flags.values():
all_flags.extend(items)
all_flags = set(all_flags)
for key in parsed_flags:
cur_flags = set(env.Flatten(env.get(key, [])))
for item in cur_flags & all_flags:
while item in env[key]:
env[key].remove(item)
def IsFileWithExt(env, file_, ext): # pylint: disable=W0613

View File

@@ -27,6 +27,12 @@ from platformio.commands.run import cli as cmd_run
from platformio.exception import CIBuildEnvsEmpty
from platformio.util import get_boards
# pylint: disable=wrong-import-order
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser import ConfigParser
def validate_path(ctx, param, value): # pylint: disable=W0613
invalid_path = None
@@ -91,7 +97,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
_copy_contents(join(build_dir, dir_name), contents)
if project_conf and isfile(project_conf):
copyfile(project_conf, join(build_dir, "platformio.ini"))
_copy_project_conf(build_dir, project_conf)
elif not board:
raise CIBuildEnvsEmpty()
@@ -157,3 +163,12 @@ def _exclude_contents(dst_dir, patterns):
rmtree(path)
elif isfile(path):
remove(path)
def _copy_project_conf(build_dir, project_conf):
cp = ConfigParser()
cp.read(project_conf)
if cp.has_section("platformio"):
cp.remove_section("platformio")
with open(join(build_dir, "platformio.ini"), "w") as fp:
cp.write(fp)

View File

@@ -23,11 +23,10 @@ from platformio.commands.platforms import \
platforms_install as cli_platforms_install
from platformio.ide.projectgenerator import ProjectGenerator
from platformio.platforms.base import PlatformFactory
from platformio.util import get_boards, get_source_dir
def validate_boards(ctx, param, value): # pylint: disable=W0613
unknown_boards = set(value) - set(get_boards().keys())
unknown_boards = set(value) - set(util.get_boards().keys())
try:
assert not unknown_boards
return value
@@ -84,6 +83,10 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
)
if ide:
if not board:
board = get_first_board(project_dir)
if board:
board = [board]
if not board:
raise exception.BoardNotDefined()
if len(board) > 1:
@@ -95,8 +98,7 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
" '%s'." % (board[0], ", ".join(board)),
fg="yellow"
)
pg = ProjectGenerator(
project_dir, ide, board[0])
pg = ProjectGenerator(project_dir, ide, board[0])
pg.generate()
click.secho(
@@ -112,10 +114,21 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
)
def get_first_board(project_dir):
with util.cd(project_dir):
config = util.get_project_config()
for section in config.sections():
if not section.startswith("env:"):
continue
elif config.has_option(section, "board"):
return config.get(section, "board")
return None
def init_base_project(project_dir):
platformio_ini = join(project_dir, "platformio.ini")
if not isfile(platformio_ini):
copyfile(join(get_source_dir(), "projectconftpl.ini"),
copyfile(join(util.get_source_dir(), "projectconftpl.ini"),
platformio_ini)
lib_dir = join(project_dir, "lib")
@@ -173,7 +186,7 @@ include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install
http://docs.platformio.org/en/stable/projectconf.html#lib-install
""")
@@ -184,7 +197,7 @@ def init_ci_conf(project_dir):
with open(join(project_dir, ".travis.yml"), "w") as f:
f.write("""# Continuous Integration (CI) is the practice, in software
# engineering, of merging all developer working copies with a shared mainline
# several times a day < http://docs.platformio.org/en/latest/ci/index.html >
# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
#
# Documentation:
#
@@ -192,10 +205,10 @@ def init_ci_conf(project_dir):
# < https://docs.travis-ci.com/user/integration/platformio/ >
#
# * PlatformIO integration with Travis CI
# < http://docs.platformio.org/en/latest/ci/travis.html >
# < http://docs.platformio.org/en/stable/ci/travis.html >
#
# * User Guide for `platformio ci` command
# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html >
# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
#
#
# Please choice one of the following templates (proposed below) and uncomment
@@ -260,7 +273,7 @@ def init_cvs_ignore(project_dir):
def fill_project_envs( # pylint: disable=too-many-arguments,too-many-locals
ctx, platformio_ini, board_types, enable_auto_uploading,
env_prefix, force_download):
builtin_boards = get_boards()
builtin_boards = util.get_boards()
content = []
used_boards = []
used_platforms = []

View File

@@ -90,7 +90,7 @@ def lib_search(query, json_output, page, **filters):
click.echo("For more examples and advanced search syntax, "
"please use documentation:")
click.secho("http://docs.platformio.org"
"/en/latest/userguide/lib/cmd_search.html\n", fg="cyan")
"/en/stable/userguide/lib/cmd_search.html\n", fg="cyan")
return
click.secho("Found %d libraries:\n" % result['total'],
@@ -153,7 +153,7 @@ def lib_install(ctx, libid, version):
def lib_install_dependency(ctx, data):
assert isinstance(data, dict)
query = []
for key in data.keys():
for key in data:
if key in ("authors", "frameworks", "platforms", "keywords"):
values = data[key]
if not isinstance(values, list):

View File

@@ -21,7 +21,7 @@ from time import time
import click
from platformio import app, exception, telemetry, util
from platformio import __version__, app, exception, telemetry, util
from platformio.commands.lib import lib_install as cmd_lib_install
from platformio.libmanager import LibraryManager
from platformio.platforms.base import PlatformFactory
@@ -243,7 +243,7 @@ def _clean_pioenvs_dir(pioenvs_dir):
def calculate_project_hash():
structure = []
structure = [__version__]
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
if not isdir(d):
continue

View File

@@ -61,6 +61,8 @@ if int(PYSERIAL_VERSION[0]) == 3:
help="Set initial RTS line state")
@click.option("--dtr", default=None, type=click.Choice(["0", "1"]),
help="Set initial DTR line state")
@click.option("--echo", is_flag=True,
help="Enable local echo, default=Off")
@click.option("--encoding", default="UTF-8",
help="Set the encoding for the serial port (e.g. hexlify, "
"Latin1, UTF-8), default: UTF-8")

View File

@@ -52,6 +52,8 @@ def cli():
r = None
try:
for cmd in cmds:
if sys.version_info < (2, 7, 0):
cmd[0] += ".__main__"
cmd = [os.path.normpath(sys.executable), "-m"] + cmd
r = None
r = util.exec_command(cmd)
@@ -68,7 +70,7 @@ def cli():
"PlatformIO has been successfully upgraded to %s" %
actual_version, fg="green")
click.echo("Release notes: ", nl=False)
click.secho("http://docs.platformio.org/en/latest/history.html",
click.secho("http://docs.platformio.org/en/stable/history.html",
fg="cyan")
except Exception as e: # pylint: disable=W0703
if not r:

View File

@@ -191,7 +191,7 @@ class UpgradeError(PlatformioException):
* Upgrade using `pip install -U platformio`
* Try different installation/upgrading steps:
http://docs.platformio.org/en/latest/installation.html
http://docs.platformio.org/en/stable/installation.html
"""

View File

@@ -16,11 +16,10 @@ import json
import os
import re
import sys
from os.path import (abspath, basename, expanduser, isdir, join, normpath,
relpath)
from os.path import (abspath, basename, expanduser, isdir, isfile, join,
normpath, relpath)
import bottle
import click # pylint: disable=wrong-import-order
from platformio import app, exception, util
@@ -33,6 +32,9 @@ class ProjectGenerator(object):
self.board = board
self._tplvars = {}
with util.cd(self.project_dir):
self.project_src_dir = util.get_projectsrc_dir()
self._gather_tplvars()
@staticmethod
@@ -66,7 +68,12 @@ class ProjectGenerator(object):
envdata = self.get_project_env()
if "env_name" not in envdata:
return data
cmd = [normpath(sys.executable), "-m", "platformio", "-f"]
cmd = [
normpath(sys.executable), "-m",
"platformio" + (
".__main__" if sys.version_info < (2, 7, 0) else ""),
"-f"
]
if app.get_session_var("caller_id"):
cmd.extend(["-c", app.get_session_var("caller_id")])
cmd.extend(["run", "-t", "idedata", "-e", envdata['env_name']])
@@ -90,7 +97,7 @@ class ProjectGenerator(object):
def get_src_files(self):
result = []
with util.cd(self.project_dir):
for root, _, files in os.walk(util.get_projectsrc_dir()):
for root, _, files in os.walk(self.project_src_dir):
for f in files:
result.append(relpath(join(root, f)))
return result
@@ -109,16 +116,18 @@ class ProjectGenerator(object):
return tpls
def generate(self):
for _relpath, _path in self.get_tpls():
tpl_dir = self.project_dir
if _relpath:
tpl_dir = join(self.project_dir, _relpath)
if not isdir(tpl_dir):
os.makedirs(tpl_dir)
for tpl_relpath, tpl_path in self.get_tpls():
dst_dir = self.project_dir
if tpl_relpath:
dst_dir = join(self.project_dir, tpl_relpath)
if not isdir(dst_dir):
os.makedirs(dst_dir)
file_name = basename(_path)[:-4]
with open(join(tpl_dir, file_name), "w") as f:
f.write(self._render_tpl(_path).encode("utf8"))
file_name = basename(tpl_path)[:-4]
self._merge_contents(
join(dst_dir, file_name),
self._render_tpl(tpl_path).encode("utf8")
)
def _render_tpl(self, tpl_path):
content = ""
@@ -126,25 +135,32 @@ class ProjectGenerator(object):
content = f.read()
return bottle.template(content, **self._tplvars)
@staticmethod
def _merge_contents(dst_path, contents):
file_name = basename(dst_path)
# merge .gitignore
if file_name == ".gitignore" and isfile(dst_path):
contents = [l.strip() for l in contents.split("\n") if l.strip()]
with open(dst_path) as f:
for line in f.readlines():
line = line.strip()
if line and line not in contents:
contents.append(line)
contents = "\n".join(contents)
with open(dst_path, "w") as f:
f.write(contents)
def _gather_tplvars(self):
src_files = self.get_src_files()
if (not any([f.endswith((".c", ".cpp")) for f in src_files]) and
self.ide == "clion"):
click.secho(
"Warning! Can not find main source file (*.c, *.cpp). So, "
"code auto-completion is disabled. Please add source files "
"to `src` directory and re-initialize project or edit "
"`CMakeLists.txt` file manually (`add_executable` command).",
fg="yellow")
self._tplvars.update(self.get_project_env())
self._tplvars.update(self.get_project_build_data())
self._tplvars.update({
"project_name": self.get_project_name(),
"src_files": src_files,
"src_files": self.get_src_files(),
"user_home_dir": abspath(expanduser("~")),
"project_dir": self.project_dir,
"project_src_dir": self.project_src_dir,
"systype": util.get_systype(),
"platformio_path": self._fix_os_path(
util.where_is_program("platformio")),

View File

@@ -10,6 +10,7 @@
<config projectName="{{project_name}}" targetName="PLATFORMIO_PROGRAM" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_UPLOADFS" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_UPDATE_ALL" />
<config projectName="{{project_name}}" targetName="PLATFORMIO_REBUILD_PROJECT_INDEX" />
<config projectName="{{project_name}}" targetName="DEBUG" />
</generated>
</component>
@@ -39,28 +40,14 @@
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/CMakeLists.txt">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15758981">
<caret line="8" column="49" selection-start-line="8" selection-start-column="49" selection-end-line="8" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
<file leaf-file-name="platformio.ini" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/platformio.ini"></entry>
</file>
% for file in src_files:
<file leaf-file-name="{{file}}" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR/${{file}}">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="24" column="4" selection-start-line="24" selection-start-column="4" selection-end-line="24" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<file leaf-file-name="file://$PROJECT_DIR$/{{file}}" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR/${{file}}"></entry>
</file>
% end
% end
</leaf>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" />
@@ -113,6 +100,8 @@
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
@@ -120,13 +109,13 @@
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" />
@@ -136,7 +125,7 @@
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="{{project_name}}" />
@@ -155,7 +144,7 @@
<property name="recentsLimit" value="5" />
<property name="settings.editor.selected.configurable" value="CPPToolchains" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/CMakeLists.txt" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/platformio.ini" />
<property name="restartRequiresConfirmation" value="true" />
<property name="FullScreen" value="false" />
</component>
@@ -201,7 +190,11 @@
<envs />
<method />
</configuration>
<list size="7">
<configuration default="false" name="PLATFORMIO_REBUILD_PROJECT_INDEX" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="PLATFORMIO_REBUILD_PROJECT_INDEX" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
<list size="8">
<item index="0" class="java.lang.String" itemvalue="Application.Build All" />
<item index="1" class="java.lang.String" itemvalue="Application.PLATFORMIO_BUILD" />
<item index="3" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOAD" />
@@ -209,6 +202,7 @@
<item index="5" class="java.lang.String" itemvalue="Application.PLATFORMIO_PROGRAM" />
<item index="4" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOADFS" />
<item index="6" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPDATE" />
<item index="7" class="java.lang.String" itemvalue="Application.PLATFORMIO_REBUILD_PROJECT_INDEX" />
</list>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
@@ -225,27 +219,10 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="252" y="21" width="1400" height="1000" extended-state="0" />
<frame x="181" y="23" width="1400" height="1000" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.4631503" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32996634" sideWeight="0.53684974" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24945612" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
@@ -280,4 +257,4 @@
</state>
</states>
</component>
</project>
</project>

View File

@@ -3,10 +3,6 @@ project({{project_name}})
include(CMakeListsPrivate.txt)
% for define in defines:
add_definitions(-D{{!define}})
% end
add_custom_target(
PLATFORMIO_BUILD ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run
@@ -43,18 +39,10 @@ add_custom_target(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
% if src_files and any([f.endswith((".c", ".cpp")) for f in src_files]):
add_executable({{project_name}}
% for f in src_files:
% if f.endswith((".c", ".cpp")):
{{f.replace("\\", "/")}}
% end
% end
add_custom_target(
PLATFORMIO_REBUILD_PROJECT_INDEX ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion init --ide clion
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
% else:
#
# To enable code auto-completion, please specify path
# to main source file (*.c, *.cpp) and uncomment line below
#
# add_executable({{project_name}} src/main_change_me.cpp)
% end
add_executable(${PROJECT_NAME} ${SRC_LIST})

View File

@@ -1,6 +1,15 @@
set(ENV{PATH} "{{env_path}}")
set(PLATFORMIO_CMD "{{platformio_path}}")
SET(CMAKE_C_COMPILER "{{cc_path}}")
SET(CMAKE_CXX_COMPILER "{{cxx_path}}")
SET(CMAKE_CXX_FLAGS_DISTRIBUTION "{{cxx_flags}}")
SET(CMAKE_C_FLAGS_DISTRIBUTION "{{cc_flags}}")
% for define in defines:
add_definitions(-D{{!define}})
% end
% for include in includes:
% if include.startswith(user_home_dir):
% if "windows" in systype:
@@ -11,4 +20,6 @@ include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\"
% else:
include_directories("{{include.replace("\\", "/")}}")
% end
% end
% end
aux_source_directory({{project_src_dir}} SRC_LIST)

View File

@@ -166,6 +166,14 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="PlatformIO: Rebuild C/C++ Project Index" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>platformio</buildCommand>
<buildArguments>-f -c eclipse</buildArguments>
<buildTarget>init --ide eclipse</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>

View File

@@ -17,10 +17,12 @@ INCLUDEPATH += "{{include}}"
DEFINES += "{{define}}"
% end
OTHER_FILES += \
platformio.ini
OTHER_FILES += platformio.ini
SOURCES += \
% for file in src_files:
{{file}}
% end
% for file in src_files:
% if file.endswith((".h", ".hpp")):
HEADERS += {{file}}
% else:
SOURCES += {{file}}
% end
% end

View File

@@ -101,7 +101,7 @@ class Upgrader(object):
prev_platforms = []
# remove platform's folder (obsolete package structure)
for name in PlatformFactory.get_platforms().keys():
for name in PlatformFactory.get_platforms():
pdir = join(get_home_dir(), name)
if not isdir(pdir):
continue
@@ -217,7 +217,7 @@ def check_platformio_upgrade():
click.secho("pip install -U platformio", fg="cyan", nl=False)
click.secho("` command.", fg="yellow")
click.secho("Changes: ", fg="yellow", nl=False)
click.secho("http://docs.platformio.org/en/latest/history.html",
click.secho("http://docs.platformio.org/en/stable/history.html",
fg="cyan")
click.echo("*" * terminal_width)
click.echo("")
@@ -234,7 +234,7 @@ def check_internal_updates(ctx, what):
outdated_items = []
if what == "platforms":
for platform in PlatformFactory.get_platforms(installed=True).keys():
for platform in PlatformFactory.get_platforms(installed=True):
p = PlatformFactory.newPlatform(platform)
if p.is_outdated():
outdated_items.append(platform)

View File

@@ -36,11 +36,9 @@ class AtmelavrPlatform(BasePlatform):
},
"tool-avrdude": {
"alias": "uploader"
},
"tool-micronucleus": {
"alias": "uploader"
},
"framework-arduinoavr": {
@@ -58,10 +56,10 @@ class AtmelavrPlatform(BasePlatform):
def configure_default_packages(self, envoptions, targets):
if envoptions.get("board"):
board = get_boards(envoptions.get("board"))
disable_tool = "tool-micronucleus"
if "digispark" in board['build']['core']:
disable_tool = "tool-avrdude"
del self.PACKAGES[disable_tool]['alias']
self.PACKAGES['tool-micronucleus']['alias'] = "uploader"
else:
self.PACKAGES['tool-avrdude']['alias'] = "uploader"
return BasePlatform.configure_default_packages(
self, envoptions, targets)

View File

@@ -13,6 +13,7 @@
# limitations under the License.
from platformio.platforms.base import BasePlatform
from platformio.util import get_boards
class AtmelsamPlatform(BasePlatform):
@@ -49,13 +50,32 @@ class AtmelsamPlatform(BasePlatform):
},
"tool-bossac": {
"alias": "uploader"
},
"tool-openocd": {
"alias": "uploader"
},
"tool-avrdude": {
}
}
def get_name(self):
return "Atmel SAM"
def configure_default_packages(self, envoptions, targets):
if envoptions.get("board"):
board = get_boards(envoptions.get("board"))
upload_protocol = board.get("upload", {}).get("protocol", None)
upload_tool = None
if upload_protocol == "openocd":
upload_tool = "tool-openocd"
elif upload_protocol == "sam-ba":
upload_tool = "tool-bossac"
elif upload_protocol == "stk500v2":
upload_tool = "tool-avrdude"
if upload_tool:
self.PACKAGES[upload_tool]['alias'] = "uploader"
return BasePlatform.configure_default_packages(
self, envoptions, targets)

View File

@@ -181,6 +181,9 @@ PLATFORM_PACKAGES = {
],
"tool-arduino101load": [
("Genuino101 uploader", "https://github.com/01org/intel-arduino-tools")
],
"tool-sreccat": [
("Merging tool", "https://github.com/marcows/SRecord")
]
}
@@ -330,7 +333,7 @@ class BasePlatform(object):
def get_installed_packages(self):
pm = PackageManager()
return [n for n in self.get_packages().keys() if pm.is_installed(n)]
return [n for n in self.get_packages() if pm.is_installed(n)]
def install(self, with_packages=None, without_packages=None,
skip_default_packages=False):
@@ -380,7 +383,7 @@ class BasePlatform(object):
deppkgs = deppkgs.union(set(p.get_packages().keys()))
pm = PackageManager()
for name in self.get_packages().keys():
for name in self.get_packages():
if not pm.is_installed(name) or name in deppkgs:
continue
pm.uninstall(name)

View File

@@ -43,6 +43,10 @@ class Nordicnrf51Platform(BasePlatform):
"alias": "framework"
},
"tool-sreccat": {
"default": True
},
"tool-rfdloader": {
}
}

View File

@@ -1,18 +1,6 @@
#
# Project Configuration File
# PlatformIO 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
# Please make sure to read documentation with examples first
# http://docs.platformio.org/en/stable/projectconf.html
#

View File

@@ -81,6 +81,7 @@ class cd(object):
class memoized(object):
'''
Decorator. Caches a function's return value each time it is called.
If called later with the same arguments, the cached value is returned
@@ -212,10 +213,20 @@ def get_projectlib_dir():
def get_pioenvs_dir():
return _get_projconf_option_dir(
path = _get_projconf_option_dir(
"envs_dir",
join(get_project_dir(), ".pioenvs")
)
if not isdir(path):
os.makedirs(path)
dontmod_path = join(path, "do-not-modify-files-here.url")
if not isfile(dontmod_path):
with open(dontmod_path, "w") as fp:
fp.write("""
[InternetShortcut]
URL=http://docs.platformio.org/en/stable/projectconf.html#envs-dir
""")
return path
def get_projectdata_dir():

View File

@@ -60,7 +60,7 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="066
KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
# STM32 discovery boards, with onboard st/linkv2
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE:="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374?", MODE:="0666"
# USBtiny
SUBSYSTEMS=="usb", ATTRS{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE="0666"
@@ -76,3 +76,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666
#TI MSP430 Launchpad
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666"
# CMSIS-DAP compatible adapters
ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"

View File

@@ -42,6 +42,14 @@ def test_init_ext_folder(platformio_setup, clirunner, validate_cliresult):
validate_pioproject(join(getcwd(), ext_folder_name))
def test_init_ide_eclipse(platformio_setup, clirunner, validate_cliresult):
with clirunner.isolated_filesystem():
result = clirunner.invoke(cli, ["-b", "uno", "--ide", "eclipse"])
validate_cliresult(result)
validate_pioproject(getcwd())
assert all([isfile(f) for f in (".cproject", ".project")])
def test_init_special_board(platformio_setup, clirunner, validate_cliresult):
with clirunner.isolated_filesystem():
result = clirunner.invoke(cli, ["-b", "uno"])