Hi I am using STM32L1 series microcontroller in meter when I connect my meter to MODBUS it become hang. I don't know what is the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-02 3:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-02 3: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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-02 3:42 AM
Sounds like you and your colleagues need to work on debugging and diagnosing the underlying issues. ​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-25 9:28 AM
I have written a book on Modbus slave design using C targeted to STM32: https://www.amazon.com/dp/B086PNZF4W
