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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:19 AM
Except this guys is starting from a STM32Cube expansion pack according snapshot sharing.
Good question is @Community member​ how to you import such project from pack ? Some tricks may exist here depending of your way of working ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:30 AM
Yes the project I'm starting with is an example from the IBM Watson expansion pack. It collects sensor data and sends the data to the IBM Cloud with MQTT protocol. There were different project files for Kei, EWARM and SW4STM32, the cube ide transformed the SW4STM32 project to the workspace when I first started it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:37 AM
Actually this is a project from the IBM Watson expansion pack. It collects sensor data and then sends the data to the IBM Cloud via MQTT protocoll.
The project file was a SW4STM32 project. The cube ide transformed into the workspace after i started it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:40 AM
Ups I thougt my first answer disapeared sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:43 AM
@Community member​ ok I've got a try myself to your STM32Cube expansion pack.
Doing proper import and adding HAL_ADC_Start(&hadc); to main.c I'm facing same issue as you.
Issue is not .h lack but .c one :)
Just add .c file and your project build is going to be successful !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:45 AM
@MM..1​ Such STM32Cube exansion pack is not STM32CubeMX compliant and as addon promoting SW4STM32 material not STM32CubeIDE one ...
FYI proper import working model is:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:50 AM
Solution is not .h but .c lack assuming you've rightly setup proper defines are shared previously. Setting reauired defines are taking care of .h include but still .c files are required from you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 2:56 AM
Thank you very much.
You are the best=)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 3:10 AM
You're welcome. Please tag such topic as Answered will help community.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-29 3:38 AM
I tried to start a new project, to make erverything right from the beginning. I uncommented the module in config.h and added stm32l4xx_hal_adc.c and stm32l4xx_hal_adc_ex.c as well. I included the header files in main.c and tried to initailize the ADC, now i have the same errors again.:grinning_face_with_sweat:
