2023-10-11 09:32 AM - edited 2023-10-11 09:34 AM
Hello everyone,
I open a new topic since my issue seems to be characterizing only my application.
I have implemented what I consider a rather stable lwIP - ModbusTCP/IP on a proprietary application using STM32H755 microcontroller. As long as I work with one board only, everything works fine, both ping and data exchange. As soon as I connect a second identical board but with different IP (verified), only one of the two allows to ping or exchange data(tried to do it together, separately, everything i could think of). If I stop the connection to the first CPU, even disconnecting it's cable, the communication returns to the previous working condition (ok). Then I tried to ping the two CPUs with two different laptops simultanously and the same thing happens, ping works only on one board at a time.
If I try to ping the same board while transferring data (SW too emulating Modbus Client) it works just fine.
To me it seems like a very long handshake, like the link is never left idle for the other participants to complete their operations. I must say that I never even tried to establish multiple connections at once with a laptop to different devices so I didn't think any of it at first and I'm still not sure if it's normal or not, even if I would say not.
Have you ever encountered the same issue while developing on stm32 platforms? Do yuou know any additional test I might perform to address this issue? Or maybe in which direction to look at for more insights? Could it be an issue in my Modbus TCP/IP protocol (just so you know, it's OS free and running it's main functions through callbacks)?
Thank you all in advance,
Zack
2023-10-29 03:29 AM
Have you checked your hypothesis related to MAC with Wireshark or the like?
Do you use Modbus TCP or Modbus UDP?
I have developed a Modbus TCP/IP (OS free) server running (multi-client) on STM32F407 and saw that Wireshark even is able do decode Modbus TCP/IP.
2023-10-29 08:03 AM - edited 2023-10-29 08:04 AM
>As soon as I connect a second identical board but with different IP (verified)
Pardon me, no offence meant, but things happen.... verified how? Any chance of duplicate MAC address?
2023-10-30 06:16 AM
@Johi and @Pavel A. Thanks for you reply, but the MAC issue was already addressed in the previous messages. That was the issue in fact.
The solution of having a UID to set a "unique" MAC address is very interesting and I'm trying to implement it.
The issue, as you can read in the last message I sent, is that reading the UID base address I get hard fault. It was written somewhere that reading such registers with Icache active was not possible. I tried to do it with a dedicated project and still got the hard fault. I am asking now if there is something I'm doing wrong on my H755 nucleo board.
Thanks
2023-10-30 02:58 PM
Check the actual compiled UID address with disassembler. If that one is correct and you still cannot read the UID, then there is something else that is wrong. Check the stack address and whether that is 8-byte aligned. Or it could be something "unrelated", which just happens to be triggered indirectly.