simulink question when do cord action.

2 visualizaciones (últimos 30 días)
唐
el 9 de Feb. de 2025
Respondida: el 11 de Feb. de 2025
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

Respuestas (3)

唐
el 10 de Feb. de 2025
Hello karthik,
Thanks for your explanaition and quick response. I will do it following your steps to check the reason.
B.R.
TangJuan

唐
el 11 de Feb. de 2025
Hello Karthik,
As your suggestion, I do reinstall software to solve the problem. I can do Building step in simulink.
I can generate a Keil program correctly when I am using STM32F103C8Tx.
however, when I change to STM32F407VETx, I get the message about warning.
It could not generate the correct Keil program.
Could you please help to check?
Thanks a lot!!
B.R.
Tangjuan
The "ARM CMSIS SIN COS" code replacement library includes the standard math library "C89/C90 (ANSI)". To avoid this warning, you can specify the code replacement library as "None" or remove the base CRL specification if applicable, then select the desired math library via the standard math library (TargetLangStandard) parameter.
The "ARM CMSIS SIN COS" code replacement library includes the standard math library "C89/C90 (ANSI)". To avoid this warning, you can specify the code replacement library as "None" or remove the base CRL specification if applicable, then select the desired math library via the standard math library (TargetLangStandard) parameter.
### Real-Time Workshop build procedure for method: 'entry
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### STM32CubMx used version: 4.250000e+00
### Starting Real-Time Workshop build procedure for model: TEST4071
### Windows version:win64
### Model connectivity is: normal
### Create verification block: None
Code Generation 1
Elapsed: 1 sec
### Generating code into build folder: C:\Users\Administrator\Desktop\TEST4071\TEST4071_stm32
### Generated code for 'TEST4071' is up to date because no structural, parameter or code replacement library changes were found.
### Real-Time Workshop build procedure for method: 'before_tlc
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### before_tlc
### Real-Time Workshop build procedure for method: 'after_tlc
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### after_tlc
### Real-Time Workshop build procedure for method: 'before_make
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### Code Format : Embedded-C
.
### Processing Template Makefile: D:\MATLAB\STM32-MAT\STM32\rtw\stm32.tmf
### TEST4071.mk which is generated from D:\MATLAB\STM32-MAT\STM32\rtw\stm32.tmf is up to date
### Real-Time Workshop build procedure for method: 'after_make
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### Real-Time Workshop build procedure for method: 'exit
### modelName: 'TEST4071
### gcs: 'TEST4071
### bdroot: 'TEST4071
### Successful completion of Real-Time Workshop build procedure for model: TEST4071
Build process completed successfully

karthik kumar k
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
  1. Check if Embedded Coder is listed in the installed toolboxes.
  2. 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.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by