I'm using the LPC4350 in conjunction with a Altera FPGA to stream ADC-Data from FPGA via USB to the analysis PC.
My problem is to get the desired streaming transmission performance.
I've started wit the usbd_rom_cdc_vcom example. With a simple loopback i'll get datarates up to 40MB/s for USB IN Endpoint (from device to PC), so the general implementation should not be a problem.
For streaming purpose i've to involve the FPGA and copy data from FPGA to the external connected SDRAM (i'm using a Micron MT48LC16M16A2 type) this interface achieves way more than 40MB/s.
If i'll do the data transfer from FPGA to MCT in "parallel" (IRQ driven) with the data transfer from MCT to PC i'll get at least 10% of brocken, incomplete packages on USB. For that reason and the resulting re-transmission of the brocken packages the transfer speed drops to max. 12MB/s. In addition the LC-Display is flickering very hard.
I can counter the LC-Display flickering in setting the SBUSCFG to 7 like mentioned in this thread https://www.lpcware.com/content/forum/tearing-lcd-when-accesing-usb but the brocken packages are still there.
I figured out that the problem is the AHB respectively EMC because the more load on EMC the more brocken packages i'll get. My assumption is the USB-DMA controller can't get the data as fast as necessary because the EMC is busy in getting data from FPGA.
For test purpose i've moved the buffer to temporary store the FPGA data to be ready to transmit via USB to the internal SRAM and disable the display controller. After doing this i'll get more than 20MB/s without any incomplete packages.
But unfortunately this isn't a final solution for me because i'll need the SRAM in other ways and cant use it for USB exclusively.
Is there a way to increase the DMA priority that way to avoid brocken packages?
How can I get this problem solved?
I'm very annoyed because the task of streaming data from EMC via USB with more than 12MB/s shouldn't be a task which is unusual and shouldn't make as much problems.
Best regards Sebastian