# ch390 **Repository Path**: RT-Thread-Mirror/ch390 ## Basic Information - **Project Name**: ch390 - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-16 - **Last Updated**: 2026-07-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CH390 WCH CH390 is a 10/100 Mbps SPI Ethernet controller. This package provides an RT-Thread Ethernet driver for CH390 and registers the device through RT-Thread lwIP Ethernet support. ## Requirements Enable these RT-Thread components before using the package: - SPI - PIN - lwIP - netdev, if your application uses RT-Thread netdev commands or APIs The BSP must attach the SPI device before this package probes CH390. Board code should configure the SPI bus, select the CS pin, and call `rt_hw_spi_device_attach()`. The package does not perform board-specific SPI attachment. ## menuconfig Example package options: ```text PKG_USING_CH390=y CH390_SPI_BUS_NAME="spi0" CH390_SPI_DEVICE_NAME="spi10" CH390_NETIF_NAME="e0" CH390_CS_PIN=4 CH390_RST_PIN=-1 CH390_INT_PIN=3 CH390_SPI_MAX_HZ=5000000 CH390_POLL_INTERVAL_MS=20 ``` `CH390_SPI_BUS_NAME` and `CH390_CS_PIN` are intended for BSP port code. The package auto-init uses `CH390_SPI_DEVICE_NAME`, `CH390_NETIF_NAME`, `CH390_RST_PIN`, `CH390_INT_PIN`, `CH390_SPI_MAX_HZ`, and `CH390_POLL_INTERVAL_MS`. ## gd32407v-lckfb Wiring Example wiring for the GD32407V-LCKFB BSP: | GD32 pin | CH390 signal | | --- | --- | | PA3 | INT | | PA4 | CS | | PA5 | SCK | | PA6 | SDO/MISO | | PA7 | SDI/MOSI | Use SPI mode CPOL + CPHA, also known as SPI mode 3. The driver configures the CH390 SPI device as `RT_SPI_MODE_3 | RT_SPI_MSB`. ## Static IP Test One simple validation setup: - Board IP: `192.168.1.30/24` - Host IP: `192.168.1.100/24` After the board boots and CH390 is registered, ping from the host to the board: ```sh ping 192.168.1.30 ``` Then ping from the RT-Thread shell to the host: ```sh ping 192.168.1.100 ```