Skip to main content
AKhot.1
Associate III
August 29, 2023
Solved

STM32H723ZG USB CDC ADC DMA

  • August 29, 2023
  • 2 replies
  • 3023 views

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.

 

 

This topic has been closed for replies.
Best answer by TDK

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.

2 replies

LCE
Principal II
August 29, 2023

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.

AKhot.1
AKhot.1Author
Associate III
August 29, 2023

#define ADC_BUF_LEN 128

volatile uint32_t adc_buf[ADC_BUF_LEN];

TDK
TDKBest answer
Super User
August 29, 2023

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""."
AKhot.1
AKhot.1Author
Associate III
August 29, 2023

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

My Bad!!

Thank you so much