2026-02-25 3:55 AM
Hi everyone,
I'm trying to use OTG in FS Mode with DMA enabled (I know it's not a consistent use case, as FS datarate is pretty low)
But still, I changed the code in Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pcd.c :
...
#if defined (USB_OTG_FS)
/* Disable DMA mode for FS instance */
if (USBx == USB_OTG_FS)
{
hpcd->Init.dma_enable = ENABLE; //FGE: try to use OTG FS with DMA enabled
}
#endif /* defined (USB_OTG_FS) */
...
But it does not enumerate.
This is the only change I brought to the CubeMX generated code
Any hints ?
Thanks
Fabrice
Solved! Go to Solution.
2026-02-26 2:13 AM
Hi @FabriceG
This is not the proper way to test USB DMA (by modifying drivers). As I suggested, you can refer to the example and enable DMA in the initialization. You can refer directly here; I've tested it on my end and it's working as expected.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-02-25 5:13 AM
2026-02-25 5:20 AM
Make sure that any data buffer you allocate in RAM and try to reach using the OTG's DMA is NOT in the CCMRAM.
JW
2026-02-25 6:45 AM
Hi,
>trying to use OTG in FS Mode
but no info, what you wanna do at all : host : for ...? , device : for ...? and dma , because ...?
+
> But it does not enumerate.
Who should enumerate ...? as a ...?
2026-02-25 7:49 AM
I'm using HID profile
2026-02-26 2:13 AM
Hi @FabriceG
This is not the proper way to test USB DMA (by modifying drivers). As I suggested, you can refer to the example and enable DMA in the initialization. You can refer directly here; I've tested it on my end and it's working as expected.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-04-07 2:26 AM
Thanks FBL, it's clear now.