Embedded coder 'Generate code only' not including toolbox files

3 vues (au cours des 30 derniers jours)
Sam Kysar
Sam Kysar le 13 Juil 2022
I am using the CAN Pack/Unpack blocks from the Embedded Coder toolbox. In my model, I generate C++ using ert.tlc and custom settings.
With 'Generate code only' checked, I generate code but the can_message.h is not in my build directory. The Makefile references the file on the system.
Setting PakNGo the can_message.h file is saved in the .zip file but this doesn't work for me. I don't know how to get can_message.h included with my normal build files in the sharedutils directory.
How do I get system included/required files in my normal build directory, not in the zip folder?
Thanks in advance!
EDIT:
Currently this is what I do in my .m build script with the PakNGo feature enabled. It seems like a setting that should be included somewhere in the configuration.
% Remove the "extracted" files and build from the fully packaged directory
if isfolder('build/CANDecoder')
movefile 'build/CANDecoder/CANDecoder.zip' 'build/CANDecoder.zip'
rmdir('build/CANDecoder','s');
unzip('build/CANDecoder.zip','build/CANDecoder');
fileattrib('build/CANDecoder','+w','','s');
delete('build/CANDecoder.zip');
end

Réponses (1)

Benjamin Thompson
Benjamin Thompson le 13 Juil 2022
If you have some other toolchain to compile the source code, you can locate the file in the MATLAB program files folder and include that folder in your compiler include path. Or you can copy it somewhere else in your file system where you want it to be.
  2 commentaires
Sam Kysar
Sam Kysar le 13 Juil 2022
I do have another toolchain and was wishing to avoid the manual copy step. Is it possible to do so from the coder configuration settings?
Benjamin Thompson
Benjamin Thompson le 14 Juil 2022
If you use an M file to build your model, you can add copyfile commands to that in order to place the header files from the Program Files MATLAB folder in the place that you want.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by