OS_Delay never returns

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • OS_Delay never returns

    I'm writing an app on the Renesas RX platform and the GNU RX compiler using the embOS object files.

    I'm calling OS_Delay(100), but the function never returns. I've stepped through the code and it appears I'm in a four-instruction infinite loop inside _OS_DelayUntil:

    FFF87D40 EDAB09 MOV.L 24H[R10],R11
    FFF87D43 437B SUB R7,R11
    FFF87D45 610B CMP #0H,R11
    FFF87D47 29F9 BLT.B 0FFF87D40H

    (For reference, _OS_DelayUntil is at 0xFFF87CDC in this build.)

    Now, I generated my project from scratch rather than using one of the sample projects as a starting point, so my assumption is that I missed some piece of initialization code somewhere. I am calling OS_InitHW() in Rtosinit_GNURX.c.

    Can anyone help me figure out what I may be overlooking?

    Thanks,

    -Matthew
  • Hello,

    could you please check that your systick timer interrupt runs?
    I guess that your systick interrupt does not work and therefore an OS_Delay() will not work.

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • It doesn't appear that the systick timer interrupt is firing. I set a breakpoint on OS_ISR_TICK() in Rtosinit_GNURX.c and the breakpoint is never hit. (I tried both a hardware and a software breakpoint.)

    While I'm sure I could debug this with enough effort, the truth is that I'm new to the RX platform. Do you have any tips on chasing this down?

    Thanks!

    -Matthew
  • Hello Matthew,

    you should start with one of our start projects, you could use it as a template when you start with your own project.

    It doesn't appear that the systick timer interrupt is firing.

    Did you call OS_InitHW()?
    Is the timer working?
    Are Interrupts enabled?

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.