This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi,
I'm trying to utilize some of the C2000Ware drivers along with Simulink Coder. I have some external devices that have slightly 'non standard' SPI/SCI interfaces but I was able to leverage the flexibility of the C2000Ware drivers to communicate with these devices. I am now trying to implement the 'core' of the design using MathWorks Simulink Coder/Embedded Coder but still need my non-standard interfaces to my devices. Can someone point me to an example that will educated me on how to configure MathWorks (compiler switches, include files, etc.) so that I can use the C2000Ware drivers?
Bob
Follow-up: I am assuming that I should be able to implement custom 'C' blocks that just call the C2000Ware library functions. When I do this I get a lot of errors... for example the C2000Ware libraries need to be able to write to 'protected' registers (HREG = XXXX).
This is likely a configuration issue on my end (ie. my project is not setup properly to use these external libraries)?
Bob
Bob,
I'll notify the MW team of this post. In the meantime this Q/A on MW site talks about invoking a TI lib from Simulink, perhaps this will help us get started in the right direction with your issue.
If by protected, you mean "EALLOW" protection, you should be able to invoke that instruction from the embedded coder C block and then disable with a "EDIS"
instruction.
Best,
Matthew
Hi,
The link provided by Matthew is a good one.
You can also look for:
https://in.mathworks.com/help/simulink/slref/coder.ceval.html
https://in.mathworks.com/help/simulink/ug/integrate-ccode-ccaller.html
https://in.mathworks.com/help/simulink/sfg/integrating-existing-c-functions-into-simulink-models-with-the-legacy-code-tool.html
For compiler settings there is a option called 'specify' under the drop-down of the field as shown above.
You can use the same to change any compiler specific settings.
HTH,