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.

OTP_Initialize() Never returns

Other Parts Discussed in Thread: TM4C1294NCPDT

Hi,

I am using Bluetopia V1.2 on TM4C1294NCPDT with CC256x bt chip. 

I observed a random issue where my system hangs.  If I connect Tiav board to CCS & pause the CCS when system hangs, it goes to OTP_Init() every time. This function seems to be used inside bluetopia libraries.  It is purely random and doen't occur every time.

Please can you suggest a wau to identify the problem?

  • Hi,

    Could you please see if you observe the same with the latest release v1.2 R2?
    If so please provide more information like while performing what operation, in which demo and any logs, so that it will be helpful, As I did not see any issue like you mentioned so far.
  • Sundeep,

    I am able to see this issue in V1.2R2 also.
    Basically I would like to acheive the low power mode on TM4C. To do that, I disable the scheduler by disabling TimerA/0. Thi low power approach works fine for long period sucha as 24 hours without any issue.

    But some time, after Disable & Enabling Timer0 I could see that my Tiva software is crashed. And whenever it crashes, I see that it end up in OTP_Initialize(). This happens randomly and and may be once in every 30 minutes or once in a Day.

    But I am frequently Disabling and enabling the TimerA/0 in constant phase, i.e. for every 5 minutes I make sure that Timer is Enabled & disabled back immediately.

    Thanks
  • Ravikiran,

    Can you provide the code for the changes you made to enter low power mode?

    The OTP_Initialize() function is called when the Bluetooth stack is initialized by the BSC_Initialize() function. Are you calling BSC_Initialize() in your code changes?

    Were you connected to any Bluetooth devices when the error occurred? Were you doing any Bluetooth activities when the error occurred?

    Thanks,
    Samuel

  • Dear Samuel,

    Thanks for the reply.

    Plese find my peice of code with comment which takes care of entering deepsleep & exiting from deepsleep.

    /* Make sure Power off all the module usch as USB/LED etc. excpet BT */
    Device_ConfigureSleep_TIVA_ONLY(TRUE) ;
    // enter to deep sleep. Switch off the time of OS Tick Counter
    TimerIntDisable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;
    SysCtlDeepSleep() ;
    // woke up due to a interrupt? lets enable the scheduler back
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;

    I am not calling any BT related API at this point & No BT related activities happening. I ensured that no BT activity happens on the device in this phase.

    As I explained I see this error randomly & hence I doubt on my deep sleep procedure.

    Please comment
  • Ravikiran,

    Did you follow an example when adding the code? Which function was this code added to? Which app are you using? Did you make any other changes to the app? If it's one of the demo apps I can try to run the code on my side to see if I can reproduce the issue.

  • I Samuel,

    I am using SPPLE demo given in Bluetopia V1.2. I Added a new thread & just disabling and enabling Timer A as explaiened in previous post.
    So, my modifications are just for disabling Timer A & enter DeepSleep & wakeup on a ISR & enable Timer A in respective order.

    So, below code which I already posted is what added in new thread.
    /* Make sure Power off all the module usch as USB/LED etc. excpet BT */
    Device_ConfigureSleep_TIVA_ONLY(TRUE) ;
    // enter to deep sleep. Switch off the time of OS Tick Counter
    TimerIntDisable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;
    SysCtlDeepSleep() ;
    // woke up due to a interrupt? lets enable the scheduler back
    TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;
  • Ravikiran,

    A few more questions:

    1. Can you replicate the issue on one of our standard Tiva platforms, either the DK-TM4C123G or the DK-TM4C129X?

    2. Are you using a NoOS or TI_RTOS project?

    3. Have you tried in IAR? If not can you?

    4. Earlier you said that, "I am frequently Disabling and enabling the TimerA/0 in constant phase, i.e. for every 5 minutes I make sure that Timer is Enabled & disabled back immediately." Your code snippet didn't demonstrate this. Please share this code too, and any other relevant code.

    5. What is the implementation of Device_ConfigureSleep_TIVA_ONLY?

    6. Based on your code snippet, could I add the following code to the SPPLE Demo and get identical behavior:

    static void SleepFunction(void *UserParameter)
    {
       /* Make sure Power off all the module usch as USB/LED etc. excpet BT */
       Device_ConfigureSleep_TIVA_ONLY(TRUE) ;
       
       // enter to deep sleep. Switch off the time of OS Tick Counter
       TimerIntDisable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;
       SysCtlDeepSleep() ;
       
       // woke up due to a interrupt? lets enable the scheduler back
       TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT) ;
    }
    
    static void MainThread(void)
    {
       ...
    +      BTPS_AddFunctionToScheduler(SleepFunction, NULL, 0);
    +      
          /* We need to execute Add a function to process the command line  */
          /* to the BTPS Scheduler.                                         */
          if(BTPS_AddFunctionToScheduler(ProcessCharacters, NULL, 200))
       ...
    }

    ?

    Thanks,
    Samuel