• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Timer_create returns NULL, C6472, Bios 6.32.5.54
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Timer_create returns NULL, C6472, Bios 6.32.5.54

Timer_create returns NULL, C6472, Bios 6.32.5.54

  • Eddie3909
    Posted by Eddie3909
    on Feb 17 2012 18:05 PM
    Mastermind8070 points

    Hi

    I am executing the code below and get a NULL returned for the pointer handle.

    I've checked the ROV ti.sysbios.timers.timer64.timer and it says "nulLocalTimers" = 6 and "numTimerDevices" = 24.

    The ROV "Basic" tab shows only one timer instance with id 0 and intNum 14

    The error block msg says "0x0081683A "E_alreadyD"" which when I look at the memory at 0x0081683A it has "E_alreadyDefined: Hwi already defined: intr# %d....."

    Is there a way to pass the message in eb to some error handler for printing? I'd like to find out when intr %d is.

    How can I change what HWI the timer module wants to use?

    And one more question: Where do I find the enums for timers other than Timer_ANY?

    The code below only runs on CORE 0.

    Error_Block eb;

    Timer_Params timerParams;

    //Task_Handle taskHandle;

    Log_print1(Diags_USER1, "Creating timer with period = %d", periodInUsec);

    Log_print1(Diags_USER1, "The number of timers before create = %d", Timer_getNumTimers());

    Error_init(&eb);

    Timer_Params_init(&timerParams);

    timerParams.period = periodInUsec; /* 2 ms */

    timerParams.periodType = Timer_PeriodType_MICROSECS;

    timerParams.startMode = Timer_StartMode_AUTO; // will start timer automatically

    //timerParams.startMode = Timer_StartMode_USER; // needs Timer_start()

    gapFillTimerHandle = Timer_create(Timer_ANY, gapFillTimerIsr, &timerParams, &eb);

    //gapFillTimerHandle = Timer_create(1, gapFillTimerIsr, &timerParams, &eb);

    //Timer_start(gapFillTimerHandle);

    Log_print1(Diags_USER1, "The number of timers after create = %d", Timer_getNumTimers());

    if (gapFillTimerHandle == NULL)

    {

    System_abort("Doppler timer create failed");

    }

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Feb 17 2012 18:17 PM
    Genius15570 points

    What version of SYS/BIOS are you using and on which device?

    You can add "eb" into a watch window and see what it contains. You can also use the Error APIs (e.g Error_print, Error_getMsg, Error_getSite, etc.) if you prefer to get it during runtime.

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Feb 17 2012 18:18 PM
    Genius15570 points

    D'oh! Sorry, I just looked at the title! Ignore my two questions. I'll try it out here.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Feb 17 2012 18:59 PM
    Genius15570 points

    I've attached a modified SYS/BIOS Task example. I've added your code snippet and confirmed the timer was created and ran properly at the configured rate. Can you create the Task example and substitute the .c and .cfg with the attached files? Does it run properly?

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Feb 17 2012 19:03 PM
    Genius15570 points
    mutex.c.txt

    Looks like attaching is not working...Trying again...

    2844.mutex.cfg.txt

    3225.mutex.c.txt

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Eddie3909
    Posted by Eddie3909
    on Feb 17 2012 19:20 PM
    Mastermind8070 points

    Update

    I added timerParams.intNum = 13 and the handle was no longer NULL.

    Does't setting intNum to its default let the BIOS select an available interrupt to use?

    Cheers

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Feb 17 2012 19:34 PM
    Genius15570 points

    It should. What does your useModule for Timer look like in your .cfg? What does your Timer #include look like in your .c? They must be the same (e.g. either ti.sysbios.hal.Timer or ti.sysbios.timers.timer64.Timer).

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Eddie3909
    Posted by Eddie3909
    on Mar 11 2012 17:13 PM
    Mastermind8070 points

    Hi Todd

    Darn, I hopped that was the problem. Unfortunately they are the same.

    In my .c I have

    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    //#include <csl_tmr.h>
    #include <ti/sysbios/BIOS.h>
    #include <xdc/runtime/Diags.h>
    #include <xdc/runtime/Log.h>
    #include <xdc/runtime/Error.h>
    #include <ti/sysbios/timers/timer64/Timer.h>
    #include <ti/sysbios/hal/Cache.h>

    And in my .cfg I have

    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');

    Cheers

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Damian Gowor
    Posted by Damian Gowor
    on May 18 2012 06:41 AM
    Intellectual850 points

    Did you resolve the problem? I have similar situation happening.

    Best regards,

    Damian Gowor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Damian Gowor
    Posted by Damian Gowor
    on May 18 2012 08:30 AM
    Intellectual850 points

    I noticed that it is happening when I am trying to use Timer 0 or Timer 1. Even when I set SYS/BIOS Timer ID to 2 or 3 I still can't use timer 0 and 1. Is there any solution for that?

    Best regards,

    Damian Gowor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • judahvang
    Posted by judahvang
    on May 18 2012 09:56 AM
    Genius16715 points

    Damian,

    Timer0 is local to core0...timer1 is local to core1...this is true for the first 6 timers.  SYSBIOS by default uses the Lower half of each of those timers for its Clock for the core its executing on.

    The upper half can still be used by the app, but must be specified in the params when creating the Timer:

    ie (in cfg).....   params.half = Timer.Half_UPPER;

    Setting Timer ID to 2 or 3 will give you Timer 2 or 3.

    If you want to use a timer that is shared by several cores, use one of the shared timers (id 7-12).

    Judah

    If my reply answers your question please mark the thread as answered

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Damian Gowor
    Posted by Damian Gowor
    on May 18 2012 10:10 AM
    Intellectual850 points

    I forgot to mention that I am using OMAP-L138. How are Timer assigned in it?

    Best regards,

    Damian Gowor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • judahvang
    Posted by judahvang
    on May 18 2012 10:32 AM
    Genius16715 points

    Um...yes, i thought you were on the same device as the original poster of this thread.

    On OMAP-L138 you have Timers 0-3 for DSP but you have to be weary of what timers the ARM is using so that you don't collide.

    There are no hard assignments.  You should be able to grab any of those timers.  Timers 2,3 cannot be run as 2 -32bit timers while 0,1 can be run as 2 32-bit timers.

    As before, this can be specified via the "half" parameter...either Half_LOWER or Half_UPPER.

    Judah

    If my reply answers your question please mark the thread as answered

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Damian Gowor
    Posted by Damian Gowor
    on May 18 2012 17:54 PM
    Intellectual850 points

    I am trying to understand what is all about in the TM64P_OUT and TM64P_IN GPIO mode. I have read the spruh77a datasheet and the library documentation from following website:

    ti.sysbios.timers.timer64.timer

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_33_04_39/exports/bios_6_33_04_39/docs/cdoc/index.html

    I am still confused how it works. Is there any other more detailed specification of this functions? How it relates to the fact that in OMAP-L138 TM64P_OUT and TM64P_IN are on the same pin? What are doing exacly GPINT__ENO, GPINT__ENI, GPDATO__, GPDATI__ bits? What is TIMER mode in GPIO mode?

    I will appreciate if somebody will explain this peripheral more clearly.

    One more thing. Why no matter what timer I choose as a SYS/BIOS clock I can't  'Timer_create' on this with ID 0 ?

    Best regards,

    Damian Gowor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Damian Gowor
    Posted by Damian Gowor
    on May 21 2012 03:10 AM
    Intellectual850 points

    I have double checked and it seems like I can't create a timer with ID 0 and use lower half. It is possible to create it when using upper half. But I need to generate clock on PIN TM64P0_OUT12. 

    Error_block says "E _ n o t A v a i l a b l e".

    Is this problem is related with SYS/BIOS configuration ?

    Best regards,

    Damian Gowor

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use