Skip to main content
chriskuku
Senior II
December 19, 2025
Solved

expected 'const ADC_HandleTypeDef *' but argument is of type 'ADC_HandleTypeDef'

  • December 19, 2025
  • 1 reply
  • 332 views

Today I started STM32CubeIDE again, was notified that an update is due, installed the update (2.0.0). Got an error alert "Computing 'size'", and the Info startup said "URL not found". Anyway, ignored this, started to build my project again. I added ADC1 (before I did the update), but didn't compile that with the old version of Cube. Now the first compile under the new version fails, saying :

../Drivers/STM32H5xx_HAL_Driver/Inc/stm32h5xx_hal_adc.h:1981:67: note: expected 'const ADC_HandleTypeDef *' but argument is of type 'ADC_HandleTypeDef'
 1981 | uint32_t HAL_ADC_GetValue(const ADC_HandleTypeDef *hadc);
 | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
Best answer by Andrew Neil

You've passed the handle itself, but the function requires a pointer to the handle.

 

PS:

Here's some instructions for posting formatted text which is not source code - such as compiler output.

1 reply

Andrew Neil
Andrew NeilBest answer
Super User
December 19, 2025

You've passed the handle itself, but the function requires a pointer to the handle.

 

PS:

Here's some instructions for posting formatted text which is not source code - such as compiler output.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
chriskuku
chriskukuAuthor
Senior II
December 19, 2025

Ah, silly me. I didn't care when using autocompletion (CTRL-Space). Thanks. Is working now.