cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX Generate All Source Files

nlippitt
Associate

Scenario: I am using STM32CubeMX (v6.13.0) to generate the necessary project files for a default STM32U5A9J-DK project with ThreadX enabled.  The project files are copied into a docker container and built with cmake.  Building and debugging in the container works until I attempt to add the ThreadX middleware.  Outside of the container building and debugging with STM32CubeIde is not an issue.

Problem: The STM32CubeMX generated project files are not sufficient to compile a ThreadX program.  Undefined reference problems flood the output.

Debug:

1) I have tried combinations of the settings in STM32CubeMX including: "Generate Under Root," "Enable multi-threaded support," and "copy all used libraries into the project folder" to no avail.  My cmake program recursively adds all .h, .c, and .s/.S files as sources or include paths as appropriate in the project folder, so all generated files are always used.

2) I attempted to resolve the undefined issues by manually adding the source files missing from the firmware package STM32Cube_FW_U5_V1.7.0.  I pull down the repository from git during my container setup.  First, I included all files in the package.  This was unsuccessful and resulted in errors.  Next, I included only necessary files and directories, viewed the remaining dependencies, and repeated the process.  This was a painful and undesirable tactic, and did not solve the problem either.  A file that did not exist in the firmware package was referenced.  Because ThreadX functions outside of the container referencing the same firmware package, I do not understand how to reference all the required files and why the option to "copy all used libraries into the project folder" fails for this middleware.

Please send support on resolving this issue.  I am hoping I am unaware of the proper way to access the needed files.  I can send more information on specific errors as desired.

Note: FreeRTOS was previously used in a similar fashion with a STM32H7 uC in a docker container without issue due to all necessary files being generated.  However with the STM32U5 I must use LevelX and USB operations, so ThreadX is the natural choice and I do not want to run into the same missing files issues when I add the LevelX and USB middlewares to the project.  Thanks!

2 REPLIES 2
STea
ST Employee

Hello @nlippitt ,

Can you send the output message and the include paths for the failing project.

Also, can you specify the exact way you pulled the repository from GitHub as missing the --recursive option can lead to missing middleware files as they are not part of the same repository.
Regards 

In order 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.

@STea wrote:

specify the exact way you pulled the repository from GitHub as missing the --recursive option can lead to missing middleware files 


@nlippitt see: https://community.st.com/t5/stm32-mcus/downloading-stm32cube-packages-from-github-correctly/ta-p/725288