Compare commits

...

47 Commits

Author SHA1 Message Date
09032fb4a5 Merge branch 'release/v2.10.2' 2016-06-15 17:57:39 +03:00
c62a3f8ee6 Version bump to 2.10.2 (issues #695) 2016-06-15 17:57:28 +03:00
682e435ded Fix firmware uploading to Arduino/Genuino 101 // Resolve #695 2016-06-15 16:02:04 +03:00
cdcf075635 Use $PLATFORM from build environment instead from the board config 2016-06-15 14:56:31 +03:00
7e027db02b Update Intel ARC32 Arduino framework to v1.0.6 // Issue #695 2016-06-15 14:52:11 +03:00
4abaa67580 Update Intel ARC32 Arduino framework to v1.0.6 2016-06-15 14:48:46 +03:00
13d43425e5 Add support for ST Nucleo L031K6 board to ARM mbed framework 2016-06-15 14:48:27 +03:00
0ba315243b Revert mcu option for genuino101 2016-06-15 14:45:08 +03:00
9655ca229f Update intel_arc32 platform 2016-06-15 14:31:07 +03:00
b842a1d9b1 Update HISTORY.rst 2016-06-15 13:18:29 +03:00
2978133862 Fix upload size checker 2016-06-15 00:59:44 +03:00
7422b99b42 Process "$BUILD_UNFLAGS" variable 2016-06-14 20:53:30 +03:00
d04a7de26b Restore PIO macros if it was deleted by framework 2016-06-14 20:48:56 +03:00
68d834fba0 Add support for ST Nucleo L031K6 board to ARM mbed framework 2016-06-14 19:59:17 +03:00
64c9004036 Fix typo 2016-06-14 19:54:27 +03:00
350fb885b8 Fix pylint error 2016-06-14 19:44:57 +03:00
8d03f2dc80 Update history 2016-06-14 19:41:34 +03:00
220dcd0f5c Improve linker flags handling for mbed 2016-06-14 19:29:54 +03:00
3671d7549d Update examples 2016-06-14 18:08:35 +03:00
a38910b381 Improve include selection for mbed boards with a custom vendor 2016-06-14 13:00:51 +03:00
941b8e84f5 Merge branch 'release/v2.10.1' 2016-06-13 21:32:07 +03:00
382c860d9b Merge branch 'release/v2.10.1' into develop 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
730b2371df Merge branch 'release/v2.9.4' into develop 2016-06-04 00:26:01 +03:00
41 changed files with 475 additions and 210 deletions

View File

@ -4,10 +4,47 @@ Release Notes
PlatformIO 2.0
--------------
2.10.2 (2016-06-15)
~~~~~~~~~~~~~~~~~~~
* Added support for ST Nucleo L031K6 board to ARM mbed framework
* Process ``build_unflags`` option for ARM mbed framework
* Updated Intel ARC32 Arduino framework to v1.0.6
(`issue #695 <https://github.com/platformio/platformio/issues/695>`_)
* Improved a check of program size before uploading to the board
* Fixed issue with ARM mbed framework ``-u _printf_float`` and
``-u _scanf_float`` when parsing ``$LINKFLAGS``
* Fixed issue with ARM mbed framework and extra includes for the custom boards,
such as Seeeduino Arch Pro
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 upload firmware
* Show ``udev`` warning only for the Linux OS while uploading firmware
2.9.3 (2016-06-03)
~~~~~~~~~~~~~~~~~~

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

@ -196,6 +196,13 @@ Arduboy
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -1190,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

@ -629,6 +629,13 @@ ST
- 512 Kb
- 128 Kb
* - ``nucleo_l031k6``
- `ST Nucleo L031K6 <https://developer.mbed.org/platforms/ST-Nucleo-L031K6/>`_
- STM32L031K6T6
- 32 MHz
- 32 Kb
- 8 Kb
* - ``nucleo_l053r8``
- `ST Nucleo L053R8 <https://developer.mbed.org/platforms/ST-Nucleo-L053R8/>`_
- STM32L053R8T6

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

@ -186,6 +186,13 @@ Arduboy
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -805,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

@ -182,6 +182,13 @@ Arduboy
- 32 Kb
- 2.5 Kb
* - ``arduboy_devkit``
- `Arduboy DevKit <https://www.arduboy.com>`_
- ATMEGA32U4
- 16 MHz
- 32 Kb
- 2.5 Kb
Arduino
~~~~~~~
@ -1555,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
~~~~~~~~~~~~~~~~~~~
@ -1986,6 +2013,13 @@ ST
- 512 Kb
- 128 Kb
* - ``nucleo_l031k6``
- `ST Nucleo L031K6 <https://developer.mbed.org/platforms/ST-Nucleo-L031K6/>`_
- STM32L031K6T6
- 32 MHz
- 32 Kb
- 8 Kb
* - ``nucleo_l053r8``
- `ST Nucleo L053R8 <https://developer.mbed.org/platforms/ST-Nucleo-L053R8/>`_
- STM32L053R8T6

View File

@ -357,6 +357,13 @@ ST
- 512 Kb
- 128 Kb
* - ``nucleo_l031k6``
- `ST Nucleo L031K6 <https://developer.mbed.org/platforms/ST-Nucleo-L031K6/>`_
- STM32L031K6T6
- 32 MHz
- 32 Kb
- 8 Kb
* - ``nucleo_l053r8``
- `ST Nucleo L053R8 <https://developer.mbed.org/platforms/ST-Nucleo-L053R8/>`_
- STM32L053R8T6

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, 4)
VERSION = (2, 10, 2)
__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

@ -6,9 +6,10 @@
"f_cpu": "32000000L",
"ldscript": "flash.ld",
"mcu": "ARCv2EM",
"cpu": "quarkse_em",
"usb_product": "Genuino 101",
"variant": "arduino_101",
"hwid": [
"hwids": [
["0x8087", "0x0AB6"]
]
},
@ -17,14 +18,13 @@
"platform": "intel_arc32",
"upload": {
"maximum_ram_size": 81920,
"maximum_size": 196608,
"use_1200bps_touch": true,
"maximum_size": 155648,
"protocol": "script",
"require_upload_port" : true,
"speed": 115200,
"wait_for_upload_port": false
"use_1200bps_touch": 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"],
@ -743,16 +765,14 @@
"arduboy": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LEONARDO",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_ARDUBOY -DARDUBOY_10",
"f_cpu": "16000000L",
"mcu": "atmega32u4",
"usb_product": "Arduino Leonardo",
"usb_product": "Arduboy",
"variant": "leonardo",
"hwid": [
"hwids": [
["0x2341", "0x0036"],
["0x2341", "0x8036"],
["0x2A03", "0x0036"],
["0x2A03", "0x8036"]
["0x2341", "0x8036"]
]
},
"frameworks": ["arduino"],
@ -770,5 +790,35 @@
},
"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

@ -49,18 +49,19 @@ 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")
@ -148,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

@ -25,8 +25,6 @@ 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(
@ -176,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 = {
@ -145,10 +145,27 @@ def add_mbedlib(libname, libar):
"lwip-sys"
)
target_map = {
"nxplpc": "NXP",
"freescalekinetis": "Freescale",
"ststm32": "STM"
}
target_includes = (
"TARGET_%s" % target_map.get(env.subst("$PLATFORM"), ""),
"TARGET_%s" % variant,
"TARGET_CORTEX_M"
)
for root, _, files in walk(lib_dir):
if (not any(f.endswith(".h") for f in files) and
basename(root) not in sysincdirs):
continue
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"):
@ -183,6 +200,11 @@ def parse_eix_file(filename):
result[key].append(
node.get(_nkeys[0]) if len(_nkeys) == 1 else node.attrib)
if "LINKFLAGS" in result:
for i, flag in enumerate(result["LINKFLAGS"]):
if flag.startswith("-u "):
result["LINKFLAGS"][i] = result["LINKFLAGS"][i].split(" ")
return result
@ -199,7 +221,7 @@ def get_build_flags(data):
def _mbed_whole_archive_hook(libs_):
if (not isinstance(libs_, list) or
env.get("BOARD_OPTIONS", {}).get("platform") == "nordicnrf51"):
env.subst("$PLATFORM") == "nordicnrf51"):
return libs_
_dynlibs = []
@ -243,9 +265,12 @@ env.Replace(
# restore external build flags
env.ProcessFlags([
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"),
env.get("BUILD_FLAGS")
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")])
# Hook for K64F and K22F
if board_type in ("frdm_k22f", "frdm_k64f"):

View File

@ -21,22 +21,16 @@ from os.path import join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default,
DefaultEnvironment)
env = 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(
AR="arc-elf32-ar",
AS="arc-elf32-as",
@ -56,9 +50,8 @@ env.Replace(
"-ffunction-sections",
"-fdata-sections",
"-Wall",
"-mav2em",
"-mlittle-endian",
"-m${BOARD_OPTIONS['build']['mcu']}",
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
"-fno-reorder-functions",
"-fno-asynchronous-unwind-tables",
"-fno-omit-frame-pointer",
@ -96,7 +89,7 @@ env.Replace(
"-Wl,--gc-sections",
"-Wl,-X",
"-Wl,-N",
"-Wl,-m${BOARD_OPTIONS['build']['mcu']}",
"-Wl,-mcpu=${BOARD_OPTIONS['build']['cpu']}",
"-Wl,-marcelf",
"-static",
"-nostdlib",
@ -107,13 +100,16 @@ env.Replace(
"-Wl,--no-whole-archive"
],
LIBS=["c", "m", "gcc"],
LIBS=["nsim", "c", "m", "gcc"],
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 +185,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, BeforeUpload, "$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,6 +14,7 @@
from __future__ import absolute_import
from os import environ
from os.path import isfile, join
from platform import system
from shutil import copyfile
@ -21,7 +22,7 @@ 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):
@ -36,13 +37,15 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate):
if "windows" not in get_systype():
port = env.subst(port)
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
if system() != "Windows":
try:
s = Serial(env.subst(port))
s = Serial(port)
s.close()
except: # pylint: disable=W0702
pass
s = Serial(port=env.subst(port), baudrate=baudrate)
s = Serial(port=port, baudrate=baudrate)
s.setDTR(False)
s.close()
sleep(0.4)
@ -53,8 +56,9 @@ def WaitForNewSerialPort(env, before):
prev_port = env.subst("$UPLOAD_PORT")
new_port = None
elapsed = 0
sleep(1)
while elapsed < 5 and new_port is None:
now = get_serialports()
now = util.get_serialports()
for p in now:
if p not in before:
new_port = p['port']
@ -78,40 +82,52 @@ def WaitForNewSerialPort(env, before):
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
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
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 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 (
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())
board_build_opts = env.get("BOARD_OPTIONS", {}).get("build", {})
for item in 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
if "UPLOAD_PORT" in env:
print "Auto-detected UPLOAD_PORT/DISK: %s" % env['UPLOAD_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"
@ -132,6 +148,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(target[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
@ -142,4 +182,5 @@ def generate(env):
env.AddMethod(WaitForNewSerialPort)
env.AddMethod(AutodetectUploadPort)
env.AddMethod(UploadToDisk)
env.AddMethod(CheckUploadSize)
return env

View File

@ -35,6 +35,14 @@ SRC_DEFAULT_FILTER = " ".join([
def BuildProgram(env):
def _append_pio_macros():
env.AppendUnique(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())],
)
_append_pio_macros()
# fix ASM handling under non-casitive OS
if not case_sensitive_suffixes(".s", ".S"):
env.Replace(
@ -55,6 +63,9 @@ def BuildProgram(env):
env.BuildFrameworks([
f.lower().strip() for f in env.get("FRAMEWORK", "").split(",")])
# restore PIO macros if it was deleted by framework
_append_pio_macros()
# build dependent libs
deplibs = env.BuildDependentLibraries("$PROJECTSRC_DIR")
@ -78,8 +89,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 +103,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 +128,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":