Supplement examples with new boards
This commit is contained in:
@@ -29,10 +29,10 @@ How to build PlatformIO based project
|
||||
> platformio run --target upload
|
||||
|
||||
# Build specific environment
|
||||
> platformio run -e nodemcuv2
|
||||
> platformio run -e esp32dev
|
||||
|
||||
# Upload firmware for the specific environment
|
||||
> platformio run -e nodemcuv2 --target upload
|
||||
> platformio run -e esp32dev --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
||||
@@ -11,3 +11,13 @@
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = esp32dev
|
||||
|
||||
[env:quantum]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = quantum
|
||||
|
||||
[env:lolin32]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = lolin32
|
||||
|
||||
@@ -29,10 +29,10 @@ How to build PlatformIO based project
|
||||
> platformio run --target upload
|
||||
|
||||
# Build specific environment
|
||||
> platformio run -e nodemcuv2
|
||||
> platformio run -e quantum
|
||||
|
||||
# Upload firmware for the specific environment
|
||||
> platformio run -e nodemcuv2 --target upload
|
||||
> platformio run -e quantum --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
||||
@@ -7,7 +7,17 @@
|
||||
; Please visit documentation for the other options and examples
|
||||
; http://docs.platformio.org/en/stable/projectconf.html
|
||||
|
||||
[env:esp32dev]
|
||||
[env:nano32]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = esp32dev
|
||||
board = nano32
|
||||
|
||||
[env:espea32]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = espea32
|
||||
|
||||
[env:esp320]
|
||||
platform = espressif32
|
||||
framework = arduino
|
||||
board = esp320
|
||||
|
||||
@@ -45,4 +45,4 @@ void loop()
|
||||
|
||||
// Wait a bit before scanning again
|
||||
delay(5000);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.pioenvs
|
||||
.clang_complete
|
||||
.gcc-flags.json
|
||||
@@ -0,0 +1,65 @@
|
||||
# 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/stable/ci/index.html >
|
||||
#
|
||||
# Documentation:
|
||||
#
|
||||
# * Travis CI Embedded Builds with PlatformIO
|
||||
# < https://docs.travis-ci.com/user/integration/platformio/ >
|
||||
#
|
||||
# * PlatformIO integration with Travis CI
|
||||
# < http://docs.platformio.org/en/stable/ci/travis.html >
|
||||
#
|
||||
# * User Guide for `platformio ci` command
|
||||
# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
|
||||
#
|
||||
#
|
||||
# Please choice one of the following templates (proposed below) and uncomment
|
||||
# it (remove "# " before each line) or use own configuration according to the
|
||||
# Travis CI documentation (see above).
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Template #1: General project. Test it using existing `platformio.ini`.
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
#
|
||||
# script:
|
||||
# - platformio run
|
||||
|
||||
|
||||
#
|
||||
# Template #2: The project is intended to by used as a library with examples
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# env:
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/file.c
|
||||
# - PLATFORMIO_CI_SRC=examples/file.ino
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/directory
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
#
|
||||
# script:
|
||||
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
|
||||
@@ -0,0 +1,38 @@
|
||||
.. Copyright 2014-present PlatformIO <contact@platformio.org>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/stable/installation.html>`_
|
||||
2. Download `development platform with examples <https://github.com/platformio/platform-espressif8266/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platform-espressif32/examples/espidf-hello-world
|
||||
|
||||
# Build project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Build specific environment
|
||||
> platformio run -e esp32dev
|
||||
|
||||
# Upload firmware for the specific environment
|
||||
> platformio run -e esp32dev --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
This directory is intended for the project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link to executable file.
|
||||
|
||||
The source code of each library should be placed in separate directory, like
|
||||
"lib/private_lib/[here are source files]".
|
||||
|
||||
For example, see how can be organised `Foo` and `Bar` libraries:
|
||||
|
||||
|--lib
|
||||
| |--Bar
|
||||
| | |--docs
|
||||
| | |--examples
|
||||
| | |--src
|
||||
| | |- Bar.c
|
||||
| | |- Bar.h
|
||||
| |--Foo
|
||||
| | |- Foo.c
|
||||
| | |- Foo.h
|
||||
| |- readme.txt --> THIS FILE
|
||||
|- platformio.ini
|
||||
|--src
|
||||
|- main.c
|
||||
|
||||
Then in `src/main.c` you should use:
|
||||
|
||||
#include <Foo.h>
|
||||
#include <Bar.h>
|
||||
|
||||
// rest H/C/CPP code
|
||||
|
||||
PlatformIO will find your libraries automatically, configure preprocessor's
|
||||
include paths and build them.
|
||||
|
||||
See additional options for PlatformIO Library Dependency Finder `lib_*`:
|
||||
|
||||
http://docs.platformio.org/en/stable/projectconf.html#lib-install
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter, extra scripting
|
||||
; Upload options: custom port, speed and extra flags
|
||||
; Library options: dependencies, extra library storages
|
||||
;
|
||||
; Please visit documentation for the other options and examples
|
||||
; http://docs.platformio.org/en/stable/projectconf.html
|
||||
|
||||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = esp32dev
|
||||
|
||||
[env:quantum]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = quantum
|
||||
|
||||
[env:lolin32]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = lolin32
|
||||
@@ -0,0 +1,32 @@
|
||||
/* Hello World Example
|
||||
|
||||
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||
|
||||
Unless required by applicable law or agreed to in writing, this
|
||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_system.h"
|
||||
#include "nvs_flash.h"
|
||||
|
||||
void hello_task(void *pvParameter)
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
for (int i = 10; i >= 0; i--) {
|
||||
printf("Restarting in %d seconds...\n", i);
|
||||
vTaskDelay(1000 / portTICK_RATE_MS);
|
||||
}
|
||||
printf("Restarting now.\n");
|
||||
fflush(stdout);
|
||||
system_restart();
|
||||
}
|
||||
|
||||
void app_main()
|
||||
{
|
||||
nvs_flash_init();
|
||||
system_init();
|
||||
xTaskCreate(&hello_task, "hello_task", 2048, NULL, 5, NULL);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
*
|
||||
* Automatically generated file; DO NOT EDIT.
|
||||
* Espressif IoT Development Framework Configuration
|
||||
*
|
||||
*/
|
||||
#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0
|
||||
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHFREQ "80m"
|
||||
#define CONFIG_NEWLIB_STDOUT_ADDCR 1
|
||||
#define CONFIG_FREERTOS_PANIC_PRINT_REBOOT 1
|
||||
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
|
||||
#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1
|
||||
#define CONFIG_BT_RESERVE_DRAM 0x0
|
||||
#define CONFIG_LWIP_MAX_SOCKETS 4
|
||||
#define CONFIG_ULP_COPROC_RESERVE_MEM 0
|
||||
#define CONFIG_ESPTOOLPY_BAUD 921600
|
||||
#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-"
|
||||
#define CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX 0
|
||||
#define CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN 16384
|
||||
#define CONFIG_ESP32_ENABLE_STACK_WIFI 1
|
||||
#define CONFIG_LOG_BOOTLOADER_LEVEL_WARN 1
|
||||
#define CONFIG_MAIN_TASK_STACK_SIZE 4096
|
||||
#define CONFIG_ESPTOOLPY_FLASHMODE "dio"
|
||||
#define CONFIG_LOG_DEFAULT_LEVEL 3
|
||||
#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHMODE_DIO 1
|
||||
#define CONFIG_PYTHON "python"
|
||||
#define CONFIG_ESPTOOLPY_COMPRESSED 1
|
||||
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
|
||||
#define CONFIG_WIFI_SSID "myssid"
|
||||
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
|
||||
#define CONFIG_WIFI_ENABLED 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHFREQ_80M 1
|
||||
#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2048
|
||||
#define CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET 0x10000
|
||||
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 240
|
||||
#define CONFIG_FREERTOS_HZ 100
|
||||
#define CONFIG_LOG_COLORS 1
|
||||
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
|
||||
#define CONFIG_LOG_BOOTLOADER_LEVEL 2
|
||||
#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200
|
||||
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_240 1
|
||||
#define CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG 1
|
||||
#define CONFIG_FREERTOS_CORETIMER_0 1
|
||||
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
|
||||
#define CONFIG_FREERTOS_DEBUG_OCDAWARE 1
|
||||
#define CONFIG_WIFI_PASSWORD "myssid"
|
||||
#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32
|
||||
#define CONFIG_ESPTOOLPY_BAUD_921600B 1
|
||||
#define CONFIG_APP_OFFSET 0x10000
|
||||
#define CONFIG_MEMMAP_SMP 1
|
||||
#define CONFIG_ESPTOOLPY_PORT "/dev/ttyUSB0"
|
||||
@@ -20,10 +20,19 @@ How to build PlatformIO based project
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platform-espressif8266/examples/espidf-http-request
|
||||
> cd platform-espressif32/examples/espidf-http-request
|
||||
|
||||
# Process example project
|
||||
# Build project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Build specific environment
|
||||
> platformio run -e quantum
|
||||
|
||||
# Upload firmware for the specific environment
|
||||
> platformio run -e quantum --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
||||
@@ -7,8 +7,20 @@
|
||||
; Please visit documentation for the other options and examples
|
||||
; http://docs.platformio.org/en/stable/projectconf.html
|
||||
|
||||
[env:esp32dev]
|
||||
[env:nano32]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = esp32dev
|
||||
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
|
||||
board = nano32
|
||||
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
|
||||
|
||||
[env:espea32]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = espea32
|
||||
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
|
||||
|
||||
[env:esp320]
|
||||
platform = espressif32
|
||||
framework = espidf
|
||||
board = esp320
|
||||
build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\"
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
*
|
||||
* Automatically generated file; DO NOT EDIT.
|
||||
* Espressif IoT Development Framework Configuration
|
||||
*
|
||||
*/
|
||||
#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0
|
||||
#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHFREQ "80m"
|
||||
#define CONFIG_NEWLIB_STDOUT_ADDCR 1
|
||||
#define CONFIG_FREERTOS_PANIC_PRINT_REBOOT 1
|
||||
#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1
|
||||
#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1
|
||||
#define CONFIG_BT_RESERVE_DRAM 0x0
|
||||
#define CONFIG_LWIP_MAX_SOCKETS 4
|
||||
#define CONFIG_ULP_COPROC_RESERVE_MEM 0
|
||||
#define CONFIG_ESPTOOLPY_BAUD 921600
|
||||
#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-"
|
||||
#define CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX 0
|
||||
#define CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN 16384
|
||||
#define CONFIG_ESP32_ENABLE_STACK_WIFI 1
|
||||
#define CONFIG_LOG_BOOTLOADER_LEVEL_WARN 1
|
||||
#define CONFIG_MAIN_TASK_STACK_SIZE 4096
|
||||
#define CONFIG_ESPTOOLPY_FLASHMODE "dio"
|
||||
#define CONFIG_LOG_DEFAULT_LEVEL 3
|
||||
#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHMODE_DIO 1
|
||||
#define CONFIG_PYTHON "python"
|
||||
#define CONFIG_ESPTOOLPY_COMPRESSED 1
|
||||
#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv"
|
||||
#define CONFIG_PARTITION_TABLE_SINGLE_APP 1
|
||||
#define CONFIG_WIFI_ENABLED 1
|
||||
#define CONFIG_ESPTOOLPY_FLASHFREQ_80M 1
|
||||
#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2048
|
||||
#define CONFIG_PARTITION_TABLE_CUSTOM_APP_BIN_OFFSET 0x10000
|
||||
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 240
|
||||
#define CONFIG_FREERTOS_HZ 100
|
||||
#define CONFIG_LOG_COLORS 1
|
||||
#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1
|
||||
#define CONFIG_LOG_BOOTLOADER_LEVEL 2
|
||||
#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200
|
||||
#define CONFIG_ESP32_DEFAULT_CPU_FREQ_240 1
|
||||
#define CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START_JTAG 1
|
||||
#define CONFIG_FREERTOS_CORETIMER_0 1
|
||||
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
|
||||
#define CONFIG_FREERTOS_DEBUG_OCDAWARE 1
|
||||
#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32
|
||||
#define CONFIG_ESPTOOLPY_BAUD_921600B 1
|
||||
#define CONFIG_APP_OFFSET 0x10000
|
||||
#define CONFIG_MEMMAP_SMP 1
|
||||
#define CONFIG_ESPTOOLPY_PORT "/dev/ttyUSB0"
|
||||
Reference in New Issue
Block a user