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.

setCpuFreq on DSP/BIOS 6

Other Parts Discussed in Thread: SYSBIOS

Hello,

 

I'm using DSP/BIOS 6 on EVM6472.

When I define timers / use TSK_sleep(), the times are multiplied by 1.4 (for example, TSK_sleep(1000) sleeps for 1.4 seconds). I assumed this was because the DSP/BIOS CPU frequency is defined to 700MHz, and not 500MHz, which is the setting I use.

Problem is, when I change the setting, it doesn't seem to fix to problem.

I tried both statically (in the .cfg file - BIOS.cpuFreq.lo = 500000000) and dynamically (using BIOS_setCpuFreq), and neither seem to change anything.

Any ideas?

 

Thanks,

Arya.

  • Hi Arya --

    I think your issue is the same as an issue posted a couple weeks ago.  See this post for the workaround.

    http://e2e.ti.com/support/embedded/f/355/t/84638.aspx


    Regards,
    -Karl-

  • Hi Karl,

     

    I tried it, and it still doesn't work - It still waits 1.4 times what I ask it to (IE, if I ask for 10 seconds it waits 14).

    This, by the way, is on core0. Other cores act even more strangely - TSK_sleep(10000) only returns after exactly 17 minutes.

     

    Arya.

  • Can you please tell me which exact version of BIOS 6.x you are using?    

    Can you please send across test case (.cfg and .c file) so we can review and reproduce?

    Thanks,
    -Karl-

  • I've reproduced the problem and I'm looking into it.

  • Can you try the following?  In the .cfg file, set the desired CPU speed and then manually set the freq for the timer. Note: I looked at ROV's ti.sysbios.timers.timer64.Timer and saw that I was using id 0. For example:

    BIOS.cpuFreq.lo = 500000000;
    Timer64 = xdc.useModule('ti.sysbios.timers.timer64.Timer');
    Timer64.intFreqs[0].lo = BIOS.cpuFreq.lo/6;

    You do not need any runtime calls (e.g. you do not need to call Clock_tickReconfig or BIOS_setCpuFreq).

    I've opened a bug for this: SDOCM00077874

    Todd

  • The BIOS version I'm using is 6.21.00.13. I will work on sending a code example, but it's a very simple project - it creates a task, and in the task calls TSK_sleep for 10 seconds (and waits for 14 seconds on core0, and 17 minutes on any other core).

    I'm working on EVM6472, if it's of any interest, and using whole program debug.

  • Thanks, this solved the problem for core0.

    I still, on the other hand, have a problem with all the other cores (I'm working on 6472, it has 6 cores). TSK_sleep(10000) there still sleeps for 17 minutes (exactly).

    Should I post a different thread on that subject?

     

    Arya.

  • Sorry, I forgot to check the behavior on the other cores.  Let's keep this thread open and I'll look into.

     

    Todd

  • Arya,

    Are you running the same executable on the other cores? Or did you build a different executable for each core?

    Which Timer are you using for the other cores?  Are you using the default Timer 0? or Are you using a shared timer?

    If you use the default Timer 0 on any core other than core 0, you might have a problem and would have to reconfigure the base address for the Timer.

    Did you already posts your .cfg/.c file somewhere already?

    Judah

  • Hi Judah,

     

    I'm running the same executable on all cores.

    I'm not using any timer, I just call TSK_sleep(10000). Currently, it sleeps for 10 seconds on core0 and 17 minutes on all other cores.

     

    Arya.

  • Arya,

    Do you know which Timer the CLK module is using?  If Timer0 is being used, it doesn't make sense to me how they same executable would be working on other cores?  Do you know if you are using a shared timer for the CLK module?  Did you mean 10 seconds versus 17 seconds or is it really 17 minutes?  Is it an option to build multiple executables for you?  The only way, I think you can get this to work correctly in BIOS v6.21 is to build at least two executables. (1) one executable is for one core which initializes the Timer used by Clock (make sure the Timer is a shared timer and not a local one).  (2) another executable is for all the other cores which does not initialize the Timer used by clock (make sure to specify the same shared Timer). 

    Judah

  • Arya,

    I should mention a couple of other options here.

    1)  BIOS v6.30 and later solves the problem of each core using its local timer by default.  Also, if using a shared timer, it allows you to specify which core will initialize the timer.  This means you can have a single executable which runs on all cores.

    2)  You can get away with a single executable in BIOS v6.21 if you meet the following conditions. (a)  Specify the clock to uses one of the shared timer (physical timers 6-11).  The logical id's are number 1-6. (b)  You should run all the executables simultaneously since they all will initialize the same timer.  This is okay, if you run them all together at the same time.

    Judah

  • I don't mind using different images on different cores... I even tried that, it does the same thing. I suppose the problem is it still uses (by default) core0's clock.

    How do I define which clock Task_sleep uses?

  • Arya,

    I confirmed that you can do the following and it should work.  This will use logical timer 1 which is actually maps to physical timer 6 which is a shared timer. Now in this case, all cores will initialize the cores so you need to run them simulanteously in order for this to work.

        var Clock = xdc.useModule('ti.sysbios.knl.Clock');
        Clock.timerId = 1;

    I should note that for BIOS v6.30 and later, timerId 1 corresponds to physical timer 1, so you would do timerId = 6 instead.

    Judah

  • Judah,

     

    Is there no way for me to tell every core to use its local timer?

    I run the cores independently. I sometimes only run several and not all of them, and cannot promise they'll all run simultaneously...

     

    Arya.

  • Arya,

    In BIOS v6.30 and later, the default behaviour is such that each core uses its local timer for the BIOS clock module.

    Unfortunately, there's no way of doing this in BIOS v6.21 without hacking the ti/sysbios/timers/timer64/Timer.xs file.  In this file, we have made a local to physical timer maping for all devices that we support.  For the 6472 device, we are not specifying the physical timers 1-5 which are the local timers for cores 1-5.

    I'd recommend moving to BIOS v6.30 or later for multicore support on c6472 device.

    Judah