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.

How to check if BIOS/Semaphore modules has started

Hi

I'm making a debugging mechanism for my system and was wondering when it is safe to use Semaphore_pend. I've used the SysCallback mechanism to get my own putch() which is working, and I want to write the output via an UART (and other channels). The UART requires that the Semaphore code has started and so the system aborts if someone calls the debugging functions before the bios has started.

There is no problem with waiting until the BIOS has started to get the output from the UART (I still have other mechanisms available) but I don't know when either of the Semaphore or BIOS modules has started. This is the implementation of the startupDone() functions for BIOS and Semaphore:

/* Module__startupDone__S */
xdc_Bool ti_sysbios_BIOS_Module__startupDone__S( void )
{
    return 1;
}


/* Module__startupDone__S */
xdc_Bool ti_sysbios_knl_Semaphore_Module__startupDone__S( void )
{
    return 1;
}

How can I check in my custom putch() method that the other modules has started?

  • Hi,

    I'm not sure why you need to do this. Most if not all modules are initialized before main() and most applications do not interject any code before then. But the problem is a bit more complex than that too. Just because the Semaphore module has been initialized does not guarantee that you can call Semaphore_pend.
    You can check the thread type: BIOS_getThreadType() and make sure its a BIOS_ThreadType_Task since Semaphore_pend() should only be called in a Task.

    Judah