Skip to main content
TTú.1
Associate II
July 27, 2021
Solved

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

  • July 27, 2021
  • 2 replies
  • 2867 views

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!

This topic has been closed for replies.
Best answer by Imen.D

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

2 replies

Imen.DBest answer
Technical Moderator
July 27, 2021

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
TTú.1
TTú.1Author
Associate II
July 28, 2021

Thanks for your help!