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.

Bios Exception handling in Bios 5

Other Parts Discussed in Thread: TMS320DM642, SYSBIOS

I have an old project which works with Bios 5 (chip TMS320DM642). I want to enable bios exceptions.

In bios 6 (different chip), I am able to enable it from the XDC configuration file:

var Exception = xdc.useModule('ti.sysbios.family.c64p.Exception');
Exception.exceptionHook = "&exceptionDSP";

How can I enable similar exceptions on Bios 5?

  • Hi Yousf Badr,

    BIOS 5.x has the EXC module.

    Please refer to the DSP/BIOS 5.x Application Programming Interface guide (i.e. docs/pru403s.pdf),

    Appendix C
    SPRU403S—August 2012
    C64x+ Exception Support

    Steve

  • Hi Steven,

    I'm currently working with Yousf Badr on the same project. I tried what you said and I forced the system to output an exception but the SW didn't get into the exception handling function. Would you please write the exact syntax and updates that need to be done, we already checked the manual?

    Thank you.

  • Hi Mahmoud Bahaa,

    I think the following should work, can you please try this?
    First, you need to make sure the EXC module is enabled in your BIOS configuration (*.tcf file).  It should be enabled by default, but it's also possible to disable it.  You can ensure that it's enabled by putting this line at the very end of your *.tcf file (at the end, but before "Prog.gen()"):
    bios.HWI.ENABLEEXC = true;
    Next, you need to decide which EXC hooks you want to use and define them.
    The hook set can be seen in exc.h:
    extern Void (*EXC_exceptionHook)(Void);
    extern Void (*EXC_internalHook)(Void);
    extern Void (*EXC_externalHook)(Void);
    extern Void (*EXC_nmiHook)(Void);

    The EXC module will assign defaults to these which do nothing (e.g. they call FXN_F_nop).  So if you want them to call your own functions, you will need to define your own hook function that conforms to the above signature and then assign the hook to your function.  For example:
    #include <exc.h>
    Void myExcHook(Void)
    {
        /* insert your code here */
    }
    ...
    EXC_exceptionHook = myExcHook;
    Steve
  • I just also realized that the source to for EXC in BIOS 5 is available in the product.  I see it here on my machine:

    C:\ti\CCS5.3.0.00090\bios_5_42_00_07\packages\ti\bios\src\exc

    Steve

  • Hi Steven,

    Thanks for your reply, when I type bios.HWI.ENABLEEXC = true; I get the following error 

    line 664: property 'ENABLEEXC' doesn't exist for instance HWI

    What do you think?

  • Hi Mahmoud,

    This makes me think that your project may be configured for the wrong device or platform.

    If you right click on your project and selece "build settings", then in the General tab, what do you see for the Device settings?  You should see C6000, and variant should be a C64x+ device.

    Also, what platform are you loading in your *.tcf file?

    It may be helpful if you attach your *.tcf file.

    Having said that, as I mentioned setting that property to true should not even be necessary, as it defaults to true.  So once you are sure that your project build settings and configuration are correctly set for your C6000 device, you should be OK.

    Steve