cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MAT Target & STM32CubeMX toolchain not producing buildable files

LWood.662
Associate

Hi everyone,

I'm trying the get the following setup working for a F767 nucleo board:

Matlab/Simulink R2019b

STM32MAT/Target v5.1.0

STM32CubeMX v5.4.0

SW4STM32

(All latest versions)

I've set up the model settings in Simulink to use the STM32.TLC, and pointed Simulink to the directory that contains Cube.

I've created the .IOC, and generated the project code, which opens nicely in SW4STM32

0690X00000ArV3RQAV.png

Building via simulink (simple model of GPIO in and GPIO out to turn LED on and off), seems to work, but leaves the folder structure below:

0690X00000ArV3WQAV.png

The project builds without error in SW4STM32, but resulting .ELF has no mention of the simulink generated code anywhere in it, and so does nothing when downloaded to the Nucleo board:

0690X00000ArV3MQAV.png

It seems to me that although the STM32-MAT/Target is creating code, Cube just ignores it when doing its thing.

Does anyone have any ideas please?

2 REPLIES 2
LWood.662
Associate

SOLVED!

So, a little more figuring out leads me to this, which I'll leave here for anyone else that might come across it.

It seems that when Cube builds the project code, it defaults to not including the generated files in the build process in SW4STM32. The following shows how to make it included.

NOTE: only the Cube generated files need including, not the Simulink generated files. In the below picture you can see two folders, "767_Test_06a" and "767_Test_06a_STM32". The "_stm32" is the Simulink generated files, and can be left as NOT included in the build.

0690X00000ArVDvQAN.png

0690X00000ArVE0QAN.png

0690X00000ArVEAQA3.png

Takumi Lee
Associate III

@User15725204371392755109

Thank you so much :D, omg you saved my day !

File with ..... "_stm32" -> right klick -> Properties -> C/C++ Build -> [X] Exclude resource from build

FIle without "_stm32" -> right klick -> Properties -> C/C++ Build -> [..] Exclude resource from build