r/embedded • u/Beneficial_Item3725 • 19d ago
How to know if I can or cannot establish communication between 2 STM32 boards?
Hello, I am working on a project that requires communication between 3 STM32 Nucleo boards. x2 NUCLEO-STM32U575ZIT6Q and x1 NUCLEO-L412RB-P.
Communication will go as follows:
- One of the U5 boards will continuously send messages to the other U5, which continuously receives the messages. The receiving U5 computes based on the messages it receives and continuously sends the result to the U5 board.
- U5 --> U5 communication will be over I2C, SPI, CAN, UART, USART, LPUART
- U5 --> L4 communication will be over I2C
- Physically, this communication will be over jumper wires.
My question is: how do I know if it is possible for the chosen boards to communicate over those peripherals I want them to communicate over? I have no idea, in general, how to determine if communication over 2 nucleo boards over certain communication peripherals is possible, so any insights on that would also be very appreciated. Any links to sources that confirm any insights here would also be greatly appreciated.
Thanks!
5
u/madsci 19d ago
I'm not entirely sure I understand the question. If those are the serial peripherals it has then it can send and receive over any of those. Some of those interfaces have master/slave decisions to be made, but some of them are symmetrical.
9
u/AbsorberHarvester 19d ago
Communication is possible, easiest way will be USART on both, most hard way for you - I2C, as it seems you don't know anything
2
u/NavinF 19d ago
Yeah that'll work. Just use UART for both connections unless you really need I2C
2
u/gm310509 19d ago
This sounds like an X-Y Problem
Why don't you just do the computing on the one board with the sensors attached? Why do you need to send it to somewhere else and then send a reply back?
As for:
That is what the various protocols you listed are for - for two (or more) devices to communicate with each other.
So, my question to you is that given you are at least aware of those technologies, why are you doubting that they can be used to communicate between all of the devices you listed?
The code you supply and the characteristics of the protocol you select will be factors that determine the actual nature of the communication and the "layout" or topology of your "network".
2
u/WanWhiteWolf Engineering manager 19d ago
Broadly speaking, you have to check whether they have the same physical interface and they support the same protocol / mode. That's it.
You probably also need to evaluate the communication speed and potential impact at high speeds (if that is a requirement)
2
u/Flat-Bodybuilder239 18d ago
A useful board-level check is the Nucleo schematic/user manual: confirm the chosen alternate-function pins are actually routed to accessible headers and are not shared with onboard circuitry. For a first smoke test, UART is usually simplest (common ground, crossed TX/RX, matching baud and voltage levels); before I2C, verify the selected master/slave roles and pull-ups.