2023-03-23 08:13 PM
i'm using STM32F030F4Px for MODBUS Master Slave communication based on USART (RS485 communication). i'm using 9600 baud rate, 8bit 1 stop bit communication with DMA and HAL.
Master is transmitting 8 bytes to slave after 10 or 20 msec which are received at slave end perfectly.
However, when slave responds to master, the slave stops receiving data from master.
2023-03-23 11:42 PM
1st thing, post your code
2023-03-25 07:57 PM
2023-03-25 07:58 PM
2023-03-25 08:35 PM
Have you tried to debug the master? When the master "is not receiving response", maybe it has crashed?
2023-03-30 05:04 AM
I'VE CHECKED IT. The master is continuously transmitting to slave after a fixed duration. but not receiving response from slave (stm32f730)
2023-03-30 05:15 AM
sir are you able to diagnose it?
2023-03-30 09:19 AM
When you call HAL_UARTEx_ReceiveToIdle_DMA you don't check for HAL status to be sure the interrupts were enable again.
Check this post where i share some code on how to check HAL status and set a flag if not successful. I check the flag in polling routine and try to enable the interrupt again. The same goes for transmitting, though I'm using HAL_UART_Transmit_IT instead of HAL_UART_Transmit_DMA, but checking HAL status would still be the same.