Hi,
For a new product we want to use usbx with host mass storage class on ThreadX (aka Azure RTOS) and a RZ/A MCU. We have ported ThreadX to our custom development board, using code from github.com/.../rza1_gcc_azure_rtos_bsp. Unfortunately, DMA is not supported. This is too slow for us, as we need to transfer large quantities of data from/to USB drives.
You can see here that DMA is disabled:
github.com/.../ux_hcd_rz.h
We've made attempts to enable DMA. Just enabling it doesn't work. It fails to send and receive commands to the USB drive correctly, and fails to initialize. I tried to debug this problem a little, but couldn't find the reason for the malfunction.
But I could make it work by inserting a delay loop after this line:
github.com/.../ux_hcd_rz_fifo_read.c
As a diff:
/* Enable DMA channel. */ _ux_hcd_rz_dma_register_write(hcd_rz, UX_RZ_DMA_CHCTRL(UX_RZ_DMA_RX_CH), UX_RZ_DMA_CHCTRL_SETEN);++ {volatile int x = 10000; while (x--);} }
Then I can read with about ~2MB/s from the USB drive, which is acceptable. Of course the code change itself is just an unacceptable hack. It seems there is some sort of race condition bug, which should be fixed.
Does Renesas have plans to add proper usbx host controller DMA support to rza1_gcc_azure_rtos_bsp? One of the main reasons we decided to go for RZ+Azure is to cut down on development time, by not having to maintain or bug fix the drivers ourselves.