‎2020-07-29 12:52 AM
Hey there,
I tried to modify an existing project by using the ADC to measure a current. My problem is when I try to include the header stm32l4xx_hal_adc.h and use the functions like HAL_ADC_Start(); i will get the error undefined "reference to...". It's the same for every function declared in the header. The path for the header is added to the compiler. Some definitions from the header are recogniced only the functions aren't. Does anyone know how to solve this problem?
Thanks in advance.
Solved! Go to Solution.
‎2020-07-29 03:41 AM
"start a new project" takes care due to such example packaging your primary sources may have been corrupted Thanks your first trials.
Be sure to delete your pack then expand it back from original .zip and have a new try.
‎2020-07-29 03:43 AM
Thats what I did:grinning_face_with_sweat:
‎2020-07-29 04:27 AM
Here are my steps leading to result ok from scratch
1) Import SW4STM32 project
2) Set defines (*_conf.h file is not local to project but part of the pack ... considering file system. In other words I've not a local copy ...)
3) Add source code to main.c
4) Add required .c files
5) Get compile success
‎2020-07-29 04:59 AM
OK I fixed it now. So before I can use this fuctions to read the ADC i have to initialize the ADC first, i guess to take an initailization code from cubemx and copy/paste it into my project is not a good idea?
‎2020-07-29 05:21 AM
cubemx is valuable but having to care take care to all dependencies ...
Please tag as answered once ok