Interface manually Simulink Teensy

Aarseth

Member
I have a Teensy 4.1 and I would like to run some Simulink files inside it, but I can't figure out how to interface it with Simulink, help. for example, a command to move a servo from a simulink button fails.
 
I don't think Simulink supports Teensy out of the box. Search the forum for Simulink and you will find a post by @brtaylor about how he does it.
 
Simulink will not directly interface with any of the Teensy boards. Big picture, I use embedded coder to generate a header and source file from Simulink and then include those files as part of a larger compilation. For Arduino, that would mean copying the header and source generated by embedded coder into the arduino program directory and interfacing between your main Arduino file with the simulink generated files. I use a CMake based build system to automate a bunch of that work along with a global definitions file to define the struct / bus interfaces between the main program and the Simulink autocode portions of the code. You can find the program here:
https://github.com/bolderflight/spaaro
 
so from the simulink file i use the code generation in c++ without configuring any card, then it creates .h file and .cpp file which i use on cmake to create the code?
 
so from the simulink file i use the code generation in c++ without configuring any card, then it creates .h file and .cpp file which i use on cmake to create the code?

Note that CMake isn't required, it just automates some steps in the process.

For Arduino, that would mean copying the header and source generated by embedded coder into the arduino program directory and interfacing between your main Arduino file with the simulink generated files.

You use Simulink to generate header and source files and copy those into the Arduino directory. I like to configure a processor in embedded coder so that my types are correct (i.e. the size of pointer, etc).
 
Back
Top