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.

TDA2P-ACD: Cannot call Semaphore_pend() while the Task or Swi scheduler is disabled.

Part Number: TDA2P-ACD


Hi all,

During usecase run, randomly, I'm getting following assert:

[HOST] [IPU2 ] 1065.139236 s:
[HOST] [IPU2 ] 1065.139327 s: ### XDC ASSERT - ERROR CALLBACK START ###
[HOST] [IPU2 ] 1065.139388 s:
[HOST] [IPU2 ] 1065.139541 s: assertion failure: A_pendTaskDisabled: Cannot call Semaphore_pend() while the Task or Swi scheduler is disabled.
[HOST] [IPU2 ] 1065.139663 s:
[HOST] [IPU2 ] 1065.139693 s: ### XDC ASSERT - ERROR CALLBACK END ###

Explicitly, I'm not calling neither Task_disable or Swi_disable, so what could be reason for this?

Best regards,

Stefan.

  • Hi Stefan,

    Where are you calling semphore pend from? This cannot be called from isr context. when do you see this issue?

    Rgds,

    Brijesh

  • Brijesh,

    When you say semaphore pend you mean BspOsal_semWait ?? Im not using this function inside ISR, I'm aware that this function can cause problems.

    But, I'm using functions Utils_queGet and Utils_quePut with BSP_OSAL_NO_WAIT argument. So, it's non-blocking function, doesn't use semaphore functions, but it uses Hwi_disable() function.

    Could this cause this problem if called inside ISR?

    This issue happens randomly when running some ISS Capture usecase, it's hard to reproduce this assert. 

    Regards,

    Stefan.

  • Hi Stefan,

    It should not, i see in the code that if you use No_wait, then it does not go to semWait. 

    Could you please share the console, stack log, when it crashing?

    Rgds,

    Brijesh

  • Brijesh,

    Im using Linux (A15) + RTOS combination, so I'm not sure how to get stack log. On uart log, I'm getting only this:

    [HOST] [IPU2 ] 1065.139236 s:
    [HOST] [IPU2 ] 1065.139327 s: ### XDC ASSERT - ERROR CALLBACK START ###
    [HOST] [IPU2 ] 1065.139388 s:
    [HOST] [IPU2 ] 1065.139541 s: assertion failure: A_pendTaskDisabled: Cannot call Semaphore_pend() while the Task or Swi scheduler is disabled.
    [HOST] [IPU2 ] 1065.139663 s:
    [HOST] [IPU2 ] 1065.139693 s: ### XDC ASSERT - ERROR CALLBACK END ###

    So, this assert will only happen if BspOsal_semWait function is called from ISR? Is there any other situation which can produce same error?

    Regards,

    Stefan.

  • Hi Stefan,

    At least the prints from the log seems to be suggest that it is assert due to calling semPend from ISR. Can you remove your que_put/get from isr and see if it happens? 

    May be something is missed out. May be No_wait is not set up correctly..

    Rgds,

    Brijesh

  • Brijesh,

    It looks like this was the problem. Even though I used non-blocking Utils_queGet and Utils_quePut functions I was getting assert.

    Since I removed this functions from ISR, I didn't have any problems. I just wanted to do more tests in order to make sure that issue is resolved, considering it's very hard to reproduce the bug.

    Thank you on your help, I will close this thread now.

    Best regards,

    Stefan.