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.

RTOS/MSP432E401Y: ClockP_usleep() or Task_sleep() isn't working.

Part Number: MSP432E401Y

Tool/software: TI-RTOS

Hi,

ClockP_usleep() or Task_sleep() isn't working.

FYI i am TIMER0_BASE for PWM generation. I wanted to know if this could be the reason.

Thanks a lot

  • Hi,

    could you share some details on what exactly isn't working? What behavior do you see that indicates the functions aren't working?

    Is this reproducible or a one time occurrence?

    Rakshith B N said:
    FYI i am TIMER0_BASE for PWM generation. I wanted to know if this could be the reason.

    Could you be a bit more specidif on what you're doing in your application?

    Please share which IDE and OS you're working with.

    Thanks and best regards,

    Britta

  • I'm sorry for not being specific earlier.
    I'm using CCS8 for the IDE. Let the explain the flow of code.
    I have a thread inside which is a task running for ADC read. The task has an infinite loop. I basically have 4 threads working on this project. Correct me if i am wrong, as per my knowledge is concerned we need to put the task into sleep so that the other threads are executed. If this is correct, at the end of the infinite loop ( while(1){ } ) i have a Task_sleep(400). Everything works fine until i reach this point. After which the controller hangs in this particular function and does not return at all. Be it ClockP_usleep() or Task_sleep() it hangs. Is this because i am using TIMER0_BASE for another function. I have read other forum where they have discussed about TIMER0_BASE being the issue. Please help me out if there's anything i'm missing.
  • Rakshith,

    Please provide this additional info:

    1) For “I have read other forum where they have discussed about TIMER0_BASE being the issue”?  Can you post a link to that or provide more info?

    2) Regarding “the controller hangs in this particular function and does not return at all.”  If you halt the CPU where specifically is the PC?  

    3) If you open “ROV Classic” under Tools, and click on the BIOS module, then the “Scan for errors…” tab, are any errors reported?

    4) The application configuration file (with .cfg extension) so I can see how the timers are configured.

    5) Are you programming any of the timers directly, not using TI-RTOS kernel or driver APIs?

    6) Are interrupts enabled when you call Task_sleep()?

    And regarding “as per my knowledge is concerned we need to put the task into sleep so that the other threads are executed”… if you have all 4 tasks running at same priority, or some at lower priority, then yes, you would need to have the task block momentarily to allow the other tasks to run.  If all are at same priority, you can use Task_yield() as an alternative to sleeping the task.

    Regards,
    Scott

  • Rakshith,

    Did this get resolved?

    Todd

    [12/17 update: Marking this as TI Thinks Resolved because original poster did not respond.]

**Attention** This is a public forum