cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Everyone, Weare working on a project where using SPI3 with DMA to communicate with flash. The problem we are facing is when copying a file from our module to PC, (file size is around 130 MB), it takes almost 14 minutes to complete the transfer.

SNata.1
Associate II

Is there anyway we can decrease this time. We are using void DMA2_Channel2_IRQHandler(void) and void DMA2_Channel1_IRQHandler(void). Both RX and Tx callbacks are not firing and really not able to debug this issue. Looking forward to a solution. Thanks everyone.

10 REPLIES 10
Uwe Bonnes
Principal III

How is the transfer from board to PC done (e.g. Serial, USB FS, USB HS)? What device?

SNata.1
Associate II

HI, Thanks for the quick reply. It is USB HS. STM32L151VEYx MCU. Device is a datalogger board, designed and fabricated by us.

I'd imagine it could be done faster.

Post a bit light​ on any usable detail to provide a diagnosis.

Why can't you and your team better understand and debug the failure?

I​nterrupts and callbacks not occurring suggests an error is being flagged or the transfer is not actually happening. Or you're using C++. Do an inspection of the peripheral registers. Do a disassembly of the code, check the vector table and associations with interrupts used and callbacks. That your routines linked in.

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

Depends where the bottleneck is. USB MSC probably looking at 4-5 minutes​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SNata.1
Associate II

Hi Clive1,

Thanks. Actually transmission happens without an issue. We are able to copy files from device to PC and vice versa. The problem is the timing. How to improve or reduce cycle time. We are reading 512 bytes per read, so for a 4096 block, we need 8 such reads. Again, this current setup works fine.

A USB MSC or something else?

C​heck MSC_PACKET_SIZE definition, or something similar, don't recall, not at a computer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SNata.1
Associate II

it is USB MSC only. We declared our own variable for packet size as 512 bytes. HAL_SPI_Receive_DMA(&heval_Spi3, buf, USB_BLK_SIZ); declared USB_BLK_SIZ as 0x200

/* MSC Class Config */

#define MSC_MEDIA_PACKET                     8192

Allows for more efficient multi-block read requests from host OS

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SNata.1
Associate II

Thanks. We will try and update on the results.