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.

TM4C1294NCPDT: How to call the SVCall fault in TI-RTOS on TM4C?

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS

How do I invoke the fault handlers using TI-RTOS on TM4C129*, in particular SVCall?

I don't think it's possible using Hwi_post since the parameter passed has to be an interrupt number found in table 2-9 of the datasheet.

Doing what is done in the bootloader example for the Tivaware libraries: 

(*((void (*)(void))(*(uint32_t *)0x2c)))();

does not seem to work, (TI-RTOS copies the vector table elsewhere at startup?)

Should be straighforward, but still not obvious to me.

Thanks for any help.

  • Hello sjf,

    A similar topic came up here, can you have a look at that to see if you get further information regarding this? e2e.ti.com/.../3293774

  • Hi Ralph, that post discusses handling the SVCall fault, which is something I have already set up. I'm trying to trigger the SVCall fault/interrupt within TI-RTOS, which I can't seem to do without triggering a hard fault.

  • Hi,

    TI-RTOS plugs the SVCall vector with an exception handler. Note: this is for MSP432E4 which is basically the same as a TM4C device.

    Why do you want to plug it? Note: TI-RTOS does not use it at all.

    Todd

  • I found it is possible to invoke the SVCall fault handler by using inline assembly. I was originally thinking there would be a TI-RTOS function that allowed this.

    Using IAR EWARM, one does the following:

    __asm("svc #0");

    A custom SVCallException  function that is called when above line is executed can be specified as shown in the Code Composer screenshot below. Or it can be set up in the TI-RTOS cfg file using the following lines:

    var ArmHwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');

    ArmHwi.svCallFunc = "&MySVCallException";
    ArmHwi.hardFaultFunc = "&MyHardFaultException";
    ArmHwi.memFaultFunc = "&MyMemFaultException";
    ArmHwi.busFaultFunc = "&MyBusFaultException";
    ArmHwi.usageFaultFunc = "&MyUsageFaultException";

    Ultimately, my goal is to make a fancy bootloader, and for now, I'm trying to exercise the mechanics of switching back and forth between bootloader and application.