Embedded coder 'Generate code only' not including toolbox files

5 visualizaciones (últimos 30 días)
Sam Kysar
Sam Kysar el 13 de Jul. de 2022
Comentada: Benjamin Thompson el 14 de Jul. de 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

Respuestas (1)

Benjamin Thompson
Benjamin Thompson el 13 de Jul. de 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 comentarios
Sam Kysar
Sam Kysar el 13 de Jul. de 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 el 14 de Jul. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by