cancel
Showing results for 
Search instead for 
Did you mean: 

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

FabriceG
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

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

View solution in original post

6 REPLIES 6
FBL
ST Employee

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

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

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

I'm using HID profile

FBL
ST Employee

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
FabriceG
Associate II

Thanks FBL, it's clear now.