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:
I have a question regarding shared memory areas with different logical addresses.
I'm working with the DSP TMS320F28P650 [DataSheet], focusing on CPU1 and its associated CLA. The CLA's program area is allocated to LS9RAM, but the start address of this memory differs depending on whether it's accessed by CPU1 or the CLA. [See Page 266 of the datasheet]
To manage the copy address for CPU1 and the run address for the CLA, I created two separate sections in the linker command file:
CLA Program Section (Cla1Prog): This section maps the CLA code with the correct addresses required by linker for the CLA's LS9RAM area.
CPU1 Access Section: This section allows CPU1 to determine the start address, enabling it to write to the same LS9RAM area.
I'm wondering if there's a simplified way to do the same.
RAMLS9_CLA : origin = 0x006000, length = 0x002000 // Use only if configured as CLA program memory RAMLS9_CPU : origin = 0x024000, length = 0x002000 // When configured as CLA program use the address 0x6000 #if defined(__TI_EABI__) Cla1ProgCPU : {} LOAD = APPFLASH_CPU1, RUN = RAMLS9_CPU, RUN_START(Cla1ProgRunStart), ALIGN(4) #else Cla1ProgCPU : {} LOAD = APPFLASH_CPU1, RUN = RAMLS9_CPU, RUN_START(_Cla1ProgRunStart), ALIGN(4) #endif #if defined(__TI_EABI__) Cla1Prog : {} LOAD = APPFLASH_CPU1, RUN = RAMLS9_CLA, LOAD_START(Cla1ProgLoadStart), LOAD_SIZE(Cla1ProgLoadSize), ALIGN(4) #else Cla1Prog : {} LOAD = APPFLASH_CPU1, RUN = RAMLS9_CLA, LOAD_START(_Cla1ProgLoadStart), LOAD_SIZE(_Cla1ProgLoadSize), ALIGN(4) #endif
Hello,
Please refer to the linker cmd file used in the cla_asin_ls8_9 example in C2000ware (path: [C2000ware install]/driverlib/f28p65x/examples/c28x/cla) for the recommended linker configurations using LSRAM8 & LSRAM9.
Best Regards,
Delaney
Hi Delaney,
Thank you for your response.
I discovered that the example is from the newer version of C2000Ware 5.02 (I was using 5.00). While I was able to locate the example project, I’m having trouble opening it with CCS Version 12.7.1.00001. [Posted a snapshot below]
Could you please confirm if this example is compatible with my version of CCS?
Thanks,
Rahul
Hi Rahul,
I also see the same issue when trying to import the example from there, I will look into why this is happening. Do you have the standalone C2000ware package installed (not the version integrated into the digital power SDK)? I am able to import the example from there without error.
Below are the linker cmd files used in the example for your reference.
RAM build:
MEMORY { /* BEGIN is used for the "boot to SARAM" bootloader mode */ BEGIN : origin = 0x000000, length = 0x000002 BOOT_RSVD : origin = 0x000002, length = 0x0001AF /* Part of M0, BOOT rom will use this for stack */ RAMM0 : origin = 0x0001B1, length = 0x00024F RAMM1 : origin = 0x000400, length = 0x000400 RAMD0 : origin = 0x00C000, length = 0x002000 RAMD1 : origin = 0x00E000, length = 0x002000 RAMD2 : origin = 0x01A000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0x8000. User should comment/uncomment based on core selection RAMD3 : origin = 0x01C000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xA000. User should comment/uncomment based on core selection RAMD4 : origin = 0x01E000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xC000. User should comment/uncomment based on core selection RAMD5 : origin = 0x020000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xE000. User should comment/uncomment based on core selection RAMLS0 : origin = 0x008000, length = 0x000800 RAMLS1 : origin = 0x008800, length = 0x000800 RAMLS2 : origin = 0x009000, length = 0x000800 RAMLS3 : origin = 0x009800, length = 0x000800 RAMLS4 : origin = 0x00A000, length = 0x000800 RAMLS5 : origin = 0x00A800, length = 0x000800 RAMLS6 : origin = 0x00B000, length = 0x000800 RAMLS7 : origin = 0x00B800, length = 0x000800 RAMLS8_9 : origin = 0x022000, length = 0x004000 // When configured as CLA program use the address 0x4000 RAMLS8_9_CLA : origin = 0x004000, length = 0x004000 // Use only if configured as CLA program memory RAMGS0 : origin = 0x010000, length = 0x002000 RAMGS1 : origin = 0x012000, length = 0x002000 RAMGS2 : origin = 0x014000, length = 0x002000 RAMGS3 : origin = 0x016000, length = 0x002000 RAMGS4 : origin = 0x018000, length = 0x002000 /* Flash Banks (128 sectors each) */ FLASH_BANK0 : origin = 0x080000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK1 : origin = 0x0A0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK2 : origin = 0x0C0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK3 : origin = 0x0E0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK4 : origin = 0x100000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection CPU1TOCPU2RAM : origin = 0x03A000, length = 0x000400 CPU2TOCPU1RAM : origin = 0x03B000, length = 0x000400 CLATOCPURAM : origin = 0x001480, length = 0x000080 CPUTOCLARAM : origin = 0x001500, length = 0x000080 CLATODMARAM : origin = 0x001680, length = 0x000080 DMATOCLARAM : origin = 0x001700, length = 0x000080 CANA_MSG_RAM : origin = 0x049000, length = 0x000800 CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 RESET : origin = 0x3FFFC0, length = 0x000002 } SECTIONS { codestart : > BEGIN .text : >> RAMD0 | RAMD1 | RAMLS3 | RAMLS4 | RAMLS5 .cinit : > RAMM0 .switch : > RAMM0 .reset : > RESET, TYPE = DSECT /* not used, */ .stack : > RAMM1 #if defined(__TI_EABI__) .bss : > RAMLS5 .bss:output : > RAMLS3 .init_array : > RAMM0 .const : > RAMLS5 | RAMLS6 .data : > RAMLS5 .sysmem : > RAMLS4 #else .pinit : > RAMM0 .ebss : >> RAMLS5 | RAMLS6 .econst : > RAMLS5 .esysmem : > RAMLS5 #endif ramgs0 : > RAMGS0, type=NOINIT ramgs1 : > RAMGS1, type=NOINIT MSGRAM_CPU1_TO_CPU2 > CPU1TOCPU2RAM, type=NOINIT MSGRAM_CPU2_TO_CPU1 > CPU2TOCPU1RAM, type=NOINIT .TI.ramfunc : {} > RAMM1 // CLA Sections /* CLA specific sections */ Cla1Prog : LOAD = RAMLS8_9, RUN = RAMLS8_9_CLA, ALIGN(4) .scratchpad : > RAMLS1 .bss_cla : > RAMLS1 .const_cla : > RAMLS1 Cla1ToCpuMsgRAM : > CLATOCPURAM CpuToCla1MsgRAM : > CPUTOCLARAM Cla1DataRam : > RAMLS2 cla_shared : > RAMLS1 CLADataLS1 : > RAMLS1 } /* //=========================================================================== // End of file. //=========================================================================== */
Flash build
MEMORY { BEGIN : origin = 0x080000, length = 0x000002 // Update the codestart location as needed BOOT_RSVD : origin = 0x000002, length = 0x0001AF /* Part of M0, BOOT rom will use this for stack */ RAMM0 : origin = 0x0001B1, length = 0x00024F RAMM1 : origin = 0x000400, length = 0x000400 RAMD0 : origin = 0x00C000, length = 0x002000 RAMD1 : origin = 0x00E000, length = 0x002000 RAMD2 : origin = 0x01A000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0x8000. User should comment/uncomment based on core selection RAMD3 : origin = 0x01C000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xA000. User should comment/uncomment based on core selection RAMD4 : origin = 0x01E000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xC000. User should comment/uncomment based on core selection RAMD5 : origin = 0x020000, length = 0x002000 // Can be mapped to either CPU1 or CPU2. When configured to CPU2, use the address 0xE000. User should comment/uncomment based on core selection RAMLS0 : origin = 0x008000, length = 0x000800 RAMLS1 : origin = 0x008800, length = 0x000800 RAMLS2 : origin = 0x009000, length = 0x000800 RAMLS3 : origin = 0x009800, length = 0x000800 RAMLS4 : origin = 0x00A000, length = 0x000800 RAMLS5 : origin = 0x00A800, length = 0x000800 RAMLS6 : origin = 0x00B000, length = 0x000800 RAMLS7 : origin = 0x00B800, length = 0x000800 //RAMLS8 : origin = 0x022000, length = 0x002000 // When configured as CLA program use the address 0x4000 //RAMLS9 : origin = 0x024000, length = 0x002000 // When configured as CLA program use the address 0x6000 RAMLS8_9_CLA : origin = 0x004000, length = 0x004000 // Use only if configured as CLA program memory RAMGS0 : origin = 0x010000, length = 0x002000 RAMGS1 : origin = 0x012000, length = 0x002000 RAMGS2 : origin = 0x014000, length = 0x002000 RAMGS3 : origin = 0x016000, length = 0x002000 RAMGS4 : origin = 0x018000, length = 0x002000 /* Flash Banks (128 sectors each) */ FLASH_BANK0 : origin = 0x080002, length = 0x1FFFE // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK1 : origin = 0x0A0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection FLASH_BANK2 : origin = 0x0C0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection // FLASH_BANK3 : origin = 0x0E0000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection // FLASH_BANK4 : origin = 0x100000, length = 0x20000 // Can be mapped to either CPU1 or CPU2. User should comment/uncomment based on core selection CPU1TOCPU2RAM : origin = 0x03A000, length = 0x000400 CPU2TOCPU1RAM : origin = 0x03B000, length = 0x000400 CLATOCPURAM : origin = 0x001480, length = 0x000080 CPUTOCLARAM : origin = 0x001500, length = 0x000080 CLATODMARAM : origin = 0x001680, length = 0x000080 DMATOCLARAM : origin = 0x001700, length = 0x000080 CANA_MSG_RAM : origin = 0x049000, length = 0x000800 CANB_MSG_RAM : origin = 0x04B000, length = 0x000800 RESET : origin = 0x3FFFC0, length = 0x000002 } SECTIONS { codestart : > BEGIN .text : >> FLASH_BANK0 | FLASH_BANK1, ALIGN(8) .cinit : > FLASH_BANK0, ALIGN(8) .switch : > FLASH_BANK0, ALIGN(8) .reset : > RESET, TYPE = DSECT /* not used, */ .stack : > RAMM1 #if defined(__TI_EABI__) .bss : > RAMLS5 .bss:output : > RAMLS3 .init_array : > FLASH_BANK0, ALIGN(8) .const : > FLASH_BANK0, ALIGN(8) .data : > RAMLS5 .sysmem : > RAMLS4 #else .pinit : > FLASH_BANK0, ALIGN(8) .ebss : >> RAMLS5 | RAMLS6 .econst : > FLASH_BANK0, ALIGN(8) .esysmem : > RAMLS5 #endif ramgs0 : > RAMGS0, type=NOINIT ramgs1 : > RAMGS1, type=NOINIT MSGRAM_CPU1_TO_CPU2 > CPU1TOCPU2RAM, type=NOINIT MSGRAM_CPU2_TO_CPU1 > CPU2TOCPU1RAM, type=NOINIT #if defined(__TI_EABI__) .TI.ramfunc : {} LOAD = FLASH_BANK0, RUN = RAMLS4, LOAD_START(RamfuncsLoadStart), LOAD_SIZE(RamfuncsLoadSize), LOAD_END(RamfuncsLoadEnd), RUN_START(RamfuncsRunStart), RUN_SIZE(RamfuncsRunSize), RUN_END(RamfuncsRunEnd), ALIGN(8) #else .TI.ramfunc : {} LOAD = FLASH_BANK0, RUN = RAMLS4, LOAD_START(_RamfuncsLoadStart), LOAD_SIZE(_RamfuncsLoadSize), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart), RUN_SIZE(_RamfuncsRunSize), RUN_END(_RamfuncsRunEnd), ALIGN(8) #endif /* CLA specific sections */ #if defined(__TI_EABI__) /* CLA specific sections */ Cla1Prog : LOAD = FLASH_BANK0, RUN = RAMLS8_9_CLA, LOAD_START(Cla1ProgLoadStart), RUN_START(Cla1ProgRunStart), LOAD_SIZE(Cla1ProgLoadSize), ALIGN(4) #else /* CLA specific sections */ Cla1Prog : LOAD = FLASH_BANK0, RUN = RAMLS8_9_CLA, LOAD_START(_Cla1ProgLoadStart), RUN_START(_Cla1ProgRunStart), LOAD_SIZE(_Cla1ProgLoadSize), ALIGN(4) #endif Cla1ToCpuMsgRAM : > CLATOCPURAM CpuToCla1MsgRAM : > CPUTOCLARAM .scratchpad : > RAMLS1 .bss_cla : > RAMLS1 Cla1DataRam : > RAMLS2 cla_shared : > RAMLS1 CLADataLS1 : > RAMLS1 #if defined(__TI_EABI__) .const_cla : LOAD = FLASH_BANK0, RUN = RAMLS1, RUN_START(Cla1ConstRunStart), LOAD_START(Cla1ConstLoadStart), LOAD_SIZE(Cla1ConstLoadSize), ALIGN(4) #else .const_cla : LOAD = FLASH_BANK0, RUN = RAMLS1, RUN_START(_Cla1ConstRunStart), LOAD_START(_Cla1ConstLoadStart), LOAD_SIZE(_Cla1ConstLoadSize), ALIGN(4) #endif } /* //=========================================================================== // End of file. //=========================================================================== */
You can also take a look at the example code at this link: cla_asin_ls8_9 (ti.com)
Best Regards,
Delaney