simulink question when do cord action.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello supporter,
I have a question about generating code,that it gets some error
.( Model Action Rebuild Reason
=================================================================
ltj Failed Code generation information file does not exist.
0 of 1 models built (0 models already up to date)
Build duration: 0h 0m 5.425s
Error:Error(s) encountered while building "ltj")
could you please help me to check the problem?
How to solve it?
Thanks a lot!
B.R.
Tangjuan

0 comentarios
Respuestas (3)
karthik kumar k
el 9 de Feb. de 2025
The error you are encountering, "Code generation information file does not exist," is common when there are issues with the Simulink model setup or the environment configuration for code generation. Here are the precise steps to resolve it:
1. Check Embedded Coder Setup
Ensure you have Embedded Coder installed. To verify:
Go to MATLAB and type:
ver
- Check if Embedded Coder is listed in the installed toolboxes.
- If not, install it via MATLAB Add-Ons.
2. Install and Configure STM32 Support Package
- Ensure the Embedded Coder Support Package for STMicroelectronics STM32 Processors is installed:
In MATLAB, navigate to Home > Add-Ons > Get Add-Ons.
Search for and install the STM32 support package.
After installation, configure the paths to the STM32CubeMX or STM32CubeIDE tools during the setup.
3. Verify the System Target File
Open your Simulink model (ltj).
Go to Simulation > Model Configuration Parameters > Code Generation.
Ensure the System Target File is set to ert.tlc (default for Embedded Coder).
- If STM32-specific files (like stm32.tlc) are available, use those.
Check the Toolchain in Code Generation > Toolchain Selection. Set it to:
- STM32CubeIDE
- OR ARM Cortex-M (if no STM32-specific options appear).
4. Fix Path Issues
- Ensure that all required directories are accessible and writable:
Avoid using folders with spaces or special characters in the file path.
Generate the code in a new, simple directory like:
cd('C:\STM32CodeGeneration')
5. Rebuild the Model
- Run the following commands to rebuild the model:
slbuild('ltj') % Build the model
This will generate the code and highlight any further errors.
6. Check Block Configurations
- Double-check the configurations of all blocks, especially GPIO blocks in your model:
Ensure the GPIO_Write blocks are correctly configured for the STM32F4 hardware (e.g., pin assignments match the hardware setup).
Confirm that the STM32_Config block is properly set for your STM32F407VET6 target.
7. Update MATLAB and STM32 Tools
- Ensure you are using the latest versions of MATLAB, STM32CubeMX, and STM32CubeIDE. Older versions might cause compatibility issues.
8. Clean Temporary Files
- Sometimes, temporary files cause conflicts. Clean them as follows:
Close MATLAB.
Navigate to your MATLAB working directory.
Delete the slprj folder and the ltj_ert_rtw folder.
Reopen MATLAB and rebuild.
9. Analyze Diagnostic Viewer Logs
After rebuilding, open the Diagnostic Viewer:
Go to the MATLAB command window and review the detailed error logs for specific root causes.
Look for any missing configuration files, permissions issues, or unsupported blocks.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!