AnsweredAssumed Answered

STM32-MAT/TARGET. Tons Of Bugs: Incorrect generation of projects for SW4STM32 and TrueSTUDIO

Question asked by Dima Sagalov on Feb 26, 2018

Environment:

Windows10 (x64)

Matlab R2017a

STM32-MAT/TARGET-v4.4.2

STM32CubeMX-v4.24.0

STM32Cube MCU Package for STM32F0 Series -v1.9.0

STM32Cube MCU Package for STM32F3 Series -v1.9.0

SW4STM32-v2.4

TrueSTUDIO-v9.0.0

 

I begin with the first problem that I encountered: the projects generated by STM32-MAT / TARGET "cling" not all of the directories «include» and «source».

The problem manifests itself for both the IDE, SW4STM32 and TrueSTUDIO, but a little differently.

 

With SW4STM32 projects, everything is relatively simple - the code generator does not add the <project_name>/Src path to the project files. It is necessary to prescribe manually.

 

With the project TrueSTUDIO is going through more strange things: the contents of the Drivers/STM32F3xx_HAL_Driver directory are not completely visible through the Project Explorer:

 

 

The files in this directory are ignored by the compiler.

And, it looks like the problem is in the ".project" file.

 

If you compare the "pure" TrueSTUDIO project generated with STM32CubeMX, and the project generated with STM32-MAT / TARGET + STM32CubeMX, you see that in the second case the following lines are added to the file ".project":

 

<link>

<name>Application</name>

<type>2</type>

<locationURI>virtual:/virtual</locationURI>

</link><link>

<name>MATLAB</name>

<type>2</type>

<locationURI>virtual:/virtual</locationURI>

</link><link>

<name>Drivers</name>

<type>2</type>

<locationURI>virtual:/virtual</locationURI>

</link><link>

<name>Drivers/CMSIS</name>

<type>2</type>

<locationURI>virtual:/virtual</locationURI>

</link><link>

<name>MATLAB/incorrect_project_truestudio.c</name>

<type>1</type>

<location>D:/stm32_mat_target_fixme/incorrect_project/incorrect_project_truestudio/incorrect_project_truestudio/Src/incorrect_project_truestudio.c</location>

</link>

 

If you delete them, the Drivers/STM32F3xx_HAL_Driver directory becomes visible through the Project Explorer and is no longer ignored by the compiler. But, again, you have to manually assign the paths <project_name>/Inc and <project_name>/Src.

Attachments

Outcomes