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 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 12:58 AM
Check modules enabled in stm32l4xx_hal_conf.h
2020-07-29 01:16 AM
Include path definitionissue ? ... could be same as : https://community.st.com/s/question/0D53W00000DJpGPSA1/file-added-and-path-added-but-still-get-no-such-file
Takes care about your include coloring ... Is such include setup effective from Eclipse point of view already ? Please could you check if such line is leading to plain or grayed include like following snapshot ... if grayed means Eclipse not able to reach
Then if ok possibly some define to enable stuff as advised by @Community member
2020-07-29 01:40 AM
Thanks for the quick answers!
I think the paths are valid, nothing is grey.
What could be the problem with define to enabel?
I'm relatively new to programming.
2020-07-29 01:46 AM
So I think #define HAL_ADC_MODULE_ENABELD is missing?
2020-07-29 01:46 AM
These kind of define to be uncommented in sync. with your IP(s) usage.
2020-07-29 01:49 AM
I guess so.
2020-07-29 01:55 AM
Still the same Error.
2020-07-29 02:07 AM
I recomm create your project from scratch in CubeMX .
2020-07-29 02:14 AM
Could you x2 check your Drivers/STM32L4xx_HAL_Driver/Inc & Src content ?
Are .h/.c files here ? Are .h/.c files exist ?
Takes care to small icon overlay on files like ...