Compare commits

...

42 Commits

Author SHA1 Message Date
941b8e84f5 Merge branch 'release/v2.10.1' 2016-06-13 21:32:07 +03:00
3dd51a442d Re-submit a package to PyPI 2016-06-13 21:31:17 +03:00
ed21e8c7b2 Merge branch 'release/v2.10.0' 2016-06-13 19:49:55 +03:00
2b6ba32b2c Merge branch 'release/v2.10.0' into develop 2016-06-13 19:49:55 +03:00
14f582faeb Version bump to 2.10.0 (issues #683, #687, #688, #689, #691) 2016-06-13 19:49:37 +03:00
768ac77ea2 Pass PlatformIO macros with version to libs 2016-06-13 19:46:54 +03:00
f75a7c91eb Update ARM mbed framework package to v121 2016-06-13 19:42:35 +03:00
104132c5d3 Typo fixes 2016-06-13 19:24:13 +03:00
3a315c5575 Move custom platform and board to separate page 2016-06-13 19:23:24 +03:00
91fb714250 Add new ST Nucleo board 2016-06-13 17:46:35 +03:00
10d868efa4 Update build script for mbed framework 2016-06-13 17:45:28 +03:00
3b8bc42266 Improve firmware uploading to Arduino Leonardo based boards // Resolve #691 2016-06-11 23:35:29 +03:00
9fb7f251f6 Typo fix 2016-06-11 16:49:25 +03:00
5398dbef95 Improve checking for the program size before uploading // Issue #689 2016-06-11 15:39:06 +03:00
a4345cedc5 Refactor board "hwid" option to "hwids" 2016-06-11 15:12:27 +03:00
ba574667c7 Add HWID for NodeMCU board 2016-06-11 13:35:02 +03:00
f2c1e279c9 Better checking of program size before uploading // Issue #689 2016-06-11 00:55:38 +03:00
60ff546fec Check program size before uploading to the board // Resolve #689 2016-06-11 00:02:36 +03:00
f6088cbbe1 Fix issue with "-L relative/path" when parsing "build_flags" // Resolve #688 2016-06-10 19:54:17 +03:00
4b093dcdbb Fix upload speed for OpenEnergyMonitor board 2016-06-10 18:01:46 +03:00
c9020d4879 Add support for STM32F0 boards for SPL framework // Issue #683 2016-06-09 19:17:19 +03:00
c5b5e80de4 Add support for emonPi the OpenEnergyMonitor system // Resolve #687 2016-06-09 18:50:08 +03:00
c1a8fdb940 Fix path to dfu util when it contains spaces. 2016-06-09 11:39:44 +03:00
1c8de51054 Add support for Arduboy DevKit 2016-06-06 18:13:12 +03:00
34c171f9fd Typo fix 2016-06-04 00:30:02 +03:00
9b2d49455a Merge branch 'release/v2.9.4' 2016-06-04 00:26:01 +03:00
730b2371df Merge branch 'release/v2.9.4' into develop 2016-06-04 00:26:01 +03:00
f1afa864cd Version bump to 2.9.4 2016-06-04 00:25:15 +03:00
439cd77db8 Show "udev" warning only for the Linux OS while upload firmware 2016-06-04 00:23:33 +03:00
4c35870dff Merge branch 'release/v2.9.3' 2016-06-03 21:04:04 +03:00
9f3624d26e Merge branch 'release/v2.9.3' into develop 2016-06-03 21:04:04 +03:00
ac4e8514db Version bump to 2.9.3 2016-06-03 21:03:48 +03:00
646123f9ab Notify Linux user to install PlatformIO udev rules 2016-06-03 20:57:20 +03:00
11ef9dbdcb Add new article 2016-06-03 20:40:24 +03:00
f3526b1d95 Add support for Arduboy 2016-06-03 20:14:37 +03:00
45d5159fe3 Remove unused imports 2016-06-03 18:46:28 +03:00
439e6b4ccf Refactor firmware uploading to the embedded boards with SAM-BA bootloader 2016-06-03 18:35:47 +03:00
fb08322c17 Fix firmware uploading to the embedded boards with SAM-BA bootloader 2016-06-03 13:58:51 +03:00
c815e0fadc Add explanation about waiting for the new serial port 2016-06-03 01:29:18 +03:00
190ffab76d Hook when new serial port is the same in boot mode 2016-06-03 01:16:16 +03:00
882bddf77e Revert back some code linked with uploading to Leonardo/Due 2016-06-03 00:42:52 +03:00
a9c02c9cbc Merge branch 'release/v2.9.2' into develop 2016-06-02 20:57:09 +03:00
42 changed files with 549 additions and 239 deletions

View File

@ -4,6 +4,43 @@ Release Notes
PlatformIO 2.0
--------------
2.10.1 (2016-06-13)
~~~~~~~~~~~~~~~~~~~
* Re-submit a package to PyPI
2.10.0 (2016-06-13)
~~~~~~~~~~~~~~~~~~~
* Added support for `emonPi <https://github.com/openenergymonitor/emonpi>`__,
the OpenEnergyMonitor system
(`issue #687 <https://github.com/platformio/platformio/issues/687>`_)
* Added support for `SPL <http://platformio.org/frameworks/spl>`__
framework for STM32F0 boards
(`issue #683 <https://github.com/platformio/platformio/issues/683>`_)
* Added support for `Arduboy DevKit <https://www.arduboy.com>`__, the game system
the size of a credit card
* Updated ARM mbed framework package to v121
* Check program size before uploading to the board
(`issue #689 <https://github.com/platformio/platformio/issues/689>`_)
* Improved firmware uploading to Arduino Leonardo based boards
(`issue #691 <https://github.com/platformio/platformio/issues/691>`_)
* Fixed issue with ``-L relative/path`` when parsing ``build_flags``
(`issue #688 <https://github.com/platformio/platformio/issues/688>`_)
2.9.4 (2016-06-04)
~~~~~~~~~~~~~~~~~~
* Show ``udev`` warning only for the Linux OS while uploading firmware
2.9.3 (2016-06-03)
~~~~~~~~~~~~~~~~~~
* Added support for `Arduboy <https://www.arduboy.com>`__, the game system
the size of a credit card
* Updated `99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`__ for Linux OS
* Refactored firmware uploading to the embedded boards with SAM-BA bootloader
2.9.2 (2016-06-02)
~~~~~~~~~~~~~~~~~~

View File

@ -23,6 +23,7 @@ Here are recent articles about PlatformIO:
2016
^^^^
* 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>`_
* May 26, 2016 - **Charlie Key** - `7 Best Developer Tools To Build Your NEXT Internet of Things Application <https://www.losant.com/blog/7-best-developer-tools-to-build-your-next-internet-of-things-application>`_

View File

@ -1,4 +1,4 @@
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
.. Copyright 2014-present Ivan Kravets <me@ikravets.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@ -19,7 +19,7 @@ Demo & Projects
Project Examples
----------------
Preconfigured demo projects are located in `PlatformIO GitHub <https://github.com/platformio/platformio-examples/tree/develop>`_ repository.
Pre-configured demo projects are located in `PlatformIO GitHub <https://github.com/platformio/platformio-examples/tree/develop>`_ repository.
"Blink Project"
---------------

View File

@ -176,6 +176,33 @@ Adafruit
- 8 Kb
- 0.5 Kb
Arduboy
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``arduboy``
- `Arduboy <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -1170,6 +1197,26 @@ OpenBCI
- 128 Kb
- 32 Kb
OpenEnergyMonitor
~~~~~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
- 2 Kb
PONTECH
~~~~~~~

View File

@ -19,7 +19,7 @@ integration. Arduino and MBED compatible. Ready for Cloud compiling.**
C/C++ Intelligent Code Completion and Smart Code Linter for the super-fast coding.
Multi-projects workflow with Multiple Panes. Themes Support with dark and light colors.
Built-in Terminal with PlatformIO CLI tool and support for the powerful Serial Port Monitor.
All advanced instruments without leaving your favourite development environment.
All advanced instruments without leaving your favorite development environment.
* **Development Platforms** - Embedded and Desktop development platforms with
pre-built toolchains, debuggers, uploaders and frameworks which work under
popular host OS: Mac, Windows, Linux (+ARM)
@ -110,8 +110,7 @@ Contents
platforms/index
platforms/embedded_boards
frameworks/index
platforms/creating_platform
platforms/creating_board
platforms/custom_platform_and_board
.. toctree::
:caption: Library Manager

View File

@ -166,6 +166,33 @@ Adafruit
- 8 Kb
- 0.5 Kb
Arduboy
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``arduboy``
- `Arduboy <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -785,6 +812,26 @@ Microduino
- 64 Kb
- 4 Kb
OpenEnergyMonitor
~~~~~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
- 2 Kb
PanStamp
~~~~~~~~

View File

@ -11,8 +11,8 @@
.. _board_creating:
Custom Board
============
Custom Embedded Board
=====================
*PlatformIO* has pre-built settings for the most popular embedded boards. This
list is available:

View File

@ -11,8 +11,8 @@
.. _platform_creating:
Custom Platform
===============
Custom Development Platform
===========================
*PlatformIO* was developed like a tool which would build the same source code
for the different development platforms via single command :ref:`cmd_run`

View File

@ -0,0 +1,19 @@
.. Copyright 2014-present Ivan Kravets <me@ikravets.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Custom Platform & Board
=======================
.. toctree::
:maxdepth: 2
creating_platform
creating_board

View File

@ -162,6 +162,33 @@ Adafruit
- 8 Kb
- 0.5 Kb
Arduboy
~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``arduboy``
- `Arduboy <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -1535,6 +1562,26 @@ OpenBCI
- 128 Kb
- 32 Kb
OpenEnergyMonitor
~~~~~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``emonpi``
- `emonPi <https://github.com/openenergymonitor/emonpi>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
- 2 Kb
Outrageous Circuits
~~~~~~~~~~~~~~~~~~~

View File

@ -240,6 +240,7 @@ Using Arduino Framework with Staging version
Articles
--------
* 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/>`_
* May 16, 2016 - **Pedro Minatel** - `Controle remoto WiFi com ESP8266 (WiFi remote control using ESP8266, Portuguese) <http://pedrominatel.com.br/esp8266/controle-remoto-wifi-com-esp8266/>`_

View File

@ -373,7 +373,7 @@ For more detailed information about available flags/options go to:
``src_build_flags``
^^^^^^^^^^^^^^^^^^^
An option ``src_build_flags`` has the same behaviour like ``build_flags``
An option ``src_build_flags`` has the same behavior like ``build_flags``
but will be applied only for the project source code from
:ref:`projectconf_pio_src_dir` directory.
@ -585,7 +585,7 @@ Example:
``lib_dfcyclic``
^^^^^^^^^^^^^^^^
Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``.
Control cyclic (recursive) behavior for ``Library Dependency Finder (LDF)``.
By default, this option is turned OFF (``lib_dfcyclic=False``) and means that
``LDF`` will find only libraries which are included in source files from the
project :ref:`projectconf_pio_src_dir`.

View File

@ -1,4 +1,4 @@
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
.. Copyright 2014-present Ivan Kravets <me@ikravets.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@ -30,7 +30,7 @@ PlatformIO CLI provides special :ref:`cmd_init` command for configuring your pro
It allows to initialize new empty project or update existing with the new data.
What is more, :ref:`cmd_init` can be used for :ref:`ide`. It means that you will
be able to import pre-generated PlatformIO project using favourite IDE and
be able to import pre-generated PlatformIO project using favorite IDE and
extend it with the professional instruments for IoT development.
This tutorial is based on the next popular embedded boards and development

View File

@ -1,4 +1,4 @@
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
.. Copyright 2014-present Ivan Kravets <me@ikravets.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@ -29,7 +29,7 @@ Description
:ref:`cmd_ci` command is conceived of as "hot key" for building project with
arbitrary source code structure. In a nutshell, using ``SRC`` and
:option:`platformio ci --lib` contents PlatformIO initialises via
:option:`platformio ci --lib` contents PlatformIO initializes via
:ref:`cmd_init` new project in :option:`platformio ci --build-dir`
with the build environments (using :option:`platformio ci --board` or
:option:`platformio ci --project-conf`) and processes them via :ref:`cmd_run`

View File

@ -1,4 +1,4 @@
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
.. Copyright 2014-present Ivan Kravets <me@ikravets.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@ -47,7 +47,7 @@ Options
.. option::
-d, --project-dir
A path to the directory where *PlatformIO* will initialise new project.
A path to the directory where *PlatformIO* will initialize new project.
.. option::
-b, --board

View File

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

View File

@ -7,7 +7,7 @@
"mcu": "atmega32u4",
"usb_product": "Adafruit Flora",
"variant": "flora",
"hwid": [
"hwids": [
["0x239A", "0x8004"]
]
},
@ -36,7 +36,7 @@
"mcu": "atmega32u4",
"usb_product": "Bluefruit Micro",
"variant": "bluefruitmicro",
"hwid": [
"hwids": [
["0x239A", "0x800A"]
]
},
@ -85,7 +85,7 @@
"mcu": "atmega32u4",
"usb_product": "Feather 32u4",
"variant": "feather32u4",
"hwid": [
"hwids": [
["0x239A", "0x800C"]
]
},

View File

@ -7,7 +7,7 @@
"mcu": "atmega32u4",
"usb_product": "LilyPad USB",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x1B4F", "0x9207"],
["0x1B4F", "0x9208"]
]
@ -164,7 +164,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Esplora",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x2341", "0x003C"],
["0x2341", "0x803C"],
["0x2A03", "0x003C"],
@ -237,7 +237,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Leonardo",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x2341", "0x0036"],
["0x2341", "0x8036"],
["0x2A03", "0x0036"],
@ -268,7 +268,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Leonardo ETH",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x2A03", "0x8040"],
["0x2A03", "0x0040"]
]
@ -402,7 +402,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Micro",
"variant": "micro",
"hwid": [
"hwids": [
["0x2341", "0x0037"],
["0x2341", "0x8037"],
["0x2A03", "0x0037"],
@ -601,7 +601,7 @@
"mcu": "atmega32u4",
"usb_product": "Robot Control",
"variant": "robot_control",
"hwid": [
"hwids": [
["0x2341", "0x0038"],
["0x2341", "0x8038"],
["0x2A03", "0x0038"],
@ -632,7 +632,7 @@
"mcu": "atmega32u4",
"usb_product": "Robot Motor",
"variant": "robot_motor",
"hwid": [
"hwids": [
["0x2341", "0x0039"],
["0x2341", "0x8039"],
["0x2A03", "0x0039"],
@ -662,7 +662,7 @@
"f_cpu": "16000000L",
"mcu": "atmega328p",
"variant": "standard",
"hwid": [
"hwids": [
["0x2341", "0x0043"],
["0x2341", "0x0001"],
["0x2A03", "0x0043"]
@ -689,7 +689,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Yun",
"variant": "yun",
"hwid": [
"hwids": [
["0x2341", "0x0041"],
["0x2341", "0x8041"],
["0x2A03", "0x0041"],
@ -721,7 +721,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Yun Mini",
"variant": "yun",
"hwid": [
"hwids": [
["0x2A03", "0x8050"],
["0x2A03", "0x0050"]
]
@ -751,7 +751,7 @@
"mcu": "atmega32u4",
"usb_product": "Arduino Industrial 101",
"variant": "yun",
"hwid": [
"hwids": [
["0x2A03", "0x8056"],
["0x2A03", "0x0056"]
]
@ -781,7 +781,7 @@
"mcu": "atmega32u4",
"usb_product": "Linino One",
"variant": "yun",
"hwid": [
"hwids": [
["0x2A03", "0x8001"],
["0x2A03", "0x0001"]
]
@ -813,7 +813,7 @@
"usb_product": "Arduino Due",
"variant": "arduino_due_x",
"ldscript": "sam3x8e.ld",
"hwid": [
"hwids": [
["0x2341", "0x003D"],
["0x2A03", "0x003D"]
]
@ -843,7 +843,7 @@
"usb_product": "Arduino Due",
"variant": "arduino_due_x",
"ldscript": "sam3x8e.ld",
"hwid": [
"hwids": [
["0x2341", "0x003E"],
["0x2A03", "0x003E"]
]
@ -873,7 +873,7 @@
"usb_product": "Arduino Zero",
"variant": "arduino_zero",
"ldscript": "flash_with_bootloader.ld",
"hwid": [
"hwids": [
["0x2341", "0x804D"],
["0x03EB", "0x2157"]
]
@ -903,7 +903,7 @@
"usb_product": "Arduino Zero",
"variant": "arduino_zero",
"ldscript": "flash_with_bootloader.ld",
"hwid": [
"hwids": [
["0x2341", "0x804D"],
["0x2341", "0x004D"],
["0x2341", "0x824D"]

View File

@ -85,7 +85,7 @@
"ldscript": "sam3x8e.ld",
"usb_product": "Digistump DigiX",
"variant": "digispark_digix",
"hwid": [
"hwids": [
["0x16D0", "0x078A"]
]
},

View File

@ -7,7 +7,7 @@
"mcu": "atmega32u4",
"usb_product": "EngduinoV1",
"variant": "engduinov1",
"hwid": [
"hwids": [
["0x1B4F", "0x9208"]
]
},
@ -35,7 +35,7 @@
"mcu": "atmega32u4",
"usb_product": "EngduinoV2",
"variant": "engduinov2",
"hwid": [
"hwids": [
["0x1B4F", "0x9208"]
]
},
@ -63,7 +63,7 @@
"mcu": "atmega32u4",
"usb_product": "EngduinoV3",
"variant": "engduinov3",
"hwid": [
"hwids": [
["0x1B4F", "0x9208"]
]
},

View File

@ -133,7 +133,10 @@
"flash_mode": "qio",
"ldscript": "esp8266.flash.4m1m.ld",
"mcu": "esp8266",
"variant": "nodemcu"
"variant": "nodemcu",
"hwids": [
["0x10C4", "0xEA60"]
]
},
"frameworks": ["arduino", "simba"],
"name": "NodeMCU 0.9 (ESP-12 Module)",
@ -158,7 +161,10 @@
"flash_mode": "dio",
"ldscript": "esp8266.flash.4m1m.ld",
"mcu": "esp8266",
"variant": "nodemcu"
"variant": "nodemcu",
"hwids": [
["0x10C4", "0xEA60"]
]
},
"frameworks": ["arduino", "simba"],
"name": "NodeMCU 1.0 (ESP-12E Module)",

View File

@ -8,7 +8,7 @@
"mcu": "ARCv2EM",
"usb_product": "Genuino 101",
"variant": "arduino_101",
"hwid": [
"hwids": [
["0x8087", "0x0AB6"]
]
},
@ -18,11 +18,8 @@
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 196608,
"use_1200bps_touch": true,
"protocol": "script",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": false
"require_upload_port" : true
},
"url": "https://www.arduino.cc/en/Main/ArduinoBoard101",
"vendor": "Intel"

View File

@ -6,7 +6,7 @@
"cpu": "fpga",
"mcu": "ice40hx1k",
"variant": "1k",
"hwid": [
"hwids": [
["0x0403", "0x6010"]
]
},
@ -28,7 +28,7 @@
"cpu": "fpga",
"mcu": "ice40hx1k",
"variant": "1k",
"hwid": [
"hwids": [
["0x0403", "0x6010"]
]
},

View File

@ -16,8 +16,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/cerebot-32mx4-limited-time-see-chipkit-pro-mx4/",
"vendor": "Digilent"
@ -40,8 +39,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=TDGL004",
"vendor": "Digilent"
@ -64,8 +62,7 @@
"maximum_size": 126976,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-mx3-microcontroller-board-with-pmod-headers/",
"vendor": "Digilent"
@ -88,8 +85,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-pro-mx4-embedded-systems-trainer-board/",
"vendor": "Digilent"
@ -112,8 +108,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-pro-mx7-advanced-peripherals-embedded-systems-trainer-board/",
"vendor": "Digilent"
@ -136,8 +131,7 @@
"maximum_size": 122880,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/microchip-chipkit/chipkit_pi",
"vendor": "element14"
@ -160,8 +154,7 @@
"maximum_size": 126976,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-cmod-breadboardable-mz-microcontroller-board/",
"vendor": "Digilent"
@ -184,8 +177,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.seeedstudio.com/wiki/CUI32Stem",
"vendor": "SeeedStudio"
@ -208,8 +200,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.schmalzhaus.com/UBW32/",
"vendor": "UBW32"
@ -232,8 +223,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.schmalzhaus.com/UBW32/",
"vendor": "UBW32"
@ -256,8 +246,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.pontech.com/productdisplay/uav100",
"vendor": "PONTECH"
@ -280,8 +269,7 @@
"maximum_size": 122880,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-dp32-dip-package-prototyping-microcontroller-board/",
"vendor": "Digilent"
@ -304,8 +292,7 @@
"maximum_size": 122880,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://fubarino.org/mini/",
"vendor": "Fubarino"
@ -328,8 +315,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://fubarino.org/sd/index.html",
"vendor": "Fubarino"
@ -352,8 +338,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-max32-microcontroller-board-with-mega-r3-headers/",
"vendor": "Digilent"
@ -376,8 +361,7 @@
"maximum_size": 258048,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "https://www.olimex.com/Products/Duino/PIC32/PIC32-PINGUINO/open-source-hardware",
"vendor": "Olimex"
@ -400,8 +384,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://www.4dsystems.com.au/product/Picadillo_35T/",
"vendor": "4DSystems"
@ -424,8 +407,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://quick240.com/quicki/",
"vendor": "PONTECH"
@ -448,8 +430,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-uc32-basic-microcontroller-board-with-uno-r3-headers/",
"vendor": "Digilent"
@ -472,8 +453,7 @@
"maximum_size": 126976,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-uno32-basic-microcontroller-board-retired-see-chipkit-uc32/",
"vendor": "Digilent"
@ -496,8 +476,7 @@
"maximum_size": 520192,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-wf32-wifi-enabled-microntroller-board-with-uno-r3-headers/",
"vendor": "Digilent"
@ -520,8 +499,7 @@
"maximum_size": 2080768,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/chipkit-wi-fire-wifi-enabled-mz-microcontroller-board/",
"vendor": "Digilent"
@ -544,8 +522,7 @@
"maximum_size": 2080768,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://store.digilentinc.com/",
"vendor": "Digilent"
@ -568,8 +545,7 @@
"maximum_size": 122880,
"protocol": "stk500v2",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": true
"speed": 115200
},
"url": "http://shop.openbci.com/",
"vendor": "OpenBCI"

View File

@ -132,7 +132,7 @@
"f_cpu": "16000000L",
"mcu": "atmega32u4",
"variant": "32u4",
"hwid": [
"hwids": [
["0x2341", "0x8036"]
]
},

View File

@ -43,6 +43,28 @@
"vendor": "BitWizard"
},
"emonpi": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_EMONPI",
"f_cpu": "16000000L",
"mcu": "atmega328p",
"variant": "standard"
},
"frameworks": ["arduino"],
"name": "emonPi",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 2048,
"maximum_size": 30720,
"protocol": "arduino",
"require_upload_port" : true,
"speed": 115200
},
"url": "https://github.com/openenergymonitor/emonpi",
"vendor": "OpenEnergyMonitor"
},
"sainSmartDue": {
"build": {
"core": "arduino",
@ -53,7 +75,7 @@
"usb_product": "Arduino Due",
"variant": "arduino_due_x",
"ldscript": "sam3x8e.ld",
"hwid": [
"hwids": [
["0x2341", "0x003E"]
]
},
@ -82,7 +104,7 @@
"usb_product": "Arduino Due",
"variant": "arduino_due_x",
"ldscript": "sam3x8e.ld",
"hwid": [
"hwids": [
["0x2341", "0x003E"]
]
},
@ -326,7 +348,7 @@
"mcu": "atmega32u4",
"usb_product": "RedBearLab Blend",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x2341", "0x8036"]
]
},
@ -355,7 +377,7 @@
"mcu": "atmega32u4",
"usb_product": "RedBearLab Blend",
"variant": "micro",
"hwid": [
"hwids": [
["0x03EB", "0x2404"]
]
},
@ -384,7 +406,7 @@
"mcu": "atmega32u4",
"usb_product": "RedBearLab Blend",
"variant": "micro",
"hwid": [
"hwids": [
["0x03EB", "0x2404"]
]
},
@ -435,7 +457,7 @@
"mcu": "atmega32u4",
"usb_product": "LightUp",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x1d50", "0x6096"]
]
},
@ -531,7 +553,7 @@
"mcu": "atmega32u4",
"variant" : "quirkbot",
"usb_product": "Quirkbot",
"hwid": [
"hwids": [
["0x2886", "0xf004"],
["0x2886", "0xf005"],
["0x2886", "0xf006"],
@ -738,5 +760,65 @@
},
"url": "http://www.atmel.com/devices/ATTINY85.aspx",
"vendor": "Generic ATTiny"
},
"arduboy": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_ARDUBOY -DARDUBOY_10",
"f_cpu": "16000000L",
"mcu": "atmega32u4",
"usb_product": "Arduboy",
"variant": "leonardo",
"hwids": [
["0x2341", "0x0036"],
["0x2341", "0x8036"]
]
},
"frameworks": ["arduino"],
"name": "Arduboy",
"platform": "atmelavr",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 2560,
"maximum_size": 28672,
"protocol": "avr109",
"require_upload_port" : true,
"speed": 57600,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.arduboy.com",
"vendor": "Arduboy"
},
"arduboy_devkit": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_ARDUBOY_DEVKIT -DAB_DEVKIT",
"f_cpu": "16000000L",
"mcu": "atmega32u4",
"usb_product": "Arduboy DevKit",
"variant": "leonardo",
"hwids": [
["0x2341", "0x0036"],
["0x2341", "0x8036"]
]
},
"frameworks": ["arduino"],
"name": "Arduboy DevKit",
"platform": "atmelavr",
"upload": {
"disable_flushing": true,
"maximum_ram_size": 2560,
"maximum_size": 28672,
"protocol": "avr109",
"require_upload_port" : true,
"speed": 57600,
"use_1200bps_touch": true,
"wait_for_upload_port": true
},
"url": "https://www.arduboy.com",
"vendor": "Arduboy"
}
}

View File

@ -28,7 +28,7 @@
"mcu": "atmega32u4",
"usb_product": "SparkFun Pro Micro",
"variant": "sparkfun_promicro",
"hwid": [
"hwids": [
["0x1B4F", "0x9205"],
["0x1B4F", "0x9206"]
]
@ -57,7 +57,7 @@
"mcu": "atmega32u4",
"usb_product": "SparkFun Pro Micro",
"variant": "sparkfun_promicro",
"hwid": [
"hwids": [
["0x1B4F", "0x9203"],
["0x1B4F", "0x9204"]
]
@ -86,7 +86,7 @@
"mcu": "atmega32u4",
"usb_product": "SparkFun Fio v3",
"variant": "sparkfun_promicro",
"hwid": [
"hwids": [
["0x1B4F", "0xF100"],
["0x1B4F", "0xF101"]
]
@ -115,7 +115,7 @@
"mcu": "atmega32u4",
"usb_product": "SparkFun MaKey",
"variant": "sparkfun_promicro",
"hwid": [
"hwids": [
["0x1B4F", "0x2B74"],
["0x1B4F", "0x2B75"]
]

View File

@ -586,6 +586,22 @@
"url": "https://developer.mbed.org/platforms/ST-Nucleo-L073RZ/",
"vendor": "ST"
},
"nucleo_l031k6": {
"build": {
"f_cpu": "32000000L",
"cpu": "cortex-m0plus",
"mcu": "stm32l031k6t6"
},
"frameworks": ["mbed"],
"name": "ST Nucleo L031K6",
"platform": "ststm32",
"upload": {
"maximum_ram_size": 8192,
"maximum_size": 32768
},
"url": "https://developer.mbed.org/platforms/ST-Nucleo-L031K6/",
"vendor": "ST"
},
"seeedArchMax": {
"build": {
"f_cpu": "168000000L",

View File

@ -22,6 +22,8 @@ from time import sleep
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
DefaultEnvironment, SConscript)
from platformio.util import get_serialports
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
@ -47,27 +49,30 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
env.Append(UPLOADERFLAGS=["-P", '"$UPLOAD_PORT"'])
if env.subst("$BOARD") == "raspduino":
if env.subst("$BOARD") in ("raspduino", "emonpi"):
def _rpi_sysgpio(path, value):
with open(path, "w") as f:
f.write(str(value))
_rpi_sysgpio("/sys/class/gpio/export", 18)
_rpi_sysgpio("/sys/class/gpio/gpio18/direction", "out")
_rpi_sysgpio("/sys/class/gpio/gpio18/value", 1)
pin_num = 18 if env.subst("$BOARD") == "raspduino" else 4
_rpi_sysgpio("/sys/class/gpio/export", pin_num)
_rpi_sysgpio("/sys/class/gpio/gpio%d/direction" % pin_num, "out")
_rpi_sysgpio("/sys/class/gpio/gpio%d/value" % pin_num, 1)
sleep(0.1)
_rpi_sysgpio("/sys/class/gpio/gpio18/value", 0)
_rpi_sysgpio("/sys/class/gpio/unexport", 18)
_rpi_sysgpio("/sys/class/gpio/gpio%d/value" % pin_num, 0)
_rpi_sysgpio("/sys/class/gpio/unexport", pin_num)
else:
if not upload_options.get("disable_flushing", False):
env.FlushSerialBuffer("$UPLOAD_PORT")
before_ports = get_serialports()
if upload_options.get("use_1200bps_touch", False):
env.TouchSerialPort("$UPLOAD_PORT", 1200)
if upload_options.get("wait_for_upload_port", False):
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort())
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
env = DefaultEnvironment()
@ -144,10 +149,9 @@ AlwaysBuild(upload)
# Target: Upload EEPROM data (from EEMEM directive)
#
uploadeep = env.Alias(
"uploadeep",
env.ElfToEep(join("$BUILD_DIR", "firmware"), target_elf),
[BeforeUpload, "$UPLOADEEPCMD"])
uploadeep = env.Alias("uploadeep",
env.ElfToEep(join("$BUILD_DIR", "firmware"), target_elf),
[BeforeUpload, "$UPLOADEEPCMD"])
AlwaysBuild(uploadeep)
#

View File

@ -21,10 +21,10 @@ from os.path import basename, join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
DefaultEnvironment, SConscript)
from platformio.util import get_serialports
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
board_type = env.subst("$BOARD")
if "zero" not in board_type:
env.Append(
@ -39,11 +39,13 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
if not upload_options.get("disable_flushing", False):
env.FlushSerialBuffer("$UPLOAD_PORT")
before_ports = get_serialports()
if upload_options.get("use_1200bps_touch", False):
env.TouchSerialPort("$UPLOAD_PORT", 1200)
if upload_options.get("wait_for_upload_port", False):
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort())
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
# use only port name for BOSSA
if "/" in env.subst("$UPLOAD_PORT"):
@ -172,8 +174,9 @@ AlwaysBuild(target_size)
if env.subst("$BOARD") == "zero":
upload = env.Alias(["upload", "uploadlazy"], target_firm, "$UPLOADCMD")
else:
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[BeforeUpload, "$UPLOADCMD"])
upload = env.Alias(
["upload", "uploadlazy"], target_firm,
[env.AutodetectUploadPort, BeforeUpload, "$UPLOADCMD"])
AlwaysBuild(upload)

View File

@ -346,7 +346,7 @@ AlwaysBuild(target_size)
target_upload = env.Alias(
["upload", "uploadlazy", "uploadfs"], target_firm,
[lambda target, source, env: env.AutodetectUploadPort(), "$UPLOADCMD"])
[env.AutodetectUploadPort, "$UPLOADCMD"])
env.AlwaysBuild(target_upload)

View File

@ -179,8 +179,8 @@ ARDUINO_VERSION = int(
ARDUINO_USBDEFINES = []
if "usb_product" in BOARD_BUILDOPTS:
ARDUINO_USBDEFINES = [
"USB_VID=${BOARD_OPTIONS['build']['hwid'][0][0]}",
"USB_PID=${BOARD_OPTIONS['build']['hwid'][0][1]}",
"USB_VID=${BOARD_OPTIONS['build']['hwids'][0][0]}",
"USB_PID=${BOARD_OPTIONS['build']['hwids'][0][1]}",
'USB_PRODUCT=\\"%s\\"' % (env.subst(
"${BOARD_OPTIONS['build']['usb_product']}").replace('"', "")),
'USB_MANUFACTURER=\\"%s\\"' % (env.subst(

View File

@ -71,7 +71,7 @@ MBED_VARIANTS = {
"samr21_xpro": "SAMR21G18A",
"saml21_xpro_b": "SAML21J18A",
"samd21_xpro": "SAMD21J18A",
"bbcmicrobit": "NRF51822"
"bbcmicrobit": "NRF51_MICROBIT"
}
MBED_LIBS_MAP = {
@ -149,6 +149,18 @@ def add_mbedlib(libname, libar):
if (not any(f.endswith(".h") for f in files) and
basename(root) not in sysincdirs):
continue
target_includes = (
"TARGET_%s" % env.get(
"BOARD_OPTIONS", {}).get("vendor", "").upper(),
"TARGET_%s" % variant,
"TARGET_CORTEX_M"
)
if "TARGET_" in root:
if all([p not in root.upper() for p in target_includes]):
continue
var_dir = join("$BUILD_DIR", "FrameworkMbed%sInc%d" %
(libname.upper(), crc32(root)))
if var_dir in env.get("CPPPATH"):

View File

@ -21,20 +21,6 @@ from os.path import join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
DefaultEnvironment)
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
if "program" in COMMAND_LINE_TARGETS:
return
env.AutodetectUploadPort()
env.Prepend(UPLOADERFLAGS=['"$UPLOAD_PORT"'])
if env.get("BOARD_OPTIONS", {}).get("upload", {}).get(
"use_1200bps_touch", False):
env.TouchSerialPort("$UPLOAD_PORT", 1200)
env = DefaultEnvironment()
env.Replace(
@ -112,8 +98,11 @@ env.Replace(
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "tool-arduino101load", "arduino101load"),
UPLOADERFLAGS=[
'"$UPLOAD_PORT"'
],
DFUUTIL=join("$PIOPACKAGES_DIR", "tool-arduino101load", "dfu-util"),
UPLOADCMD='"$UPLOADER" $DFUUTIL $SOURCES $UPLOADERFLAGS verbose',
UPLOADCMD='"$UPLOADER" "$DFUUTIL" $SOURCES $UPLOADERFLAGS verbose',
PROGNAME="firmware",
PROGSUFFIX=".elf"
@ -189,8 +178,8 @@ AlwaysBuild(target_size)
# Target: Upload firmware
#
upload = env.Alias(
["upload", "uploadlazy"], target_firm, [BeforeUpload, "$UPLOADCMD"])
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[env.AutodetectUploadPort, "$UPLOADCMD"])
AlwaysBuild(upload)
#

View File

@ -21,12 +21,6 @@ from os.path import join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
DefaultEnvironment)
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
env.Prepend(UPLOADERFLAGS=["-d", '"$UPLOAD_PORT"'])
env = DefaultEnvironment()
env.Replace(
@ -86,7 +80,8 @@ env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-pic32prog", "pic32prog"),
UPLOADERFLAGS=[
"-b", "$UPLOAD_SPEED"
"-b", "$UPLOAD_SPEED",
"-d", '"$UPLOAD_PORT"'
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS $SOURCES',
@ -179,8 +174,8 @@ AlwaysBuild(target_size)
# Target: Upload firmware
#
upload = env.Alias(
["upload", "uploadlazy"], target_firm, [BeforeUpload, "$UPLOADCMD"])
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[env.AutodetectUploadPort, "$UPLOADCMD"])
AlwaysBuild(upload)
#

View File

@ -63,9 +63,8 @@ AlwaysBuild(target_size)
#
if env.subst("$BOARD") == "rfduino":
upload = env.Alias(
["upload", "uploadlazy"], target_firm,
[lambda target, source, env: env.AutodetectUploadPort(), "$UPLOADCMD"])
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[env.AutodetectUploadPort, "$UPLOADCMD"])
else:
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
AlwaysBuild(upload)

View File

@ -17,19 +17,10 @@
"""
from os.path import join
from shutil import copyfile
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
DefaultEnvironment, SConscript)
def UploadToDisk(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
copyfile(join(env.subst("$BUILD_DIR"), "firmware.bin"),
join(env.subst("$UPLOAD_PORT"), "firmware.bin"))
print("Firmware has been successfully uploaded.\n"
"Please restart your board.")
env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
@ -60,7 +51,7 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file
#
upload = env.Alias(["upload", "uploadlazy"], target_firm, UploadToDisk)
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
AlwaysBuild(upload)
#

View File

@ -100,8 +100,7 @@ AlwaysBuild(target_size)
#
if "mbed" in env.subst("$FRAMEWORK") and not env.subst("$UPLOAD_PROTOCOL"):
upload = env.Alias(["upload", "uploadlazy"],
target_firm, env.UploadToDisk)
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
else:
upload = env.Alias(["upload", "uploadlazy"], target_firm, "$UPLOADCMD")
AlwaysBuild(upload)

View File

@ -14,13 +14,15 @@
from __future__ import absolute_import
from os import environ
from os.path import isfile, join
from platform import system
from shutil import copyfile
from time import sleep
from serial import Serial
from platformio.util import get_logicaldisks, get_serialports, get_systype
from platformio import util
def FlushSerialBuffer(env, port):
@ -35,7 +37,7 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
if "windows" not in get_systype():
if system() != "Windows":
try:
s = Serial(env.subst(port))
s.close()
@ -47,22 +49,28 @@ def TouchSerialPort(env, port, baudrate):
sleep(0.4)
def WaitForNewSerialPort(env):
before = [i['port'] for i in get_serialports(use_grep=True)]
sleep(0.5)
def WaitForNewSerialPort(env, before):
print "Waiting for the new upload port..."
prev_port = env.subst("$UPLOAD_PORT")
new_port = None
elapsed = 0
while elapsed < 10:
now = [i['port'] for i in get_serialports(use_grep=True)]
diff = list(set(now) - set(before))
if diff:
new_port = diff[0]
break
sleep(1)
while elapsed < 5 and new_port is None:
now = util.get_serialports()
for p in now:
if p not in before:
new_port = p['port']
break
before = now
sleep(0.25)
elapsed += 0.25
if not new_port:
for p in now:
if prev_port == p['port']:
new_port = p['port']
break
if not new_port:
env.Exit("Error: Couldn't find a board on the selected port. "
"Check that you have the correct port selected. "
@ -72,31 +80,52 @@ def WaitForNewSerialPort(env):
return new_port
def AutodetectUploadPort(env):
if "UPLOAD_PORT" in env:
return
def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument
env = args[0]
print "Looking for upload port/disk..."
if env.subst("$FRAMEWORK") == "mbed":
def _look_for_mbed_disk():
msdlabels = ("mbed", "nucleo", "frdm")
for item in get_logicaldisks():
for item in util.get_logicaldisks():
if (not item['name'] or
not any([l in item['name'].lower() for l in msdlabels])):
continue
env.Replace(UPLOAD_PORT=item['disk'])
break
else:
board_build_opts = env.get("BOARD_OPTIONS", {}).get("build", {})
for item in get_serialports():
return item['disk']
return None
def _look_for_serial_port():
port = None
board_hwids = env.get("BOARD_OPTIONS", {}).get(
"build", {}).get("hwids", [])
for item in util.get_serialports():
if "VID:PID" not in item['hwid']:
continue
env.Replace(UPLOAD_PORT=item['port'])
for hwid in board_build_opts.get("hwid", []):
board_hwid = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "")
if board_hwid in item['hwid']:
break
port = item['port']
for hwid in board_hwids:
hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "")
if hwid_str in item['hwid']:
return port
return port
if "UPLOAD_PORT" in env:
print "Auto-detected UPLOAD_PORT/DISK: %s" % env['UPLOAD_PORT']
print env.subst("Manually specified: $UPLOAD_PORT")
return
if env.subst("$FRAMEWORK") == "mbed":
env.Replace(UPLOAD_PORT=_look_for_mbed_disk())
else:
if (system() == "Linux" and
not isfile("/etc/udev/99-platformio-udev.rules")):
print(
"\nWarning! Please install `99-platformio-udev.rules` and "
"check that your board's PID and VID are listed in the rules."
"\n https://raw.githubusercontent.com/platformio/platformio"
"/develop/scripts/99-platformio-udev.rules\n"
)
env.Replace(UPLOAD_PORT=_look_for_serial_port())
if env.subst("$UPLOAD_PORT"):
print env.subst("Auto-detected: $UPLOAD_PORT")
else:
env.Exit("Error: Please specify `upload_port` for environment or use "
"global `--upload-port` option.\n"
@ -117,6 +146,30 @@ def UploadToDisk(_, target, source, env): # pylint: disable=W0613,W0621
"Please restart your board.")
def CheckUploadSize(_, target, source, env): # pylint: disable=W0613,W0621
max_size = int(env.get("BOARD_OPTIONS", {}).get("upload", {}).get(
"maximum_size", 0))
if max_size == 0 or "SIZETOOL" not in env:
return
print "Check program size..."
sysenv = environ.copy()
sysenv['PATH'] = str(env['ENV']['PATH'])
cmd = [env.subst("$SIZETOOL"), "-B", str(source[0])]
result = util.exec_command(cmd, env=sysenv)
if result['returncode'] != 0:
return
print result['out'].strip()
line = result['out'].strip().splitlines()[1]
values = [v.strip() for v in line.split("\t")]
used_size = int(values[0]) + int(values[1])
if used_size > max_size:
env.Exit("Error: The program size (%d bytes) is greater "
"than maximum allowed (%s bytes)" % (used_size, max_size))
def exists(_):
return True
@ -127,4 +180,5 @@ def generate(env):
env.AddMethod(WaitForNewSerialPort)
env.AddMethod(AutodetectUploadPort)
env.AddMethod(UploadToDisk)
env.AddMethod(CheckUploadSize)
return env

View File

@ -35,6 +35,11 @@ SRC_DEFAULT_FILTER = " ".join([
def BuildProgram(env):
env.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())],
)
# fix ASM handling under non-casitive OS
if not case_sensitive_suffixes(".s", ".S"):
env.Replace(
@ -78,8 +83,6 @@ def BuildProgram(env):
env.ProcessFlags([env.get("SRC_BUILD_FLAGS", None)])
env.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())],
CPPPATH=["$PROJECTSRC_DIR"],
LIBS=deplibs,
LIBPATH=["$BUILD_DIR"]
@ -94,11 +97,16 @@ def BuildProgram(env):
"Error: Nothing to build. Please put your source code files "
"to '%s' folder" % env.subst("$PROJECTSRC_DIR"))
return env.Program(
program = env.Program(
join("$BUILD_DIR", env.subst("$PROGNAME")),
sources
)
if set(["upload", "uploadlazy", "program"]) & set(COMMAND_LINE_TARGETS):
env.AddPostAction(program, env.CheckUploadSize)
return program
def ProcessFlags(env, flags):
for f in flags:
@ -114,10 +122,11 @@ def ProcessFlags(env, flags):
env.Append(CPPDEFINES=[flag])
env.Append(**parsed_flags)
# fix relative CPPPATH
for i, p in enumerate(env.get("CPPPATH", [])):
if isdir(p):
env['CPPPATH'][i] = realpath(p)
# fix relative CPPPATH & LIBPATH
for k in ("CPPPATH", "LIBPATH"):
for i, p in enumerate(env.get(k, [])):
if isdir(p):
env[k][i] = realpath(p)
# fix relative path for "-include"
for i, f in enumerate(env.get("CCFLAGS", [])):
if isinstance(f, tuple) and f[0] == "-include":

View File

@ -280,34 +280,7 @@ def exec_command(*args, **kwargs):
return result
def get_serialports(use_grep=False):
def _grep_serial_ports():
result = []
if system() == "Windows":
output = exec_command(["mode"]).get("out", "")
for line in output.split("\n"):
line = line.strip()
if "COM" in line:
result.append({"port": line[line.index("COM"):-1],
"description": "", "hwid": ""})
else:
if system() == "Linux":
patterns = ["/dev/%s*" % p for p in (
"ttyS", "ttyUSB", "ttyACM", "ttyAMA", "rfcomm", "ttyO")]
else:
patterns = ["/dev/tty.*", "/dev/cu.*"]
for pattern in patterns:
for port in glob(pattern):
result.append(
{"port": port, "description": "", "hwid": ""})
return result
if use_grep:
result = _grep_serial_ports()
if result:
return result
def get_serialports():
try:
from serial.tools.list_ports import comports
except ImportError:
@ -325,9 +298,9 @@ def get_serialports(use_grep=False):
result.append({"port": p, "description": d, "hwid": h})
# fix for PySerial
if not result and not use_grep:
result = _grep_serial_ports()
if not result and system() == "Darwin":
for p in glob("/dev/tty.*"):
result.append({"port": p, "description": "n/a", "hwid": "n/a"})
return result

View File

@ -45,8 +45,15 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="066
# QinHeng Electronics HL-340 USB-Serial adapter
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666"
# ARDUINO UNO
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", MODE:="0666"
# Arduino boards
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][02]*", MODE:="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666"
# Arduino SAM-BA
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666"
# Digistump boards
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"