cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Calibration Failure on STM32N657 Using ADC1 Channel 1

dw1
Associate II

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

5 REPLIES 5
Imen.D
ST Employee

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.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
dw1
Associate II

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

Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
dw1
Associate II

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

Hello @dw1 

Please update your post in english. 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om