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.

bios5/bios6 build conditional

Other Parts Discussed in Thread: SYSBIOS

Hi,

I have a file that needs to run with both bios5 or 6.   It has timer calls and log printf calls where the api is different between 5 and 6.

Is there a constant, in bios.h maybe that I can use to figure out which api calls to make?   I don't want to define anything new or have the builder know the difference.

 

I found this in bios.h:

 

#define ti_sysbios_BIOS___VERS 150

 

Can I use this somehow?    Is there something better?     I did a brief search of e2e but didn't find exactly what I was looking for.


Thanks,
Matt

  • Matt,

    Have you thought about creating an OS Abstraction Layer which can provide a consistent set of API calls for your application and allow you to link with the OS of your choice underneath it?

  • Hi David,

    Yes, that would be a good idea, but one of the things I need to abstract most is the Log calls, and, unfortunately, those do not like string pointers because of the way the mechanism works.   As I understand, at least on Bios 5, the string is not transmitted over the jtag, but just a code with the arguments for formatting on the PC side.   Abstracting that is difficult because the main text cannot be a pointer (please let me know if I have that right).


    For the timer calls, (and almost every other also), I think its a good idea.    Can you think of a way around the log_printf?

    On Bios 5, I have calls like this:

            LOG_printf(&trace,"Test ID: %s, FAIL.  %s", (*(sorted_test_ptrs[index])).test_name, (*(sorted_test_ptrs[index])).test_result_text);

    On Bios 6, these became:

             Log_print2(Diags_USER1,"Test ID: %s, FAIL.  %s", (IArg)(*(sorted_test_ptrs[index])).test_name, (IArg)(*(sorted_test_ptrs[index])).test_result_text);


    Could I do this better so that these can be abstracted?   Or maybe a different way in both cases?


    Br,
    Matt

  • Matt,

    SYS/BIOS comes with a legacy DSP/BIOS API support.  You can read more about that in the app note SPRAAS7E.

    So I think you can just use the legacy DSP/BIOS LOG interface.  Also, since BIOS6 has the same restrictions as BIOS5 with regard to strings, there should be no problem with how you pass strings pointers.  If it works with DSP/BIOS, then it should work withSYS/BIOS.

    Dave