nf-interpreter
nf-interpreter copied to clipboard
Add support for other ESP32 ethernet boards
Description
This adds support for the following Ethernet based ESP32 boards.
- ESP32_ETHERNET_KIT_1.2 (Espressif)
- ESP32_WT32_ETH01
- ESP32_WESP32
Change the Ethernet configuration so as to support new boards and other PHY. Changed config options from ETH_ETHERNET_PHY to ETH_ETHERNET_INTERFACE to allow phy names or SPI to be used. spi can be configured but spi settings currently fixed(later PR). Did try a SPI W5500 module which seemed to startup but didn't get IP.(Leave that for now)
Found we could programmatically set the PHY clocking so removed setting of clocks from sdkconfig in binutils.Esp32.cmake. Also found the IDF files were being changed by binutils so if 2 builds used same config file you could get both changes in there. So now restore original contents after calling starting IDF build.
Changed all IDF configs to comment out clocking and comment out CONFIG_ETH_USE_OPENETH
Setup CmakePresets for new boards. Add new boards to CmakeUserPresets.TEMPLATE.json plus versions with Bluetooth. Version with V3 cpu have Bluetooth by default.
Fixed an issue with DHCP which seems to happen randomly on these boards. Some firmware versions seemed to work but next wouldn't. The DHCP was being started before the Ethernet interface was running. We started DHCP direcvtly after installing but when the Ethernet Started event is fired the DHCP is automatically started again by event handler in IDF. (lwip_sockets.cpp). Removed the DHCP starting directly after installing driver. Seemed to work ok with ESP32 on wireless. Should be tested with STM32.
Have not added new boards to Azure pipe line at the moment.
Motivation and Context
Add other Ethernet boards Fix DHCP issue
How Has This Been Tested?
Boards tested locally
- Olimex
- Ethernet Kit
- WT32_ETH01
- Wesp32
LilyGo board needs to be tested (@Ellerbach )
Types of changes
- [ ] Improvement (non-breaking change that improves a feature, code or algorithm)
- [x] Bug fix (non-breaking change which fixes an issue with code or algorithm)
- [x] New feature (non-breaking change which adds functionality to code)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Config and build (change in the configuration and build system, has no impact on code or features)
- [ ] Dev Containers (changes related with Dev Containers, has no impact on code or features)
- [ ] Dependencies (update dependencies and changes associated, has no impact on code or features)
- [ ] Documentation (changes or updates in the documentation, has no impact on code or features)
Checklist
- [x] My code follows the code style of this project (only if there are changes in source code).
- [ ] My changes require an update to the documentation (there are changes that require the docs website to be updated).
- [ ] I have updated the documentation accordingly (the changes require an update on the docs in this repo).
- [x] I have read the CONTRIBUTING document.
- [x] I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
@AdrianSoundy I've fixed the checklist for you. FYI, the correct format is [x], no spaces inside brackets.
@AdrianSoundy I've submitted a PR against your fork with those improvements on replacing the template with a CMake macro. Please review.
@AdrianSoundy FYI: I've just rebased this AdrianSoundy/nf-interpreter#71. Please review when you have the opportunity so we can get this one merged.
Issue with non Ethernet builds as still including NF_ESP32_Ethernet.cpp Will look in to it.
@josesimoes Are you happy with merging this ?