how do I override rt_main in embedded coder?
Afficher commentaires plus anciens
Using embedded coder to generate code, I want to exclude rt_main.c from the build and use my own customized version (since the one that gets included does not actually run any of my code). I see that I can generate an example main program (ert_main.c) but I don't see how I can incorporate my customized version of that file into the build. I can add my own main function to the build, but then I get a linker error because main is defined twice. How do I write a customized main function?
Réponses (1)
Vandit
le 31 Mai 2023
Modifié(e) : Stefanie Schwarz
le 18 Nov 2025
0 votes
Hi,
To modify main function ‘ert_main.c’, you can navigate to ‘Model_Name_ert_rtw’ folder and customize ‘ert_main.c’ file as per your requirements.
Now to generate a new executable, please refer to the steps shown below:
1. Inside the ‘Model_Name_ert_rtw’ folder, delete all ‘.obj’ files.
2. Delete the already existing ‘Model_Name.exe’ file from your current working directory.
3.Run the ‘Model_Name.bat’ file by running the command ‘!Model_Name.bat’ in the command window to generate the executable again.
Hope this helps.
3 commentaires
Paul
le 20 Juin 2023
serena aiello
le 26 Oct 2023
Hi Paul, I want to do the same thing. Do you have find an automatic solution?
Paul
le 26 Oct 2023
Catégories
En savoir plus sur ARM Cortex-A Processors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!