forked from platformio/platformio-core
Merge pull request #169 from valeros/develop
Add support for ESP8266 // Resolve #119
This commit is contained in:
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);
|
||||||
|
}
|
@ -16,8 +16,7 @@
|
|||||||
"maximum_size": 524288,
|
"maximum_size": 524288,
|
||||||
"protocol": "arduino",
|
"protocol": "arduino",
|
||||||
"require_upload_port" : true,
|
"require_upload_port" : true,
|
||||||
"speed": 115200,
|
"speed": 115200
|
||||||
"wait_for_upload_port": true
|
|
||||||
},
|
},
|
||||||
"url": "https://nurdspace.nl/ESP8266",
|
"url": "https://nurdspace.nl/ESP8266",
|
||||||
"vendor": "Espressif"
|
"vendor": "Espressif"
|
||||||
|
@ -493,5 +493,33 @@
|
|||||||
},
|
},
|
||||||
"url": "http://www.bq.com/gb/products/zum.html",
|
"url": "http://www.bq.com/gb/products/zum.html",
|
||||||
"vendor": "BQ"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,6 @@ env.Replace(
|
|||||||
"-Wl,-static"
|
"-Wl,-static"
|
||||||
],
|
],
|
||||||
|
|
||||||
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")],
|
|
||||||
LIBS=["hal", "phy", "net80211", "lwip", "wpa", "main", "pp", "c", "gcc"],
|
|
||||||
|
|
||||||
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
|
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
|
||||||
|
|
||||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"),
|
UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"),
|
||||||
@ -104,6 +101,25 @@ env.Append(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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: Build executable and linkable firmware
|
||||||
#
|
#
|
||||||
@ -121,6 +137,7 @@ else:
|
|||||||
[join("$BUILD_DIR", "firmware_00000"),
|
[join("$BUILD_DIR", "firmware_00000"),
|
||||||
join("$BUILD_DIR", "firmware_40000")], target_elf)
|
join("$BUILD_DIR", "firmware_40000")], target_elf)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Target: Print binary size
|
# Target: Print binary size
|
||||||
#
|
#
|
||||||
|
@ -44,7 +44,10 @@ elif env.get("PLATFORM") == "timsp430":
|
|||||||
)
|
)
|
||||||
elif env.get("PLATFORM") == "espressif":
|
elif env.get("PLATFORM") == "espressif":
|
||||||
env.Prepend(
|
env.Prepend(
|
||||||
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")]
|
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)
|
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
|
||||||
|
Reference in New Issue
Block a user