全部例程

WIZ UartTool V1.0 显示 — 网络初始化(静态 IP 配置) 
PC 端 ping 192.168.1.50 测试 — 4 包全通,0% 丢包
开始使用TOE引擎
W6300
更新于 2026年10月27日
前置工具准备
W6300 以太网控制器简介
网络地址信息简介
硬件连接与拓扑
工程结构
Project/
├── main.c ← 系统入口:串口、GPIO、QSPI 初始化 + user_run()
└── USER/
├── user_main.c/h ← 网络地址定义 + user_run() 主流程
├── wiz_platform.c/h ← 平台适配:debug_usart_init、wizchip_gpio_init、hspi_init
├── wiz_interface.c/h ← W6300 驱动接口:wizchip_initialize、network_init
└── wizchip_conf.h ← WIZnet 配置与 wiz_NetInfo 定义步骤1:定义网络地址信息
/* network information */
wiz_NetInfo default_net_info = {
.mac = {0x00, 0x08, 0xDC, 0x12, 0x22, 0x12},
.ip = {192, 168, 1, 50},
.gw = {192, 168, 1, 1},
.sn = {255, 255, 255, 0},
.dns = {8, 8, 8, 8},
.ipmode = NETINFO_STATIC_V4,
.dhcp = NETINFO_STATIC
};步骤2:初始化硬件
debug_usart_init(115200U);
wizchip_gpio_init();
hspi_init();
printf("\r\nMH2457 W6300 QSPI example start\r\n");
user_run();步骤3:初始化TOE引擎并检测PHY状态
/* w6300 init */
wizchip_initialize();
wiz_phy_link_check();步骤4:初始化 W6300 并设置网络地址
void user_run(void)
{
wiz_NetInfo net_info;
printf("%s Network Install example\r\n", _WIZCHIP_ID_);
wizchip_initialize();
network_init(ethernet_buf, &default_net_info);
wizchip_getnetinfo(&net_info);
printf("please try ping %d.%d.%d.%d\r\n",
net_info.ip[0], net_info.ip[1], net_info.ip[2], net_info.ip[3]);
while (1)
{
}
}步骤5:回读IP地址并打印PING提示
wizchip_getnetinfo(&net_info);
printf("please try ping %d.%d.%d.%d\r\n",
net_info.ip[0], net_info.ip[1], net_info.ip[2], net_info.ip[3]);运行验证
MH2457 W6300 QSPI example start
W6300 Network Install example
=================================================================
W6300 network configuration : STATIC
MAC : 00:08:DC:12:22:12
IP : 192.168.1.50
Subnet Mask : 255.255.255.0
Gateway : 192.168.1.1
DNS : 8.8.8.8
=================================================================
please try ping 192.168.1.50

常见问题
总结