Open andy817501 opened 1 month ago
But I use USB_OTG_FS dma enable=ENABLE and turn on dcache to make it work as a cdc device, It can work normally,I don't need to turn off dcache or use SCB->CACR |= SCB_CACR_FORCEWT_Msk, but usb_host can not work , i find when i open the dcache and dma in usb host I do get 2-5 trasnfers through, and then it stalls.
Hi @andy817501,
From your setup description, I see ThreadX
and USBX
. Are you trying to port these libraries to the STM32CubeH7 firmware? If yes, you can have a look to the x-cube-azrtos-h7 repository. You may find the answer to your question by browsing into the different applications available.
Please keep me informed.
With regards,
@ALABSTM I discovered after porting that USB_cdc_host DMA and Dcache are working together to produce anomalies,but the usb_cdc_device is no such issue
yes,i had a look at the x-cube-azrtos-h7 repository , and make sure The DTCM (0x20000000) memory region do not be used ,and make sure to configure the USB pool memory region with attribute "Non-Cacheable" to ensure coherency between CPU and USB DMA
for Ux_Device_CDC_ACM , I Can use the dache + dma work together , But for Ux_Host_CDC_ACM i can not ,I have already provided detailed information before
ST Internal Reference: 193167
Hi @andy817501,
I forwarded your question to our development teams. Let's wait for their feedback.
With regards,
See also STM32CubeF7#8
I had look this issue, but it only Mentioning the closure of dache,and use not cacheable Memory ,for the closure of dache i think it is unacceptable , for not cacheable Memory ,i had use it,But there will still be problems, We look forward to your reply
HI! @ALABSTM Tell me if you need any help or further information.
Hi @andy817501,
You mentioned configuring a memory region to be not cacheable. Did you ensure that your USB buffers are also in this non-cacheable region? Should I understand you did, when reading the sentence "make sure to configure the USB pool memory region with attribute "Non-Cacheable""?
If needed, you can refer to the provided USB examples showing how to configure the MPU, as in the code snippet below:
Please let me know whether it helps.
With regards,
yes, I Configure the MPU attributes as Normal Non Cacheable for RAM_D2,and use RAM_D2 as the usb_cdc_device's dma buffers is permissible,but I can not use the usb_cdc_host with dma
Describe the set-up
Additional context when i used the usb_host and opened the dma and dcache, the usb cannot work I have divided the memory area used by USB DMA into RAM-D2,I have configured R2 MPU_ACCESS_NOT_BUFFERABLE , MPU_ACCESS_NOT_CACHEABLE , MPU_ACCESS_NOT_SHAREABLE and MPU_TEX_LEVEL1 and when I turn off DCAHCE, USB host and dma can be used normally,or I can use SCB->CACR |= SCB_CACR_FORCEWT_Msk And use __DSB() in the HAL_SCD_ShenfyURBChange_Callback function; It can also be used, but I'm not sure if it will affect performance. Is there any way not to turn off dcache and not to use SCB->CACR |= SCB_CACR_FORCEWT_Msk for dcache.