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.

TMS320F28379D: RAM/FLASH cmd file changes to load FreeRTOS on TM320F28379D

Part Number: TMS320F28379D

Hi,

I am able to import a demo project with below .projectspec file

<projectSpec>
  <project
        name="led_ex1_blinky_rtos"
        device="TMS320F28379D"
        cgtVersion="20.2.1.LTS"
        outputFormat="ELF"
        launchWizard="False"
        linkerCommandFile=""
        enableSysConfigTool="true"
        sysConfigBuildOptions="--product ${C2000WARE_ROOT}/.metadata/sdk.json --device F2837xD"
        >
    <configuration name="CPU1_RAM" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${Free_RTOS}/portable/CCS/C2000_C28x -I${Free_RTOS}/include --define=CPU1 -v28 -ml -mt --cla_support=cla2	--float_support=fpu64	--tmu_support=tmu0 --diag_warning=225  --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --heap_size=0x200 --define RAM " />
    <configuration name="CPU1_FLASH" compilerBuildOptions="--opt_level=off -I${PROJECT_ROOT}/device -I${C2000WARE_DLIB_ROOT} -I${Free_RTOS}/portable/CCS/C2000_C28x -I${Free_RTOS}/include --define=CPU1 --define=_FLASH -v28 -ml -mt --cla_support=cla2 --float_support=fpu64 --tmu_support=tmu0 --vcu_support=vcu2 --diag_warning=225  --diag_suppress=10063 --display_error_number" linkerBuildOptions="--entry_point code_start --stack_size=0x100 --heap_size=0x200   " />
    <pathVariable name="C2000WARE_ROOT" path="C:/ti/c2000/C2000Ware_3_02_00_00" scope="project" />
    <pathVariable name="C2000WARE_DLIB_ROOT" path="${C2000WARE_ROOT}/driverlib/f2837xd/driverlib" scope="project" />
    <pathVariable name="Free_RTOS" path="../../../Source/" scope="project" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/include/driverlib.h" targetDirectory="device" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/include/device.h" targetDirectory="device" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/source/device.c" targetDirectory="device" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/targetConfigs/TMS320F28377D.ccxml" targetDirectory="targetConfigs" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/cmd/2837xD_RAM_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_RAM" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/cmd/2837xD_FLASH_lnk_cpu1.cmd" targetDirectory="" applicableConfigurations="CPU1_FLASH" />
    <file action="copy" path="${C2000WARE_DLIB_ROOT}/" targetDirectory="device" excludeFromBuild="True" />
    <file action="copy" path="${C2000WARE_ROOT}/device_support/f2837xd/common/source/F2837xD_CodeStartBranch.asm" targetDirectory="device" />
    <file action="link" path="${C2000WARE_DLIB_ROOT}/ccs/Debug/driverlib.lib" targetDirectory="" />
    <file action="copy" path="../led_ex1_blinky_rtos.c" targetDirectory="" />
	<file action="copy" path="../FreeRTOSConfig.h" targetDirectory="" />
	<file action="link" path="${Free_RTOS}/tasks.c" targetDirectory="FreeRTOS" />
	<file action="link" path="${Free_RTOS}/queue.c" targetDirectory="FreeRTOS" />
	<file action="link" path="${Free_RTOS}/list.c" targetDirectory="FreeRTOS" />
	<file action="link" path="${Free_RTOS}/portable/CCS/C2000_C28x/port.c" targetDirectory="FreeRTOS/port" />
	<file action="link" path="${Free_RTOS}/portable/CCS/C2000_C28x/portasm.asm" targetDirectory="FreeRTOS/port" />
	<file action="link" path="${Free_RTOS}/portable/CCS/C2000_C28x/portmacro.h" targetDirectory="FreeRTOS/port" />
  </project>
</projectSpec>

But when I try to build it I get the below error

But if I change the Build Configuration to CPU_FLASH, I am able to build and run the code

Question 1: I would like to know what are the changes that need to be made in the RAM cmd file to accommodate FreeRTOS

Question 2: What is the difference between RAM and FLASH builds?

Question 2.a: Isn't RAM a volatile memory? Can it be used for loading code even in production phase or is it only for debugging?

Regards,

Rashmitha

  • Hi,

    Question 1: I would like to know what are the changes that need to be made in the RAM cmd file to accommodate FreeRTOS

    For RAM configuration to build, you can merge multiple RAM regions like RAMLS0- RAMLS4 etc to create a single region which can be allocated to text section. PFB the snippet from linker cmd file for reference.

    RAMLS0_7         : origin = 0x008000, length = 0x004000 // size=
       /*
       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
       */
       
       RAMDxGSx           : origin = 0x00C000, length = 0x0010FF8
       /*
       RAMD0            : origin = 0x00C000, length = 0x000800
       RAMD1            : origin = 0x00C800, length = 0x000800
       RAMGS0           : origin = 0x00D000, length = 0x001000
       RAMGS1           : origin = 0x00E000, length = 0x001000
       RAMGS2           : origin = 0x00F000, length = 0x001000
       RAMGS3           : origin = 0x010000, length = 0x001000
       RAMGS4           : origin = 0x011000, length = 0x001000
       RAMGS5           : origin = 0x012000, length = 0x001000
       RAMGS6           : origin = 0x013000, length = 0x001000
       RAMGS7           : origin = 0x014000, length = 0x001000
       RAMGS8           : origin = 0x015000, length = 0x001000
       RAMGS9           : origin = 0x016000, length = 0x001000
       RAMGS10          : origin = 0x017000, length = 0x001000
       RAMGS11          : origin = 0x018000, length = 0x001000
       RAMGS12          : origin = 0x019000, length = 0x001000
       RAMGS13          : origin = 0x01A000, length = 0x001000
       RAMGS14          : origin = 0x01B000, length = 0x001000
       RAMGS15          : origin = 0x01C000, length = 0x000FF8
       */

    Question 2: What is the difference between RAM and FLASH builds?

    RAM build uses only RAM memory regions for different sections of the application while Flash build uses Flash memory for sections like text, const etc and RAM memory for sections like data, bss etc.

    Question 2.a: Isn't RAM a volatile memory? Can it be used for loading code even in production phase or is it only for debugging?

    Yes. Usually Flash configuration only would be used in production. Certain code sections like ISR which needs be fast can be loaded into flash but run from RAM in production code.

    Thanks
    Vasudha

  • Thank you so much Vasudha, I was able to build successfully and run it on the launchpad!