Part Number: C2000WARE
Hi!
I have been told that when using dual-core, I need to use two different linker files. I already had one set-up called 2837xD_RAM_lnk_cpu1.cmd, which compiled fine.
I then copied a second linker file from an example project as outlined in a previous forum post, called 2837xD_RAM_lnk_cpu2.cmd for the second CPU. I left the file itself unchanged, and used the exact same code in CPU2 as CPU1 to define memory:
// Configure memory on CPU2 for the CLA
void CLA2_configClaMemory(void)
{
// From F28377D reset no memory resources are allocated to CLA so it needs to be done here
EALLOW;
// Set CPU2 <=> CLA message RAMs
MemCfgRegs.MSGxINIT.bit.INIT_CLA1TOCPU = 1; // Initialise CLA1ToCPUMsgRAM
while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CLA1TOCPU != 1) {}; // Wait until done
MemCfgRegs.MSGxINIT.bit.INIT_CPUTOCLA1 = 1; // Initialise CPUToCLA1MsgRAM
while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CPUTOCLA1 != 1) {}; // Wait until done
// Set up program and data memory blocks for use by CLA1
MemCfgRegs.LSxMSEL.bit.MSEL_LS4 = 1; // Allocate LS4 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS4 = 1; // Set LS4 as program memory
MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1; // Allocate LS5 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1; // Set LS5 as program memory
MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 1; // Allocate LS0 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS0 = 0; // Set LS0 as data memory
MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 1; // Allocate LS1 RAM to CLA1
MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS1 = 0; // Set LS1 as data memory
EDIS;
}
Unfortunately, I am unsure if this is how it should be done. (This is how I do it in CPU1). I am unsure if I need to enter the project properties, and somehow assign this second linker file to CPU2, and the first linker file to CPU1, so that it knows which CPU should use which linker file? I cannot for the life of me find these options. Anyway, maybe the errors I am getting spit out at me may clarify the issue:
**** Build of configuration CPU1_RAM for project HV_MPM1 ****
"C:\\ti\\ccs1020\\ccs\\utils\\bin\\gmake" -k -j 4 all -O
Building file: "../MPM_CPU2.c"
Invoking: C2000 Compiler
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/headers/include" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/device_support/f2837xd/common/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/libraries/DCL" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/libraries/calibration/hrpwm/f2837xd/include" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/device" --include_path="C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/driverlib" --include_path="C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --define=_DUAL_HEADERS --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --preproc_with_compile --preproc_dependency="MPM_CPU2.d_raw" --include_path="C:/Users/joel-/workspace_v10/HV_MPM1/CPU1_RAM/syscfg" "../MPM_CPU2.c"
"../MPM_CPU2.c", line 89: warning #225-D: function "CLA_configClaMemory" declared implicitly
"../MPM_CPU2.c", line 90: warning #225-D: function "CLA_initCpu2Cla1" declared implicitly
Finished building: "../MPM_CPU2.c"
Building target: "HV_MPM1.out"
Invoking: C2000 Linker
"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla1 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu2 -Ooff --define=_DUAL_HEADERS --define=DEBUG --define=CPU1 --diag_suppress=10063 --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi -z -m"HV_MPM1.map" --stack_size=0x100 --warn_sections -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/lib" -i"C:/ti/ccs1020/ccs/tools/compiler/ti-cgt-c2000_20.2.2.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="HV_MPM1_linkInfo.xml" --entry_point=code_start --rom_model -o "HV_MPM1.out" "./CLA_Fly.obj" "./CLA_Res.obj" "./MPM_CPU1.obj" "./MPM_CPU2.obj" "./device/F2837xD_CodeStartBranch.obj" "./device/device.obj" "./libraries/DCL/DCL_DF11_L1.obj" "./libraries/DCL/DCL_DF22_L2L3.obj" "./libraries/DCL/DCL_clamp_L1.obj" "../2837xD_RAM_lnk_cpu1.cmd" "../2837xD_RAM_lnk_cpu2.cmd" "../F2837xD_Headers_nonBIOS_cpu1.cmd" "C:/ti/c2000/C2000Ware_3_04_00_00/driverlib/f2837xd/driverlib/ccs/Debug/driverlib.lib" -llibc.a
<Linking>
"../2837xD_RAM_lnk_cpu2.cmd", line 7: error #10263: BEGIN memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 7: error #10264: BEGIN memory range overlaps existing memory range BEGIN
"../2837xD_RAM_lnk_cpu2.cmd", line 8: error #10263: RAMM0 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 8: error #10264: RAMM0 memory range overlaps existing memory range RAMM0
"../2837xD_RAM_lnk_cpu2.cmd", line 9: error #10263: RAMD0 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 9: error #10264: RAMD0 memory range overlaps existing memory range RAMD0
"../2837xD_RAM_lnk_cpu2.cmd", line 10: error #10263: RAMLS0 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 10: error #10264: RAMLS0 memory range overlaps existing memory range RAMLS0
"../2837xD_RAM_lnk_cpu2.cmd", line 11: error #10263: RAMLS1 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 11: error #10264: RAMLS1 memory range overlaps existing memory range RAMLS1
"../2837xD_RAM_lnk_cpu2.cmd", line 12: error #10263: RAMLS2 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 12: error #10264: RAMLS2 memory range overlaps existing memory range RAMLS2
"../2837xD_RAM_lnk_cpu2.cmd", line 13: error #10263: RAMLS3 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 13: error #10264: RAMLS3 memory range overlaps existing memory range RAMLS3
"../2837xD_RAM_lnk_cpu2.cmd", line 14: error #10263: RAMLS4 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 14: error #10264: RAMLS4 memory range overlaps existing memory range RAMLS4
"../2837xD_RAM_lnk_cpu2.cmd", line 15: error #10263: RESET memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 15: error #10264: RESET memory range overlaps existing memory range RESET
"../2837xD_RAM_lnk_cpu2.cmd", line 19: error #10263: BOOT_RSVD memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 19: error #10264: BOOT_RSVD memory range overlaps existing memory range BOOT_RSVD
"../2837xD_RAM_lnk_cpu2.cmd", line 20: error #10263: RAMM1 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 20: error #10264: RAMM1 memory range overlaps existing memory range RAMM1
"../2837xD_RAM_lnk_cpu2.cmd", line 21: error #10263: RAMD1 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 21: error #10264: RAMD1 memory range overlaps existing memory range RAMD1
"../2837xD_RAM_lnk_cpu2.cmd", line 23: error #10263: RAMLS5 memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 23: error #10264: RAMLS5 memory range overlaps existing memory range RAMLS5
"../2837xD_RAM_lnk_cpu2.cmd", line 25: error #10263: CANA_MSG_RAM memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 25: error #10264: CANA_MSG_RAM memory range overlaps existing memory range CANA_MSG_RAM
"../2837xD_RAM_lnk_cpu2.cmd", line 26: error #10263: CANB_MSG_RAM memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 26: error #10264: CANB_MSG_RAM memory range overlaps existing memory range CANB_MSG_RAM
"../2837xD_RAM_lnk_cpu2.cmd", line 28: error #10263: CPU2TOCPU1RAM memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 28: error #10264: CPU2TOCPU1RAM memory range overlaps existing memory range CPU2TOCPU1RAM
"../2837xD_RAM_lnk_cpu2.cmd", line 29: error #10263: CPU1TOCPU2RAM memory range has already been specified
"../2837xD_RAM_lnk_cpu2.cmd", line 29: error #10264: CPU1TOCPU2RAM memory range overlaps existing memory range CPU1TOCPU2RAM
error #10056: symbol "resCurr" redefined: first defined in "./MPM_CPU1.obj"; redefined in "./MPM_CPU2.obj"
error #10056: symbol "resError" redefined: first defined in "./MPM_CPU1.obj"; redefined in "./MPM_CPU2.obj"
warning #10247-D: creating output section ".bss_cla" without a SECTIONS specification
warning #10247-D: creating output section "Cla1Prog" without a SECTIONS specification
warning #10247-D: creating output section ".scratchpad" without a SECTIONS specification
warning #10247-D: creating output section "CpuToCla1MsgRAM" without a SECTIONS specification
warning #10247-D: creating output section "Cpu1ToCpu2MsgRAM" without a SECTIONS specification
warning #10247-D: creating output section "Cpu1ToCpu21MsgRAM" without a SECTIONS specification
warning #10247-D: creating output section "Cpu2ToCpu1RAM" without a SECTIONS specification
warning #10247-D: creating output section "Cla1ToCpuMsgRAM" without a SECTIONS specification
warning #10247-D: creating output section "Cpu2ToCpu1MsgRAM" without a SECTIONS specification
warning #10247-D: creating output section ".const_cla" without a SECTIONS specification
"../2837xD_RAM_lnk_cpu1.cmd", line 63: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment/blocking fails for section ".cinit" size 0x5epage 0. Available memory ranges:
RAMM0 size: 0x380 unused: 0x22 max hole: 0x22
undefined first referenced
symbol in file
--------- ----------------
AdcaRegs ./MPM_CPU1.obj
AdcaResultRegs ./MPM_CPU1.obj
AdcbRegs ./MPM_CPU1.obj
AdcbResultRegs ./MPM_CPU1.obj
AdccRegs ./MPM_CPU1.obj
AdccResultRegs ./MPM_CPU1.obj
AuxCPU_ISR ./MPM_CPU1.obj
CLA_initCpu2Cla1 ./MPM_CPU2.obj
Cla1Regs ./MPM_CPU1.obj
ClkCfgRegs ./MPM_CPU1.obj
Cmpss1Regs ./MPM_CPU1.obj
Cmpss2Regs ./MPM_CPU1.obj
Cmpss3Regs ./MPM_CPU1.obj
Cmpss5Regs ./MPM_CPU1.obj
Cmpss6Regs ./MPM_CPU1.obj
CpuSysRegs ./MPM_CPU1.obj
CpuTimer0Regs ./MPM_CPU1.obj
DCL_runClamp_C1 ./CLA_Res.obj
DCL_runDF22_C2 ./CLA_Res.obj
DCL_runDF22_C3 ./CLA_Res.obj
DacaRegs ./MPM_CPU1.obj
DacbRegs ./MPM_CPU1.obj
DaccRegs ./MPM_CPU1.obj
DmaClaSrcSelRegs ./MPM_CPU1.obj
EPwm1Regs ./MPM_CPU1.obj
EPwm4Regs ./MPM_CPU1.obj
EPwmXbarRegs ./MPM_CPU1.obj
F28x_usDelay ./MPM_CPU1.obj
GpioCtrlRegs ./MPM_CPU1.obj
GpioDataRegs ./MPM_CPU1.obj
InitEPwm1Gpio ./MPM_CPU1.obj
InitEPwm4Gpio ./MPM_CPU1.obj
InitGpio ./MPM_CPU1.obj
InitInputXbar ./MPM_CPU1.obj
InitPieCtrl ./MPM_CPU1.obj
InitPieVectTable ./MPM_CPU1.obj
InitSysCtrl ./MPM_CPU1.obj
IpcRegs ./MPM_CPU1.obj
MemCfgRegs ./MPM_CPU1.obj
PieCtrlRegs ./MPM_CPU1.obj
PieVectTable ./MPM_CPU1.obj
SFO ./MPM_CPU1.obj
__claDCL_runClamp_C1_sp ./CLA_Res.obj
__claDCL_runDF22_C3_sp ./CLA_Res.obj
cla2Isr1 ./MPM_CPU2.obj
cla2Isr2 ./MPM_CPU2.obj
cla2Isr3 ./MPM_CPU2.obj
cla2Isr4 ./MPM_CPU2.obj
cla2Isr5 ./MPM_CPU2.obj
cla2Isr6 ./MPM_CPU2.obj
cla2Isr7 ./MPM_CPU2.obj
cla2Isr8 ./MPM_CPU2.obj
i_ctrl2 ./CLA_Fly.obj
main C:\ti\ccs1020\ccs\tools\compiler\ti-cgt-c2000_20.2.2.LTS\lib\rts2800_fpu32_eabi.lib<args_main.c.obj>
res_ctrl2 ./CLA_Res.obj
v_ctrl2 ./CLA_Fly.obj
voltage_command ./CLA_Fly.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "HV_MPM1.out" not built
>> Compilation failure
makefile:156: recipe for target 'HV_MPM1.out' failed
makefile:152: recipe for target 'all' failed
gmake[1]: *** [HV_MPM1.out] Error 1
gmake: *** [all] Error 2
**** Build Finished ****
It looks as though, because the memory map is all over the place, random variables I have in my code are no longer being defined, maybe there is no space for them in the memory?
I am a bit of a newbie when it comes to the memory mapping - definitely something up here!
Any advice is appreciated..
Joel