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.

ISR visibility for Proxy Vector Table using TI-RTOS

Other Parts Discussed in Thread: MSP430F6779, SYSBIOS

Hi All

I have created a proxy interrupt vector table in order to use a bootloader image and an application image on our device, and update the proxy table depending on the new application that is flashed in.

When the TI-RTOS is not used. I can easily create on as follows (MSP430F6779):

__asm (" .sect .APP_PROXY_VECTORS");
__asm (" .retain .APP_PROXY_VECTORS");
__asm (" .global ProxyVectorTable");
__asm ("ProxyVectorTable:");
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(0) AES */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(1) COMP_B */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(2) RTC */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(3) LCD_C */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(4) TIMER3_A1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(5) TIMER3_A0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(6) PORT2 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(7) TIMER2_A1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(8) TIMER2_A0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(9) PORT1 */
__asm (" BRA #USCIB1_ISR;"); /* APP_PROXY_VECTOR(10) USCI_B1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(11) USCI_A3 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(12) TIMER1_A1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(13) TIMER1_A0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(14) DMA */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(15) AUX */
__asm (" BRA #USCI_A2_ISR;"); /* APP_PROXY_VECTOR(16) USCI_A2 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(17) USCI_A1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(18) TIMER0_A1 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(19) TIMER0_A0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(20) SD24B */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(21) ADC10 */
__asm (" BRA #USCI_B0_ISR;"); /* APP_PROXY_VECTOR(22) USCI_B0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(23) USCI_A0 */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(24) WDT */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(25) UNMI */
__asm (" BRA #Dummy_Isr;"); /* APP_PROXY_VECTOR(26) SYSNMI */


This is because I have visibility of the ISR routines that I have created.

Now when using the TI-RTOS, the ISRs are generated and they are quite layered into the sysbios and I do not have visibility. I would have thought that something like the following would work, but I can't seem to get access to the ISRs when under TI-RTOS:

__asm (" .sect .APP_PROXY_VECTORS");
__asm (" .retain .APP_PROXY_VECTORS");
__asm (" .global ProxyVectorTable");
__asm ("ProxyVectorTable:");
__asm (" BRA #ti_sysbios_family_msp430_Hwi36;"); /* APP_PROXY_VECTOR(0) AES*/
__asm (" BRA #ti_sysbios_family_msp430_Hwi37;"); /* APP_PROXY_VECTOR(1) COMP_B */
__asm (" BRA #ti_sysbios_family_msp430_Hwi38;"); /* APP_PROXY_VECTOR(2) RTC */
__asm (" BRA #ti_sysbios_family_msp430_Hwi39;"); /* APP_PROXY_VECTOR(3) LCD_C */
__asm (" BRA #ti_sysbios_family_msp430_Hwi40;"); /* APP_PROXY_VECTOR(4) TIMER3_A1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi41;"); /* APP_PROXY_VECTOR(5) TIMER3_A0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi42;"); /* APP_PROXY_VECTOR(6) PORT2 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi43;"); /* APP_PROXY_VECTOR(7) TIMER2_A1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi44;"); /* APP_PROXY_VECTOR(8) TIMER2_A0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi45;"); /* APP_PROXY_VECTOR(9) PORT1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi46;"); /* APP_PROXY_VECTOR(10) USCI_B1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi47;"); /* APP_PROXY_VECTOR(11) USCI_A3 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi48;"); /* APP_PROXY_VECTOR(12) TIMER1_A1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi49;"); /* APP_PROXY_VECTOR(13) TIMER1_A0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi50;"); /* APP_PROXY_VECTOR(14) DMA */
__asm (" BRA #ti_sysbios_family_msp430_Hwi51;"); /* APP_PROXY_VECTOR(15) AUX */
__asm (" BRA #ti_sysbios_family_msp430_Hwi52;"); /* APP_PROXY_VECTOR(16) USCI_A2 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi53;"); /* APP_PROXY_VECTOR(17) USCI_A1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi54;"); /* APP_PROXY_VECTOR(18) TIMER0_A1 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi55;"); /* APP_PROXY_VECTOR(19) TIMER0_A0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi56;"); /* APP_PROXY_VECTOR(20) SD24B */
__asm (" BRA #ti_sysbios_family_msp430_Hwi57;"); /* APP_PROXY_VECTOR(21) ADC10 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi58;"); /* APP_PROXY_VECTOR(22) USCI_B0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi59;"); /* APP_PROXY_VECTOR(23) USCI_A0 */
__asm (" BRA #ti_sysbios_family_msp430_Hwi60;"); /* APP_PROXY_VECTOR(24) WDT */
__asm (" BRA #ti_sysbios_family_msp430_Hwi61;"); /* APP_PROXY_VECTOR(25) UNMI */
__asm (" BRA #ti_sysbios_family_msp430_Hwi62;"); /* APP_PROXY_VECTOR(26) SYSNMI */

Please can you guide me with how to get visibility, or if something else needs to be done?

I have tried declaring them and using extern, but no luck so far.

Thanks.

 

  • Hi Mark,

    Are you trying to override the TI-RTOS vector table?  If so, may I ask why?  Why not just use the Hwi module to take care of your interrupt management?

    Steve

  • Hi Steve

    We have two applications. One is a bootloader and the other is the main application. The bootloader needs to determines if there is an image that needs to be flashed into the internal flash to the application area, and also determines if there is one that needs to boot that is already there.

    The bootloader will always run first.

    We are basically following what is described in MSPBoot, if you look at section 2.2.3.

    We need to relocate the interrupt vectors to a proxy table for the application, but it's the visibility of the ISR routines that is causing an issue. The bootloader lives at C000 to 0xFFFF, where as our application lives at 0x2C000 onwards, so we also need to be able to point to the ISRs in the application which are 20-bit addresses, where as the interrupt vector table expects 16-bit ones.

    Is there a way to get access to these ISR addresses from my application?

    We've choosen this implementation based on the information from another post by us.

    e2e.ti.com/.../455518

    Thanks.
  • Mark,

    Ok, I spoke with my colleague about this and got some insight.  I think one issue you are running into here is due to the nature of how the interrupt vectors are created in the MSP430.  For this family of devices, the vector is only generated if it is actually configured and used within the application.

    For example, if the application is configured to use interrupt 38 and 45, then the following functions will be generated:

    ti_sysbios_family_msp430_Hwi38

    ti_sysbios_family_msp430_Hwi45

    However, all others wil not be generated (e.g. ti_sysbios_family_msp430_Hwi36, ti_sysbios_family_msp430_Hwi37, ti_sysbios_family_msp430_Hwi39, and so on, won't be generated).

    So, your asm statements up above won't be valid, since they will be instructions to branch to non-existent symbols.

    I am wondering if it would work for you to generate the above asm(BRA, *) statements above?

    Basically, since the function name format of the Hwi functions is always the same, you could use grep (or similar tool) to search the application's *.map file for the string "ti_sysbios_family_msp430_Hwi".  This would give you a list of the functions that do exist in the given application.

    From there, you could use what was found to write a script that generates the proper asm() statements for the vectors whose Hwi functions exist.  For all other vector table entries, your asm() statement could jump to a dummy function that spins or does a nop, or whatever you would need to do when it's undefined.

    Steve

  • Hi Steve

    Thanks for getting back to me.

    I have now fixed this buy creating dummy ISRs for the unused interrupts, and creating hooks for the used one.

    Each used interrupt creates a three phase interrupts. I can see the second and optional third phase, but not the first phase, for example on 59, we get the following created in HwiFuncs.c

    __interrupt Void ti_sysbios_family_msp430_Hwi59(Void)

    Void ti_sysbios_family_msp430_Hwi59_p2(Void)

    Then our ISR

    UARTEUSCIA_hwiIntFxn(0) is called in p2.

    I create a hook for the first phase, which can then call the visible p2 and then the ISR.

    So in my code for 59 I have a proxy interrupt as follows:

    __interrupt void Proxy59(void)
    {

    UInt taskKey;

    /* disable Task scheduler */
    taskKey = ti_sysbios_knl_Task_disable();

    /* switch stacks and then run the phase 2 function */
    ti_sysbios_family_xxx_Hwi_switchAndRunFunc(&ti_sysbios_family_msp430_Hwi59_p2);

    /* handle any Task re-scheduling as required */
    ti_sysbios_knl_Task_restoreHwi(taskKey);

    }

    And the entry in my proxy table looks like this.

    __asm (" BRA #Proxy59;"); /* APP_PROXY_VECTOR(23) USCI_A0 */

    This all works fine and I now have it running.

    Thanks again

     

  • Ok, great that you got past this. Could you please mark this thread as "answered"?

    Thanks,

    Steve