‎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 02: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 ...
‎2020-07-29 02: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.
‎2020-07-29 02: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.
‎2020-07-29 02:40 AM
Ups I thougt my first answer disapeared sorry.
‎2020-07-29 02: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 !
‎2020-07-29 02: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:
‎2020-07-29 02: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.
‎2020-07-29 02:56 AM
Thank you very much.
You are the best=)
‎2020-07-29 03:10 AM
You're welcome. Please tag such topic as Answered will help community.
‎2020-07-29 03: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.😅