diff --git a/HISTORY.rst b/HISTORY.rst index 2663748b..2cf5ea27 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,31 @@ Release Notes PlatformIO 2.0 -------------- +2.11.2 (2016-08-02) +~~~~~~~~~~~~~~~~~~~ + +* Improved support for `Microchip PIC32 `__ development platform and ChipKIT boards + (`issue #438 `_) +* Added support for Pinoccio Scout board + (`issue #52 `_) +* Added support for `Teensy USB Features `__ + (HID, SERIAL_HID, DISK, DISK_SDFLASH, MIDI, etc.) + (`issue #722 `_) +* Switched to built-in GCC LwIP library for Espressif development platform +* Added support for local ``--echo`` for Serial Port Monitor + (`issue #733 `_) +* Updated ``udev`` rules for the new STM32F407DISCOVERY boards + (`issue #731 `_) +* Implemented firmware merging with base firmware for Nordic nRF51 development platform + (`issue #500 `_, + `issue #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 `_) +* Fixed firmware uploading to Atmel SAMD21-XPRO board using ARM mbed framework + (`issue #732 `_) + 2.11.1 (2016-07-12) ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index e0d9c67f..b16c12d6 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -1341,6 +1341,26 @@ PanStamp - 32 Kb - 4 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ diff --git a/docs/ide/atom.rst b/docs/ide/atom.rst index f46d5a2c..09c6692c 100644 --- a/docs/ide/atom.rst +++ b/docs/ide/atom.rst @@ -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 `_ 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 `_ 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 `_ 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 `_. @@ -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 diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index bbd6584a..387dad92 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -24,7 +24,7 @@ Refer to the `CLion Documentation Import Project`` and specify root directory where is located :ref:`projectconf` 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): @@ -68,6 +73,65 @@ the screenshot below): after generating process wont be reflected in IDE. To fix it please run ``PLATFORMIO_REBUILD_PROJECT_INDEX`` target. +Known issues +------------ + +.. _ide_clion_knownissues_inopde_not_supported: + +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 `` +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 `` 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 + + void someFunction(int num); + + void function setup () { + someFunction(13); + } + + void function loop() { + delay(1000); + } + + void someFunction(int num) { + } + + Articles / Manuals ------------------ @@ -81,6 +145,6 @@ Examples -------- "Blink" Project -^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~ Source code of `CLion "Blink" Project `_. diff --git a/docs/ide/codeblocks.rst b/docs/ide/codeblocks.rst index 0769a469..04819998 100644 --- a/docs/ide/codeblocks.rst +++ b/docs/ide/codeblocks.rst @@ -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 `_. .. 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:: diff --git a/docs/ide/eclipse.rst b/docs/ide/eclipse.rst index 2ef869f8..6f889b6b 100644 --- a/docs/ide/eclipse.rst +++ b/docs/ide/eclipse.rst @@ -28,7 +28,7 @@ Refer to the `CDT Documentation `_ 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:: diff --git a/docs/ide/emacs.rst b/docs/ide/emacs.rst index 4a153c86..ef402dfb 100644 --- a/docs/ide/emacs.rst +++ b/docs/ide/emacs.rst @@ -23,7 +23,7 @@ Refer to the `Emacs Documentation ` 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:: diff --git a/docs/ide/netbeans.rst b/docs/ide/netbeans.rst index 6cba0b76..432ddb26 100644 --- a/docs/ide/netbeans.rst +++ b/docs/ide/netbeans.rst @@ -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:: diff --git a/docs/ide/qtcreator.rst b/docs/ide/qtcreator.rst index 79baddc6..a84c8875 100644 --- a/docs/ide/qtcreator.rst +++ b/docs/ide/qtcreator.rst @@ -20,7 +20,7 @@ Refer to the `Qt-creator Manual `_ 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 diff --git a/docs/ide/sublimetext.rst b/docs/ide/sublimetext.rst index 42d64bf4..feaa5f3a 100644 --- a/docs/ide/sublimetext.rst +++ b/docs/ide/sublimetext.rst @@ -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 diff --git a/docs/ide/visualstudio.rst b/docs/ide/visualstudio.rst index 8d70dfbe..e7008e92 100644 --- a/docs/ide/visualstudio.rst +++ b/docs/ide/visualstudio.rst @@ -20,7 +20,7 @@ Refer to the `Visual Studio Documentation `_ .. 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 diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index f5ba50c1..52bcb584 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -842,6 +842,26 @@ PanStamp - 32 Kb - 2 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ diff --git a/docs/platforms/creating_platform.rst b/docs/platforms/creating_platform.rst index 913fb40d..09e11695 100644 --- a/docs/platforms/creating_platform.rst +++ b/docs/platforms/creating_platform.rst @@ -143,6 +143,9 @@ Packages * - ``tool-scons`` - `SCons software construction tool `_ + * - ``tool-sreccat`` + - `Merging tool `_ + * - ``tool-stlink`` - `ST-Link `_ diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index f5a6a0d6..91df1475 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -1726,6 +1726,26 @@ PanStamp - 32 Kb - 4 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ diff --git a/docs/platforms/nordicnrf51.rst b/docs/platforms/nordicnrf51.rst index 4c4d65fe..fff500b3 100644 --- a/docs/platforms/nordicnrf51.rst +++ b/docs/platforms/nordicnrf51.rst @@ -37,6 +37,9 @@ Packages * - ``toolchain-gccarmnoneeabi`` - `gcc-arm-embedded `_, `GDB `_ + * - ``tool-sreccat`` + - `Merging tool `_ + * - ``framework-arduinonordicnrf51`` - `Arduino Wiring-based Framework (RFduino Core) `_ diff --git a/docs/platforms/teensy_extra.rst b/docs/platforms/teensy_extra.rst index cca6c119..360ea86c 100644 --- a/docs/platforms/teensy_extra.rst +++ b/docs/platforms/teensy_extra.rst @@ -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 `_. + Examples -------- diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 3b2d0c24..57146752 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -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 diff --git a/docs/userguide/cmd_serialports.rst b/docs/userguide/cmd_serialports.rst index 0ba8f36a..963046b1 100644 --- a/docs/userguide/cmd_serialports.rst +++ b/docs/userguide/cmd_serialports.rst @@ -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 diff --git a/platformio/__init__.py b/platformio/__init__.py index 2063af7b..1282de0a 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 11, 1) +VERSION = (2, 11, 2) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/__main__.py b/platformio/__main__.py index c553e8f6..d6ade4d6 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -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 diff --git a/platformio/app.py b/platformio/app.py index f7fcce2a..20f2f55e 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -46,7 +46,7 @@ DEFAULT_SETTINGS = { }, "enable_telemetry": { "description": ( - "Telemetry service (Yes/No)"), "value": True }, diff --git a/platformio/boards/arduino.json b/platformio/boards/arduino.json index 45c2ffef..99ab8a54 100644 --- a/platformio/boards/arduino.json +++ b/platformio/boards/arduino.json @@ -881,6 +881,9 @@ "frameworks": ["arduino"], "name": "Arduino Zero (Programming Port)", "platform": "atmelsam", + "debug": { + "openocdcfg": "arduino_zero.cfg" + }, "upload": { "disable_flushing": true, "maximum_ram_size": 32768, @@ -888,7 +891,8 @@ "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" @@ -974,6 +978,9 @@ "frameworks": ["arduino"], "name": "Arduino M0 Pro (Programming Port)", "platform": "atmelsam", + "debug": { + "openocdcfg": "arduino_zero_org.cfg" + }, "upload": { "disable_flushing": true, "maximum_ram_size": 32768, diff --git a/platformio/boards/atmelsam.json b/platformio/boards/atmelsam.json index bb2561ee..fc956996 100644 --- a/platformio/boards/atmelsam.json +++ b/platformio/boards/atmelsam.json @@ -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 }, diff --git a/platformio/boards/microchippic32.json b/platformio/boards/microchippic32.json index 7090d97c..0b569c03 100644 --- a/platformio/boards/microchippic32.json +++ b/platformio/boards/microchippic32.json @@ -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" }, diff --git a/platformio/boards/misc.json b/platformio/boards/misc.json index 114e8022..0a9be48e 100644 --- a/platformio/boards/misc.json +++ b/platformio/boards/misc.json @@ -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" } } diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index 26009472..d4b25a46 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -122,32 +122,35 @@ if upload_protocol == "openocd": 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", - "%s;" % user_code_section if user_code_section else "0x2000", - "shutdown\"" + "-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") diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 16164d8d..17300c75 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -55,13 +55,14 @@ 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", + "mesh", "wpa2", "smartconfig", "pp", "main", "wpa", "lwip_gcc", "net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc", "m", "stdc++" ] @@ -198,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] @@ -310,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 # diff --git a/platformio/builder/scripts/frameworks/mbed.py b/platformio/builder/scripts/frameworks/mbed.py index 16503122..76aca7fa 100644 --- a/platformio/builder/scripts/frameworks/mbed.py +++ b/platformio/builder/scripts/frameworks/mbed.py @@ -28,6 +28,7 @@ http://mbed.org/ from __future__ import print_function +import json import re import sys import xml.etree.ElementTree as ElementTree @@ -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,6 +295,10 @@ 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")) diff --git a/platformio/builder/scripts/microchippic32.py b/platformio/builder/scripts/microchippic32.py index 607baf25..da44457f 100644 --- a/platformio/builder/scripts/microchippic32.py +++ b/platformio/builder/scripts/microchippic32.py @@ -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 diff --git a/platformio/builder/scripts/nordicnrf51.py b/platformio/builder/scripts/nordicnrf51.py index 99f96614..ae4626c1 100644 --- a/platformio/builder/scripts/nordicnrf51.py +++ b/platformio/builder/scripts/nordicnrf51.py @@ -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 diff --git a/platformio/builder/scripts/teensy.py b/platformio/builder/scripts/teensy.py index 43e293f3..c01c67e8 100644 --- a/platformio/builder/scripts/teensy.py +++ b/platformio/builder/scripts/teensy.py @@ -40,7 +40,6 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3": env.Append( CPPDEFINES=[ - "USB_SERIAL", "LAYOUT_US_ENGLISH" ], diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 29ab41a2..b24fca21 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -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", []): diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index c9758fa1..a10f7cf1 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -115,6 +115,8 @@ def BuildProgram(env): def ProcessFlags(env, flags): 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): @@ -148,14 +150,16 @@ def ProcessFlags(env, flags): def ProcessUnFlags(env, flags): if not flags: return - parsed_flags = env.ParseFlags(flags) + 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.get(key, [])) + cur_flags = set(env.Flatten(env.get(key, []))) for item in cur_flags & all_flags: while item in env[key]: env[key].remove(item) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index 550e839c..6a9e964c 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -186,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 """) @@ -197,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: # @@ -205,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 diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index bbf8bb09..b48b23dc 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -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'], diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index d17d98aa..19b69ddb 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -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") diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 44e3b8ea..24676bf1 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -70,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: diff --git a/platformio/exception.py b/platformio/exception.py index 78059eb2..07fa0248 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -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 """ diff --git a/platformio/maintenance.py b/platformio/maintenance.py index d2e944eb..4832793d 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -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("") diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index 5566f37b..ba97cbe6 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -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") ] } diff --git a/platformio/platforms/nordicnrf51.py b/platformio/platforms/nordicnrf51.py index b68e240b..32a0d054 100644 --- a/platformio/platforms/nordicnrf51.py +++ b/platformio/platforms/nordicnrf51.py @@ -43,6 +43,10 @@ class Nordicnrf51Platform(BasePlatform): "alias": "framework" }, + "tool-sreccat": { + "default": True + }, + "tool-rfdloader": { } } diff --git a/platformio/projectconftpl.ini b/platformio/projectconftpl.ini index da48cf88..0e9de3f9 100644 --- a/platformio/projectconftpl.ini +++ b/platformio/projectconftpl.ini @@ -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 +# \ No newline at end of file diff --git a/platformio/util.py b/platformio/util.py index 727c9957..f5e96b20 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -224,7 +224,7 @@ def get_pioenvs_dir(): with open(dontmod_path, "w") as fp: fp.write(""" [InternetShortcut] -URL=http://docs.platformio.org/en/latest/projectconf.html#envs-dir +URL=http://docs.platformio.org/en/stable/projectconf.html#envs-dir """) return path diff --git a/scripts/99-platformio-udev.rules b/scripts/99-platformio-udev.rules index 340e723b..ac52af74 100644 --- a/scripts/99-platformio-udev.rules +++ b/scripts/99-platformio-udev.rules @@ -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"