forked from platformio/platformio-core
Merge branch 'release/v1.4.0'
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
[settings]
|
||||
line_length=79
|
||||
known_third_party=click,requests,serial,SCons
|
||||
known_third_party=click,requests,serial,SCons,pytest
|
||||
|
25
HISTORY.rst
25
HISTORY.rst
@ -1,6 +1,31 @@
|
||||
Release History
|
||||
===============
|
||||
|
||||
1.4.0 (2015-04-11)
|
||||
------------------
|
||||
|
||||
* Added `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`_
|
||||
development platform with ESP01 board
|
||||
* Integrated PlatformIO with AppVeyor Windows based Continuous Integration system
|
||||
(`issue #149 <https://github.com/platformio/platformio/issues/149>`_)
|
||||
* Added support for Teensy LC board to
|
||||
`teensy <http://docs.platformio.org/en/latest/platforms/teensy.html>`__
|
||||
platform
|
||||
* Added support for new Arduino based boards by *SparkFun, BQ, LightUp,
|
||||
LowPowerLab, Quirkbot, RedBearLab, TinyCircuits, WickedDevice* to
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
|
||||
platform
|
||||
* Upgraded `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
||||
1.6.3 version (`issue #156 <https://github.com/platformio/platformio/issues/156>`_)
|
||||
* Upgraded `Energia Framework <http://docs.platformio.org/en/latest/frameworks/energia.html>`__ to
|
||||
0101E0015 version (`issue #146 <https://github.com/platformio/platformio/issues/146>`_)
|
||||
* Upgraded `Arduino Framework with Teensy Core <http://docs.platformio.org/en/latest/frameworks/arduino.html>`_ to
|
||||
1.22 version (`issue #162 <https://github.com/platformio/platformio/issues/162>`_,
|
||||
`issue #170 <https://github.com/platformio/platformio/issues/170>`_)
|
||||
* Fixed exceptions with PlatformIO auto-updates when Internet connection isn't
|
||||
active
|
||||
|
||||
|
||||
1.3.0 (2015-03-27)
|
||||
------------------
|
||||
|
||||
|
14
README.rst
14
README.rst
@ -2,8 +2,11 @@ PlatformIO
|
||||
==========
|
||||
|
||||
.. image:: https://travis-ci.org/platformio/platformio.svg?branch=develop
|
||||
:target: https://travis-ci.org/profile/platformio
|
||||
:alt: Build Status
|
||||
:target: https://travis-ci.org/platformio/platformio
|
||||
:alt: Travis.CI Build Status
|
||||
.. image:: https://ci.appveyor.com/api/projects/status/ee26e58de798rctd/branch/develop?svg=true
|
||||
:target: https://ci.appveyor.com/project/ivankravets/platformio
|
||||
:alt: AppVeyor.CI Build Status
|
||||
.. image:: https://gemnasium.com/ivankravets/platformio.png
|
||||
:target: https://gemnasium.com/ivankravets/platformio
|
||||
:alt: Dependency Status
|
||||
@ -21,6 +24,7 @@ PlatformIO
|
||||
`Documentation <http://docs.platformio.org>`_ |
|
||||
`Project Examples <https://github.com/platformio/platformio/tree/develop/examples>`_ |
|
||||
`Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Reddit <http://www.reddit.com/r/platformio/>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_
|
||||
|
||||
*Atmel AVR & SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, ST STM32,
|
||||
@ -41,11 +45,13 @@ and the missing library manager.
|
||||
* `User Guide <http://docs.platformio.org/en/latest/userguide/index.html>`_
|
||||
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_
|
||||
* `Articles about us <http://docs.platformio.org/en/latest/articles.html>`_
|
||||
* `FAQ <http://docs.platformio.org/en/latest/faq.html>`_
|
||||
* `Release History <http://docs.platformio.org/en/latest/history.html>`_
|
||||
|
||||
You have **no need** to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms including: compiler, debugger,
|
||||
uploader (for embedded boards) and many other useful tools.
|
||||
has pre-built different development platforms and pre-configured settings for
|
||||
the most popular embedded boards. For further details, please
|
||||
refer to `What is PlatformIO? <http://docs.platformio.org/en/latest/faq.html#what-is-platformio>`_
|
||||
|
||||
Use whenever. *Run everywhere.*
|
||||
-------------------------------
|
||||
|
21
appveyor.yml
Normal file
21
appveyor.yml
Normal file
@ -0,0 +1,21 @@
|
||||
build: off
|
||||
environment:
|
||||
global:
|
||||
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd"
|
||||
matrix:
|
||||
- TOXENV: "py27"
|
||||
TOXPYTHON: "C:\\Python27-x64\\python.exe"
|
||||
WINDOWS_SDK_VERSION: "v7.0"
|
||||
PYTHON_HOME: "C:\\Python27-x64"
|
||||
PYTHON_VERSION: "2.7"
|
||||
PYTHON_ARCH: "64"
|
||||
init:
|
||||
- "ECHO %TOXENV%"
|
||||
- ps: "ls C:\\Python*"
|
||||
install:
|
||||
- "git submodule update --init --recursive"
|
||||
- "powershell scripts\\appveyor\\install.ps1"
|
||||
test_script:
|
||||
- "%PYTHON_HOME%\\Scripts\\tox --version"
|
||||
- "%PYTHON_HOME%\\Scripts\\pip --version"
|
||||
- "%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\tox"
|
101
docs/faq.rst
Normal file
101
docs/faq.rst
Normal file
@ -0,0 +1,101 @@
|
||||
.. _faq:
|
||||
|
||||
Frequently Asked Questions
|
||||
==========================
|
||||
|
||||
.. contents::
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
.. _faq_what_is_platformio:
|
||||
|
||||
What is PlatformIO?
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is a cross-platform code builder
|
||||
and the missing library manager.
|
||||
|
||||
PlatformIO is independent from the platform, in which it is running. In fact,
|
||||
the only requirement is Python, which exists pretty much everywhere. What this
|
||||
means is that PlatformIO projects can be easily moved from one computer to
|
||||
another, as well as that PlatformIO allows for the easy sharing of projects
|
||||
between team members, regardless of operating system they prefer to work with.
|
||||
Beyond that, PlatformIO can be run not only on commonly used desktops/laptops
|
||||
but also on the servers without X Window System. While PlatformIO itself is a
|
||||
console application, it can be used in combination with one's favorite
|
||||
:ref:`ide` or text editor such as :ref:`ide_arduino`, :ref:`ide_eclipse`,
|
||||
:ref:`ide_visualstudio`, :ref:`ide_vim`, :ref:`ide_sublimetext`, etc.
|
||||
|
||||
Alright, so PlatformIO can run on different operating systems. But more
|
||||
importantly, from development perspective at least, is a list of supported
|
||||
boards and MCUs. To keep things short: PlatformIO supports over 100
|
||||
:ref:`Embedded Boards <platforms>` and all major
|
||||
:ref:`Development Platforms <platforms>`.
|
||||
|
||||
PlatformIO allows users to:
|
||||
|
||||
* Decide which operation system they want to run development process on.
|
||||
You can even use one OS at home and another at work.
|
||||
* Choose which editor to use for writing the code. It can be pretty simple
|
||||
editor or powerful favorite :ref:`ide`.
|
||||
* Focus on the code development, significantly simplifying support for the
|
||||
:ref:`platforms` and MCUs.
|
||||
|
||||
|
||||
How does it work?
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Without going too deep into PlatformIO implementation details, work cycle of
|
||||
the project developed using PlatformIO is as follows:
|
||||
|
||||
* Users choose board(s) interested in :ref:`projectconf`
|
||||
* Based on this list of boards, PlatformIO downloads required toolchains and
|
||||
installs them automatically.
|
||||
* Users develop code and PlatformIO makes sure that it is compiled, prepared
|
||||
and uploaded to all the boards of interest.
|
||||
|
||||
.. _faq_troubleshooting:
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
.. _faq_troubleshooting_pioblocksprompt:
|
||||
|
||||
PlatformIO blocks command execution using user prompt
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you are going to run *PlatformIO* from **subprocess**, you **MUST
|
||||
DISABLE** all prompts. It will allow you to avoid blocking.
|
||||
There are a few options:
|
||||
|
||||
- using environment variable :ref:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No <envvar_PLATFORMIO_SETTING_ENABLE_PROMPTS>`
|
||||
- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command
|
||||
- masking under Continuous Integration system via environment variable
|
||||
:ref:`CI=true <envvar_CI>`.
|
||||
|
||||
|
||||
Windows: ``UnicodeDecodeError: 'ascii' codec can't decode byte``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Answered in `issue #143 <https://github.com/platformio/platformio/issues/143#issuecomment-88060906>`_.
|
||||
|
||||
Serial does not work with panStampAVR board
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Answered in `issue #144 <https://github.com/platformio/platformio/issues/144#issuecomment-87388038>`_.
|
||||
|
||||
|
||||
An error ``pkg_resources.DistributionNotFound``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Please upgrade *SetupTools* package:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ [sudo] pip uninstall setuptools
|
||||
$ [sudo] pip install setuptools
|
||||
|
||||
# Then re-install PlatformIO
|
||||
$ [sudo] pip uninstall platformio
|
||||
$ [sudo] pip install platformio
|
@ -22,6 +22,9 @@ Platforms
|
||||
* - :ref:`platform_atmelsam`
|
||||
- Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix.
|
||||
|
||||
* - :ref:`platform_espressif`
|
||||
- Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.
|
||||
|
||||
* - :ref:`platform_teensy`
|
||||
- Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port.
|
||||
|
||||
@ -328,6 +331,26 @@ Arduino
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
BQ
|
||||
~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``zumbt328``
|
||||
- `BQ ZUM BT-328 board <http://www.bq.com/gb/products/zum.html>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
BitWizard
|
||||
~~~~~~~~~
|
||||
|
||||
@ -430,6 +453,73 @@ Engduino
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
Espressif
|
||||
~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``esp01``
|
||||
- `Espressif ESP8266 board <https://nurdspace.nl/ESP8266>`_
|
||||
- ESP8266
|
||||
- 80 MHz
|
||||
- 512 Kb
|
||||
- 32 Kb
|
||||
|
||||
LightUp
|
||||
~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``lightup``
|
||||
- `LightUp <https://www.lightup.io/>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
LowPowerLab
|
||||
~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``moteino``
|
||||
- `LowPowerLab Moteino <https://lowpowerlab.com/shop/moteino-r4>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``moteinomega``
|
||||
- `LowPowerLab MoteinoMEGA <http://lowpowerlab.com/blog/2014/08/09/moteinomega-available-now/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
Microduino
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -533,6 +623,60 @@ PanStamp
|
||||
- 32 Kb
|
||||
- 4 Kb
|
||||
|
||||
Quirkbot
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``quirkbot``
|
||||
- `Quirkbot <http://quirkbot.com>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
RedBearLab
|
||||
~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``blend``
|
||||
- `RedBearLab Blend <http://redbearlab.com/blend/>`_
|
||||
- ATMEGA32U4
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
* - ``blendmicro16``
|
||||
- `RedBearLab Blend Micro 3.3V/16MHz (overclock) <http://redbearlab.com/blendmicro/>`_
|
||||
- ATMEGA32U4
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
* - ``blendmicro8``
|
||||
- `RedBearLab Blend Micro 3.3V/8MHz <http://redbearlab.com/blendmicro/>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
RepRap
|
||||
~~~~~~
|
||||
|
||||
@ -634,6 +778,13 @@ SparkFun
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``sparkfun_digitalsandbox``
|
||||
- `SparkFun Digital Sandbox <https://www.sparkfun.com/products/12651>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``sparkfun_fiov3``
|
||||
- `SparkFun Fio V3 3.3V/8MHz <https://www.sparkfun.com/products/11520>`_
|
||||
- ATMEGA32U4
|
||||
@ -690,6 +841,13 @@ SparkFun
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``uview``
|
||||
- `SparkFun MicroView <https://www.sparkfun.com/products/12923>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
Teensy
|
||||
~~~~~~
|
||||
|
||||
@ -730,3 +888,64 @@ Teensy
|
||||
- 72 MHz
|
||||
- 256 Kb
|
||||
- 64 Kb
|
||||
|
||||
* - ``teensylc``
|
||||
- `Teensy LC <http://www.pjrc.com/teensy/teensyLC.html>`_
|
||||
- MKL26Z64
|
||||
- 48 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
||||
TinyCircuits
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``tinyduino``
|
||||
- `TinyCircuits TinyDuino Processor Board <https://tiny-circuits.com/tinyduino-processor-board.html>`_
|
||||
- ATMEGA328P
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``tinylily``
|
||||
- `TinyCircuits TinyLily Mini Processor <https://tiny-circuits.com/tiny-lily-mini-processor.html>`_
|
||||
- ATMEGA328P
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
WickedDevice
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``wildfirev2``
|
||||
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
* - ``wildfirev3``
|
||||
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
@ -3,7 +3,7 @@
|
||||
Visual Studio
|
||||
=============
|
||||
|
||||
The `Microsoft Visual Studio <http://visualstudio.com/>`_ is an integrated development environment (IDE) from Microsoft. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring.
|
||||
The `Microsoft Visual Studio (Free) <http://visualstudio.com/free>`_ is an integrated development environment (IDE) from Microsoft. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
|
@ -14,17 +14,13 @@ TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
|
||||
* `Source Code <https://github.com/platformio/platformio>`_ |
|
||||
`Issues <https://github.com/platformio/platformio/issues>`_
|
||||
* `Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Reddit <http://www.reddit.com/r/platformio/>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_
|
||||
|
||||
You have no need to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms including: compiler, debugger,
|
||||
uploader (for embedded) and many other useful tools.
|
||||
|
||||
**PlatformIO** allows developer to compile the same code with different
|
||||
platforms using only one command :ref:`cmd_run`. This happens due to
|
||||
:ref:`projectconf` where you can setup different environments with specific
|
||||
options: platform type, firmware uploading settings, pre-built framework
|
||||
and many more.
|
||||
You have **no need** to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms and pre-configured settings for
|
||||
the most popular embedded boards. For further details, please
|
||||
refer to :ref:`faq_what_is_platformio`
|
||||
|
||||
Embedded Development. *Easier Than Ever.*
|
||||
-----------------------------------------
|
||||
@ -69,4 +65,5 @@ Contents
|
||||
userguide/index
|
||||
ide
|
||||
articles
|
||||
FAQ <faq>
|
||||
history
|
||||
|
@ -30,19 +30,23 @@ application:
|
||||
application.
|
||||
|
||||
.. warning::
|
||||
If you are going to run *PlatformIO* from **subprocess**, you **MUST
|
||||
DISABLE** all prompts. It will allow you to avoid blocking.
|
||||
There are a few options:
|
||||
If you are going to run *PlatformIO* from **subprocess**, you
|
||||
:ref:`MUST DISABLE <faq_troubleshooting_pioblocksprompt>` all prompts.
|
||||
It will allow you to avoid blocking.
|
||||
|
||||
- using environment variable :ref:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No <envvar_PLATFORMIO_SETTING_ENABLE_PROMPTS>`
|
||||
- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command
|
||||
- masking under Continuous Integration system via environment variable
|
||||
:ref:`CI=true <envvar_CI>`.
|
||||
|
||||
Please *choose one of* the following:
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
For further details, frequently questions, please refer to :ref:`faq`.
|
||||
|
||||
Installation Methods
|
||||
--------------------
|
||||
|
||||
Please *choose one of* the following installation methods:
|
||||
|
||||
Super-Quick (Mac / Linux)
|
||||
-------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
|
||||
(**you might need** to run ``sudo`` first):
|
||||
@ -53,7 +57,7 @@ To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
|
||||
|
||||
|
||||
Installer Script (Mac / Linux / Windows)
|
||||
----------------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To install or upgrade *PlatformIO*, download
|
||||
`get-platformio.py <https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py>`_
|
||||
@ -70,16 +74,8 @@ On *Windows OS* it may look like:
|
||||
|
||||
C:\Python27\python.exe get-platformio.py
|
||||
|
||||
.. warning::
|
||||
If you have an error ``pkg_resources.DistributionNotFound`` please
|
||||
upgrade *SetupTools* package: ``$ [sudo] pip uninstall setuptools``
|
||||
and ``$ [sudo] pip install setuptools``.
|
||||
Then re-install *PlatformIO*: ``$ [sudo] pip uninstall platformio``
|
||||
and ``$ [sudo] pip install platformio``.
|
||||
|
||||
|
||||
Full Guide
|
||||
----------
|
||||
~~~~~~~~~~
|
||||
|
||||
1. Check a ``python`` version (only 2.6-2.7 is supported):
|
||||
|
||||
@ -121,7 +117,7 @@ For upgrading the ``platformio`` to new version please use this command:
|
||||
|
||||
|
||||
Development Version
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. warning::
|
||||
We don't recommend to use ``develop`` version in production.
|
||||
|
@ -167,6 +167,16 @@ A version of the current library source code.
|
||||
|PIOAPICR| will use the *CVS*-revision from the latest commit.
|
||||
|
||||
|
||||
.. _libjson_url:
|
||||
|
||||
``url``
|
||||
-------
|
||||
|
||||
*Optional* | Type: ``String`` | Max. Length: 255
|
||||
|
||||
Home page of library (if is different from :ref:`libjson_repository` url).
|
||||
|
||||
|
||||
.. _libjson_include:
|
||||
|
||||
``include``
|
||||
|
@ -333,6 +333,26 @@ Arduino
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
BQ
|
||||
~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``zumbt328``
|
||||
- `BQ ZUM BT-328 board <http://www.bq.com/gb/products/zum.html>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
BitWizard
|
||||
~~~~~~~~~
|
||||
|
||||
@ -428,6 +448,53 @@ Engduino
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
LightUp
|
||||
~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``lightup``
|
||||
- `LightUp <https://www.lightup.io/>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
LowPowerLab
|
||||
~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``moteino``
|
||||
- `LowPowerLab Moteino <https://lowpowerlab.com/shop/moteino-r4>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``moteinomega``
|
||||
- `LowPowerLab MoteinoMEGA <http://lowpowerlab.com/blog/2014/08/09/moteinomega-available-now/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
Microduino
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -524,6 +591,60 @@ PanStamp
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
Quirkbot
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``quirkbot``
|
||||
- `Quirkbot <http://quirkbot.com>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
RedBearLab
|
||||
~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``blend``
|
||||
- `RedBearLab Blend <http://redbearlab.com/blend/>`_
|
||||
- ATMEGA32U4
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
* - ``blendmicro16``
|
||||
- `RedBearLab Blend Micro 3.3V/16MHz (overclock) <http://redbearlab.com/blendmicro/>`_
|
||||
- ATMEGA32U4
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
* - ``blendmicro8``
|
||||
- `RedBearLab Blend Micro 3.3V/8MHz <http://redbearlab.com/blendmicro/>`_
|
||||
- ATMEGA32U4
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
RepRap
|
||||
~~~~~~
|
||||
|
||||
@ -598,6 +719,13 @@ SparkFun
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``sparkfun_digitalsandbox``
|
||||
- `SparkFun Digital Sandbox <https://www.sparkfun.com/products/12651>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``sparkfun_fiov3``
|
||||
- `SparkFun Fio V3 3.3V/8MHz <https://www.sparkfun.com/products/11520>`_
|
||||
- ATMEGA32U4
|
||||
@ -653,3 +781,64 @@ SparkFun
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``uview``
|
||||
- `SparkFun MicroView <https://www.sparkfun.com/products/12923>`_
|
||||
- ATMEGA328P
|
||||
- 16 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
TinyCircuits
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``tinyduino``
|
||||
- `TinyCircuits TinyDuino Processor Board <https://tiny-circuits.com/tinyduino-processor-board.html>`_
|
||||
- ATMEGA328P
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
* - ``tinylily``
|
||||
- `TinyCircuits TinyLily Mini Processor <https://tiny-circuits.com/tiny-lily-mini-processor.html>`_
|
||||
- ATMEGA328P
|
||||
- 8 MHz
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
WickedDevice
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``wildfirev2``
|
||||
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
* - ``wildfirev3``
|
||||
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
@ -45,6 +45,9 @@ Packages
|
||||
* - ``framework-arduinoavr``
|
||||
- `Arduino Wiring-based Framework (AVR Core, 1.6) <http://arduino.cc/en/Reference/HomePage>`_
|
||||
|
||||
* - ``framework-arduinoespressif``
|
||||
- `Arduino Wiring-based Framework (ESP8266 Core) <https://github.com/esp8266/Arduino>`_
|
||||
|
||||
* - ``framework-arduinomsp430``
|
||||
- `Arduino Wiring-based Framework (MSP430 Core) <http://arduino.cc/en/Reference/HomePage>`_
|
||||
|
||||
@ -75,12 +78,18 @@ Packages
|
||||
* - ``ldscripts``
|
||||
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
|
||||
|
||||
* - ``sdk-esp8266``
|
||||
- `ESP8266 SDK <http://bbs.espressif.com>`_
|
||||
|
||||
* - ``tool-avrdude``
|
||||
- `AVRDUDE <http://www.nongnu.org/avrdude/>`_
|
||||
|
||||
* - ``tool-bossac``
|
||||
- `BOSSA CLI <https://sourceforge.net/projects/b-o-s-s-a/>`_
|
||||
|
||||
* - ``tool-esptool``
|
||||
- `esptool-ck <https://github.com/igrr/esptool-ck>`_
|
||||
|
||||
* - ``tool-lm4flash``
|
||||
- `Flash Programmer <http://www.ti.com/tool/lmflashprogrammer>`_
|
||||
|
||||
@ -105,6 +114,9 @@ Packages
|
||||
* - ``toolchain-timsp430``
|
||||
- `msp-gcc <http://sourceforge.net/projects/mspgcc/>`_, `GDB <http://www.gnu.org/software/gdb/>`_
|
||||
|
||||
* - ``toolchain-xtensa``
|
||||
- `xtensa-gcc <https://github.com/jcmvbkbc/gcc-xtensa>`_, `GDB <http://www.gnu.org/software/gdb/>`_
|
||||
|
||||
.. _platform_creating_manifest_file:
|
||||
|
||||
Manifest File
|
||||
|
79
docs/platforms/espressif.rst
Normal file
79
docs/platforms/espressif.rst
Normal file
@ -0,0 +1,79 @@
|
||||
.. _platform_espressif:
|
||||
|
||||
Platform ``espressif``
|
||||
======================
|
||||
Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.
|
||||
|
||||
For more detailed information please visit `vendor site <https://espressif.com/>`_.
|
||||
|
||||
.. contents::
|
||||
|
||||
Packages
|
||||
--------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Contents
|
||||
|
||||
* - ``ldscripts``
|
||||
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
|
||||
|
||||
* - ``sdk-esp8266``
|
||||
- `ESP8266 SDK <http://bbs.espressif.com>`_
|
||||
|
||||
* - ``tool-esptool``
|
||||
- `esptool-ck <https://github.com/igrr/esptool-ck>`_
|
||||
|
||||
* - ``framework-arduinoespressif``
|
||||
- `Arduino Wiring-based Framework (ESP8266 Core) <https://github.com/esp8266/Arduino>`_
|
||||
|
||||
* - ``toolchain-xtensa``
|
||||
- `xtensa-gcc <https://github.com/jcmvbkbc/gcc-xtensa>`_, `GDB <http://www.gnu.org/software/gdb/>`_
|
||||
|
||||
.. warning::
|
||||
**Linux Users:** Don't forget to install "udev" rules file
|
||||
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
----------
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
Boards
|
||||
------
|
||||
|
||||
.. note::
|
||||
* You can list pre-configured boards by :ref:`cmd_boards` command or
|
||||
`PlatformIO Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
Espressif
|
||||
~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``esp01``
|
||||
- `Espressif ESP8266 board <https://nurdspace.nl/ESP8266>`_
|
||||
- ESP8266
|
||||
- 80 MHz
|
||||
- 512 Kb
|
||||
- 32 Kb
|
@ -16,6 +16,7 @@ MCU, upload protocol or etc. Please use ``board`` option.
|
||||
|
||||
atmelavr
|
||||
atmelsam
|
||||
espressif
|
||||
freescalekinetis
|
||||
nordicnrf51
|
||||
nxplpc
|
||||
|
@ -98,3 +98,10 @@ Teensy
|
||||
- 72 MHz
|
||||
- 256 Kb
|
||||
- 64 Kb
|
||||
|
||||
* - ``teensylc``
|
||||
- `Teensy LC <http://www.pjrc.com/teensy/teensyLC.html>`_
|
||||
- MKL26Z64
|
||||
- 48 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
21
examples/espressif/esp8266-native/README.rst
Normal file
21
examples/espressif/esp8266-native/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-native
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
22
examples/espressif/esp8266-native/platformio.ini
Normal file
22
examples/espressif/esp8266-native/platformio.ini
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
board = esp01
|
5
examples/espressif/esp8266-native/src/user_config.h
Normal file
5
examples/espressif/esp8266-native/src/user_config.h
Normal file
@ -0,0 +1,5 @@
|
||||
#ifndef __USER_CONFIG_H__
|
||||
#define __USER_CONFIG_H__
|
||||
|
||||
#endif
|
||||
|
33
examples/espressif/esp8266-native/src/user_main.c
Normal file
33
examples/espressif/esp8266-native/src/user_main.c
Normal file
@ -0,0 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2013-2014 Espressif Systems (Wuxi)
|
||||
*
|
||||
* FileName: user_main.c
|
||||
*
|
||||
* Description: entry file of user application
|
||||
*
|
||||
* Modification history:
|
||||
* 2014/1/1, v1.0 create this file.
|
||||
*******************************************************************************/
|
||||
#include "ets_sys.h"
|
||||
#include "osapi.h"
|
||||
|
||||
#include "user_interface.h"
|
||||
#include "smartconfig.h"
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
smartconfig_done(void *data)
|
||||
{
|
||||
struct station_config *sta_conf = data;
|
||||
|
||||
wifi_station_set_config(sta_conf);
|
||||
wifi_station_disconnect();
|
||||
wifi_station_connect();
|
||||
}
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
os_printf("SDK version:%s\n", system_get_sdk_version());
|
||||
|
||||
wifi_set_opmode(STATION_MODE);
|
||||
smartconfig_start(SC_TYPE_AIRKISS, smartconfig_done);
|
||||
}
|
21
examples/espressif/esp8266-webserver/README.rst
Normal file
21
examples/espressif/esp8266-webserver/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-webserver
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
23
examples/espressif/esp8266-webserver/platformio.ini
Normal file
23
examples/espressif/esp8266-webserver/platformio.ini
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
framework = arduino
|
||||
board = esp01
|
54
examples/espressif/esp8266-webserver/src/HelloServer.ino
Normal file
54
examples/espressif/esp8266-webserver/src/HelloServer.ino
Normal file
@ -0,0 +1,54 @@
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
|
||||
const char* ssid = "*****";
|
||||
const char* password = "*****";
|
||||
|
||||
|
||||
ESP8266WebServer server(80);
|
||||
|
||||
const int led = 13;
|
||||
|
||||
void handle_root() {
|
||||
digitalWrite(led, 1);
|
||||
server.send(200, "text/plain", "hello from esp8266!");
|
||||
delay(100);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
Serial.begin(115200);
|
||||
pinMode(led, OUTPUT);
|
||||
digitalWrite(led, 0);
|
||||
|
||||
// Connect to WiFi network
|
||||
WiFi.begin(ssid, password);
|
||||
Serial.println("");
|
||||
|
||||
// Wait for connection
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(500);
|
||||
Serial.print(".");
|
||||
}
|
||||
Serial.println("");
|
||||
Serial.print("Connected to ");
|
||||
Serial.println(ssid);
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.on("/", handle_root);
|
||||
|
||||
server.on("/inline", [](){
|
||||
server.send(200, "text/plain", "this works as well");
|
||||
});
|
||||
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
server.handleClient();
|
||||
}
|
21
examples/espressif/esp8266-wifiscan/README.rst
Normal file
21
examples/espressif/esp8266-wifiscan/README.rst
Normal file
@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/espressif/esp8266-wifiscan
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
23
examples/espressif/esp8266-wifiscan/platformio.ini
Normal file
23
examples/espressif/esp8266-wifiscan/platformio.ini
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:esp01_8266]
|
||||
platform = espressif
|
||||
framework = arduino
|
||||
board = esp01
|
48
examples/espressif/esp8266-wifiscan/src/WiFiScan.ino
Normal file
48
examples/espressif/esp8266-wifiscan/src/WiFiScan.ino
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* This sketch demonstrates how to scan WiFi networks.
|
||||
* The API is almost the same as with the WiFi Shield library,
|
||||
* the most obvious difference being the different file you need to include:
|
||||
*/
|
||||
#include "ESP8266WiFi.h"
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
// Set WiFi to station mode and disconnect from an AP if it was previously connected
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.disconnect();
|
||||
delay(100);
|
||||
|
||||
Serial.println("Setup done");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println("scan start");
|
||||
|
||||
// WiFi.scanNetworks will return the number of networks found
|
||||
int n = WiFi.scanNetworks();
|
||||
Serial.println("scan done");
|
||||
if (n == 0)
|
||||
Serial.println("no networks found");
|
||||
else
|
||||
{
|
||||
Serial.print(n);
|
||||
Serial.println(" networks found");
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
// Print SSID and RSSI for each network found
|
||||
Serial.print(i + 1);
|
||||
Serial.print(": ");
|
||||
Serial.print(WiFi.SSID(i));
|
||||
Serial.print(" (");
|
||||
Serial.print(WiFi.RSSI(i));
|
||||
Serial.print(")");
|
||||
Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*");
|
||||
delay(10);
|
||||
}
|
||||
}
|
||||
Serial.println("");
|
||||
|
||||
// Wait a bit before scanning again
|
||||
delay(5000);
|
||||
}
|
@ -40,3 +40,9 @@ platform = teensy
|
||||
framework = arduino
|
||||
board = teensy31
|
||||
build_flags = -DTEENSY31
|
||||
|
||||
[env:teensylc]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensylc
|
||||
build_flags = -DTEENSYLC
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (1, 3, 0)
|
||||
VERSION = (1, 4, 0)
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
24
platformio/boards/espressif.json
Normal file
24
platformio/boards/espressif.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"esp01": {
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "esp8266.ld",
|
||||
"mcu": "esp8266",
|
||||
"variant": "esp01"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Espressif ESP8266 board",
|
||||
"platform": "espressif",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 524288,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://nurdspace.nl/ESP8266",
|
||||
"vendor": "Espressif"
|
||||
}
|
||||
}
|
@ -226,5 +226,300 @@
|
||||
},
|
||||
"url": "https://code.google.com/p/sanguino/",
|
||||
"vendor": "Sanguino"
|
||||
},
|
||||
|
||||
"tinyduino": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LILYPAD",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "TinyCircuits TinyDuino Processor Board",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600
|
||||
},
|
||||
"url": "https://tiny-circuits.com/tinyduino-processor-board.html",
|
||||
"vendor": "TinyCircuits"
|
||||
},
|
||||
|
||||
"wildfirev3": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev3"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v3 [optiboot]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"wildfirev2": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev2"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v2 [stk500]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 122878,
|
||||
"protocol": "wiring",
|
||||
"require_upload_port" : true,
|
||||
"speed": 38400
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"blend": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8036",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend",
|
||||
"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": "http://redbearlab.com/blend/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"blendmicro8": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x2404",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "micro",
|
||||
"vid": "0x03EB"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend Micro 3.3V/8MHz",
|
||||
"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": "http://redbearlab.com/blendmicro/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"blendmicro16": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x2404",
|
||||
"usb_product": "RedBearLab Blend",
|
||||
"variant": "micro",
|
||||
"vid": "0x03EB"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "RedBearLab Blend Micro 3.3V/16MHz (overclock)",
|
||||
"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": "http://redbearlab.com/blendmicro/",
|
||||
"vendor": "RedBearLab"
|
||||
},
|
||||
|
||||
"tinylily": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LILYPAD",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "TinyCircuits TinyLily Mini Processor",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 57600
|
||||
},
|
||||
"url": "https://tiny-circuits.com/tiny-lily-mini-processor.html",
|
||||
"vendor": "TinyCircuits"
|
||||
},
|
||||
|
||||
"lightup": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_LEONARDO",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x6096",
|
||||
"usb_product": "LightUp",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x1d50"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LightUp",
|
||||
"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.lightup.io/",
|
||||
"vendor": "LightUp"
|
||||
},
|
||||
|
||||
"moteino": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_MOTEINO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LowPowerLab Moteino",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 31744,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://lowpowerlab.com/shop/moteino-r4",
|
||||
"vendor": "LowPowerLab"
|
||||
},
|
||||
|
||||
"moteinomega": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_MOTEINOMEGA",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "moteinoMega"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LowPowerLab MoteinoMEGA",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://lowpowerlab.com/blog/2014/08/09/moteinomega-available-now/",
|
||||
"vendor": "LowPowerLab"
|
||||
},
|
||||
|
||||
"zumbt328": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_BT",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "BQ ZUM BT-328 board",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 19200
|
||||
},
|
||||
"url": "http://www.bq.com/gb/products/zum.html",
|
||||
"vendor": "BQ"
|
||||
},
|
||||
|
||||
"quirkbot": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DQUIRKBOT",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"variant" : "quirkbot",
|
||||
"vid": "0xf055",
|
||||
"pid": "0xf055",
|
||||
"usb_product": "Quirkbot"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Quirkbot",
|
||||
"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": "http://quirkbot.com",
|
||||
"vendor": "Quirkbot"
|
||||
}
|
||||
}
|
||||
|
@ -187,5 +187,48 @@
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/10743",
|
||||
"vendor": "SparkFun"
|
||||
},
|
||||
"sparkfun_digitalsandbox": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "SparkFun Digital Sandbox",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/12651",
|
||||
"vendor": "SparkFun"
|
||||
},
|
||||
|
||||
"uview": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "SparkFun MicroView",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "https://www.sparkfun.com/products/12923",
|
||||
"vendor": "SparkFun"
|
||||
}
|
||||
}
|
@ -71,5 +71,25 @@
|
||||
},
|
||||
"url": "https://www.pjrc.com/store/teensy31.html",
|
||||
"vendor": "Teensy"
|
||||
},
|
||||
|
||||
"teensylc": {
|
||||
"build": {
|
||||
"core": "teensy3",
|
||||
"extra_flags": "-D__MKL26Z64__",
|
||||
"f_cpu": "48000000L",
|
||||
"ldscript": "mkl26z64.ld",
|
||||
"mcu": "mkl26z64",
|
||||
"cpu": "cortex-m0plus"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Teensy LC",
|
||||
"platform": "teensy",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 63488
|
||||
},
|
||||
"url": "http://www.pjrc.com/teensy/teensyLC.html",
|
||||
"vendor": "Teensy"
|
||||
}
|
||||
}
|
||||
|
@ -45,9 +45,10 @@ env.Replace(
|
||||
|
||||
LINKFLAGS=[
|
||||
"-Os",
|
||||
"-Wl,--gc-sections",
|
||||
"-Wl,--gc-sections,--relax",
|
||||
"-mthumb",
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}"
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
|
||||
"--specs=nano.specs"
|
||||
],
|
||||
|
||||
LIBS=["c", "gcc", "m"],
|
||||
@ -55,21 +56,6 @@ env.Replace(
|
||||
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES'
|
||||
)
|
||||
|
||||
if env.get("BOARD_OPTIONS", {}).get("build", {}).get(
|
||||
"cpu", "")[-2:] == "m4" and env.get("BOARD") != "frdm_k20d50m":
|
||||
env.Append(
|
||||
CPPFLAGS=[
|
||||
"-mfloat-abi=hard",
|
||||
"-mfpu=fpv4-sp-d16",
|
||||
"-fsingle-precision-constant"
|
||||
],
|
||||
LINKFLAGS=[
|
||||
"-mfloat-abi=hard",
|
||||
"-mfpu=fpv4-sp-d16",
|
||||
"-fsingle-precision-constant"
|
||||
]
|
||||
)
|
||||
|
||||
env.Append(
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
|
@ -44,7 +44,7 @@ env.Replace(
|
||||
LINKFLAGS=[
|
||||
"-Os",
|
||||
"-mmcu=$BOARD_MCU",
|
||||
"-Wl,--gc-sections"
|
||||
"-Wl,--gc-sections,--relax"
|
||||
],
|
||||
|
||||
LIBS=["m"],
|
||||
|
160
platformio/builder/scripts/espressif.py
Normal file
160
platformio/builder/scripts/espressif.py
Normal file
@ -0,0 +1,160 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
"""
|
||||
Builder for Espressif MCUs
|
||||
"""
|
||||
|
||||
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 = DefaultEnvironment()
|
||||
|
||||
env.Replace(
|
||||
AR="xtensa-lx106-elf-ar",
|
||||
AS="xtensa-lx106-elf-as",
|
||||
CC="xtensa-lx106-elf-gcc",
|
||||
CXX="xtensa-lx106-elf-g++",
|
||||
OBJCOPY="xtensa-lx106-elf-objcopy",
|
||||
RANLIB="xtensa-lx106-elf-ranlib",
|
||||
SIZETOOL="xtensa-lx106-elf-size",
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CFLAGS=[
|
||||
"-std=c99",
|
||||
"-Wpointer-arith",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wl,-EL",
|
||||
"-fno-inline-functions",
|
||||
"-nostdlib"
|
||||
],
|
||||
|
||||
CPPFLAGS=[
|
||||
"-Os", # optimize for size
|
||||
"-mlongcalls",
|
||||
"-mtext-section-literals",
|
||||
"-MMD" # output dependancy info
|
||||
],
|
||||
|
||||
CXXFLAGS=[
|
||||
"-fno-rtti",
|
||||
"-fno-exceptions",
|
||||
"-std=c++11"
|
||||
],
|
||||
|
||||
CPPDEFINES=[
|
||||
"F_CPU=$BOARD_F_CPU",
|
||||
"__ets__",
|
||||
"ICACHE_FLASH"
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-nostdlib",
|
||||
"-Wl,--no-check-sections",
|
||||
"-u", "call_user_start",
|
||||
"-Wl,-static"
|
||||
],
|
||||
|
||||
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
|
||||
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"),
|
||||
UPLOADERFLAGS=[
|
||||
"-vv",
|
||||
"-cd", "none",
|
||||
"-cb", "$UPLOAD_SPEED",
|
||||
"-cp", "$UPLOAD_PORT",
|
||||
"-ca", "0x00000",
|
||||
"-cf", "${SOURCES[0]}",
|
||||
"-ca", "0x40000",
|
||||
"-cf", "${SOURCES[1]}"
|
||||
],
|
||||
UPLOADCMD='$UPLOADER $UPLOADERFLAGS'
|
||||
)
|
||||
|
||||
env.Append(
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
action=" ".join([
|
||||
"$UPLOADER",
|
||||
"-eo", "$SOURCES",
|
||||
"-bo", "${TARGETS[0]}",
|
||||
"-bs", ".text",
|
||||
"-bs", ".data",
|
||||
"-bs", ".rodata",
|
||||
"-bc", "-ec",
|
||||
"-eo", "$SOURCES",
|
||||
"-es", ".irom0.text", "${TARGETS[1]}",
|
||||
"-ec", "-v"
|
||||
]),
|
||||
suffix=".bin"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
#
|
||||
# Configure SDK
|
||||
#
|
||||
|
||||
if "FRAMEWORK" not in env:
|
||||
env.Append(
|
||||
CPPPATH=[
|
||||
join("$PIOPACKAGES_DIR", "sdk-esp8266", "include"),
|
||||
"$PROJECTSRC_DIR"
|
||||
],
|
||||
LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")]
|
||||
)
|
||||
env.Replace(
|
||||
LDSCRIPT_PATH=join(
|
||||
"$PIOPACKAGES_DIR", "sdk-esp8266", "ld", "eagle.app.v6.ld"),
|
||||
LIBS=["c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "main",
|
||||
"json", "upgrade", "smartconfig", "at", "ssl"]
|
||||
)
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildFirmware()
|
||||
|
||||
#
|
||||
# Target: Build the .hex
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_firm = env.ElfToBin(
|
||||
[join("$BUILD_DIR", "firmware_00000"),
|
||||
join("$BUILD_DIR", "firmware_40000")], target_elf)
|
||||
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
||||
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
|
||||
AlwaysBuild(target_size)
|
||||
|
||||
#
|
||||
# Target: Upload firmware
|
||||
#
|
||||
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_firm,
|
||||
[BeforeUpload, "$UPLOADCMD"])
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
# Target: Define targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
@ -42,6 +42,13 @@ elif env.get("PLATFORM") == "timsp430":
|
||||
"$PIOPACKAGES_DIR",
|
||||
"framework-arduinomsp430"
|
||||
)
|
||||
elif env.get("PLATFORM") == "espressif":
|
||||
env.Prepend(
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")],
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")],
|
||||
LIBS=["hal", "phy", "net80211", "lwip",
|
||||
"wpa", "main", "pp", "c", "gcc"]
|
||||
)
|
||||
|
||||
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
|
||||
|
||||
@ -195,14 +202,12 @@ libs.append(envsafe.BuildLibrary(
|
||||
))
|
||||
|
||||
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||
|
||||
env.Append(
|
||||
LIBPATH=[
|
||||
join("$PLATFORMFW_DIR", "variants",
|
||||
"${BOARD_OPTIONS['build']['variant']}")
|
||||
]
|
||||
)
|
||||
|
||||
envsafe.Append(
|
||||
CFLAGS=[
|
||||
"-std=gnu99"
|
||||
|
@ -16,6 +16,9 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy":
|
||||
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "baseavr.py")))
|
||||
elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
|
||||
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
|
||||
env.Append(
|
||||
LINKFLAGS=["-Wl,--defsym=__rtc_localtime=$UNIX_TIME"]
|
||||
)
|
||||
|
||||
env.Append(
|
||||
CPPDEFINES=[
|
||||
|
@ -63,7 +63,7 @@ def BuildFirmware(env):
|
||||
return firmenv.Program(
|
||||
join("$BUILD_DIR", "firmware"),
|
||||
[firmenv.GlobCXXFiles(vdir) for vdir in vdirs],
|
||||
LIBS=env.get("LIBS", []) + deplibs,
|
||||
LIBS=list(env.get("LIBS", []) + deplibs)[::-1],
|
||||
LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"],
|
||||
PROGSUFFIX=".elf"
|
||||
)
|
||||
|
@ -10,12 +10,11 @@ from time import time
|
||||
|
||||
import click
|
||||
|
||||
from platformio import __version__, app, telemetry
|
||||
from platformio import __version__, app, exception, telemetry
|
||||
from platformio.commands.install import cli as cmd_install
|
||||
from platformio.commands.lib import lib_update as cmd_libraries_update
|
||||
from platformio.commands.update import cli as cli_update
|
||||
from platformio.commands.upgrade import get_latest_version
|
||||
from platformio.exception import GetLatestVersionError, UpgraderFailed
|
||||
from platformio.libmanager import LibraryManager
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
from platformio.util import get_home_dir, get_lib_dir
|
||||
@ -24,9 +23,14 @@ from platformio.util import get_home_dir, get_lib_dir
|
||||
def on_platformio_start(ctx):
|
||||
telemetry.on_command(ctx)
|
||||
after_upgrade(ctx)
|
||||
check_platformio_upgrade()
|
||||
check_internal_updates(ctx, "platforms")
|
||||
check_internal_updates(ctx, "libraries")
|
||||
|
||||
try:
|
||||
check_platformio_upgrade()
|
||||
check_internal_updates(ctx, "platforms")
|
||||
check_internal_updates(ctx, "libraries")
|
||||
except (exception.GetLatestVersionError, exception.APIRequestError):
|
||||
click.secho("Failed to check for PlatformIO upgrades. "
|
||||
"Please check your Internet connection.", fg="red")
|
||||
|
||||
|
||||
def on_platformio_end(ctx, result): # pylint: disable=W0613
|
||||
@ -135,7 +139,7 @@ def after_upgrade(ctx):
|
||||
telemetry.on_event(category="Auto", action="Upgrade",
|
||||
label="%s > %s" % (last_version, __version__))
|
||||
else:
|
||||
raise UpgraderFailed()
|
||||
raise exception.UpgraderFailed()
|
||||
click.echo("")
|
||||
|
||||
|
||||
@ -148,12 +152,7 @@ def check_platformio_upgrade():
|
||||
last_check['platformio_upgrade'] = int(time())
|
||||
app.set_state_item("last_check", last_check)
|
||||
|
||||
try:
|
||||
latest_version = get_latest_version()
|
||||
except GetLatestVersionError:
|
||||
click.secho("Failed to check for PlatformIO upgrades", fg="red")
|
||||
return
|
||||
|
||||
latest_version = get_latest_version()
|
||||
if (latest_version == __version__ or
|
||||
Upgrader.version_to_int(latest_version) <
|
||||
Upgrader.version_to_int(__version__)):
|
||||
|
@ -30,6 +30,10 @@ PLATFORM_PACKAGES = {
|
||||
("Arduino Wiring-based Framework (MSP430 Core)",
|
||||
"http://arduino.cc/en/Reference/HomePage")
|
||||
],
|
||||
"framework-arduinoespressif": [
|
||||
("Arduino Wiring-based Framework (ESP8266 Core)",
|
||||
"https://github.com/esp8266/Arduino")
|
||||
],
|
||||
"framework-energiamsp430": [
|
||||
("Energia Wiring-based Framework (MSP430 Core)",
|
||||
"http://energia.nu/reference/")
|
||||
@ -55,6 +59,9 @@ PLATFORM_PACKAGES = {
|
||||
"framework-mbed": [
|
||||
("mbed Framework", "http://mbed.org")
|
||||
],
|
||||
"sdk-esp8266": [
|
||||
("ESP8266 SDK", "http://bbs.espressif.com")
|
||||
],
|
||||
"ldscripts": [
|
||||
("Linker Scripts",
|
||||
"https://sourceware.org/binutils/docs/ld/Scripts.html")
|
||||
@ -69,6 +76,10 @@ PLATFORM_PACKAGES = {
|
||||
("gcc-arm-embedded", "https://launchpad.net/gcc-arm-embedded"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
],
|
||||
"toolchain-xtensa": [
|
||||
("xtensa-gcc", "https://github.com/jcmvbkbc/gcc-xtensa"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
],
|
||||
"toolchain-timsp430": [
|
||||
("msp-gcc", "http://sourceforge.net/projects/mspgcc/"),
|
||||
("GDB", "http://www.gnu.org/software/gdb/")
|
||||
@ -93,6 +104,9 @@ PLATFORM_PACKAGES = {
|
||||
],
|
||||
"tool-mspdebug": [
|
||||
("MSPDebug", "http://mspdebug.sourceforge.net/")
|
||||
],
|
||||
"tool-esptool": [
|
||||
("esptool-ck", "https://github.com/igrr/esptool-ck")
|
||||
]
|
||||
}
|
||||
|
||||
|
43
platformio/platforms/espressif.py
Normal file
43
platformio/platforms/espressif.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
from platformio.platforms.base import BasePlatform
|
||||
|
||||
|
||||
class EspressifPlatform(BasePlatform):
|
||||
|
||||
"""
|
||||
Espressif Systems is a privately held fabless semiconductor company.
|
||||
They provide wireless communications and Wi-Fi chips which are widely
|
||||
used in mobile devices and the Internet of Things applications.
|
||||
|
||||
https://espressif.com/
|
||||
"""
|
||||
|
||||
PACKAGES = {
|
||||
|
||||
"toolchain-xtensa": {
|
||||
"alias": "toolchain",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"ldscripts": {
|
||||
"default": True
|
||||
},
|
||||
|
||||
"tool-esptool": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"sdk-esp8266": {
|
||||
"default": True
|
||||
},
|
||||
|
||||
"framework-arduinoespressif": {
|
||||
"default": True
|
||||
}
|
||||
}
|
||||
|
||||
def get_name(self):
|
||||
return "Espressif"
|
87
scripts/appveyor/install.ps1
Normal file
87
scripts/appveyor/install.ps1
Normal file
@ -0,0 +1,87 @@
|
||||
# https://packaging.python.org/en/latest/appveyor.html
|
||||
# Sample script to install Python and pip under Windows
|
||||
# Authors: Olivier Grisel and Kyle Kastner
|
||||
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
$BASE_URL = "https://www.python.org/ftp/python/"
|
||||
$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
|
||||
$GET_PIP_PATH = "C:\get-pip.py"
|
||||
|
||||
|
||||
function DownloadPython ($python_version, $platform_suffix) {
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$filename = "python-" + $python_version + $platform_suffix + ".msi"
|
||||
$url = $BASE_URL + $python_version + "/" + $filename
|
||||
|
||||
$basedir = $pwd.Path + "\"
|
||||
$filepath = $basedir + $filename
|
||||
if (Test-Path $filename) {
|
||||
Write-Host "Reusing" $filepath
|
||||
return $filepath
|
||||
}
|
||||
|
||||
# Download and retry up to 5 times in case of network transient errors.
|
||||
Write-Host "Downloading" $filename "from" $url
|
||||
$retry_attempts = 3
|
||||
for($i=0; $i -lt $retry_attempts; $i++){
|
||||
try {
|
||||
$webclient.DownloadFile($url, $filepath)
|
||||
break
|
||||
}
|
||||
Catch [Exception]{
|
||||
Start-Sleep 1
|
||||
}
|
||||
}
|
||||
Write-Host "File saved at" $filepath
|
||||
return $filepath
|
||||
}
|
||||
|
||||
|
||||
function InstallPython ($python_version, $architecture, $python_home) {
|
||||
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
|
||||
if (Test-Path $python_home) {
|
||||
Write-Host $python_home "already exists, skipping."
|
||||
return $false
|
||||
}
|
||||
if ($architecture -eq "32") {
|
||||
$platform_suffix = ""
|
||||
} else {
|
||||
$platform_suffix = ".amd64"
|
||||
}
|
||||
$filepath = DownloadPython $python_version $platform_suffix
|
||||
Write-Host "Installing" $filepath "to" $python_home
|
||||
$args = "/qn /i $filepath TARGETDIR=$python_home"
|
||||
Write-Host "msiexec.exe" $args
|
||||
Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru
|
||||
Write-Host "Python $python_version ($architecture) installation complete"
|
||||
return $true
|
||||
}
|
||||
|
||||
|
||||
function InstallPip ($python_home) {
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
$python_path = $python_home + "/python.exe"
|
||||
if (-not(Test-Path $pip_path)) {
|
||||
Write-Host "Installing pip..."
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
|
||||
Write-Host "Executing:" $python_path $GET_PIP_PATH
|
||||
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
|
||||
} else {
|
||||
Write-Host "pip already installed."
|
||||
}
|
||||
}
|
||||
|
||||
function InstallPackage ($python_home, $pkg) {
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
& $pip_path install $pkg
|
||||
}
|
||||
|
||||
function main () {
|
||||
InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON_HOME
|
||||
InstallPip $env:PYTHON_HOME
|
||||
InstallPackage $env:PYTHON_HOME setuptools
|
||||
InstallPackage $env:PYTHON_HOME tox
|
||||
}
|
||||
|
||||
main
|
48
scripts/appveyor/run_with_compiler.cmd
Normal file
48
scripts/appveyor/run_with_compiler.cmd
Normal file
@ -0,0 +1,48 @@
|
||||
:: https://packaging.python.org/en/latest/appveyor.html
|
||||
:: To build extensions for 64 bit Python 3, we need to configure environment
|
||||
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
|
||||
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
|
||||
::
|
||||
:: To build extensions for 64 bit Python 2, we need to configure environment
|
||||
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
|
||||
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
|
||||
::
|
||||
:: 32 bit builds do not require specific environment configurations.
|
||||
::
|
||||
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
|
||||
:: cmd interpreter, at least for (SDK v7.0)
|
||||
::
|
||||
:: More details at:
|
||||
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
|
||||
:: http://stackoverflow.com/a/13751649/163740
|
||||
::
|
||||
:: Author: Olivier Grisel
|
||||
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
@ECHO OFF
|
||||
|
||||
SET COMMAND_TO_RUN=%*
|
||||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
|
||||
|
||||
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
|
||||
IF %MAJOR_PYTHON_VERSION% == "2" (
|
||||
SET WINDOWS_SDK_VERSION="v7.0"
|
||||
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
|
||||
SET WINDOWS_SDK_VERSION="v7.1"
|
||||
) ELSE (
|
||||
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
|
||||
EXIT 1
|
||||
)
|
||||
|
||||
IF "%PYTHON_ARCH%"=="64" (
|
||||
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
|
||||
SET DISTUTILS_USE_SDK=1
|
||||
SET MSSdk=1
|
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
|
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
|
||||
ECHO Executing: %COMMAND_TO_RUN%
|
||||
call %COMMAND_TO_RUN% || EXIT 1
|
||||
) ELSE (
|
||||
ECHO Using default MSVC build environment for 32 bit architecture
|
||||
ECHO Executing: %COMMAND_TO_RUN%
|
||||
call %COMMAND_TO_RUN% || EXIT 1
|
||||
)
|
@ -1,6 +1,7 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
from glob import glob
|
||||
from os import listdir, walk
|
||||
from os.path import dirname, getsize, isdir, isfile, join, normpath
|
||||
from shutil import rmtree
|
||||
@ -39,12 +40,11 @@ def test_run(platformio_setup, pioproject_dir):
|
||||
pioenvs_dir = join(pioproject_dir, ".pioenvs")
|
||||
for item in listdir(pioenvs_dir):
|
||||
assert isfile(join(pioenvs_dir, item, "firmware.elf"))
|
||||
# check .hex or .bin file
|
||||
bin_file = join(pioenvs_dir, item, "firmware.bin")
|
||||
hex_file = join(pioenvs_dir, item, "firmware.hex")
|
||||
if not isfile(bin_file):
|
||||
if not isfile(hex_file):
|
||||
pytest.fail("Missed firmware file")
|
||||
assert getsize(hex_file) > 0
|
||||
else:
|
||||
assert getsize(bin_file) > 0
|
||||
# check .hex or .bin files
|
||||
firmwares = []
|
||||
for ext in ("bin", "hex"):
|
||||
firmwares += glob(join(pioenvs_dir, item, "firmware*.%s" % ext))
|
||||
if not firmwares:
|
||||
pytest.fail("Missed firmware file")
|
||||
for firmware in firmwares:
|
||||
assert getsize(firmware) > 0
|
||||
|
Reference in New Issue
Block a user