cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723ZG USB CDC ADC DMA

AKhot.1
Senior

I am using STM32H723ZG nucleo board. When I enable HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buf, ADC_BUF_LEN); USB Virtual port doesn't show up and when I disable it, it shows up. Can anyone explain what could be the issue?

AKhot1_0-1693307526832.png

I was able to print "Hello" character using CDC_Transmit_HS function when DMA(in circular mode) wasn't enabled. When I enabled it, Virtual port doesn't show up. Please help me with this.

AKhot1_1-1693307704147.png

 

AKhot1_3-1693307747447.png

Above is the clock setting.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Would be good to see more relevant code.

Guessing the issue is related to your ADC complete handling/callback, probably stuck in interrupts and not servicing the USB properly.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
LCE
Principal

How are adc_buf and ADC_BUF_LEN defined?

And just to make sure that you are not activating any DMA stuff before MX_DMA_Init(), better move that "up", so that MX_DMA_Init() is called immediately after GPIO init.

#define ADC_BUF_LEN 128

volatile uint32_t adc_buf[ADC_BUF_LEN];

TDK
Guru

Would be good to see more relevant code.

Guessing the issue is related to your ADC complete handling/callback, probably stuck in interrupts and not servicing the USB properly.

If you feel a post has answered your question, please click "Accept as Solution".

You are right. In the complete callback function I called system reset function. 

My Bad!!

Thank you so much