cancel
Showing results for 
Search instead for 
Did you mean: 

A BUG about using STM32-MAT to automatically generate code

liu qimin
Associate

Some times when we follow the usual process to build a SIMULINK model of STM32 MCU, hoping to use the STM32-MAT tool chain to automatically generate code that STM32 MCU can run. The HEX or BIN file obtained as a result is downloaded to the MCU, but the MCU does not operate in accordance with the desired action.

After many experiments, it is found that when creating a CubeMX project, select "Advanced" in the "Application Structure" option of the Project Manager window (the default option when creating a new project), then the BIN (HEX) file we finally get is invalid , And during the creation process, the software did not prompt that an error occurred.

When "Basic" is selected in the "Application Structure" option of the Project Manager window, the final BIN (HEX) file we get is valid, and it runs normally in the MCU. I don't know if this is STM32-MAT or an error generated by CubeMX, I hope it can be corrected.

There is also a small problem. After the Simulink correctly generates the project and imports it into the compilation tool, if the generated EWARM project is compiled without problems after importing, and the TrueSTUDIO or STM32Cube project is generated, it will prompt that some source files cannot be found during compilation. Then, you need to manually add the source file path generated by Simulink, TrueSTUDIO or STM32Cube can compile correctly.

0693W00000595hDQAQ.png

3 REPLIES 3

Hi @liu qimin​ 

I didn't understand you request very well.

You request is to change the Application Structure to "Basic" when we are using STM32-MAT ? Please correct me if I'm wrong.

Best regards,

Nesrine

I think the underlying request is to fix your tools so they interact and function properly with any combination of the settings.​

It might be presented better with non working projects.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
liu qimin
Associate

Hi

Nesrine

As mentioned by clive1, when the STM32-MAT tool chain calls .IOC files of different configurations, some of the generated projects can be successfully compiled in CubeIDE, and some have compilation errors.

And there is a more serious error. When there are more complicated models in the SIMULINK model (such as a complicated STATE_FLOW model), no matter how you configure the .IOC file, the generated project cannot be compiled in CubeIDE. Therefore, if these errors are not corrected, this tool chain has no application value in actual engineering.

Best Regards!

LiuQimin