Spartan 6 interface with STM32F7 - Page 1
Forum section: electronics / general

author: sanwal209
author_rank: Regular Contributor
timestamp: December 17, 2017, 08:22:28 pm
content: Hi Guys,I am building a project. In this project 3x OV9655 cameras are connected to spartan 6. Spartan6 function is to merge data streams from cameras and if require do some video processing and fpga send processed data streams to STM32F7 via 8 Bit parallel port and UART.I dont have extra GPIO available on Spartan6 because i am using QFP package and i am not satisfied with only 8 bit parallel port connected to MCU due to lack of high data rate.Solution i thought is to convert LVDS of Spartan6 to parallel outputs but i couldn't find deserializer for this purpose.Please guys can you suggest a deserializer or any other method to interface Spartan6 to STM32F7Thanks

author: jbb
author_rank: Super Contributor
timestamp: December 18, 2017, 01:53:10 am
content: I don’t know if it will fit well, but maybe you could use part of the FPGA to emulate a QSPI slave. I think that the STM32F7 can memory map external flash chips, thus enabling the use of quite fast DMA transfers.Depending to the STM32 (and FPGA resources) you might be able to do DDR interface, too. 4b * 60MHz * DDR = 480 Mb/sec.

author: hans
author_rank: Super Contributor
timestamp: December 18, 2017, 11:29:15 am
content: Yes it can, more specifically QSPI can even be used to run code of it, so it's definitely well mapped into the memory region.Even more so STM32F7 supports "dual-flash" mode operation, effectively creating a 8-bit data bus divided over 2 QSPI interfaces. The added bonus versus a normal 8-bit memory bus is the DDR.According to datasheet of STM32F722IC, the max dual-flash Quad-spi clock frequency is 80MHz (single = 108MHz). So 8x2x80=1280Mbit/s. Takes 10 - 11 GPIO's (if you can share CS..).Not sure if you can do much better than this, as you will either need to increase the bus width (not possible) or the bus frequency (limitations of STM32 part).I would also certainly test if the internal AHB memory bus/matrix of STM32 is not saturated/suffers from jitter at these throughputs, and/or which SRAM regions you need to use to sustain the throughput.

author: sanwal209
author_rank: Regular Contributor
timestamp: December 18, 2017, 03:04:27 pm
content: Hey Guys,Thanks for the response, I thought about a solution which is as follow:I will connect 16bit Data output from FPGA to 2 ports(PD& PE) of STM32F7 and one clock going into two timer interrupt pins of STM32F7. Now on rising edge of clock DMA will trigger and take the data from PD port and on falling edge DMA will take data from PE Port. I dont know if this is feasible and if it is i can get a good data rate. QSPI is also a good option but i am utilizing it somewhere else on board.Thanks for the help guys, i appreciate it.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2017, 03:23:56 pm
content: QSPI is a good option if you're short on IO pins and/or for pcb routability reasons.You could also use the "Flexible static memory controller" (FSMC), which is also memory-mapped and supports 8- and 16-bit data bus width.

author: hans
author_rank: Super Contributor
timestamp: December 18, 2017, 03:29:46 pm
content: We still don't know what speed you're aiming at. Like is 10MB/s enough or do you need 100MB/s+?The APB1 is limited to 45Mhz and APB2 to 90MHz, so you will need to chose timers from APB2. But even then you're stuck to 90MHz, and I cannot predict if it can handle 2x90MHz DMA requests sent over the AHB <> APB bridge. My gut feeling is, that it cannot, but you could test this on a development board.With alternating buffers you also need to merge the words from both buffers together, as I don't think DMA supports custom stride values.QuoteIf you're lucky, your software algorithm can be adopted to read words from alternating buffers.

author: sanwal209
author_rank: Regular Contributor
timestamp: December 18, 2017, 05:47:15 pm
content: 3x Digital CMOS cameras are connected to FPGA and if we take RGB 24Bit data with 30FPS then each camera data rate 118MB/s. Target application is to do video processing on video data streams and dump it to MCU. In this case maximum data rate we need is 118MB/s but i also want to have an option to get raw RGB data from each camera to MCU for which i need atleast 360MB/s.with only available 16pins on FPGA, i have to have MCU which supports atleast 200MHz pin's toggling speed. I am also having gut feelings that STM32 will not be able to do this, so i am thinking to move to some higher end processor like sitara but even that beast cannot handle that much high speed.In short in am stuck:)

author: andersm
author_rank: Super Contributor
timestamp: December 18, 2017, 07:45:59 pm
content: Getting it to the MCU is only half of the problem, what are you going to do with the data once it's there?

author: sanwal209
author_rank: Regular Contributor
timestamp: December 18, 2017, 07:47:53 pm
content: Dumping on Ethernet or USB or LCD. There will be 3 options.

author: andersm
author_rank: Super Contributor
timestamp: December 18, 2017, 09:25:36 pm
content: How are you going to pump 100-300 megabytes/second over either high-speed USB or 100Mbit Ethernet?

author: sanwal209
author_rank: Regular Contributor
timestamp: December 18, 2017, 09:38:08 pm
content: I thought of compressing the data send it to ethernet. STM32F7 have USB2.0 Full speed and USB2.0 Supports 480MBps isnt?It will be too much to STM32F7 as i said before and that is why i am looking for some higher end processor like AM3358 but its GPIOs are also not that much fast.Can you please suggest something?

author: nctnico
author_rank: Super Contributor
timestamp: December 18, 2017, 09:50:03 pm
content: Quote from: sanwal209 on December 18, 2017, 09:38:08 pmFFS use a SoC with a camera interface. If pins are a problem then use MIPI.

author: sanwal209
author_rank: Regular Contributor
timestamp: December 18, 2017, 09:59:03 pm
content: Using SoC will be so obvious solution. I haven't worked on FPGA before and i thought about this project for learning purpose. Point is to have healthy discussion on a solution.I could have used Zynq and forget about using external MCU but BGA package will increase the cost of PCB by at least 3x times.Thanks

author: andersm
author_rank: Super Contributor
timestamp: December 18, 2017, 10:39:55 pm
content: Quote from: sanwal209 on December 18, 2017, 09:38:08 pmUSB high speed is 480 megabitsper second, and realistic throughput tops out at about 35MB/s. For the data rates you're describing, you'd need superspeed USB, or 5GBASE-T Ethernet. FTDI have a new series ofsuperspeed FIFO ICsthat they claim can do 5GBps.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 19, 2017, 12:29:44 am
content: Quote from: andersm on December 18, 2017, 10:39:55 pmsanwal209, just to be precise, USBfull-speedis 12Mbps, no matter what the USB revision. High-speed, available in USB 2.0 and later, is 480Mbps as andersm said.I think STM32F7 actually supports USB high-speed (OTG).I agree with the 35MB/s at maximum for USB high-speed, and even so, I doubt you'll get that kind of sustained bandwidth with an STM32F7. I got a little above 30MB/s sustained with USB high-speed (bulk transfers) on an ARM SOC @1.2GHz... and even that took some optimization time. You may have better luck with isochronous transfers but good luck with that.For super-speed USB or multi-gigabit ethernet, you will need a powerful processor. STM32F7 just won't cut it.

author: andersm
author_rank: Super Contributor
timestamp: December 19, 2017, 07:02:54 am
content: It should be pointed out that even if you manage to export the data to a PC, sustaining those kinds of speeds are going to require some effort. For example, 360MB/s exceeds the random write speed of most mass-market SSDs. Your priority really needs to be reducing the amount of data that needs to be moved (for example, do the camera sensors actually provide 24-bit color depth? Can you do a Y'CbCr color space transform without losing too much data?)

author: Siwastaja
author_rank: Super Contributor
timestamp: December 19, 2017, 05:05:30 pm
content: You already have an FPGA, which is just the right tool for the job of transferring massive amounts of data quickly. Do it completely there: move the ethernet thing to the FPGA. If you need some complex control where a CPU is more handy than writing HDL, use a softcore.

author: sanwal209
author_rank: Regular Contributor
timestamp: December 19, 2017, 09:39:46 pm
content: @andersm Yes there is an option in camera to use YUV output data format and also for cropping the frame. You guys are right it would be pain in the arse to transmit that huge amount of data.@SiliconWizard Yes you are right, i studied the datasheet thoroughly. As i said to andersm i will take a resort on other data formats like YUV plus a compression algorithm in FPGA will not be a bad idea.@Siwastaja yes it is possible but i am always fascinated by the idea of FPGA and processor based hard real time applications, so i will try to keep this architecture to learn more because this going to be my first project based on FPGA and MCU.

author: sanwal209
author_rank: Regular Contributor
timestamp: December 21, 2017, 08:24:55 am
content: So finally decided to go with Octavo OSD335X SOM based on TI Sitara AM335x. FPGA will be connected to it via GPMC.