Part Number: LAUNCHXL-F28P65X
Dear TI Support Team,
I hope you are well.
We are currently working on a project where we generate C code from a PLECS model using TI C2000 blocks. The generated code is then integrated into a Beckhoff SSC (Slave Stack Code) project. Our goal is to develop a TI F28P650DK9 microcontroller as an EtherCAT slave to control power electronic stages. Please could you reply as soon as possible, as my thesis deadline is at the end of February.
When we generate code from PLECS, it creates multiple files. From these files, we mainly use the model .c/.h files and the generated HAL.c file. However, when we include the generated HAL.c file directly into our CCS-based TI Echoback example project as the backbone of our experiment in CCS, we get many compilation errors (mainly conflicts with driverlib, GPIO configuration, and initialization code). Because of this, the project does not build.
current controller model I made in PLECS.
PLECS generated files with TI Blocks the highlithed ones were include in the CCS project.
As a temporary workaround, we are currently creating our own custom plx_hal.c and plx_hal.h files and only implementing the required functions manually. This works, but we do not want to continue this way in the future.
workspace tree with the custom made plx_hal.c and .h files while the plecs generated hal.c file excluded also the main project framework project used here was F28p65x_CPU1_Echoback_example provided by TI.
the errors I get after only running the code with the plecs generated hal.c files instead of using my custom plx_hal.c and .h files
I’m getting a build failure because the compiler can’t find the header file plx_hal.h. The key error lines I’m including below show the exact files/lines where it fails, and that the build stops because of these errors (the other messages are warnings and aren’t stopping the build).
Important lines to paste:
- [57] "../f28p65x_cpu1_echoback_solution/led_feedback_c2000_block.c", line 41: fatal error #1965: cannot open source file "plx_hal.h"
- [58] 1 catastrophic error detected in the compilation of "../f28p65x_cpu1_echoback_solution/led_feedback_c2000_block.c".
- [59] Compilation terminated.
- [63] "../f28p65x_cpu1_echoback_solution/led_feedback_c2000_block_hal.c", line 9: fatal error #1965: cannot open source file "plx_hal.h"
- [64] 1 catastrophic error detected in the compilation of "../f28p65x_cpu1_echoback_solution/led_feedback_c2000_block_hal.c".
- [65] Compilation terminated.
- [108] gmake: Target 'all' not remade because of errors.
For your reference I have also attached my self-made plx_hal.c / .h files that I am currently using and also the hal.c file generated by plecs that is currently excluded from my project. Also I am attaching the .xml file generated from SSC and also the custom PDO’s .xlsx file I made for the project and the zip file for the complete working project “f28p65x_cpu1_echoback_solution.zip” but the custom plx_hal.c/.h are not included in the given file and the plecs generated files “PWM Model.zip”.
Could you please advise what the recommended and clean solution is for integrating PLECS-generated TI code into an existing SSC EtherCAT project?
- Is there a specific workflow for combining PLECS code (with TI Blocks ) with EtherCAT slave files generated from SSC “Slave Stack Code” in CCS?
- Should the generated HAL.c file be modified or partially excluded?
- Is there a recommended way to avoid these errors?
We would really appreciate your guidance on the correct integration approach.
Thank you very much for your support.
Moiz Zaheer Malik
f28p65x_cpu1_echoback_solution.zip
