Skip to main content
Explorer II
June 22, 2025
Solved

ADC Calibration Failure on STM32N657 Using ADC1 Channel 1

  • June 22, 2025
  • 2 replies
  • 973 views

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:

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

    2. Calibration Outcome:

      • Always fails with .HAL_ERROR

    Questions:

    1. Why do  and  stay zero after initialization? Is the ADC not properly enabled?ADC_CRADC_ISR

    2. Could the external reference voltage (1.76V, slightly below nominal 1.8V) cause calibration failure?

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

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

    Hello @dw1 

    Could you please add the call to the function HAL_PWREx_EnableVddA() in HAL_ADC_MspInit(). 

    Please see the example below:

     STM32CubeN6/Projects/NUCLEO-N657X0-Q/Examples/ADC/ADC_AnalogWatchdog/FSBL/Src/stm32n6xx_hal_msp.c at main · STMicroelectronics/STM32CubeN6 · GitHub

    2 replies

    Technical Moderator
    June 23, 2025

    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.

    dw1Author
    Explorer II
    June 23, 2025

    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

    Technical Moderator
    June 23, 2025

    Could you please share your CubeMX project or ADC configuration settings, including clock source and prescaler values, to further analyze the issue ?

    Technical Moderator
    June 24, 2025

    Hello @dw1 

    Please update your post in english. 

    Saket_OmAnswer
    Technical Moderator
    July 1, 2025

    Hello @dw1 

    Could you please add the call to the function HAL_PWREx_EnableVddA() in HAL_ADC_MspInit(). 

    Please see the example below:

     STM32CubeN6/Projects/NUCLEO-N657X0-Q/Examples/ADC/ADC_AnalogWatchdog/FSBL/Src/stm32n6xx_hal_msp.c at main · STMicroelectronics/STM32CubeN6 · GitHub