port to STM32 and W5500 #62
Replies: 9 comments 21 replies
-
Thanks for testing the waters here. I've made a bunch of changes that should address the issues you saw during porting:
In other words, all the issues should be solved and the library should be able to be used out-of-the-box with STM32. I tested with I also wrote my own W5500 driver that I'll share in the near future. Other changes of note:
Note: Random numbers aren't just used for crypto or security. They're for these things (non-exhaustive list):
|
Beta Was this translation helpful? Give feedback.
-
Hello. what a nice surprise. I am glad I inspired you. I am working on integrating a driver for ESP32 as WiFi adapter. Espressif has a firmware for ESP32 which makes it an MAC level WiFi adapter. Arduino made a driver for the host side for their new Portenta C33 board. It has a form of an Arduino library and I extracted it from their Renesas Core into a stand-alone repository and I made it compatible with any ARM Arduino (originally it used Reneasas SDK for SPI, delay and pin manipulation). Now I finished a first version of integrating the ESPHost library int the RP2040 core, which uses LwIP from RP2040 SDK and has WiFi only for Pico W on-board WiFi. The maintainer added support for wired Ethernet with W5500 and enc28j60, but there was no WiFi option for other RP2040 boards . |
Beta Was this translation helpful? Give feedback.
-
I just pushed the latest
(Use the latest; the earlier versions are historical but only slightly different.) I'm sure there's room for improvement in the design and in the W5500 driver, but I think it's a good start for:
Yes, correct. (Well, it should, but I haven't yet tested with a Teensy 4.0.) |
Beta Was this translation helpful? Give feedback.
-
The upcoming 0.27.0 release will contain the new driver. Note that it’s now in |
Beta Was this translation helpful? Give feedback.
-
sorry, I still work on WiFi drivers in Pico Core when I have time for Arduino. |
Beta Was this translation helpful? Give feedback.
-
Oh, I was just adding the detail that I added my W5500 driver to the library. This is just informational; there’s no need or expectation to do anything on your end. Note also that I added a new driver interface API. If I had some hardware, the time, and the will, I could add a driver for the ENC28J60, I suppose. Who would use it? Side question: If you have the time and the willingness, would you be willing to test the latest on an STM32 with the new W5500 driver? Simply uncomment the line that defines |
Beta Was this translation helpful? Give feedback.
-
in |
Beta Was this translation helpful? Give feedback.
-
just for fun I attempted to compile the library with the Arduino SAMD core. but they are on C++ 11 version of arm gcc, so no luck. I was lucky then choosing the STM32 Core |
Beta Was this translation helpful? Give feedback.
-
Note: I’ve been making efforts to keep the |
Beta Was this translation helpful? Give feedback.
-
Hi Shawn
You know I do a research on Arduino networking libraries. But I don't have all the specific hardware so I try to run the LwIP based libraries on boards I have. I made the Ethernet library for Portenta C33 Eth peripheral run on an Uno R4 with an Ethernet shield. I adopted the hw interfacing functions to a driver for W5500 from esp8266 Arduino (LwIP too). Then I used the same trick with the STM32Ethernet library, which was written for a STM32 MCU with an Eth peripheral. I used Black Pill, a board with STM32 F411 MCU without the Eth peripheral.
And then I ported your QNEthernet to the STM32 core and W5500 and I tested it on the same Black Pill with a W550 module. Everything I wanted to test worked.
The port to STM32:
#include <imxrt.h>
and#include <sys/time.h>
. they seem unused.#include <core_pins.h>
. seems unused too-DDMAMEM="" -DFLASHMEM=""
For the W5500 port I wrote lwip_w5500.cpp. I attach it. All the s_netif and netif lines are duplicated from lwip_t41.c. Maybe do a compare. What was possible I left in place.
For the w5500 I had to change lwipopts.h. Enable the checksums, because the W5500 doesn't do them and set ETH_PAD_SIZE to 0.
lwip_w5500.cpp
The yield function I used instead of EventResponder
Beta Was this translation helpful? Give feedback.
All reactions