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.

AM3356: Exception hooks usage in RTOS

Part Number: AM3356
Other Parts Discussed in Thread: SYSBIOS

Hi,

Let me talk about SYS/BIOS for AM335x.

We use processor SDK v4.3(SYS/BIOS 6.52.0.12)

Exception_excHandler in Exception.c include this source code.

/* Call user's exception hook */

if (Exception_excHookFuncs[coreId] != NULL) {

Exception_excHookFuncs[coreId](excContextp);
}

Can user use this Exception_excHookFuncs for getting excContextp ?
If yes, how to use this function.

extern const Exception_ExceptionHookFuncPtr Exception_excHookFunc;

const Exception_excHookFunc[coreId](excContextp)
{
unsigned int val;
val = excContextp;
}

But PC can not jump this function

Best Regards
Hiroyasu

  • Hiroyasu,

    Yes, a pointer to the exception context structure is passed to the user-configured exception hook function.

    But I don't understand your statement “But PC can not jump this function”.  Can you please clarify?

    If you are asking about how this hooks gets called… it will be called when the exception occurs.  But your exception hook function must be explicitly configured in the application configuration (.cfg) file.  For example, here is a snippet from a .cfg file to configure a hook function named “exc_handler()”

        var Exception = xdc.useModule('ti.sysbios.family.arm.exc.Exception');
        Exception.excHookFunc = "&exc_handler";

    Is this what you are looking for?

    Also, you may want to watch this training module:  https://training.ti.com/debugging-common-application-issues-ti-rtos   It discusses exception handling for Cortex-M devices, but this may still be helpful.

    Best regards,
    Scott

  • Hi, Scott

    Thank you for your reply.
    It is good answer ! I got it.

    Thank you !

    Best Regards
    Hiroyasu