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.

DSP > SYS/BIOS Migration Initialization Routine

I have successfully migrated my project to SYS/BIOS and have left all lagacy code intact, the way it was written for DSP?BIOS.   In the original program, (which was not written by me, I am trying to modify it's purpose to suit my project on the same board) the initialiaztion routine was called from main, 

which sent it to a different part of the code. In this code, the modules are initialized, then at the end of the routine, a semaphore is posted to finish the initialization.

inside the initialization semaphore, more modules are enabled (PWM, CAN, Watchdog) and a "wait state" flag is set which is picked up by a timed SWI and begins execution of the rest of the code.

7026.init_semaphore.txt

My questions are:

Does the initialization of the PWM and CAN modules and etc. still need to be done at the task level in SYS/BIOS?  or can I just place them with the rest of the initialization routine? 

Does the legacy semaphore module still work before calling BIOS_start()?

With main set up in this fashion, should BIOS_start() still be called at the end of main, like so? or after the initialization of the legacy modules? Or somewhere else?

  • Justin DelMar said:
    Does the legacy semaphore module still work before calling BIOS_start()?

    Yes.  The legacy SEM_post just calls the SYS/BIOS Semaphore_post, which can be called from main.  Also, you can see a list of calling context tables for each module (such as Semaphore and Swi) in the BIOS API documentation.

    Justin DelMar said:
    Does the initialization of the PWM and CAN modules and etc. still need to be done at the task level in SYS/BIOS?  or can I just place them with the rest of the initialization routine? 

    It all depends.  What are the PWM and CAN modules?  Are these BIOS dependent modules?  If so, they may be OK to be called from main if they only call BIOS functions that can be called from main (see the call context tables to check).  Otherwise, you can put that code into an init task or use one of the BIOS startup hook functions.

    Justin DelMar said:
    With main set up in this fashion, should BIOS_start() still be called at the end of main, like so? or after the initialization of the legacy modules? Or somewhere else?

    BIOS_start() must always be called from main.

    Steve