[RESOLVED]UART interrupt conflicts with ethernet? FreeRTOS, LwIP, CubeIDE
A very weird problem here... But Cube-skeptics won't be surprised for sure.
I have a custom board with STM32H753.
Devices in use are several UARTs, FMC, ethernet, I2C, few timers.
FreeRTOS with LwIP.
In main(), just before osKernelStart() I try to read from USART6 in interrupt mode, using HAL_UART_Receive_IT.
But the USART6 interrupt never occurs and HAL_UART_Receive_IT does not receive a single byte.
USART6 is configured in normal async mode, no flow control.
Blocking HAL_UART_Receive() works nicely, so the UART itself is enabled and configured.
The interrupt is enabled in Cube-generated code:
HAL_NVIC_SetPriority(USART6_IRQn, 6, 0); // tried also priority 0
HAL_NVIC_EnableIRQ(USART6_IRQn);
When HAL_UART_Receive_IT timeouts, the USART RXNE interrupt in ISR is pending,
but the NVIC bit in IABR (IABR[2] bit 7) is clear!
Then I commented out MX_LWIP_Init call and the USART6 interrupt works as it should.
Why the ethernet & LwIP initialization blocks USART6 interrupt?
I need ETH and USART6 work together in interrupt mode.
-- pa
*** UPDATE***
The trouble is caused by initialization of LwIP (or its freeRTOS tasks?), even without the ETH.
I commented out everything in low_level_init() - and UART6 interrupts still miss.
The project has been generated from .ioc file, by latest CubeIDE and H7 library v 1.6.0, no previous code.
*** UPDATE2***
Generated another project in older CubeMX based on same .ioc but without LwIP and RTOS.
Ethernet and LwIP manually merged from a Cube LwIP example,
in which Ethernet works in polling loop & H7 library V1.5.0.
The generated init code is almost identical.
There UART6 interrupt works fine.
So this looks like 100% software corruption somewhere in LwIP.
