Skip to main content
Associate II
February 25, 2026
Solved

Nucleo-144 F439ZI : OTG in FS Mode with DMA does not enumerate

  • February 25, 2026
  • 5 replies
  • 162 views

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

Best answer by FBL

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.

5 replies

Technical Moderator
February 25, 2026

Hello @FabriceG 

Do you reproduce when starting with this reference example?

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.Best regards,FBL
waclawek.jan
Super User
February 25, 2026

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

AScha.3
Super User
February 25, 2026

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 ...?

"If you feel a post has answered your question, please click ""Accept as Solution""."
FabriceGAuthor
Associate II
February 25, 2026

I'm using HID profile

FBLBest answer
Technical Moderator
February 26, 2026

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.Best regards,FBL
FabriceGAuthor
Associate II
April 7, 2026

Thanks FBL, it's clear now.