Embedded coder 'Generate code only' not including toolbox files

3 Ansichten (letzte 30 Tage)
Sam Kysar
Sam Kysar am 13 Jul. 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

Antworten (1)

Benjamin Thompson
Benjamin Thompson am 13 Jul. 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 Kommentare
Sam Kysar
Sam Kysar am 13 Jul. 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 am 14 Jul. 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by