Implement custom code in C2000 code generation

Hello,

I am trying to implement the EMIF interface of the F28379D in Plecs for C-code-generation to communicate with an FPGA. There is no suitable block in the library browser.

Also, the C script block does not seem to be suitable for including custom C code in the code generation, but is only intended for the Plecs simulation.

Is there any way to include custom code or write a custom library for this purpose?

Thank you,
André

André,

The EMIF interface is not supported by the C2000 target support package. As you suggested, the C-Script block is not a means to implement this functionality.

Creating a component to support this or any other peripheral is not trivial. Therefore we do not support users in creating their own custom blocks.

Regards,

Bryan

It would be nice if there was a generic interface to custom C code.

In the generated C-code I have the possibility to include further C-files. But I don’t see any other way to call the C-files in the Plecs tasks without manually changing the generated code after each build.

Thanks for the feedback. The PLECS Coder works based on the functionality you’re looking for, in that it inserts C snippets into the generated code. I’ll send a private email generally describing how it works.