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:
Hello,
I try to setup a multicore project in CCS Theia. There is an example project in C2000Ware for multicore microcontrollers. It uses a third project which combines the CPU1 and CPU2 project.
This example uses sysconfig which I don’t want to use.
The second example project does not use sysconfig but does not use a multicore project.
I tried to setup this multicore project by myself, but I cannot change the project type. In CCS the project type can be changed by creation of new projects:
In CCS Theia, at creation is this option not available, and after creation it cannot be changed anymore:
How does this setup work in CCS Theia. I would like to have this multicore project so I can build, load, connect and debug both cores. I found the following resources, but they do not help for CCS Theia:
Does anyone know how to do this or have any recourse for this?
Best regards,
Roman
Hi Roman,
If you're not using SysConfig, then you don't need the third project. Each CPU can have their own project respectively.
Best,
Ryan Ma
Hey Ryan,
Yes, I tried that, and it worked. With this third system-project I could load and connect to both cores directly. Are those system-projects not implemented in Theia yet?
Best regards,
Roman
Hi Roman,
Let me walk you through on how to create a non sysconfig based multi core project using the "System" project that ties together the other two projects.
The following folder structure must be used within
1. Create a new empty folder within c28x_dual folder
2. Create another folder within the new folder called CCS
3. Within the CCS/ folder create a project spec, here is an example
<projectSpec> <project name="led_ex3_blinky_sysconfig_multi" configurations=" CPU_FLASH, CPU_RAM, CPU_LAUNCHXL_FLASH, CPU_LAUNCHXL_RAM, " device="TMS320F28P650DK9" outputType="system" cgtVersion="22.6.1.LTS" > <pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" /> <file path="../system.xml" action="copy" openOnCreation="false"/> <configuration name="CPU_FLASH" ></configuration> <configuration name="CPU_RAM" ></configuration> <configuration name="CPU_LAUNCHXL_FLASH" ></configuration> <configuration name="CPU_LAUNCHXL_RAM" ></configuration> </project> <project name="led_ex3_c28x_dual_blinky_cpu1" device="TMS320F28P650DK9" cgtVersion="22.6.1.LTS" outputFormat="ELF" launchWizard="False" linkerCommandFile="" > <configuration name="CPU_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " /> <configuration name="CPU_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH " /> <configuration name="CPU_LAUNCHXL_RAM" compilerBuildOptions= "--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --cla_support=cla2 --define=RAM --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063 --define=_LAUNCHXL_F28P65X" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " /> <configuration name="CPU_LAUNCHXL_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU1 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063 --define=_LAUNCHXL_F28P65X" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH " /> <pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" /> <pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f28p65x/driverlib/" scope="project" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/include/driverlib.h" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/include/device.h" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/source/device.c" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/targetConfigs/TMS320F28P650DK9.ccxml" targetDirectory="targetConfigs" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/cmd/28p65x_generic_ram_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU_RAM, CPU_LAUNCHXL_RAM" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/cmd/28p65x_generic_flash_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU_FLASH, CPU_LAUNCHXL_FLASH" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/source/f28p65x_codestartbranch.asm" targetDirectory="device" /> <file action="link" path="../../../../../../driverlib/f28p65x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" /> <file action="copy" path="../../../../../../driverlib/f28p65x/driverlib/" targetDirectory="device" excludeFromBuild="True" /> <file action="copy" path="../led_ex3_c28x_dual_blinky_cpu1.c" targetDirectory="" /> </project> <project name="led_ex3_c28x_dual_blinky_cpu2" device="TMS320F28P650DK9" cgtVersion="22.6.1.LTS" outputFormat="ELF" launchWizard="False" linkerCommandFile="" > <configuration name="CPU_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=RAM --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU2 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " /> <configuration name="CPU_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU2 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH " /> <configuration name="CPU_LAUNCHXL_RAM" compilerBuildOptions= "--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -v28 -ml -mt --define=RAM --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU2 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063 --define=_LAUNCHXL_F28P65X" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 " /> <configuration name="CPU_LAUNCHXL_FLASH" compilerBuildOptions="--opt_level=off -I${C2000WARE_ROOT} -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} --define=_FLASH -v28 -ml -mt --float_support=fpu64 --tmu_support=tmu1 --define=DEBUG --define=CPU2 --gen_func_subsections=on --diag_warning=225 --diag_suppress=10063 --define=_LAUNCHXL_F28P65X" linkerBuildOptions="--entry_point code_start --stack_size=0x3F8 --heap_size=0x200 --define=_FLASH " /> <pathVariable name="C2000WARE_ROOT" path="../../../../../../" scope="project" /> <pathVariable name="C2000WARE_DLIB_ROOT" path="../../../../../../driverlib/f28p65x/driverlib/" scope="project" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/include/driverlib.h" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/include/device.h" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/source/device.c" targetDirectory="device" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/targetConfigs/TMS320F28P650DK9.ccxml" targetDirectory="targetConfigs" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/cmd/28p65x_generic_ram_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU_RAM, CPU_LAUNCHXL_RAM" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/cmd/28p65x_generic_flash_lnk_cpu2.cmd" targetDirectory="" applicableConfigurations="CPU_FLASH, CPU_LAUNCHXL_FLASH" /> <file action="copy" path="../../../../../../device_support/f28p65x/common/source/f28p65x_codestartbranch.asm" targetDirectory="device" /> <file action="link" path="../../../../../../driverlib/f28p65x/driverlib/ccs/Debug/driverlib.lib" targetDirectory="" /> <file action="copy" path="../../../../../../driverlib/f28p65x/driverlib/" targetDirectory="device" excludeFromBuild="True" /> <file action="copy" path="../led_ex3_c28x_dual_blinky_cpu2.c" targetDirectory="" /> </project> </projectSpec>
2. Go up one folder, within led_multi_no_syscfg, Create these two example ipc files for each cpu
//############################################################################# // // FILE: led_ex2_blinky_sysconfig_cpu1.c // // TITLE: SysConfig LED Blinky Example // //! \addtogroup driver_dual_example_list //! <h1> LED Blinky Example</h1> //! //! This example demonstrates how to blink a LED using CPU1 and blink another //! LED using CPU2 (led_ex1_blinky_cpu2.c). //! //! \note In the default CPU2 linker cmd file, GS4, FLASH_BANK3 and FLASH_BANK4 //! are used for allocating various CPU2 sections. The CPU1 application //! assigns the ownership of these memory regions to CPU2 by using SysConfig. //! Please note that CPU2 .out file can be loaded only after CPU1 completes //! this configuration. //! //! The erase setting (CPU1/CPU2 On-Chip Flash -> erase setting) needs to be //! configured as selected banks only (Choose the corresponding BANKS allocated //! for CPUs) or necessary sectors only before loading CPU1/CPU2.out file //! (This is applicable only for FLASH configuration) //! //! Please switch to LAUNCHPAD build configurations if using launchpad. //! //! \b External \b Connections \n //! - None. //! //! \b Watch \b Variables \n //! - None. //! // //############################################################################# // // // $Copyright: $ //############################################################################# // // Included Files // // Make sure to include "board.h" to use SysConfig // #include "driverlib.h" #include "device.h" #include "board.h" // // Main // void main(void) { // // Initialize device clock and peripherals // Device_init(); // // Initialize GPIO and configure the GPIO pin as a push-pull output // Device_initGPIO(); // // Initialize settings from SysConfig // Board_init(); // // Boot CPU2 core // Device_bootCPU2(BOOT_MODE_CPU2); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Sync CPUs so the blinking starts at the same time, though the LEDs toggle at different frequency // IPC_sync(IPC_CPU1_L_CPU2_R, IPC_SYNC); // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM; // // Loop Forever // for(;;) { // // Turn on LED // GPIO_writePin(CPU1_LED, 0); // // Delay for a bit. // DEVICE_DELAY_US(500000); // // Turn off LED // GPIO_writePin(CPU1_LED, 1); // // Delay for a bit. // DEVICE_DELAY_US(500000); } } // // End of File //
//############################################################################# // // FILE: led_ex2_blinky_sysconfig_cpu2.c // // TITLE: SysConfig LED Blinky Example // //! <h1> LED Blinky Example (CPU2) </h1> //! //! This example demonstrates how to blink a LED using CPU2. //! //! \note In the default CPU2 linker cmd file, GS4, FLASH_BANK3 and FLASH_BANK4 //! are used for allocating various CPU2 sections. The CPU1 application //! assigns the ownership of these memory regions to CPU2 by using SysConfig. //! Please note that CPU2 .out file can be loaded only after CPU1 completes //! this configuration. //! //! The erase setting (CPU1/CPU2 On-Chip Flash -> erase setting) needs to be //! configured as selected banks only (Choose the corresponding BANKS allocated //! for CPUs) or necessary sectors only before loading CPU1/CPU2.out file //! (This is applicable only for FLASH configuration) //! //! Please switch to LAUNCHPAD build configurations if using launchpad. //! //! \b External \b Connections \n //! - None. //! //! \b Watch \b Variables \n //! - None. //! // //############################################################################# // // // $Copyright: $ //############################################################################# // // Included Files // // Make sure to include "board.h" to use SysConfig // #include "driverlib.h" #include "device.h" #include "board.h" // // Main // void main(void) { // // Initialize device clock and peripherals // Device_init(); // // Initialize settings from SysConfig // Board_init(); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Sync CPUs so the blinking starts at the same time, though the LEDs toggle at different frequency // IPC_sync(IPC_CPU2_L_CPU1_R, IPC_SYNC); // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM; // // Loop Forever // for(;;) { // // Turn on LED // GPIO_writePin(CPU2_LED, 1); // // Delay for a bit. // DEVICE_DELAY_US(500000); // // Turn off LED // GPIO_writePin(CPU2_LED, 0); // // Delay for a bit. // DEVICE_DELAY_US(500000); } } // // End of File //
3. The last step is creating the system.xml file that is referenced from the projectspec in the same folder
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <system> <project configuration="@match" id="project_0" name="led_ex3_c28x_dual_blinky_cpu1"> </project> <core id="C28xx_CPU1" project="project_0"/> <project configuration="@match" id="project_1" name="led_ex3_c28x_dual_blinky_cpu2"> </project> <core id="C28xx_CPU2" project="project_1"/> <preBuildSteps> </preBuildSteps> <postBuildSteps> </postBuildSteps> </system>
Your final folder should look like this
Within CCS/ folder:
Within CCS Theia, you should see this led_ex3_blinky_sysconfig_multi project that references the other two core application projects
Best regards,
Ryan Ma
Hey Ryan
Thank you for your help. It worked to set up this multi core template project.
But overall, it is so hard to get things running in Theia. No idea how to set up a static library, setting up the debug configuration and so on. Also, not a lot of help can be found online, maybe it is just too early. I think it is better to start without Theia and start with the normal CCS.
Best regards,
Roman