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.

Register LCD Interrupt Hanlder at TI-RTOS

hi all,

how to use RTOS Hwi module register LCD uDMA handle ?

which LCD Global configuration, configuration structure and Hardware attributes?

i reference link for dma-transmitted-to-lcd on Tiva . it show error :

"

#10099-D program will not fit into available memory. run placement with alignment fails for section ".vtable" size 0x26c , overlaps with ".vecs", size 0x360 (page 0) tm4c129xnczad.cmd

"

it is "LCDIntRegister(LCD0_BASE, LCDIntHandler)" failed allocate with vecs segment , The TI-RTOS Hwi module should be used to plug an interrupt instead of using IntRegister?

ref: 

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1036584/dk-tm4c129x-rtos---uart-interrupt-register-problem?tisearch=e2e-sitesearch&keymatch=SW-DK-TM4C129X

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/630449/tm4c1297nczad-extra-dma-words-transmitted-to-lcd

e2e.ti.com/.../faq-can-i-update-the-vector-table-with-intregister-when-using-ti-rtos

  • Hello Steven,

    As you've likely seen on that last FAQ link, you cannot use LCDIntRegister to register the interrupt. Instead, it needs to be registered through the HWI module. I will post code to do this later in this reply.

    While you cannot register the interrupt this way, the LCD controller is not part of the supported peripherals for TI-RTOS so aside from the HWI plug in, you will need to use TivaWare APIs to actual control the LCD controller peripheral in tasks. That will be fine as long as you aren't trying to register the interrupt handler outside of the HWI module. I just wanted to make sure that was clear as well.

    Here is an example for how to plug the LCD interrupt vector into the HWI:

    void main(void)
    {
    
        hardware_init();                         // init hardware via Xware
    
        Hwi_Params hwiParams;
        Hwi_Handle myHwi;
        Error_Block eb;
        /* Initialize error block and hwiParams to default values */
        Error_init(&eb);
        Hwi_Params_init(&hwiParams);
        hwiParams.enableInt = FALSE;
        myHwi = Hwi_create(113, (Hwi_FuncPtr)lcdFunction, &hwiParams, &eb);
        if (myHwi == NULL) {
        System_abort("Hwi create failed");
        }
        Hwi_enableInterrupt(113);
    
    
       BIOS_start();
    
    }
    

    In this function, I have named the actual ISR for the LCD controll as lcdFunction. You also need to identify the correct interrupt vector number for the peripheral in question. For the LCD controller, that will be 113. You can find this on Table 2-9. Interrupts in the device datasheet.

    The following line registers the interrupt vector number (113) to the ISR function (lcdFunction):

    myHwi = Hwi_create(113, (Hwi_FuncPtr)lcdFunction, &hwiParams, &eb);

    And then this line actually enables the interrupt in the HWI module:

    Hwi_enableInterrupt(113);

    In your case, if you stick with the same interrupt handler name, then just replace lcdFunction with LCDIntHandler for those calls.

    Best Regards,

    Ralph Jacobi