Simulink C caller block can't compile C code, but other blocks can

13 次查看(过去 30 天)
I'm programming a TI C2000 processor (the F28379D Delfino) using Simulink and I can't get the C caller block to compile any code for my TI board. When I compile C code with the C caller I get the error "F28x_Project.h does not exist." However, I can compile and run the exact same code from a memory read block, so I've been using that as a workaround. Does anyone know why the C caller would have trouble working with the TI header files? Does it compile C differently from the memory copy block? I've tried declaring the header file various ways and making sure it's in the correct directory, and I know it is because the memory copy block compiles my code.
Thanks for any suggestions.

采纳的回答

Venkatesh Chilapur
Venkatesh Chilapur 2019-6-28
Hi Matthew,
Attached is the model which now compiles with C caller block.
Please note changes made to Simulation target and custom code section as well as the source files.
The C caller block resolves the function it needs to call before the build starts.
Hence simulation target needs to have the relevant information.
We dont have all the paths yet in place at this time. Hence if we specify few headers like F28x_Project.h they will not be found. But when the actual build starts, we will have them found. Hence avoid having these device specific headers as part of your custom code.
This issue is not seen with memcopy as it does not need to resolve the C function.
It just puts the text(code)in the generated file.
HTH,
Regards,
Venkatesh C

更多回答(1 个)

Venkatesh Chilapur
Venkatesh Chilapur 2019-6-25
Hi Matthew,
Please can you attach the model to help us investigate further.
Regards,
Venkatesh C
  2 个评论
Mukesh Ghosh
Mukesh Ghosh 2021-12-14
Hello,
I am facing the same problem. Is someone find the solution of this problem? When I run my C caller block from .slx, it shows me Matlab could not find header files which is link to microcontrolller. How to solve this problem?
Kind regards
Mukesh Ghosh

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by