We are using STM32F469VI for developing a device which uses the following peripherals:
- GPIO
- UART (probably around 3 of them)
- SDIO (SD card in device, requiring FatFS access as well as mass storage via USB, see below)
- USB (2 ports)
- I2C
We would like to configure the USB ports as composite devices consisting of:
- 2 HID interfaces
- Mass storage (for accessing the SD card)
- IAP2
Questions are as follows:
- Is Cube HAL a good choice of library for this kind of project, or do you recommend something more low-level?
- If low-level, what would you recommend that we use?
- What is an efficient way to implement USB mass storage access to an internal SD card? The Cube middleware handles USB transactions inside its ISR, but is it wise to read/write data from/to an SD card within an ISR? Or is there an example anywhere that maybe just queues the request in the ISR and carries out the I/O somewhere in the main loop? Can the USB middleware be modified to account for this?
- If we use DMA for the SD card, how would we synchronize USB with those DMA requests? The middleware requires us to have the data requested by host ready in the context of the USB ISR, but when using DMA this cannot be done.
Thank you, and kind regards,
Felix Grützmacher, Help Tech GmbH