Issue using stm32L4 with matlab 2025a
Show older comments
### Invoking Target Language Compiler on stm32L4_blink.rtw
### Using System Target File: C:\Program Files\MATLAB\R2025a\rtw\c\ert\ert.tlc
### Loading TLC function libraries
........
### Initial pass through model to cache user defined code
### Caching model source code
..............................
### Writing header file stm32L4_blink_types.h
.
### Writing header file stm32L4_blink.h
### Writing header file rtwtypes.h
### Writing source file stm32L4_blink.c
### Writing header file stm32L4_blink_private.h
### Writing header file rtmodel.h
.
### Writing source file ert_main.c
### TLC code generation complete (took 1.272s).
### Saving binary information cache.
### Generating code from STM32CubeMX project: E:\matlabexample\stm32l7\stm32l4blinkled.ioc
### Build procedure for stm32L4_blink aborted due to an error.
Top model targets:
Model Build Reason Status Build Duration
=========================================================================================================================================
stm32L4_blink Information cache folder or artifacts were missing. Failed to build. For more information, see build log. 0d
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 41.734s
Error:E:\matlabexample\stm32l7\.mxproject\.mxproject file does not exist at .ioc project path E:\matlabexample\stm32l7\.mxproject. Ensure code is generated from STM32CubeMX project.
Also In Matlab2025a Toolchain changed to ARMClANG. ANY Changes required in CubeMX Related to this?
Accepted Answer
More Answers (1)
Anmol
on 3 Sep 2025
Hi Ankit,
I understand that you are generating code for a Simulink/Embedded Coder for an STM32 project working with MATLAB 2025a and facing the mentioned error:
Error:E:\matlabexample\stm32l7\.mxproject\.mxproject file does not exist at .ioc project path E:\matlabexample\stm32l7\.mxproject. Ensure code is generated from STM32CubeMX project.
This error is occurring because of the missing .mxproject file at the .ioc project path.
The primary purpose of the .mxproject file is to tell the STM32CubeIDE build system how to compile and link your code correctly. It stores the metadata that is generated when you configure your project in STM32CubeMX .This file is specific to the IDE and holds information that the compiler and linker need to do their job.
You can refer to this example to better understand the workflow of working with CubeMX project and MATLAB. This might help you identify any issues in configuring the model.
www.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ug/Getting-started-stm32cubemx.html
Hope, this helps.
Categories
Find more on STMicroelectronics Discovery Boards in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!