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.

CC1312R: Idle Function and possible Sysconfig issue

Part Number: CC1312R
Other Parts Discussed in Thread: SYSCONFIG,

Hi,

I am migrating my application to the latest SDK simplelink_cc13xx_cc26xx_sdk_5_30_00_56

I am using standalone Sysconfig with IAR. (Not using CCS).

Sysconfig is set to custom board and I switched the device.

My previous application had custom idle function set in app.cfg.

Idle.addFunc("&myIdleFunc");

I have changed it back as I want to use the default idle functions for power saving. I now get this error in the linker:

Error[Li005]: no definition for "myIdleFunc" [referenced from C:\ti\simplelink_cc13xx_cc26xx_sdk_5_30_00_56\source\ti\ti154stack\common\boards\CC13X2_LAUNCHXL\configPkg\package\cfg\app_prm4f.orm4f]

Is this because Sysconfig is still using a board file? Or have I missed something when trying to set app.cfg back to default?

sysconfig

Thanks.

  • To clarify, if I add:

    extern void myIdleFunc(void);

    and

    void myIdleFunc(void)
    {
      
    }

    to my application, it builds okay. But I don't think I should have to.

  • Hi Andrew,

    Is there a particular reason why do you think that Sysconfig might have to do with what you are seeing?

    So, if I understood correctly, you have changed your .cfg file to the following:

    /* ================ Idle configuration ================ */
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    /*
     * The Idle module is used to specify a list of functions to be called when no
     * other tasks are running in the system.
     *
     * Functions added here will be run continuously within the idle task.
     *
     * Function signature:
     *     Void func(Void);
     */
    //Idle.addFunc("&myIdleFunc");
    Idle.addFunc('&Power_idleFunc');  /* Add the Power module's idle function */

    Am I correct?

    The error that you are seeing seems to be a Linker error if I'm not mistaken. Can you check the Linker options for the project in IAR. Maybe there is something going on in there.

    Did you clean the project before rebuilding?

    BR,
    Andres

  • Hi,

    Thanks for your reply. Yes, the Idle Configuration is as you have posted. The idea is that it is the same as default, so as if I haven't changed anything.

    Can you confirm this is the default set up and that I don't need to declare myIdleFunc?

    I thought the problem might be Sysconfig because I did something new in this SDK migration by selecting 'custom board' and then change device. And on top of that, the error is from a file in:

    ti154stack\common\boards\CC13X2_LAUNCHXL

    which I thought might be incorrectly included by Sysconfig as I have a custom board. I don't know how TI use files in CC13X2_LAUNCHXL when I have a custom board. 

    I can overcome the error by declaring myIdleFunc but I'm quite sure I didn't used to have to do that and my worry is that somehow I've messed up the default configuration.

    I've checked the linker setup and I can't see any issues, and yes, I always clean files.

  • Hi,

    I've dug into this a bit further. It seems that in the lastest SDK there are a lot of files which weren't in my previous (4.3) SDK.

    This is the current contents of CC13X2_LAUNCHXL:

    and this is the previous version (4.3):

    The SDK now has two additional folders, and it's configPkg/cfg/app_prm4f.c that is causing the problem with the following line:

    /*
     * ======== ti.sysbios.knl.Idle DECLARATIONS ========
     */
    
    /* --> myIdleFunc */
    extern xdc_Void myIdleFunc(xdc_Void);

    Does this mean that myIdleFunc() has to be declared now whereas before it didn't?

    Thanks,

    Andy

  • Hi Andrew,

    I think that you might have inadvertently done something wrong when importing your base project to IAR. It's quite likely that you selected a folder within the SDK install directory for your project.

    I mention this because there shouldn't be any configPkg folder in it. This is how a clean install of the 5.30 SDK looks.

    So probably IAR is looking for something that isn't there.

    I suggest that you take a step back, and download a clean copy of the SDK.

    BR,
    Andres

  • Hi,

    You're right. I uninstalled using the Windows Uninstaller and the configPkg and src were the only folders left. I deleted and reinstalled the SDK.

    Now my project is very broken in IAR as it's looking for files in this location. I've no idea what's happened but I think you're right about the IAR base project setup. I started with an example Collector project. May be because I compiled the raw project first to check it worked, it has left folders and files in this location. May be I have to start again but not compile the example project at all. Instead, copy all my project parts across and compile only then.

    I still think it might be a Sysconfig problem where the original collector example setup was for a CC1312R Launchpad, which I then changed from in Sysconfig. Besides this, I've no idea what's gone wrong.

    [Su007]: Unable to open the command file "c:/ti/simplelink_cc13xx_cc26xx_sdk_5_30_00_56/source/ti/ti154stack/apps/../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/compiler.opt.defs" C:\Users\Software3\Documents\cc1312r_868_sdk_5_30_v6\collector\release\Obj\Collector CC13X2\application\collector\link_controller\cllc.o.rsp 1

  • Hi,

    I have started again but have ended up with the same folders back in. It's something to do with either IAR when opening the example collector project, or compiling the example code. I will try again and see if I can get a better idea of what's going on. I've got some tight deadlines so this is not a nice problem to have. 

    What is the proper way to start a new collector project from IAR? Is it:

    1) Browse to the example folder and open the workspace directly.

    2) Or use the Information Center and browse to examples which opens a template.eww

    One of the methods easily creates an infinte loop of folders, but I can't remember which. 

    Any help with the proper way to start an IAR project from collector example would be useful. I've always managed to fumble through the process before but this new issue has stopped my progress.

    Also, the eternal issue of Sysconfig not being able to open a .sysconfig file from any of the examples still persists. I've posted on this several times over the last few years.

  • I can confirm that if I add the following to the example sysconfig file so that it opens, the configPkg folder gets added to the sdk which then causes the myIdleFunc() issue.

    * @cliArgs --board "/ti/boards/CC1312R1_LAUNCHXL" --rtos "tirtos" --product "simplelink_cc13xx_cc26xx_sdk@5.30.00.56"
    * @versions {"tool":"1.10.0+2163"}

    It looks like I need to not use  --board "/ti/boards/CC1312R1_LAUNCHXL" 

  • the configPkg gets produced at the start of a fresh IAR build. I was very careful and created a completely new project and sysconfig file with no board specified at all, I still get the folder outputs:

  • Hi Andrew,

    The proper way t open an example in IAR is by browsing to the example folder and open the template file (i.e., .eww file).

    When you double click it, IAR will open and ask if you want to save the workspace in a new folder.

    When you click OK, by default you'll probably see that IAR chooses the example folder in the SDK. It is at this point where I think that you might be making a mistake. You are meant to choose a different folder for your workspace.

    If you do this, no files should be added or modified in the SDK.

    Furthermore, when you build the project, configPkg will be generated, but it will show up in your workspace folder.

    Now, with respect with your Sysconfig issue. I don't really know why you are facing that problem.There is no need to modify anything to make Sysconfig work in IAR. Although I do know that IAR can behave a bit odd with the Custom Viewers.

    Have you followed the steps in these guides?

    http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/3.40.00.02/exports/docs/zigbee/html/sysconfig/getting-started.html#sysconfig-use-iar

    http://software-dl.ti.com/ecs/SIMPLELINK_CC32XX_SDK/3_20_00_06/exports/docs/simplelink_mcu_sdk/Using_SysConfig_with_IAR_Workbench.html

    BR,
    Andres

  • Hi,

    Thanks for this information. I think I have it working now. Some points:

    1) I was always specifying my own folder when opening the collector example in IAR. However, I think where I was going wrong was using IAR Information Center, and then downloading 'Example Projects' which I haven't done this time, instead following your method of browsing directly to the template. It seemed to install strangely even if I did browse to the template after downloading example projects from Information Center.

    So, the lesson is never use IAR Information Center.

    2) I actually did not realise I could click on the sysconfig file in IAR and it would open Sysconfig. I have always opened Sysconfig separately and open the files directly. Whenever opening a new file it always fails and I would have to add the header lines I mentioned previously. I had to change the Configure Viewer to:

    $SYSCONFIG_ROOT$\nw\nw.exe $SYSCONFIG_ROOT$ --compiler iar -s $SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$\.metadata\product.json --output $PROJ_DIR$ $FILE_PATH$

    which worked. Fantastic!

    3) I can confirm that configPkg is still added to the SDK location, however, app_prm4f.c does not include myIdleFunc() so should not be a problem when I have finished porting my application across the the new collector example.

    Thanks for all your help. It's good to know I have it all set up properly now.

    Andy

  • Looking at the default IAR project compiler and linker extra options, it seems that the configPkg is built and stored in the sdk:

    -f$COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$/source/ti/ti154stack/apps/../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/compiler.opt.defs

    -f$COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$/source/ti/ti154stack/apps/../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/linker.cmd

    I assume this is correct, and I would never have delved into this if it wasn't for me not opening up the IAR template correctly in the first place.

  • Looking at the default IAR project compiler and linker extra options, it seems that the configPkg is built and stored in the sdk:

    -f$COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$/source/ti/ti154stack/apps/../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/compiler.opt.defs

    -f$COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$/source/ti/ti154stack/apps/../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/linker.cmd

    I assume this is correct, and I would never have delved into this if it wasn't for me not opening up the IAR template correctly in the first place.

    Or it is incorrect and the IAR project is not setting up properly from the template. Looking at my previous setup in an older version of IAR (8.50.9) and older SDK (CC13X2 v4.30) , these extra options are not there, instead configPkg is local to the project as you suggested:

    in the latest IAR compiler (v9.2) and latest sdk 5.3, the config include extra option is there:

  • Hi,

    My last update on this: I was having problems due to configPkg being compiled in the SDK directory. I suggest this is a problem with the IAR template in the latest SDK (V5.30). I have not had this issue before (previous SDK was V4.30).

    The solution: I moved app.cfg local to my project, I opened the IAR project in a text editor and changed all references to app.cfg to:

    $PROJ_DIR$/app.cfg

    Then all references to

    COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR$/source/ti/ti154stack/apps/
    ../../../../source/ti/ti154stack/common/boards/CC13X2_LAUNCHXL/configPkg/
    compiler.opt.defs

    to:

    $PROJ_DIR$/configPkg/compiler.opt.defs

    This then causes the configPkg to be built locally.