cancel
Showing results for 
Search instead for 
Did you mean: 

How to add library to BSP driver and install it in STM32CubeIDE - TouchGFX project

TTú.1
Associate III

Hello everyone!

I am a person who is learning about GUI programming, my project requires interface design on touchgfx software and using STM32F429ZI kit.

I am doing reading a signal from a kit's button, the purpose is to use this signal to trigger another action.

I referenced a sample project from the developer following the link below (From GUI Task -> A working example for STM32F429):

https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/backend-communication

Here I see a sample project that uses the STM32F429I-Discovery library (added in the BSP driver) to use a function that reads data from the kit's button.

I have created a new project that also uses the STM32F429I-Discovery library to read data from the kit's button using the STM32CubeIDE software. I followed the instructions in the link below to add the STM32F429I-Discovery library:

https://www.youtube.com/watch?v=5gCNhFbwrLU&t=214s

But then I got the error "undefined reference to `BSP_PB_GetState'" in the model.cpp file (the BSP_PB_GetState function is the function that reads the signal from the button, placed in the Model::tick() function of the model.cpp file).

As far as I think the error could be because the file.h and file.c of the library were not linked together when I installed. Or I installed it wrong.

Can someone show me how to correctly add the library to the BSP driver?

Software I am using:

TouchGFX 4.16.1

STM32CubeMX 6.2.0

STM32CubeIDE 1.6.1

This is my project:

https://drive.google.com/file/d/1ZkqQEz21tRwr7N1oGBaPsd6pIVBhDACy/view?usp=sharing

Thank you so much everyone!

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Trần Tú​ and welcome to the Community 🙂

Go to Tool Settings tab and C Compiler->Directories section, then add the new folders containing include files:

../Drivers/BSP/Components/Common

../Drivers/BSP/Components/<library>

../Drivers/BSP/STM32F429I-Discovery

To figure out what is missed in your configuration, please have a look at this ST video, and this article that can help you to add the library to the BSP driver in STM32CubeIDE.

Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @Trần Tú​ and welcome to the Community 🙂

Go to Tool Settings tab and C Compiler->Directories section, then add the new folders containing include files:

../Drivers/BSP/Components/Common

../Drivers/BSP/Components/<library>

../Drivers/BSP/STM32F429I-Discovery

To figure out what is missed in your configuration, please have a look at this ST video, and this article that can help you to add the library to the BSP driver in STM32CubeIDE.

Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
TTú.1
Associate III

Thanks for your help!