Skip to main content
Maz D
Associate II
July 31, 2017
Solved

Fastest communication interface between two STM32F7's

  • July 31, 2017
  • 28 replies
  • 6346 views
Posted on July 31, 2017 at 16:02

Hi,

I have a simple question but which causes me a little headache.

Does anyone know how I might interface two STM32F7 so that I might obtain the fastest communication between the two?

Something better than 10MBytes would be the best and 20MBytes excellent.

If my question needs more info do not hesitate to ask for clarification.

All help would be appreciated.

Thanks

#speed #interface #best #fastest #communication #stm32f7
This topic has been closed for replies.
Best answer by AVI-crak
Posted on August 01, 2017 at 10:53

Saving the area of the PCB - use two SPI interfaces on each chip. The first in master mode, the second in submission mode.

You can not think about clock synchronization. The delay will be minimal. It is important to understand, the chip that transmits information - uses the memory of a neighboring chip to store data. For this reason, the start of information exchange should occur by mutual synchronization of readiness. For example, on receiving / transmitting a number that increases on the other side.

The data exchange works through the ring buffer, the tail / head indicators are located in different parts of the access. The head pointer is read on its own memory, the tail pointer is located on the memory of a neighboring chip.

To use sets of flags is a useless occupation, tested by our own experience. Once the ideal balance is found, a new need for a fresh resource appears. This race is infinite, it just spends your time.

Without saving the PCB, an external chip, for example CY7C028-15AXC.

Work with ring buffer on external memory, without restrictions, without synchronization, without prohibitions and distortions of information. Everything is possible, except for a beautiful printed circuit board. A multi-layer printed circuit board is required - to hide the hinges.

Without saving a PCB, but with saving your own time.

Use an external FPGA chip to simulate two ported sram memory. This can be a simpler solution - than you think at first glance. After all, you have the opportunity to independently assign contact connections for the FPGA chip.

For debugging communication technology - use usart. When the software model is stable and fast - you can go to a faster interface. I'm not kidding.

28 replies

Tesla DeLorean
Guru
July 31, 2017
Posted on July 31, 2017 at 16:18

Shared dual-port memory.

FIFO tied to sender FSMC and receiver DCMI.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Maz D
Maz DAuthor
Associate II
July 31, 2017
Posted on July 31, 2017 at 17:06

Hello Clive,

This a very intresting answear and had me thinking for a while. The FMC interface has one clock and 8 to 32 lines of data. Which means I dont have to agregate other types of interfaces like the SPI or I2C to have more throughput.

But if I am not wrong, this is a transmit only interface.

Whereas I need to transmit and receive on the same lines so that I may route the minium of lines between the two MCUs all the while conserving the tranmission speed.

Also by shared memory, is it a question of sharing the MCU memory or an external component (ex: DPRAM)?

Tesla DeLorean
Guru
July 31, 2017
Posted on July 31, 2017 at 17:57

The FSMC/FMC is a bidirectional interface. Your problem is the devices don't share a common clock domain, and there isn't a DRQ/DACK method for the DMA. DCMI does provide for a method of high speed synchronous transfers (input), fill the data source, trigger a block transfer.

You'd likely need something to mitigate the ebb/flow of data, and stage the data between the two systems

Something like this could be exploited

http://www.averlogic.com/AL422B.asp

 

Might need to gang them up to get width and directionality required.

Ask yourself why you are even approaching the problem this way, wouldn't a multi-core device with SMP/NUMA memory architecture work better. Does all the data need to be transferred back and forth?

Shoveling data between two F7 would seem to eat a lot of processing bandwidth.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
T J
Senior III
August 1, 2017
Posted on August 01, 2017 at 06:33

did you look at the LVDS serializers/deserializers ?  these run the data serially at 300MHz +

this will give you easily 30MHz 8 bit bus with 2/3 control lines over 4 wires for full duplex (maximum length 20cm)

LVDS chips work very well, easily, but they need some room on the PCB..

Maz D
Maz DAuthor
Associate II
August 1, 2017
Posted on August 01, 2017 at 09:46

The space on the PCB is my main problem actualy. I am realy constrained. I dont realy have space left for other components.

AVI-crak
AVI-crakBest answer
Senior
August 1, 2017
Posted on August 01, 2017 at 10:53

Saving the area of the PCB - use two SPI interfaces on each chip. The first in master mode, the second in submission mode.

You can not think about clock synchronization. The delay will be minimal. It is important to understand, the chip that transmits information - uses the memory of a neighboring chip to store data. For this reason, the start of information exchange should occur by mutual synchronization of readiness. For example, on receiving / transmitting a number that increases on the other side.

The data exchange works through the ring buffer, the tail / head indicators are located in different parts of the access. The head pointer is read on its own memory, the tail pointer is located on the memory of a neighboring chip.

To use sets of flags is a useless occupation, tested by our own experience. Once the ideal balance is found, a new need for a fresh resource appears. This race is infinite, it just spends your time.

Without saving the PCB, an external chip, for example CY7C028-15AXC.

Work with ring buffer on external memory, without restrictions, without synchronization, without prohibitions and distortions of information. Everything is possible, except for a beautiful printed circuit board. A multi-layer printed circuit board is required - to hide the hinges.

Without saving a PCB, but with saving your own time.

Use an external FPGA chip to simulate two ported sram memory. This can be a simpler solution - than you think at first glance. After all, you have the opportunity to independently assign contact connections for the FPGA chip.

For debugging communication technology - use usart. When the software model is stable and fast - you can go to a faster interface. I'm not kidding.

andy b
Senior
August 1, 2017
Posted on August 01, 2017 at 18:13

Hi

Apparently nobody talked about connecting your stm32f7 with ethernet.Can achieve high speeds and with RMII interface you can do it with few MCU pins.Depending on the protocol you use if you do UDP you can transit data pretty fast.You only need to implement your own checksome/datacheck to make sure everything you've received is intact but if your lines stay on your PCB this may not be required if your hardware has the correct protections.You can have your main MCU as server and second one as client.

Hope this helps

-Andy
Tesla DeLorean
Guru
August 1, 2017
Posted on August 01, 2017 at 19:49

Can you flip the RX/TX pairs and connect them back-to-back without a PHY?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
andy b
Senior
August 1, 2017
Posted on August 01, 2017 at 20:16

Not sure about this tried checking and the good old Goggles and haven't found a clear answer.But if needed just putting 2 PHY will probably work.They are some of the smaller chips out there so even tho he's clearly said he doesn't have much room left on his pcb he probably has enough for 2 tiny chips ,a few resistors and capacitors.He can probably do it in 1 1/2 square inches if not less.Your question certainly makes me want to try PHY less.I'll keep searching a bit to see if someone's done it before.

S.Ma
Principal
August 2, 2017
Posted on August 02, 2017 at 04:43

First question would be the bus length and capacitance, signal integrity. If both mcu are within 20cm, 40 mbps per spi should be doable with 160mhz sysclk with relatively simple sw stack. Ethernet interface, if available might be doable as well. A qspi mram bus shared and sw arbitrated could also be considered with sdio: reading can be done by hw memory mapping.

Maz D
Maz DAuthor
Associate II
August 2, 2017
Posted on August 02, 2017 at 14:41

I agree as I think this is still the best method because it demands the least rework of libraries. I will go for this solution and tell you how it goes.

Eugene Solo
Associate III
August 3, 2017
Posted on August 03, 2017 at 09:44

Don't listen to them. Use QSPI bus with one additional pin for direction handshaking (or even without that pin, use existing pins from QSPI itself of 'out-of-band' signalling)

Maz D
Maz DAuthor
Associate II
August 3, 2017
Posted on August 03, 2017 at 09:54

I might be wrong on this, but for me there is no QSPI slave on the STM32F7. There is also the issue with the clock pin and clock synchronisation.

That said I am ready to do some engineering to get it to work if you have further technical details on how I might get it done?
T J
Senior III
August 3, 2017
Posted on August 03, 2017 at 09:59

I am working with a F767 in cube and visual studio,

I checked the cube, the only DMA function for QSPI seems to be a Slave Receiver.

William Warnots
Associate II
August 3, 2017
Posted on August 03, 2017 at 09:58

Use SPI with  Chip select software , but you need remember that set the pin frequency very High.

David Littell
Senior II
August 3, 2017
Posted on August 03, 2017 at 13:55

Re setting the pin frequency very high: not necessarily.  An understanding of the signal's load capacitance and the actual operating frequency is needed.  Look for the I/O AC characteristics table in the Data Sheet, scope it while operating, and use the lowest workable setting.

Ken Coley
Visitor II
August 3, 2017
Posted on August 03, 2017 at 16:45

You didn't mention if the two STM32F7 were on the same PCB or different ones.  Ethernet would be the simplest for multi-board since not only is the hardware well defined, but the software stack is also.  If the MCUs are both on the same board then you might want to look at a shared memory block implementation or as many above mentioned an SPI solution.  Without knowing more about the application and data flows, its hard to recommend a specific implementation.

Maz D
Maz DAuthor
Associate II
August 3, 2017
Posted on August 03, 2017 at 18:16

Yeap they are on the same PCB.

Willem La Grange
Associate
August 3, 2017
Posted on August 03, 2017 at 23:03

I would use a USB HS device to USB HS Host (or OTG is also possible) as the fastest communication medium (480Mb/s) and you have DMA  with shared memory to speed things up even more. Use the external PHY for best results but it is not cheap. That would be the easiest firmware solution as well. 

The problem is the decoding and action on these message with a clock speed od only 216MHz. I agree that you should rethink why do you need that speed! Maybe it would be better to wait until October 2017 for the H7 series to launch at 400MHz.

Using Dual port RAM and the FMC will also give you pretty good speeds but there has to me something more to signal start and end of messages. Will be easy to loose sync if used as a communication medium.