-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arduino-esp32 2.0.x support #536
Merged
Merged
Changes from 151 commits
Commits
Show all changes
153 commits
Select commit
Hold shift + click to select a range
f7a684f
Exclude gtest dependent file from arduino lib
atanisoft 54f0649
Add required stdint.h header for esp32 endian.h
atanisoft 9fd56ea
WiFi updates for IDF v4.0+
atanisoft 894489b
Initial pass at select() support for IDF v4.0+
atanisoft 1832209
ESP-IDF based GPIO
atanisoft 8eba514
Add arduino-esp32 2.0.0
atanisoft 565033f
Build arduino platforms in parallel
atanisoft 1a9ab7e
Restrict Esp32HardwareCan to only ESP32
atanisoft a93d476
Mark Esp32HardwareCan as deprecated
atanisoft 552756b
Unify the IDF v4.0+ and v3.x select() VFS impl
atanisoft 0d2272a
Further consolidation of IDF v3.x and IDF v4.x implementation for sel…
atanisoft cd6a401
Correct portYIELD_FROM_ISR call argument
atanisoft 67c276e
Fix ESP32-C3 IS_GPIO_OUTPUT macro.
atanisoft afae71f
Add ESP32-S2 and ESP32-C3 temporary support for __atomic_exchange_1.
atanisoft ed8426d
Squash a few warnings for overriding defined values
atanisoft 8f14daa
Add feature flag for HubDeviceNonBlock/HubDeviceSelect on SimpleCanSt…
atanisoft eb05f4e
Ensure the ESP32 variants used the printf variant of HASSERT/DIE
atanisoft f56b501
Add note for ESP32-C3 flash pins
atanisoft 63f5e61
Adjust CpuLoad to work on single or dual core ESP32 chips
atanisoft b18adac
Adding WS2812 LED GPIO wrapper using the ESP32 RMT peripheral
atanisoft 538f4c9
Expose TWAI driver (IDF v4.3+ only)
atanisoft c306aae
Initial ESP32-C3 examples
atanisoft d2b5ef9
Correct compilation step for esp32 variants
atanisoft 138c21f
Exclude TWAI from IDF v4.2 and earlier.
atanisoft 3e42e21
Add temporary CAN -> TWAI adapter to work around issues with the IDF …
atanisoft 9fba485
Version restrict Esp32WS2812 to IDF v4.3+
atanisoft 3043c2f
Disable CAN and TWAI by default.
atanisoft 1c61bf1
Esp32 Bootloader support (TWAI only)
atanisoft 3ce57c7
Add ESP32-S2 examples and update C3 examples to include variant in SNIP
atanisoft d9102f2
Adjust timing of WS2812 and add class docs
atanisoft 071d768
Add concurrency guard to limit concurrent ESP32 dev builds.
atanisoft 2ecd0cb
Adding utility class method for SoC info.
atanisoft 71394a9
add log statements in ISR to debug IDF issue 5604 on ESP32-S2 WROVER …
atanisoft 339a4c8
Update ESP32-C3 and ESP32-S2 CAN load test apps
atanisoft a970333
Add SoC info to ESP32IOBoard
atanisoft e609d1a
Name input/output groups
atanisoft 03833e5
Add TWAI based bootloader to ESP32-S2/C3 IO Board
atanisoft da38c51
Correct path to rom/rtc.h for IDF v3.x
atanisoft 7bb00a8
test matrix build for esp32 dev
atanisoft c2233fa
try num 2 for matrix build
atanisoft 6054031
try num 3
atanisoft 0eeb6a9
try num 4
atanisoft 777c540
try num 5
atanisoft 175bb8e
fix rom/rtc.h logic
atanisoft 894985c
version mask IDF v4.x APIs
atanisoft a130e80
Adjust MultiConfiguredPC to work on the Arduino
atanisoft 2064f30
WiFi updates for IDF v4.0+
atanisoft 13a3c48
Converting TWAI stats task to be a watchdog and stats task.
atanisoft eaa5383
Add DummyGPIO to Arduino tree
atanisoft 6b43951
Add check for CONFIG_VFS_SUPPORT_SELECT to protect select() usages wi…
atanisoft 2c54a4c
Update documentation in examples and expose TWAI for ESP32IOBoard
atanisoft 447bd7b
Fix variable reference from wifi_manager_task.
atanisoft 865617d
Fix ESP32S2CanLoadTest example
atanisoft 901f0ad
Cleanup headers in CanLoadTest examples.
atanisoft a15319e
Add missing include
atanisoft 359035e
Simplify ESP32 OSSelectWakeup code to only use exceptfds since that i…
atanisoft 9f636fe
Updating TWAI driver to use LOG(X..) instead of ESP_LOGX since logs a…
atanisoft 534153e
Allow log_output override for ESP32
atanisoft 09aca29
Updates to the C3 and S2 examples to expose TWAI select usage and pri…
atanisoft 6d2db07
Add missing ESP32 checks for ESP-IDF usage
atanisoft 947ed2a
Correct ESP32-C3/S3 chip id name.
atanisoft 81e0f0f
remove unused variable
atanisoft ecdde30
Add ESP32-PICO-V3 and technical reference links
atanisoft 0374e27
Removed blocking mode from documentation, clarified on the requiremen…
atanisoft d26056d
Correct documentation note for the on-board LED
atanisoft a06348b
fix missing comma and add chip_id to log statements
atanisoft d938e7b
init variable to correct IDF build failure
atanisoft e3a6c25
use esp_rom_gpio APIs
atanisoft a183495
Split out create_config_descriptor_xml so it can be used without ardu…
atanisoft cd4f737
Update libify.sh
atanisoft 6bea7e1
Add shutdown method for the GcTcpHub
atanisoft bdbdd6c
Add ServoConsumer support for arduino/ESP32
atanisoft ad41952
Add code to prevent overflow when dividing deadline_nsec.
atanisoft 59f37c0
Add stack_malloc support since arduino-esp32 2.0 enables FreeRTOS sta…
atanisoft b881a5b
Move to using the GcTcpHub from SimpleStackBase rather than maintain …
atanisoft 30002bf
Adjust CpuLoad tracking after more extensive testing
atanisoft 3c853d0
Merge branch 'md-esp20' of github.com:bakerstu/openmrn into md-esp20
atanisoft c53cb01
Adding Esp32Ledc PWM signal generator
atanisoft 87779b8
Move Esp32Ledc to IDF v4.3+
atanisoft 61a1e0f
IDF version check in cxx
atanisoft 741b6c5
Merge branch 'master' into md-esp20
atanisoft 96ef7da
Add LocalTrackIf to arduino build (feature flag gated)
atanisoft 34b21d8
Make Esp32SocInfo always check PRO_CPU and clarify comment as to why
atanisoft e0ec8f5
Remove "have_hub" since it is not used now.
atanisoft dc8b0a4
Remove ESP32 customizations for libatomic as they are now implemented…
atanisoft 7682b23
Clarify comments further on Esp32SocInfo
atanisoft aebb477
Simplify ESP32 Atomic to use new macros from ESP-IDF v3.3
atanisoft 7060668
Allow defaulting and overriding constants with expansion
atanisoft fab0e84
Add logging for GPIO initialization
atanisoft 2897125
Move runtime TWAI statistics to a dedicated structure to avoid incorr…
atanisoft a4df2ad
Add dcc_constants and RailComDriver files to arduino build
atanisoft 758a4f3
Add SNTP callback registration
atanisoft 7859564
Merge branch 'master' into md-esp20
atanisoft c8f575b
1. Add option to disable both Hub and Uplink.
atanisoft d937bc5
merge master into md-esp20
atanisoft d191456
Disable socket fstat validation for ESP32 due to IDF not implementing…
atanisoft 5b47f20
Add ADC_PIN wrapper for initializing/sampling ADC inputs.
atanisoft 45e5cd3
Add locking and only advance TX queue upon success TX.
atanisoft fb81429
Move Esp32WiFiManager to use a StateFlow pattern and drop the extra t…
atanisoft 9aee231
Fix typo in PSRAM details.
atanisoft 5e4c644
Merge branch 'master' into md-esp20
atanisoft c4b4621
Comment esp32-dev since 2.0.0 has been released.
atanisoft 1aad092
Workaround for broken endian.h stdint.h dependency on esp32
atanisoft b87a974
Add minimal support for ESP32-H2 SoC
atanisoft c126c0b
Only update WiFi config if minimums are not met
atanisoft f42c6c7
Add documentation to esp32 bootloader code and cleanup examples
atanisoft 70271db
Fix default parameter for softap name/pw and reduce executor priority…
atanisoft 94ba080
Update docs for pin assignments
atanisoft 8a24b79
Update reset reason text based on latest IDF
atanisoft 8184d30
Start Esp32WiFiManager Executor pinned to core on multi-core SoC
atanisoft afb3bbb
Expose method for retrievial of TWAI stats
atanisoft 86fa0aa
ESP32-S3 support
atanisoft 6241644
cleanup in VFS start_select functions, nfds will always be at least one.
atanisoft dcf3c07
Split ESP32-S2 and ESP32-S3 GpioInputPin checks.
atanisoft 0544953
IDF v5+ support
atanisoft 1fcd79c
Move rtc.h include to header
atanisoft b2adaaf
Add missing sdkconfig.h include
atanisoft 597e651
Merge branch 'master' into md-esp20
atanisoft 977313d
Renamed ESP8684 -> ESP32-C2 per IDF v5 rename.
atanisoft b39a326
Merge branch 'master' into md-esp20
atanisoft f56824e
Recent updates from OpenMRNIDF
atanisoft 2a04a8f
remove w/a for https://github.com/espressif/esp-idf/issues/7498
atanisoft e3c7a97
arduino-esp32 1.0.x bug fix for rom/gpio.h reference
atanisoft d438180
Style fix for CDIXMLGenerator.hxx
atanisoft 83017bb
adjust can_ioctl.h includes for arduino.
atanisoft abed301
uniquely name the GcTcpHub listener.
atanisoft d71a3db
Adjust WS2812 RMT channel details for ESP32-S3
atanisoft 0f6173c
Feedback updates:
atanisoft d461651
Fix variable reference
atanisoft 3af9acd
Esp32Ledc documentation and code updates from feedback.
atanisoft 093c4c9
Remove IO reference from factory_reset
atanisoft 88bed80
Fix HASSERT validations.
atanisoft df601b1
Update IO board examples with note on OTA partition requirement.
atanisoft c595eba
Increase SNIPClient default timeout by 500ms.
atanisoft e5aba8f
Switch ADC API due to ESP32-C3 not supporting per-channel ADC bit width.
atanisoft 0dff897
Merge branch 'master' into md-esp20
atanisoft f7096b6
Add core dump conversion utility.
atanisoft e0081ec
Silence compiler warnings in Esp32Ledc
atanisoft 4642143
Add override for mdns_unpublish API
atanisoft c2e7b6a
Merge branch 'master' into md-esp20
atanisoft 07a7c80
Merge branch 'master' into md-esp20
atanisoft 187cc34
Move includes outside namespace to prevent unintentional namespace bo…
atanisoft 52b9de0
Merge branch 'master' into md-esp20
atanisoft 55b2331
Merge branch 'master' into md-esp20
atanisoft a38a53d
Update based on OpenMRNIDF edits
atanisoft e68ea8b
Fix case where Esp32WiFiManager was not correctly cleaning up the pre…
atanisoft 100f4b4
Merge branch 'master' into md-esp20
balazsracz a647db9
Merge branch 'master' into md-esp20
balazsracz 87050e8
Remove Esp32WS2812 in favor of using led_strip IDF component or Ardui…
atanisoft 06cb5f1
Sync from OpenMRNIDF
atanisoft f98aa20
remove sdkconfig reference.
atanisoft 2514cb0
Fixes compile error under linux.
balazsracz ad6459c
Merge branch 'master' into md-esp20
balazsracz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -16,8 +16,8 @@ on: | |
- '**ArduinoBuild.yml' | ||
pull_request: | ||
jobs: | ||
build: | ||
name: Build ESP32 examples | ||
build-stm32: | ||
name: Build Arduino STM32 examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -29,21 +29,55 @@ jobs: | |
$GITHUB_WORKSPACE/arduino/libify.sh $HOME/Arduino/libraries/OpenMRNLite $GITHUB_WORKSPACE -f -l | ||
rm -f $GITHUB_WORKSPACE/arduino/examples/Stm*/build_opt.h | ||
|
||
- name: Compile all STM32 examples | ||
uses: ArminJo/arduino-test-compile@v3.0.0 | ||
- name: Compile STM32 examples | ||
uses: ArminJo/arduino-test-compile@v3 | ||
with: | ||
platform-url: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json | ||
arduino-board-fqbn: STM32:stm32:Nucleo_144:pnum=NUCLEO_F767ZI,upload_method=MassStorage,xserial=generic,usb=CDCgen,xusb=FS,opt=osstd,rtlib=nano | ||
sketch-names: Stm32*.ino | ||
build-properties: '{ "All": "-DHAL_CAN_MODULE_ENABLED" }' | ||
debug-compile: true | ||
|
||
- name: Compile all ESP32 examples | ||
uses: ArminJo/[email protected] | ||
|
||
build-esp32: | ||
name: Build Arduino ${{ matrix.target }} examples | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 2 | ||
matrix: | ||
target: [esp32, esp32c3, esp32s2] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Generate OpenMRNLite library | ||
run: | | ||
mkdir --parents $HOME/Arduino/libraries/OpenMRNLite | ||
$GITHUB_WORKSPACE/arduino/libify.sh $HOME/Arduino/libraries/OpenMRNLite $GITHUB_WORKSPACE -f -l | ||
rm -f $GITHUB_WORKSPACE/arduino/examples/Stm*/build_opt.h | ||
|
||
- name: Compile ESP32 examples | ||
uses: ArminJo/arduino-test-compile@v3 | ||
with: | ||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | ||
arduino-board-fqbn: esp32:esp32:node32s | ||
sketch-names: ESP*.ino | ||
sketch-names: ESP32CanLoadTest.ino,ESP32IOBoard.ino,ESP32SerialBridge.ino,ESP32WifiCanBridge.ino | ||
debug-compile: true | ||
if: ${{ matrix.target == 'esp32' }} | ||
|
||
|
||
- name: Compile ESP32-C3 examples | ||
uses: ArminJo/arduino-test-compile@v3 | ||
with: | ||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | ||
arduino-board-fqbn: esp32:esp32:esp32c3 | ||
sketch-names: ESP32C3CanLoadTest.ino,ESP32C3IOBoard.ino | ||
debug-compile: true | ||
if: ${{ matrix.target == 'esp32c3' }} | ||
|
||
- name: Compile ESP32-S2 examples | ||
uses: ArminJo/arduino-test-compile@v3 | ||
with: | ||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | ||
arduino-board-fqbn: esp32:esp32:esp32s2 | ||
sketch-names: ESP32S2CanLoadTest.ino,ESP32S2IOBoard.ino | ||
debug-compile: true | ||
if: ${{ matrix.target == 'esp32s2' }} |
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,126 @@ | ||
/** \copyright | ||
* Copyright (c) 2018, Balazs Racz | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* \file CDIXMLGenerator.hxx | ||
* | ||
* Standalone CDI XML generation class. | ||
* | ||
* @author Balazs Racz, Mike Dunston | ||
* @date 24 July 2018 | ||
*/ | ||
|
||
#ifndef _CDIXMLGENERATOR_HXX_ | ||
#define _CDIXMLGENERATOR_HXX_ | ||
|
||
#include "openlcb/SimpleStack.hxx" | ||
#include "utils/FileUtils.hxx" | ||
|
||
/// Standalone utility class for generating the XML representation of the node | ||
/// configuration structure. This is primarily used in Arduino environments. | ||
class CDIXMLGenerator | ||
{ | ||
public: | ||
/// Creates the XML representation of the configuration structure and saves | ||
/// it to a file on the filesystem. Must be called after SPIFFS.begin() but | ||
/// before calling the {\link create_config_file_if_needed} method. The | ||
/// config file will be re-written whenever there was a change in the | ||
/// contents. It is also necessary to declare the static compiled-in CDI to | ||
/// be empty: | ||
/// ``` | ||
/// namespace openlcb { | ||
/// // This will stop openlcb from exporting the CDI memory space | ||
/// // upon start. | ||
/// extern const char CDI_DATA[] = ""; | ||
/// } // namespace openlcb | ||
/// ``` | ||
/// @param cfg is the global configuration instance (usually called cfg). | ||
/// @param filename is where the xml file can be stored on the | ||
/// filesystem. For example "/spiffs/cdi.xml". | ||
/// @return true if the configuration xml file was modified by this method, | ||
/// false if the file was already up-to-date. | ||
template <class ConfigDef> | ||
static bool create_config_descriptor_xml( | ||
const ConfigDef &config, const char *filename, | ||
openlcb::SimpleStackBase *stack = nullptr) | ||
{ | ||
string cdi_string; | ||
ConfigDef cfg(config.offset()); | ||
cfg.config_renderer().render_cdi(&cdi_string); | ||
|
||
cdi_string += '\0'; | ||
|
||
bool need_write = false; | ||
LOG(INFO, "[CDI] Checking %s...", filename); | ||
FILE *ff = fopen(filename, "rb"); | ||
if (!ff) | ||
{ | ||
LOG(INFO, "[CDI] File %s does not exist", filename); | ||
need_write = true; | ||
} | ||
else | ||
{ | ||
fclose(ff); | ||
string current_str = read_file_to_string(filename); | ||
if (current_str != cdi_string) | ||
{ | ||
LOG(INFO, "[CDI] File %s is not up-to-date", filename); | ||
need_write = true; | ||
} | ||
else | ||
{ | ||
LOG(INFO, "[CDI] File %s appears up-to-date (len %u vs %u)", | ||
filename, current_str.size(), cdi_string.size()); | ||
} | ||
} | ||
if (need_write) | ||
{ | ||
LOG(INFO, "[CDI] Updating %s (len %u)", filename, | ||
cdi_string.size()); | ||
write_string_to_file(filename, cdi_string); | ||
} | ||
|
||
if (stack) | ||
{ | ||
LOG(INFO, "[CDI] Registering CDI with stack..."); | ||
// Creates list of event IDs for factory reset. | ||
auto *v = new vector<uint16_t>(); | ||
cfg.handle_events([v](unsigned o) { v->push_back(o); }); | ||
v->push_back(0); | ||
stack->set_event_offsets(v); | ||
// We leak v because it has to stay alive for the entire lifetime | ||
// of the stack. | ||
|
||
// Add the file memory space to the stack. | ||
openlcb::MemorySpace *space = | ||
new openlcb::ROFileMemorySpace(filename); | ||
stack->memory_config_handler()->registry()->insert( | ||
stack->node(), openlcb::MemoryConfigDefs::SPACE_CDI, space); | ||
} | ||
return need_write; | ||
} | ||
}; | ||
|
||
#endif // _CDIXMLGENERATOR_HXX_ |
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 @@ | ||
wifi_params.cpp |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing documentation of the "stack" variable. Also add to the docs that this method also exports the memory space if stack is specified.