-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial PR providing support for building and running Sming applications directly within Host environment (Linux / Windows). Implemented * Serial port driver emulation, based on gdbstub technique. Socket server support added to allow multiple terminal connection via telnet. * Flash memory emulated using backing file * Dummy gdbstub component (not required) * Task queues * Timers * Basic time functions * Network support for Linux and Windows Dummy modules * Digital * Interrupts Build * Use different build subdirectory for Linux/Windows (based on UNAME) * Add `HostTests` sample * Runs some tests against ArduinoJson6 and filesystem, asserts on failure * Remove related code from LiveDebug sample * Travis-CI * Move script into separate `build.sh` file * Host compilation requires more up to date GCC - conflict with `std::isnan` and `std::isinf` and stdc function declarations * Build and run `HostTests` sample * Appveyor * Add basic Host build File layout changes * Move `pwm.h` into `Components/drivers`, consistent with ESP-IDF * Add `esp_wifi` component Build conflicts * Replace `itoa` macro with function definition * Rename `random()` in WMath.cpp (name conflict) * `#undef` conflicting structure member names in `gdb_syscall.h` * Fix implementation of sprintf_P() Fix `IMPORT_FSTR` for Linux/Windows host builds * `.word` only emits 2 bytes on Linux, so use `.long` which is fine for all 32-bit machines * Windows (COFF format) requires different implemention * Use `.irom0.text`, not `.irom.text` (fixes 'section changed' warning)
- Loading branch information
Showing
192 changed files
with
7,703 additions
and
771 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
REM Windows build script | ||
|
||
SET SMING_HOME=%APPVEYOR_BUILD_FOLDER%\Sming | ||
|
||
IF "%SMING_ARCH%" == "Esp8266" SET ESP_HOME=c:\Espressif | ||
|
||
cd %SMING_HOME% | ||
gcc -v | ||
|
||
make help | ||
make list-config | ||
|
||
REM Compile the tools first | ||
make tools V=1 || goto :error | ||
|
||
cd %SMING_HOME% | ||
make STRICT=1 || goto :error | ||
|
||
|
||
if "%SMING_ARCH%" == "Host" ( | ||
|
||
REM Build a couple of basic applications | ||
make Basic_Serial || goto :error | ||
make Basic_ProgMem || goto :error | ||
|
||
REM Run basic tests | ||
cd %SMING_HOME%\..\tests\HostTests | ||
make flash || goto :error | ||
|
||
) ELSE ( | ||
|
||
make Basic_Blink V=1 || goto :error | ||
make Basic_Ssl || goto :error | ||
make Basic_SmartConfig || goto :error | ||
|
||
) | ||
|
||
goto :EOF | ||
|
||
:error | ||
echo Failed with error #%errorlevel%. | ||
exit /b %errorlevel% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
REM Windows install script | ||
|
||
goto :%SMING_ARCH% | ||
|
||
:Esp8266 | ||
|
||
IF "%SDK_VERSION%" == "1.5.0" ( | ||
choco install esp8266-udk --source https://www.myget.org/F/kireevco-chocolatey/ -y --no-progress | ||
mkdir c:\Espressif\utils\ESP8266 | ||
copy /b c:\Espressif\utils\memanalyzer.exe c:\Espressif\utils\ESP8266\memanalyzer.exe | ||
copy /b c:\Espressif\utils\esptool.exe c:\Espressif\utils\ESP8266\esptool.exe | ||
) ELSE ( | ||
choco install esp8266-udk --source https://www.myget.org/F/sming/ -y --no-progress | ||
) | ||
|
||
goto :EOF | ||
|
||
|
||
:Host | ||
|
||
REM Ensure MinGW installation is up to date | ||
mingw-get update | ||
mingw-get upgrade | ||
|
||
goto :EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -ex # exit with nonzero exit code if anything fails | ||
|
||
env | ||
unset SPIFFY | ||
unset ESPTOOL2 | ||
|
||
export SMING_HOME=$TRAVIS_BUILD_DIR/Sming | ||
|
||
# Check coding style | ||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
.travis/tools/clang/format-pr.sh; | ||
fi | ||
|
||
# Setup ARCH SDK paths | ||
if [ "$SMING_ARCH" == "Esp8266" ]; then | ||
export ESP_HOME=$TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
if [ "$SDK_VERSION" == "3.0.0" ]; then | ||
export SDK_BASE=$SMING_HOME/third-party/ESP8266_NONOS_SDK | ||
fi | ||
|
||
export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/ | ||
fi | ||
|
||
# Full compile checks please | ||
export STRICT=1 | ||
|
||
# Diagnostic info | ||
cd $SMING_HOME | ||
make help | ||
make list-config | ||
|
||
# Build the framework | ||
make | ||
|
||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
make Basic_Blink Basic_DateTime Basic_Delegates Basic_Interrupts Basic_ProgMem Basic_Serial Basic_Servo LiveDebug DEBUG_VERBOSE_LEVEL=3 | ||
cd ../tests/HostTests | ||
make flash | ||
else | ||
make samples | ||
make clean samples-clean | ||
make ENABLE_CUSTOM_HEAP=1 STRICT=1 | ||
make Basic_Blink ENABLE_CUSTOM_HEAP=1 DEBUG_VERBOSE_LEVEL=3 | ||
|
||
make dist-clean | ||
make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2 STRICT=1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -ex # exit with nonzero exit code if anything fails | ||
|
||
if [ "$TRAVIS_BUILD_STAGE_NAME" == "Test" ]; then | ||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-6.0 100 | ||
fi | ||
|
||
if [ "$SMING_ARCH" == "Esp8266" ]; then | ||
if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then | ||
SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip" | ||
fi | ||
|
||
if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz" | ||
fi | ||
|
||
mkdir -p $TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
|
||
if [ "$SDK_VERSION" == "1.5.0" ]; then | ||
wget --no-verbose https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME} | ||
bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk | ||
fi | ||
|
||
if [ "$SDK_VERSION" != "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
wget --no-verbose https://github.com/nodemcu/nodemcu-firmware/raw/2d958750b56fc60297f564b4ec303e47928b5927/tools/esp-open-sdk.tar.xz | ||
tar -Jxvf esp-open-sdk.tar.xz; ln -s $(pwd)/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. | ||
fi | ||
|
||
if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then | ||
wget --no-verbose https://www.espressif.com/sites/default/files/sdks/esp8266_nonos_sdk_v2.0.0_16_08_10.zip -O sdk.zip | ||
unzip sdk.zip | ||
ln -s $(pwd)/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk | ||
fi | ||
fi # Esp8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <pwm.h> | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif |
12 changes: 12 additions & 0 deletions
12
Sming/Arch/Esp8266/Components/esp_wifi/include/esp_smartconfig.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#if defined (__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <smartconfig.h> | ||
|
||
#if defined (__cplusplus) | ||
} | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <user_interface.h> | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.