Not getting ADC ready signal (ADRDY bit) after enable STM32U5A5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 2:45 AM - edited ‎2025-02-18 4:09 AM
I am working with STM32 U5A5 series of STM32 controllers and currently facing one issue with ADC1, Getting timeout when we try to enable ADC(this issue we are getting only for ADC1 and ADC4 is working as expected).
Below are the code
hadc1.Instance = ADC1;
hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;
hadc1.Init.Resolution = ADC_RESOLUTION_14B;
hadc1.Init.GainCompensation = 0;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
hadc1.Init.LowPowerAutoWait = DISABLE;
hadc1.Init.ContinuousConvMode = DISABLE;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
if (HAL_ADC_Init(&hadc1) != HAL_OK)
{
Error_Handler();
}
__HAL_RCC_GPIOC_CLK_ENABLE();
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_4;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_5CYCLE;
sConfig.SingleDiff = ADC_SINGLE_ENDED;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.Offset = 0;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
HAL_ADCEx_Calibration_Start( &hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED );
Inside HAL_ADCEx_Calibration_Start function ADC_Enable(hadc) is called there we are getting timeout.
can anyone please help me to figure out what is missed. Same code is working fine with U575 series but getting timeout issue for U5A5 series.
- Labels:
-
STM32U5 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 3:02 AM
Do you have the analog voltage domain isolation removed, i.e. PWR_SVMCR.ASV set?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 3:07 AM
yes PWR_SVMCR.ASV set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 5:19 AM
Hello @mohan-ltts
Please refer to the example Projects/NUCLEO-U575ZI-Q/Examples/ADC/ADC_SingleConversion_TriggerSW_IT to correctly set up your configuration.
Thanks
Omar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 5:22 AM - edited ‎2025-02-18 5:24 AM
Hello @Saket_Om ,
In U575 board it is working as expected and with U5A5 board only we are getting timeout issue.
Any changes we need specific to U5A5 board compare to U575?
Thanks,
Mohan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 5:46 AM
The linked example uses the U575 and ADC1. Probably worth checking out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 5:53 AM
Hello @mohan-ltts
I have reported your issue internally. However, if you can share your project, we will be able to assist you more effectively.
Internal ticket number: 203506 (This is an internal tracking number and is not accessible or usable by customers).
Thanks
Omar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-18 5:53 AM
ADC clock enabled and running?
Read out and check/post ADC registers content.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-19 5:13 AM
ADC clock enabled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-02-24 7:19 AM
Hello @mohan-ltts
Could you please try the following tests and check the results:
- Comment out the function call for the calibration step and perform HAL_ADC_Start(). Check if the function still exits in a timeout state. If yes, the issue comes from the flag ADC_FLAG_RDY and not the calibration. ADC_FLAG_RDY requires the kernel clock to be activated.
- In the ADC configuration, replace ADC_CLOCK_ASYNC_DIV1 with ADC_CLOCK_ASYNC_DIV4. The U5 can run at 160 MHz, and the ADC kernel clock is limited to 55 MHz. Using the prescaler ADC_CLOCK_ASYNC_DIV4 ensures that the ADC is not overclocked.
Thanks
Omar
