cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive unknown byte of data in stm32h743 series for modbus?

ykn
Senior

Hi ,

I want to use my controller as a modbus slave.

there is interrupt call back function which receive predefine data.

but the modbus function like 15,16 have 10 to 11 byte of data and other function has 8 byte ,

how to receive that

thanking you

2 REPLIES 2
ykn
Senior

hi there,

after some search on google, i found this solution

looks like it would be very useful to me

https://controllerstech.com/uart-dma-with-idle-line-detection/

Pavel A.
Evangelist III

Perhaps that solution will be less useful that you hope.

It relies on the "idle detection" feature. The RX idle condition occurs after one character time of silence (aka "idle character") and this timeout is not configurable.

But the Modbus protocol requires gap between messages to be at least 3.5 characters.

For this the UART has the Receive timeout feature (RTO). The HAL library seems to support it, but using it is more complicated that it should be. Look for more specific Modbus examples.