Launchpad f28379d dual core with Simulink and custom code
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I am trying to develop a dual-core application on the F28379D Launchpad where CPU1 would run custom code (coded in C via CSS) and CPU2 would run
Simulink-generated code.
I have opened the Simulink-generated code in CSS and there seems to be some IPC communication (via the IPC Lite library) between the CPU's
but it is a bit complicated for me to understand.
What I did so far is that I copied the IPC interrupt handler CPU02toCPU01IPC0IntHandler() into my code for CPU1 to prevent the CPU2 getting stuck at
while (IPCLiteLtoRGetResult(&ulRWord32,IPC_LENGTH_32_BITS, IPC_FLAG31) != STATUS_PASS) {}
but this doesn't help entirely. Depending on the (Simulink) code for CPU2 what usually happens is that in CPU2, the call
runModel = rtmGetErrorStatus(dual_CPU1_M) == (NULL);
evaluates as 0 so the main loop while (runModel){...} doesn't execute.
In some other cases the CPU1 ends up in the "Illegal Operation Trap" ILLEGAL_ISR(void).
I am not sure what is the exact cause for each behaviour, but both are surely caused by the fact that I am ignoring some essential startup communication/setup.
I'd like to ask for directions as to what initial IPC communications have to be made between the two CPU's in order to succesfully run Simulink-generated code for CPU2 alongside custom C code for CPU1.
Some info:
My MATLAB version is 2019b.
I am able to run dual-core applications where both CPU's are either Simulink-generated or coded in CSS.
Thanks in advance.
Vít.
2 件のコメント
Venkatesh Chilapur
2020 年 1 月 24 日
Hi,
Our suggestion would be to try to work on CPU1 from MATLAB as we would have implemented handshaking between the two cores to get through the initialization to get both cores up and running. When you get custom code on CPU1, this handshaking may miss. When you work on CPU1 and CPU2 from MATLAB there is always the gaurnatee that this setup will work. We have custom code blocks and other techniques to include the user handwritten code in to MATLAB. So on CPU1 you should explore these options to get your handwritten code in to MATLAB.
HTH,
Venkatesh C
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!