ADC Calibration Failure on STM32N657 Using ADC1 Channel 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-21 9:32 PM - last edited on ‎2025-06-24 10:11 PM by Imen.D
Dear STMicroelectronics Support Team,
I am encountering an issue with ADC calibration on the STM32N657 microcontroller. Despite multiple attempts, the calibration process consistently fails. Below are the details of my setup and observations for your reference:
Hardware Configuration:
-
ADC: ADC1, Channel 1
-
Reference Voltage:
-
VREF+: External 1.8V (measured 1.76V)
-
VREF-: Ground
-
-
Other: Enabled ICache/DCache, GPIO, USART1, and system isolation.
Software Configuration:
-
Initialization Code:
SCB_EnableICache();
SCB_EnableDCache();
HAL_Init();
MX_GPIO_Init();
MX_ADC1_Init();
MX_USART1_UART_Init();
SystemIsolation_Config();
// Debug: Check registers post-init
printf("Post-Init ADC_CR: 0x%08lX\r\n", hadc1.Instance->CR); // Output: 0x00000000
printf("Post-Init ADC_ISR: 0x%08lX\r\n", hadc1.Instance->ISR); // Output: 0x00000000
// Explicit MSP init (debug)
HAL_ADC_MspInit(&hadc1);
printf("Post-MSP ADC_CR: 0x%08lX\r\n", hadc1.Instance->CR); // Output: 0x00000000
printf("Post-MSP ADC_ISR: 0x%08lX\r\n", hadc1.Instance->ISR); // Output: 0x00000000
// Attempt calibration
HAL_StatusTypeDef status = HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
if (status != HAL_OK) {
printf("Calibration Failed. CR: 0x%08lX, ISR: 0x%08lX\n",
hadc1.Instance->CR, hadc1.Instance->ISR); // CR: 0x00000001, ISR: 0x0000000B
while(1);
}
-
Observed Behavior:
-
Register States:
-
After initialization, and remain , suggesting ADC is not enabled.ADC_CRADC_ISR0x00000000
-
Post-calibration failure:
-
ADC_CR = 0x00000001 (ADEN bit set, but no further activity).
-
ADC_ISR = 0x0000000B (Flags: + + ).ADRDYEOSEOC
-
-
-
Calibration Outcome:
-
Always fails with .HAL_ERROR
-
Questions:
-
Why do and stay zero after initialization? Is the ADC not properly enabled?ADC_CRADC_ISR
-
Could the external reference voltage (1.76V, slightly below nominal 1.8V) cause calibration failure?
-
Are there known errata or configuration steps specific to STM32N657 for ADC calibration?
Additional Context:
-
CubeMX Configuration:
-
Single-ended mode, 12-bit resolution, software trigger.
-
No DMA/IRQ, scan mode disabled.
-
-
Troubleshooting Attempts:
-
Verified clock configuration (ADC clock ≤ max limit).
-
Checked VDDA/VREF+ stability with oscilloscope.
-
I would greatly appreciate any insights or suggestions to resolve this issue. Please let me know if further details are required.
Best regards,
dw1 -
EDIT by ST Moderator: elaborate this post in English
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32N6 series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-07-01 1:16 AM - edited ‎2025-07-01 1:16 AM
Hello @dw1
Could you please add the call to the function HAL_PWREx_EnableVddA() in HAL_ADC_MspInit().
Please see the example below:
Saket_Om
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-23 2:10 AM
Hello @dw1 ,
We advise you to post your question in English to insure a quick response for the Community.
This can also help other users to take advantage of your post, in the case they have the same question.
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-23 2:55 AM
Hello Imen,
Thank you for your advice! I will make sure to post my question in English next time. I appreciate your help and will mark the solution once my question is answered.
Best regards,
dw1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-23 8:11 AM
Could you please share your CubeMX project or ADC configuration settings, including clock source and prescaler values, to further analyze the issue ?
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-23 8:48 AM
Hello Imen,
Thank you for your prompt response. To further assist in diagnosing the ADC calibration issue, I have attached a compressed file containing my complete STM32CubeMX project, including all configuration files and source code.
I hope these files meet your requirements for deeper analysis. Please let me know if any additional information is needed. Your expertise is greatly appreciated.
Best regards,
dw1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-24 8:58 AM
Hello @dw1
Please update your post in english.
Saket_Om
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-07-01 1:16 AM - edited ‎2025-07-01 1:16 AM
Hello @dw1
Could you please add the call to the function HAL_PWREx_EnableVddA() in HAL_ADC_MspInit().
Please see the example below:
Saket_Om
