2021-06-16 10:17 PM
I have STM32L475VC + ISM43362 WIFI Module.
Set module, connect to AP.
if(ISM43362_Init() == WIFI_STATUS_OK)
{
USART_SendString(SYS_USART, "WIFI INIT OK\r");
if(WIFI_GetMAC_Address(mac_addr) == WIFI_STATUS_OK)
{
USART_SendString(SYS_USART, "MAC ADDRESS ");
USART_SendHex(SYS_USART, mac_addr[0],0);
USART_SendString(SYS_USART, ":");
USART_SendHex(SYS_USART, mac_addr[1],0);
USART_SendString(SYS_USART, ":");
USART_SendHex(SYS_USART, mac_addr[2],0);
USART_SendString(SYS_USART, ":");
USART_SendHex(SYS_USART, mac_addr[3],0);
USART_SendString(SYS_USART, ":");
USART_SendHex(SYS_USART, mac_addr[4],0);
USART_SendString(SYS_USART, ":");
USART_SendHex(SYS_USART, mac_addr[5],1);
}
}
else
USART_SendString(SYS_USART, "WIFI INIT ERROR\r");
if( WIFI_Connect(SSID, PASSWORD, WIFI_ECN_WPA2_PSK) == WIFI_STATUS_OK)
{
if(WIFI_GetIP_Address(ip_addr) == WIFI_STATUS_OK)
{
USART_SendString(SYS_USART, "Connected: got IP Address ");
USART_SendInt(SYS_USART, ip_addr[0], 0);
USART_SendString(SYS_USART, ".");
USART_SendInt(SYS_USART, ip_addr[1], 0);
USART_SendString(SYS_USART, ".");
USART_SendInt(SYS_USART, ip_addr[2], 0);
USART_SendString(SYS_USART, ".");
USART_SendInt(SYS_USART, ip_addr[3], 1);
}
else
{
USART_SendString(SYS_USART , "ERROR: CANNOT get IP address\r");
}
}
if (WIFI_StartServer(SOCKET, WIFI_TCP_PROTOCOL, 1, "", PORT) == WIFI_STATUS_OK)
USART_SendString(SYS_USART, "Start server - SUCCESS\r");
else
USART_SendString(SYS_USART, "Start server - ERROR\r");
Everything OK.
WIFI INIT OK
MAC ADDRESS C4:7F:51:7:B5:A5
Connected: got IP Address 172.16.1.120
Start server - SUCCESS
In main.c I put a UART string reception
while (1)
{
if (uart4_rx_ready)
{
uart4_rx_ready = 0;
PARSER_ParseCommand(uart4_rx_buf);
}
}
It's OK. I get user commands from terminal and parse it. Commands I get char by char on UART interrupt.
Now I add a WIFI module reception
while (1)
{
if (uart4_rx_ready)
{
uart4_rx_ready = 0;
PARSER_ParseCommand(uart4_rx_buf);
}
if (WIFI_STATUS_OK == WIFI_ReceiveData(SOCKET, udp_rx_buf, 1000, &udp_rx_len, 0 ))
{
if (udp_rx_len > 0)
USART_SendInt(SYS_USART, udp_rx_len, 1);
}
}
And UART reception crushes - I get a first char then I get - ORE: Overrun error.
What's wrong?