cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `HAL_DFSDM_ChannelInit'

IWhit.2
Associate II

I'm using the BSP audio functions in my application. All of this is unmodified and straight from github. My current problem is the linker being unable to find several of the HAL_DFSDM functions called from STM32F769i_discovery_audio.c. The really puzzling part is I've got a section of code....

 if(HAL_OK != HAL_DFSDM_ChannelInit(&hAudioInTopLeftChannel))

 {

 return AUDIO_ERROR;

 }

which the linker reports undefined reference. But... just twenty lines further on in the same function (static uint8_t DFSDMx_Init(uint32_t AudioFreq) this code....

  if(HAL_OK != HAL_DFSDM_ChannelInit(&hAudioInTopRightChannel))

 {

  return AUDIO_ERROR;

 }

doesn't report an error.

What's going on? How can the linker report an undefined reference but not then report a problem when the same call occurs later in the very same function?

My main.c is a c++ function but stm32f769i_discovery.h and stm32f769i_discovery_audio.h are included with

extern "c" {

#include "stm32f769i_discovery.h"

#include "stm32f769i_discovery_audio.h"

}

Any help gratfeully appreciated

1 REPLY 1
Semer CHERNI
ST Employee

Hello @IWhit.2​ 

First let me thank you for posting.

I was not able to reproduce the misbehavior you mentioned in your post. Perhaps we are not using the same environment.

I have conduced the test on the "BSP" example for "DFSDM" Library with CubeMx 6.6.1 and CubeIDE 1.10.1.

0693W00000UnOieQAF.png 

To be able to push the analysis further, I will need a link for the project you used and the complete compilation log.

Kind regards,

Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.