Hex file from Simulink

31 ビュー (過去 30 日間)
Lorenza
Lorenza 2024 年 9 月 23 日
回答済み: Udit06 2024 年 9 月 24 日
Is there a way to generate a .hex file from Simulink? (I installed the gcc compilator)

回答 (1 件)

Udit06
Udit06 2024 年 9 月 24 日
Hi Lorenza,
To generate a .HEX file from Simulink, you cannot directly export it from the Simulink model. However, you can use a utility like hex2000 that is part of the compiler tools in the Code Composer Studio (CCS) installation directory. If you have installed the GCC compiler, you might have similar utilities available depending on your specific setup.
Here is a general approach you can follow:
  1. Generate the Executable: First, ensure that you have configured your Simulink model to generate C code using a code generation tool like Embedded Coder. This will typically produce an executable file, such as an .OUT or .ELF file.
  2. Use a Conversion Utility: If you have a utility similar to hex2000 in your GCC setup, you can convert the generated executable to a .HEX file. For example, if you have an output file named "model.out", you can use a command like the following in your command prompt or terminal:
hex2000 --ascii --outfile=model.hex model.out
I hope this helps.

Community Treasure Hunt

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

Start Hunting!

Translated by