2019-05-02 03:31 AM
2019-05-02 03:39 AM
Me neither.
Describe your problem in more detail. Firmware you are using (code snippets), type/parameters of connection, crash symptoms.
People here have no magic crystal balls.
What have you tried already ?
2019-05-02 03:42 AM
Sounds like you and your colleagues need to work on debugging and diagnosing the underlying issues.
2019-05-02 10:30 AM
Start with some basics:
1) is the serial protocol correct? Is it RS-485, half duplex? Are the + and - sides connected properly, with termination? Is your bus turn-around time correct?
2) can you see messages arrive from meter, or can you tell if meter receives messages?
3) For modbus, are both sides using same RTU or ASCII protocol?
4) are your inter-character and inter-frame gaps correct if RTU?
5) Did you verify baud rates on both sides are correct (i.e. use a scope, don't assume)? Your STM32 may not be using the PCLK source you think is correct for the baud rate (a common mistake).
6) Does your Modbus receive routine have a timeout? If not it will hang forever if anything is configured wrong.
7) Are you configured for 7-bit + parity if ASCII mode?
8) Check your UART status for receive errors (framing, overrun, parity).
Jack Peacock
2020-07-25 09:28 AM
I have written a book on Modbus slave design using C targeted to STM32: https://www.amazon.com/dp/B086PNZF4W