cancel
Showing results for 
Search instead for 
Did you mean: 

What is the fastest interface between an STM32 and an FPGA?

snkparty1
Associate II

I am designing a system with an STM32 and an FPGA(Xilinx 7 series).

STM32 is in charge of the user interface and the FPGA is in charge of driving the LCD to show images.

Information needs to be exchanged between the STM32 and the FPGA. (STM32 send a command to the FPGA to choose which image to display or to stop displaying. STM32 also need to write all logs to the SD card through the FPGA. FPGA needs to report to the STM32 how many images are displayed and how many remain.)

After some research, I found SPI seems to be fast and easy to implement.(I am not sure which interface is commonly used for communication between STM32 and FPGA?). I wonder if there is another interface that is faster or easier to implement?

1 ACCEPTED SOLUTION

Accepted Solutions

You can use USART with no problems.

I had done a project previously where we had 17 STM32 + one TM4C129, each with a Command and Telemetry port using USART connected to a Xilinx Spartan 7. So that's 36 UART ports. 

The Xilinx has had no issues communicating with that many microcontrollers at the same time with just UART. 

If you FIFO doesn't work, then it's called GIGO.
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

View solution in original post

9 REPLIES 9
Ozone
Principal

The "fastest" option would be a Cortex core in the FPGA itself.
However ...

> STM32 send a command to the FPGA to choose which image to display or to stop displaying. STM32 also need to write all logs to the SD card through the FPGA. FPGA needs to report to the STM32 how many images are displayed and how many remain.

This does not sound as you need a high bandwidth here, a proper protocol between both seems more important.

> STM32 is in charge of the user interface and the FPGA is in charge of driving the LCD to show images.

Which suggests "fast" means without noticeable delay for the operator.
I suspect reading the actual images and rendering them to the display require more time than the transfer of GUI commands.

Which STM32?

FMC, QUADSPI, OCTOSPI, DCMI (inbound), PSSI

LCD, then perhaps LTDC and an RGB interface.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GaetanGodart
ST Employee

Hello @snkparty1 ,

 

FPGA and MCU (such as STM32) are 2 completely different hardware products.

The MCU is a multi purpose component able to make various calculations based on C code
On the other hand, an FPGA is not coded using C but rather it is coded by closing or opening gates to create a new hardware configuration that perfectly fits your application.

Therefore, FPGA are usually faster (even though it depends on what you get) but they are more complex, lower level and require more time to get the same result.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
Karl Yamashita
Principal

You haven't indicate what kind of information? String information? Telemetry binary data?

How often are they communicating with each other?

 

If you FIFO doesn't work, then it's called GIGO.
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Sorry for not providing detail and confused you.
The system is for 3D printer and MCU is STM32H743, the reason to choose this stm32 is I have a development board with STM32H743 and this chip is powerful enough to have a touchGFX user interface and freertos system runing on it.(Availability also matters)

The MCU will send
1.Get information about how many images are in SD card and how many images has been displayed on LCD
2."show next image" command to FPGA to inform FPGA to display image on LCD.(Print process complete and change to next image)
3.save system log on SD card

Since MCU needs to communicate to send command, poll the status, log information to SD card. All of which does not require large amount of data to be transfered.The speed requirement is not that high so SPI seems to be a ok choice. But if I choose SPI then MCU is master and FPGA is slave so FPGA can not start to send information to MCU. MCU needs to poll FPGA continously to check if FPGA side works fine or not.

 

system.jpg

 

> Since MCU needs to communicate to send command, poll the status, log information to SD card. All of which does not require large amount of data to be transfered.The speed requirement is not that high so SPI seems to be a ok choice.

Exactly this was my point.
There are no high throughput requirements for such a GUI controller, no need to overcomplicate things.

And the more "standardized" the communication channel is, the easier you can port your applications to other MCUs.

You can use USART with no problems.

I had done a project previously where we had 17 STM32 + one TM4C129, each with a Command and Telemetry port using USART connected to a Xilinx Spartan 7. So that's 36 UART ports. 

The Xilinx has had no issues communicating with that many microcontrollers at the same time with just UART. 

If you FIFO doesn't work, then it's called GIGO.
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
Pavel A.
Super User

IMHO not clear what the FPGA does here at all. The MCU can drive the SD card, maybe even the LCD,

Your suggestion helps a lot, thanks. I will try both spi and usart during development to see which protocol suits this project better.