Hi,
I am developing a Simulink Embedded Coder Target for Teensy 3.x and 4.x. I tested the library only for Teensy 4.1.
The library uses the Simulink Embedded Coder to generate the C/C++ code for the Simulink model and the main function, using custom Simulink TLC files. The Teensy core is compiled and linked as well. All the code is compiled from Simulink using the ARM compiler provided with Teensyduino and a makefile generated by Simulink. The final hex file is deployed to the Teensy target using Teensyloader, again directly from Simulink.
I have implemented only a few blocks in the library (I/O, Serial), just for quick and simple tests. I plan to implement other blocks in the future. Implementing custom blocks requires some skills in using C S-functions and TLC files.
I have also implemented external mode, which uses Dual Serial with SerialUSB1 dedicated to host-target communication. Using external mode, you can monitor the signals and tune the parameters of the model in real-time. However, Processor-In-the-Loop, Software-In-the-Loop, and Hardware-In-the-Loop are not implemented.
You can find more details on GitHub (https://github.com/stefphd/teensy_ert) or on the Matlab FileExchange (https://it.mathworks.com/matlabcentral/fileexchange/135922-simulink-embedded-coder-target-for-teensy).
I am developing a Simulink Embedded Coder Target for Teensy 3.x and 4.x. I tested the library only for Teensy 4.1.
The library uses the Simulink Embedded Coder to generate the C/C++ code for the Simulink model and the main function, using custom Simulink TLC files. The Teensy core is compiled and linked as well. All the code is compiled from Simulink using the ARM compiler provided with Teensyduino and a makefile generated by Simulink. The final hex file is deployed to the Teensy target using Teensyloader, again directly from Simulink.
I have implemented only a few blocks in the library (I/O, Serial), just for quick and simple tests. I plan to implement other blocks in the future. Implementing custom blocks requires some skills in using C S-functions and TLC files.
I have also implemented external mode, which uses Dual Serial with SerialUSB1 dedicated to host-target communication. Using external mode, you can monitor the signals and tune the parameters of the model in real-time. However, Processor-In-the-Loop, Software-In-the-Loop, and Hardware-In-the-Loop are not implemented.
You can find more details on GitHub (https://github.com/stefphd/teensy_ert) or on the Matlab FileExchange (https://it.mathworks.com/matlabcentral/fileexchange/135922-simulink-embedded-coder-target-for-teensy).