Forum: System Workbench for STM32

Error Undefined reference .c hal driver file seems missing - How to add it

To develop my application, I have to use some USD device audio application examples developped for one of the stm32F4 Eval boards, and adapt that example to my STM32F4_dicovery. I have issues to adapt the different path from one project exemple to another project.

In the attached picture is the summary.
Error:
undefined reference to `HAL_PCDEx_SetRxFiFo’ usbd_conf.c /STM324xG-EVAL_USBD-FS/Application/User line 363 C/C++ Problem

I followed the cascade of includes and it seems OK, but stm32f4xx_hal_pcd_ex.c does not appear in the Project>Drivers>STM32F4xx_HaL_Driver folder. A lot of stm32f4xx_hal_xxx.c are here, but the one I need seems to be missing.

So the path seems OK as I have the majority of the hal source files, but a specific one that I need is missing.

On the project STM324x9I-EVAL_USBD-FS, compiles, and stm32f4xx_hal_pcd_ex.c does appear in the Project>Drivers>STM32F4xx_HAL_Driver folder.

How to correct this? I have not found where/how the folders Driver>BSP, CMSIS and STM32F4xx_HAL_Driver are defined (in project properties ?), and how it can happen that for a project, not all .c files from the folder may be listed.

I blocked all the day on this, spending a lot of time trying things, but nothing worked. Help would be much appreciated.

Best regards,

JMF

After looking some more to the .project of working and non working projects, I finally manually created a “Linked file” in the Project>Drivers>STM32F4xx_HaL_Driver folder pointing to stm32f4xx_hal_pcd_ex.c

It works.

It is not clear to me yet how are defined/implemented the project drivers folder in the different Cube projects. I had made the assumptions that all hal files would appear in all folders. But this seems wrong...

JMF