The W5300 TOE examples use W5300 TOE Shield - ethernet I/O shield compatible with STM32 Nucleo-144 board built on WIZnet's W5300ethernet chip, and STM32 Nucleo-144 board.
STM32 Nucleo-144 boards support the list below.
And W5300 TOE Examples support two IDEs.
※ Please select and use the IDE according to your dev. environment.
Description :
- ARDUINO W5300: INO-based example implemented using ARDUINO IDE.
- PlatformIO W5300: CPP-based example implemented using PlatformIO.
- ARDUINO for STM32 Project
Reference: https://github.com/stm32duino/Arduino_Core_STM32/blob/main/README.md This repo is available as a package usable with Arduino Boards Manager.
Add this link in the "Additional Boards Managers URLs" field: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.jso
- Replace existing Ethernet and FMC library with this W5300 library path:
C:\Users_YOUR_NAME_\AppData\Local\Arduino15\libraries
- PlatformIO for STM32 Project
Make PlatformIO Project for STM32F4 Series (for example: select NUCLEO-F429ZI board).
- Make PlatformIO Project for STM32F4 Series (for example: select NUCLEO-F429ZI board).
Follow the README in the PlatformIO's directory and folder.
- Follow the README in the PlatformIO's directory and folder.
This library have to locate in lib path.
- This library have to locate in lib path.
W5300-TOE-ARDUINO
┃
┣ Etherent
┃ ┣ example
┃ ┃ ┣ LinkStatus
┃ ┃ ┣ ChatServer
┃ ┃ ┣ AdvancedChatServer
┃ ┃ ┣ WebServer
┃ ┃ ┣ BarometricPressureWebServer
┃ ┃ ┗ PlatformIO_CPP_Examples (CPP Example files for PlatformIO)
┃ ┃
┃ ┗ src (W5300 ioLibrary for ARDUINO)
┗ FMC
┃ ┗ (STM32F's FMC Register Setup files)
┗ Static
┣ documents
┗ images
Hardware requirementsThe ethernet examples use NUCLEO-F429ZI build on STM32 MCU with WIZnet's [W5300][link-w5300] ethernet chip. If you use other STM board, supported board of STMicroelectronics micropython in [LIST][link-suppoted_stm] and check that the board supports FMC 16bit data.
Pin DiagramSTM32F429ZI
This document is based on STM32F429ZI. If you use other STM board, Please edit it to your HW configuration. 📷
- FMC Data pin (0-8 or 0-16)
- FMC Address pin (0-10)
- FMC Control GPIO pin (NE, NWE, NOE)
- WIZChip Control GPIO pin (INT, RST)
- UART3 pin(connect to ST-LINK) -- Be changed for use the FMC on the Nucleoboard. Pin D8,D9 -> Pin C10,C11
The ST-LINK pin was changed due to overlapping use of the FMC(Flexible Memory controller) data pin to control the W5300 built in the W5300 TOE Shield and the ST-LINK pin of the STM32 Nucleo-144 board.
- STLK_RX[STM32F103CBT6_PA3] : PD8 → PC10
- STLK_TX[STM32F103CBT6_PA2] : PD9 → PC11
Therefore, in order to use the ST-LINK of the STM32 Nucleo-144 board, minor settings are required for the W5300 TOE Shield and STM32 Nucleo-144 board.
- Remove SB5 and SB6 from the top of the STM32 Nucleo-144 board.
- With the W5300 TOE Shield and STM32 Nucleo-144 board combined, connect PC10, PC11 of the W5300 TOE Shield and CN5 TX, RX of the top of the STM32 Nucleo-144 board with jumper cables.
- W5300 TOE Shield : PC10 - STM32 Nucleo-144 board : RX
- W5300 TOE Shield : PC11 - STM32 Nucleo-144 board : TX
- Modify STM32 packages' variants code for Serial
ARDUINO:"C:\Users\Eric\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\variants\STM32F4xx\F427Z(G-I)T_F429ZET_F429Z(G-I)(T-Y)_F437Z(G-I)T_F439Z(G-I)(T-Y)"
PlatformIO: "C:\Users_YOUR_NAME_\.platformio\packages\framework-arduinoststm32\variants\STM32F4xx\F427Z(G-I)T_F429ZET_F429Z(G-I)(T-Y)_F437Z(G-I)T_F439Z(G-I)(T-Y)\variant_NUCLEO_F429ZI.h"
#define PIN_SERIAL_RX PC11
#define PIN_SERIAL_TX PC10
The ARDUINO an PlatformIO(built-in VSCode) support the serial monitor. So you need not prepare serial terminal program
Step 2: Prepare hardwareCombine W5300 TOE Shield with STM32 Nucleo-144 board.
- Combine W5300 TOE Shield with STM32 Nucleo-144 board.
Connect ethernet cable to W5300 TOE Shield ethernet port.
- Connect ethernet cable to W5300 TOE Shield ethernet port.
Connect STM32 Nucleo-144 board to desktop or laptop using 5 pin micro USB cable.
- Connect STM32 Nucleo-144 board to desktop or laptop using 5 pin micro USB cable.
To test the examples, minor settings shall be done in code.
- Choose the demo application.
< sample > a. ARDUINO: To run the ChatServer example, you must double click the ChatServer.ino in 'Ethernet/examples/ChatServer' directory.
b. PlatformIO: To run the ChatServer example, you have to move the ChatServer.cpp in 'Ethernet/examples/PlatformIO_CPP_Examples' to 'Your PlatformIO Project Path/src/' directory to build.
- Setup network configuration.
Setup your network configuration in the examples such as IP of 'ChatServer.ino' or 'ChatServer.cpp'in project directory.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 11, 111);
IPAddress myDns(192, 168, 11, 1);
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 0, 0);
Step 4: Build and DownloadAfter completing the ChatServer example configuration, build in the IDE you are using.
- After completing the ChatServer example configuration, build in the IDE you are using.
When the build is completed, download the firmware to the STM32 Nucleo-144 board.
- When the build is completed, download the firmware to the STM32 Nucleo-144 board.
- Connect to the serial COM port of STM32 Nucleo-144 board. Default Serail speed was set to 9600 by example codes.
You can easilly see the network data by Hercules. Download: https://www.hw-group.com/software/hercules-setup-utility
- ChatServer 📷
If you send text stream to Server, you can receive the loopback stream.
AdvancedChatServer 📷 📷 If Multi-client connect to Server, each client can chat each other.
- AdvancedChatServer 📷 📷 If Multi-client connect to Server, each client can chat each other.
WebServer 📷
- WebServer 📷
If you connect to Server by using Browser, you can see the simple web page from server after several seconds.
Comments
Please log in or sign up to comment.