-
Notifications
You must be signed in to change notification settings - Fork 27
Description
1 我不知道为何我前面发的issue没有回复就被关闭。
2 这个库和wiznet软件包做modbustcp时存在2个问题:
2.1 如果直接衔接,会无法网络通,原因时listen函数调用的setsockopt传参不对,wiz_setsockopt无法识别,给出“WIZnet setsockopt input option value or option length error.”的提示,忽略wiz_setsockopt可以通讯,但可能没有真正用到W5500网络芯片的opt,所以过运行一段时间也会出问题。
2.2LibmodbusTCP的例子中用的时close(client_sock_fd);但运行一段时间后会出现如图错误
全部用closesocket可以运行稍微长一点(3个小时),但最终还是会崩溃。用cmbacktrace和addr2line定位的是:
F:\work\soft\rtt_studio\motofan\Motofan\Debug>addr2line -e Motofan.elf -a -f 0801f8a2 08004c42
0x0801f8a2
Mbtcp_thread
F:\work\soft\rtt_studio\motofan\Motofan\Debug/../packages/libmodbus-latest/examples/modbus_tcp_test.c:224
0x08004c42
rt_mutex_release
F:\work\soft\rtt_studio\motofan\Motofan\Debug/../rt-thread/src/ipc.c:877
具体位置是:FD_SET这一行
while (1)
{
max_fd = -1;
FD_ZERO(&readset);
FD_SET(server_fd, &readset);