- Open your Simulink model (.slx) in Simulink.
- Navigate to the Configuration Parameters by clicking on "Simulation" in the Simulink menu and selecting "Configuration Parameters."
- In the Configuration Parameters dialog box, go to the "Code Generation" section.
- Look for the option related to "Data and function memory sections" or similar.
- Enable the option to "Generate separate code and data sections" or a similar option that allows for separate code and data generation.
- Save the configuration settings and generate the code again.
Missing variable definition in .h
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am currently generating a .c code from a .slx (AUTOSAR model). The issue I'm facing is that all the variables used in .c file are defined in the .h file, except for two variables: SWC_NAME_VAR_INIT and SWC_NAME_CODE. This problem is causing errors during the building phase.I'm wondering why these variables are not defined in the .h file and how can I configure Simulink to resolve this issue ?.
This is the content of model_name.c file :
0 commentaires
Réponses (1)
Aniketh
le 6 Juil 2023
It is possible that the variables SWC_NAME_VAR_INIT and SWC_NAME_CODE are not defined in the .h file of your generated C code from the .slx (AUTOSAR model). This could be causing errors during the building phase.
One suggestion to resolve this issue is to configure Simulink to generate the necessary definitions for these variables. You can try the following steps:
By enabling the option to generate separate code and data sections, it is possible that Simulink will generate the necessary definitions for SWC_NAME_VAR_INIT and SWC_NAME_CODE in the relevant source files. These definitions will be separate from the header file and may help resolve the errors you are facing during the building phase.
Voir également
Catégories
En savoir plus sur Simulink Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!