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.

CC2652R: XDCTool Problem With Configuro Tool

Part Number: CC2652R
Other Parts Discussed in Thread: SYSBIOS

Hello,

I am trying to build a TI-RTOS application from scratch.  To do so, I have begun by setting up the XDCTool so I can use some of its useful functions, such as System_printf, to do debugging of my TI-RTOS application in the future.  So far, I have not been able to get the System_printf function to work because I have not been able to get the configuro tool to process my .cfg file and generate the necessary .opt and .cmd files.

I am using CCS Version 10.1.0, XDCTools version 3.61.01.25, Simplelink SDK Version 4.20.00.35, and am compiling my project with TI v20.2.1.LTS.  My OS is 64-bit Windows 10.  My target device is CC2652R1F.  I am programming it via the JTAG interface on the Launchpad.

I created a CCS project with simply a main.c file.  I then added the products, XDCTools and the Simplelink SDK, to the project via the Properties / Products functionality.  My file system is shown in the picture below.

Next, I wrote some C code in the main.c file.  The code is pictured below.

After reading through the old XDC Getting Started Guide and XDC Consumer User's Guide (both circa 2007) I gathered that I needed to also write a configuration file to get access to the System module and therefore the System_printf function.  The configuration file I wrote is pictured below.

As per the instructions in the XDC Getting Started Guide, it is necessary to run this .cfg file through the configuro tool to generate a .opt file and a .cmd file.  I'm not really sure why this is necessary or what exactly this does, but I'm sure I need to do it.  I first checked that my XDC installation was good by running the xs --version and xs xdc.tools.configuro --help commands.  Both work as they should.  I then went into CCS and tried to set the target and platform for the XDC tool.  My attempt is pictured below.

I picked the Target and Platform by looking through the html document located at {XDC Install Directory} / docs / xdctools_3_61_01_25_supported_targets.html and I picked the ti.targets.arm.elf.M4F target because the CC2652R1F has an ARM Cortex M4F processor and I am using the TI C Compiler.  That document is pictured below.

I wasn't sure how to pick the proper Platform for the device I am using, so I guessed ti.targets.arm.rtsarm.  This is probably where my issue lies.

Then I went to run the configuro tool via the command line.  My attempt and subsequent error message are shown below.

It seems as though I have chosen the Platform incorrectly.  But when I check the path xdctools.configuro / packages directory, I am confronted with the files pictured below.  I have poked around in them quite a bit, but I am unable to find any document that lists platforms I can use.

So I guess I have a couple questions:

Am I using the XDCTool correctly?  I really do need to generate the .opt and .cmd files to build my project and get access to functions such as System_printf?  How do I select the proper Platform for the configuro tool?  Are there any updated XDCTool user guides available, as the one I am currently using is from 2007 (and the docs file within the XDC download contains documents which are very difficult to understand)?

Note that I have looked through the "hello" example located at {simple link SDK path} \ examples \ rtos \ CC26X2R1_LAUNCHXL\ sysbios \ hello, but it seems to use the platform ti.platforms.simplelink:CC2642R1F which also does not work for me.

I am fairly new to embedded programming, so I may be making lots of mistakes.  Thank you for the help!  

  

  • Hello Andrew,

    I recommend you start with an example and build on your application from there.  In the hello_CC26X2R1_LAUNCHXL_tirtors_ccs example you can enter Project Properties -> General -> Project -> Variant and select the CC2652R1F before building your project.  Beyond that, your best learning portal will be through the SimpleLink Academy Labs offered on TIREx: http://dev.ti.com/tirex/explore/node?node=ADuSIrFg2kUHlTd9Kp0MqQ__pTTHBmu__LATEST 

    Regards,
    Ryan

  • Hey Ryan,

    Thanks for the advice, but I am really trying to start from scratch to learn about TI's RTOS toolchain.  I do not want to start with an example.

    I have selected my hardware variant as you described, but this doesn't seem relevant to my issue.  The variant simply generates the .ccxml file located in the targetConfigs folder.

    I am still having trouble generating the .opt and .cmd files via the configuro tool that comes with XDCTools.  I discovered that my version of XDCTools, 3.61.01.25, does not come with any targets or platforms.  Rather, the targets and platforms come with the Simplelink SDK and are located in [kernel / tirtos / packages / ti /targets] and [kernel / tirtos / packages / ti / platforms] respectively.  For this reason, I am getting the error message pictured below no matter what platform I specify in the command:

    Is it therefore intended that I move my platform from its location in the Simplelink SDK into the path noted in the error message above, C:\ ccs.v10 \ xdctools_3_61_01_25_core / packages?  Why does the XDCTool no longer come with platforms?

    One other question.  In CCS, I see the following under Project Properties > Build > XDCTools:

    I assume the script under "Summary of flags set" is run every time I build my project.  This script seems to be doing exactly what I am trying to do via the command line -- therefore it poses the question: do I even need to generate the .opt and .cmd files via the command line, or will this script generate them whenever I build the project?

  • Andrew,

    We HIGHLY recommend you start with an example. You are asking for lots of extra work that it does not really get you anything (other than many wasted hours and lots of forum posts).

    Regarding System_printf, you can refer to https://dev.ti.com/tirex/explore/node?node=ANqagjxZxWnBRB7bx0EnOw__pTTHBmu__LATEST for a tutorial on all the methods to display debug output.

    Todd

  • Hey Todd,

    Thank you for the response.  I understand that my approach necessitates lots of extra work....but this is an educational project, so the idea is that I work things out from scratch.

    I reviewed the tutorial you linked and while the section discussing the System_printf API is helpful, it does not describe how the underlying XDCTool piece works.  It builds off an example with a number of unexplained files.

    Are there any engineers on this platform that know more about the configuro tool and/or XDCTools that might be able to help me?  The issue I am having is not terribly complex, it's just that there is very little up to date documentation discussing target/platform selection in the context of XDCTools.

    -Andrew

  • Hi Andrew,
    I think I can help a little, but I am not sure what do you mean by "building a project from scratch". When you build a project in CCS, CCS runs gmake, which then uses makefile that CCS created, and these makefiles generate command lines for xs, compiler and linker.

    Maybe you can go to the directory Debug in your command window, type "C:\ccs.v10\ccs\utils\bin\gmake.exe" and follow what's happening. If you are familiar with gmake, you should be able to trace which commands are run and why. 

  • Hey Sasha,

    All I mean by "building a project from scratch" is that I don't want to start with an example project and build off of it.  I can see all of the commands for xs, the compiler, and the linker in the console output within CCS.

    I think I have figured out my issues with the target and platform to specify to the configuro tool.  For anyone seeing this in the future, the targets supported by a particular version of XDCTools are specified in the download folder of XDCTools.  The platforms, however, come with the Simplelink SDK, separate from XDCTools.

    I ended up getting System_printf to work with a barebones setup.  Again, for anyone in the future having trouble with this, here is what I did to get it working:

    For some reason, the linker command file generated by the configuro tool does not fully specify how things should be allocated to memory.  The linker command file generated by the configuro tool I got is shown below:


    /* * Do not modify this file; it is automatically generated from the template * linkcmd.xdt in the ti.platforms.simplelink package and will be overwritten. */ /* * put '"'s around paths because, without this, the linker * considers '-' as minus operator, not a file name character. */ -l"C:\Users\alarson\workspace_v10\GettingStartedWithRTOS\Debug\configPkg\package\cfg\xdccfg_pem4f.oem4f" -l"C:\ccs.v10\simplelink_cc13x2_26x2_sdk_4_20_00_35\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4f" -l"C:\ccs.v10\simplelink_cc13x2_26x2_sdk_4_20_00_35\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\boot.aem4f" -l"C:\ccs.v10\simplelink_cc13x2_26x2_sdk_4_20_00_35\kernel\tirtos\packages\ti\targets\arm\rtsarm\lib\auto_init.aem4f" -l"C:\ccs.v10\xdctools_3_61_01_25_core\packages\xdc\rov\runtime\lib\xdc.rov.runtime.aem4f" --retain="*(xdc.meta)" /* C6x Elf symbols */ --symbol_map __TI_STACK_SIZE=__STACK_SIZE --symbol_map __TI_STACK_BASE=__stack --symbol_map _stack=__stack --args 0x200 -heap 0x1000 -stack 0x1000 /* * Linker command file contributions from all loaded packages: */ /* Content from xdc.services.global (null): */ /* Content from xdc (null): */ /* Content from xdc.corevers (null): */ /* Content from xdc.rov (null): */ /* Content from xdc.runtime (null): */ /* Content from xdc.rov.support (null): */ /* Content from xdc.rov.runtime (null): */ /* Content from xdc.shelf (null): */ /* Content from xdc.services.spec (null): */ /* Content from xdc.services.intern.xsr (null): */ /* Content from xdc.services.intern.gen (null): */ /* Content from xdc.services.intern.cmd (null): */ /* Content from xdc.bld (null): */ /* Content from ti.targets (null): */ /* Content from ti.targets.arm.elf (null): */ /* Content from ti.targets.arm.rtsarm (null): */ /* Content from xdc.platform (null): */ /* Content from ti.catalog.arm.cortexm4 (null): */ /* Content from ti.catalog (null): */ /* Content from ti.catalog.peripherals.hdvicp2 (null): */ /* Content from ti.catalog.arm.peripherals.timers (null): */ /* Content from xdc.cfg (null): */ /* Content from ti.platforms.simplelink (null): */ /* Content from configPkg (null): */ /* * symbolic aliases for static instance objects */ xdc_rov_runtime_Mon__checksum = 1; xdc_rov_runtime_Mon__write = 1; xdc_runtime_Startup__EXECFXN__C = 1; xdc_runtime_Startup__RESETFXN__C = 1; SECTIONS { .bootVecs: load > 0x0 xdc.meta: type = COPY }

    After trying to build my project with just this generated linker command file, I got a bunch of errors telling me that there were some sections of memory which were not properly initialized.  That surprised me -- I thought the configuro tool would handle everything for me.  Therefore, I needed to create and add another linker command file to allocate the standard sections such as .text, .data, etc.  I found a linker command file called CC26X2R1_LAUNCHXL_TIRTOS.cmd in the Simplelink SDK.  It is used by the "hello" example.  I simply copy and pasted this linker command file into my project and removed a couple pieces of it which I found unnecessary.  The code is shown below:

    /*
     *  ======== CC26X2R1_LAUNCHXL.cmd ========
     */
    
    HEAPSIZE = 0x1000;  /* Size of heap buffer used by HeapMem */
    
    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define FLASH_BASE              0x0
    #define FLASH_SIZE              0x58000
    #define RAM_BASE                0x20000000
    #define RAM_SIZE                0x14000
    #define GPRAM_BASE              0x11000000
    #define GPRAM_SIZE              0x2000
    
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE
        /* Application can use GPRAM region as RAM if cache is disabled in the CCFG
        (DEFAULT_CCFG_SIZE_AND_DIS_FLAGS.SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM = 0) */
        GPRAM (RWX): origin = GPRAM_BASE, length = GPRAM_SIZE
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs        :   > FLASH_BASE
        .text           :   >> FLASH
        .TI.ramfunc     : {} load=FLASH, run=SRAM, table(BINIT)
        .const          :   >> FLASH
        .constdata      :   >> FLASH
        .rodata         :   >> FLASH
        .binit          :   > FLASH
        .cinit          :   > FLASH
        .pinit          :   > FLASH
        .init_array     :   > FLASH
        .emb_text       :   >> FLASH
        .ccfg           :   > FLASH (HIGH)
    
        .vtable         :   > SRAM
        .vtable_ram     :   > SRAM
         vtable_ram     :   > SRAM
        .data           :   > SRAM
        .bss            :   > SRAM
        .sysmem         :   > SRAM
        .stack          :   > SRAM (HIGH)
        .nonretenvar    :   > SRAM
        /* Heap buffer used by HeapMem */
        .priheap   : {
            __primary_heap_start__ = .;
            . += HEAPSIZE;
            __primary_heap_end__ = .;
        } > SRAM align 8
        .gpram          :   > GPRAM
    }

    My project then compiled and linked properly.  Note also that System_flush() must be called after System_printf to get things to print to the console properly.

    This was a good, but at times frustrating, learning experience.

    I will now try to get the RTOS up and running.  Hopefully that process is more smooth than this one.

    Thank you to Ryan, Todd, and Sasha for the assistance.