Set up a periodic task in SYS/BIOS

I am using CCS v4.2 and trying to build SYS/BIOS project. I know about XGCONF editor and how you can edit CFG files with it. I am trying to set up a "periodic task" to run, like you could with the "PRD" option in TCF files used in DSP/BIOS version 5. Version 6 seems to be very different. There is a tab for "task" (under ti.sysbios.knl.Task), where I am assuming you specify the function to run "fxn" under "Create Args". Then there are options like arguments to the function and task priority, but I don't see anywhere where you can specify that the function should run "continuously" or give the interval at which it should execute. Is there a different way of doing it in SYS/BIOS? Maybe some combination of settings for clock, SWI, and task?

21 Replies

  • In reply to Jeff Brower:

    If SL2RAM is a memory segment, i.e., defined under the MEMORY portion of a memory map, then your DATA_SECTION macro won't work.  You'll need a sections specification in your .cfg file such as:

    var dataSection = new Program.SectionSpec;

    dataSection.loadSegment = "SL2RAM";

    Program.sectMap[".my_data"] = dataSection;

    and, I've found I still need to assign this in the .cmd file as:

    SECTIONS

    {

      .my_data : > SL2RAM, PAGE = 1

    }

    and in your code:

    #pragma DATA_SECTION(var, ".my_data");

     

    Mark

  • In reply to Karl Wechsler:

    Jeff Brower

    3) Is there away to get the RTSC Platform Edit/View dialog to 'remember' the package path? Every time we go in there, we have to manually browse/enter the path.  The default path (value shown upon entry) has nothing to do with platform packages.

    Jeff,

    If you are trying to create new platforms we recommend using the default area. A typical workflow will be to create a platform using Tools -> RTSC Tools -> Platform -> New in the default area - <USERDIR>\myRepository\packages. Then when you want to modify/view your platform you use Tools -> RTSC Tools -> Platform -> Edit/View 

    Modifying the platforms delivered with XDCtools in place is not recommended.

    Note that the tool does not have 'memory' - it does not remember the repository selected in a previous invocation. I  think this will be a useful feature to add to the tool. 

     

    Thanks

    Amit

     

  • In reply to Karl Wechsler:

    Karl-

    > And then add this to your .cfg file

    > Program.sectMap["myvars"] = "SL2RAM"

    For now, I created a .cmd file for the project and added a SECTIONS directive.  This killed the warning.  Sorry if I used the old-fashioned way :-)

    -Jeff

  • In reply to Mark Takatz:

    Mark-

     

    Thanks.  Just the .cmd file directive and DATA_SECTION pragma change seemed to be enough.  The warning disappeared and the var is located correctly in SL2RAM.

     

    -Jeff

     

  • In reply to Jeff Brower:

    Hello,

    I followed a suggestion in this thread and created a project from the "Clock" template that appears when you create a new SYS/BIOS project.

    The first thing i noticed is that it does not configure a running task GRAPHICALLY. All the setup is done in the code, in the clock.c file. So, I added a new kernel "Clock" instance from clock.cfg, using the graphical editor. Pointed it to a new function that I added, that would print a message to the console periodically. Now the project built and ran as expected. I was able to see both tasks running, the one created in the code, and the one I added graphically.

    I still don't know why I am getting strange errors when creating tasks from an "empty" SYS/BIOS template. I thought I should be able to do it easily, since it should be possible to do everything from scratch. But at least I got to an example to work for my purposes.

  • In reply to AmitMookerjee:

    Amit-

    I think you put too much stock in Wizards and creating new projects / platforms.  In my 25+ year experience, the first thing we want to look at are *existing* projects, and see how TI guys did it.  In that light, we load one of your existing projects (see previous posts on this thread recommending various ones for us to try), go to Tools -> RTSC -> Platform -> Edit/View... and try to select a Platform Package... and find?  Nothing.

    Yes we can figure it out, but it's another 20 min headache.  And then after figuring it out, the next time we're back there, that dialog box has lost what we told it -- unexpected for a WinXP dialog box.  And that's not insignificant info either, that's the entire memory map for the project, one of the first things of concern.

    CCS v4.2, while powerful with impressive new features, has yet to convince me it's easy to use.

    -Jeff

  • In reply to Jeff Brower:

    Hi Jeff,

    Your point is well taken. I have filed ECL325514 to track this enhancement request. We will address this in the next major release - XDCtools 3.21 - scheduled in mid-November.

     

    Jeff Brower

    CCS v4.2, while powerful with impressive new features, has yet to convince me it's easy to use.

    -Jeff

     

    Are there any other specific  enhancements that you can suggest that will  help improve the user experience?

  • In reply to Jeff Brower:

    It gets even more fun when you need to copy sections from FLASH to RAM.  There are relevant threads and few solutions to the problem in and around these fora.

    Mark

  • In reply to Mark Takatz:

    All:

    Can someone post to the DSP-BIOS wiki or SYS-BIOS wiki the method for setting up a single-shot task?

    I have a situation where I need to wait until after the launch of DSP-BIOS to start operation on a device. I want to do this one time and be done.

    Regards,

    Todd Anderson

  • In reply to Todd Anderson78572:

    Hi Todd,

    Are you looking for instructions on just how to create a Task, or specifically how to create a Task that is "single-shot?"

    A "single shot" task could just be a standard task whose corresponding function does not have a loop.  It would run some code and when the task function exits, the task would terminate.

    For example:

    Void mySingleShotTask()

    {

        /* do some stuff */

        return;  /* ensure that above code allows this to be reached (e.g. no forever loop) */

    }

    Steve