2017-07-20 03:30 AM
Hello everyone,
Testing LwIP + FreeRTOS on my devboard.
Everything configured by CubeMX.
each time I use 'connect' function I ends up in infinite loop inside vPortRaiseBASEPRI
I have strong feeling that has some correlation with interrupt priorities.
Additional information:
Ethernet - use RMII interface
SYS clocked from Timer 14...
Socket crated from main thread.
Thanks in advance
#freertos #stm32f407 #lwip2017-07-20 04:24 AM
Update.
Looks like it has some correlation with UART1 interrupts...
2017-07-20 05:22 AM
update.
manually (CubeMX does not allow to increase priority of USART interrupts) increased priority of USART1 IRQ from 5 to 4.
so far so good...
2017-07-20 07:46 AM
Hi
Rare to see someone that has exacly the same problem as me.Did that change solve your problem ? Whats weird is that I have the same problem but I don't have any UART enabled.Got any idea what it could be ?I only have ethernet , LwIP and Free RTOS enabled.-Andy2017-07-20 08:10 AM
Working so far. No deadlocks. Now I have issues with lwip timeouts ....
Receive never ends if other side didn't close a socket....
2017-07-20 08:35 AM
Well still trying to find which interrutp priority is wrong.Since I have no other peripherals enabled it shouldn't be too long (fingers crossed).I tried changing the ethernet priority but still got the same problem.
2017-07-21 02:37 AM
Also I removed the HAL IRQ handler for UART and wrote my own which use FIFO. This helps a lot !
The HAL has quite strange implementation of serial port data. Now I have 64 byte output cyclic buffer, which is more then enough for my serial text terminal.
Also enable in lwipopts.h
#define SOCKETS_DEBUG LWIP_DBG_ON
and try to use timeouts.
// Setup timeouts
if(lwip_setsockopt(socket_fd,SOL_SOCKET,SO_RCVTIMEO,&rx_timeout,sizeof(tx_timeout)) <0){
lwip_close(socket_fd);
printf('
Net, Failed to set timeouts
');
}
if(lwip_setsockopt(socket_fd,SOL_SOCKET,SO_SNDTIMEO,&tx_timeout,sizeof(tx_timeout)) <0){
lwip_close(socket_fd);
printf('
Net, Failed to set timeouts
');
} �?�?�?�?�?�?�?�?�?�?