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.

Exception Handling Framework of SYS-BIOS

Other Parts Discussed in Thread: SYSBIOS

We have a query regarding sys-bios

SYS-BIOS has a default ISR which is associated with exceptions which map to HWI-INT1.

When Exceptions are enabled, external as well as internal exceptions are mapped to HWI-INT1.

We found that SYS-BIOS by default has a ISR HWI-INT1 which seems to be automatically generated.

We want to know if is it possible for us to hook some other function as ISR to HWI-INT1. If yes, then what are the changes we need to do to implement this.

We are using BIOS Version 6_33_06_50 and XDC Version 3_23_04_60 on 6616 processor.

  • Hi Sandeep,

    So you want to hook the exception handler, right?
    You can register some hook functions to Exception module just like below :

    ============ in your cfg file ============= 

    var Exception = xdc.useModule("ti.sysbios.family.c64p.Exceptio");
    Exception.
    exceptionHook = <your hook function>;

    ====================================

    <your hook function> will be invoked when any exceptions happen.
    You can also hook a specific exception. For example, if you want to hook a exception caused by "external", you can do like this:

    ============ in your cfg file ============= 

    var Exception = xdc.useModule("ti.sysbios.family.c64p.Exceptio");
    Exception.
    externalHook= <your hook function>;

    ====================================

    Please check the cdoc for the details.

    Best Regards,
    Kawada 

  • Hi Kawada,

    My concern is.. can we replace exception module exception handler with our handler registered for HWI INT1.

    In earlier c64x+ core we tried something like that...whenever exception occurs BIOS exception module EXC_dispatch function is called. We used the same EXC_dispatch function name in our code and performed exception handling.

      But Now we are using c66xx. i am not sure whether the same procedure will work or not.

    In C66xx, exception module of BIOS provides Exception_dispatch function. Can we use the same function name in our code.will it work properly..

    Regards,

    sandeep

  • Hum.. You looks like doing tricky way.
    I'm not sure whether you can exactly replace Exception_dispatch with your own exception handler,
    but to answer your question, you *may* be able to replace it by the following in cfg file :

        Hwi = xdc.useModule("ti.sysbios.family.c64p.Hwi");
        Hwi.plugMeta(1, <your own exception handler>); 

    But before going with this way, please take a look at Exception.c in <bios_install_dir>\bios_6_33_06_50\packages\ti\sysbios\family\c64p

    By default, BIOS will register Exception_dispatch function (it has been implemented in assembly code) to the system and Exception_handler() will be called from this. As you can see in Exception.c, Exception_handler() is :

    - printing some logs
    - calling user exception handlers as I mentioned before
    - and then going to abort via Error_raise().
     
    As you see, these are very simple. So, I believe you don't have to replace the current with your exception handler but you just can register your exception handler to Exception module. Of cause, you will not be able to use your current exception handler as exception handlers for Exception module, but I think you can do with minimal changes.

    Is this answer your question ?

    Best Regards,
    Kawada 

  • thanks kawada,

    I hope this may help.. I will try and update

    Regards,

    sandeep