I cannot use the HAL functions for ADC?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
ADC
-
STM32CubeIDE
-
STM32L4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 4: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 12:58 AM
Check modules enabled in stm32l4xx_hal_conf.h
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1: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​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1:46 AM
So I think #define HAL_ADC_MODULE_ENABELD is missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1:46 AM
These kind of define to be uncommented in sync. with your IP(s) usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1:49 AM
I guess so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 1:55 AM
Still the same Error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:07 AM
I recomm create your project from scratch in CubeMX .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2: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 ...
