cancel
Showing results for 
Search instead for 
Did you mean: 

Communication via RS485 stop working after random time

JDame.1
Associate

Hi everybody,

This is the first time I'm writing in a forum so I'm sorry if I didn't right.

I'm developed a board based on STM32F091VBT.I'm using this board to communicate with other devices (two touch, a gateway and another board based on STM32F091VBT) via RS485 and RS232. Everything works well but, after a random time, the communication between the two board suddenly stops working (meanwhile the communication with the other devices still works). I analyzed the situation with an oscilloscope and also with debugger and I can clearly see the data frame sent by the other board but for some reason the receive interrupt of my board doesn't be triggered anymore.

I'm using the HAL_UART_RxCpltCallback and helping myself with the debug I was able to catch the moment and I can see that, when this strange behaviour happens, this condition "if (UartHandle->Instance == USART6)" doesn't become true even though the data frame is continuously sent by the other board.

I also notice that frequently a frame error happen but then, after cleared the flag, continues to work.

I was thinking to an overrun error so I disable it in the advanced init but the problem still happens.

I also tried to follow this advice HAL library serial port FE frame error processing method - Fear Cat but the situation didn't change.

Have you ever faced a similar problem? Do you have any suggestion?

I tried to be as clear as possible, I'm sorry if I wasn't and thanks for your reply!

2 REPLIES 2
Javier1
Principal

rs485 is half duplex, are you handling your transceiver's enable/disable tx/rx pin correctly?

maybe your transceiver stays in tx mode forever?

we dont need to firmware by ourselves, lets talk

Hi Javier,

Thanks for your answer.

Yep, I manage the DE pin directly just to avoid these kind of problems, in fact the communication between the other devices on the others RS485 ports still works.

The communication between the two boards works well for a random time and then for some reason stop working.

It seems like a noise that cause this issue but I'm working with checksum so I just reject the corrupt data and go on.

One board is a master so the other send the data only after receiving, so I can exclude some collision problems.

The communication between the devices has the same baudrate (38400) and the same settings. The only thing that changes is the frequency: with the other devices is every 200ms with the one that cause the issue is 100ms.