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.

TMS570LC4357: Run time VIM table update

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi Team,

During startup (from halcogen generated code), vim is getting initialized. But, if we want to update with the user defined ISR's  during run-time in the VIM, what precautions we should take. Is it supported?
Ex: Lets say, currently for channel0, esmHighInterrupt method gets installed during start up. After sometime, if we want to change the ISR with e_high_interrupt method (as per user defined), can we this be updated during runtime?

  • Hello,

    You can use vimChannelMap function to map a request to a channel. The function is defined in sys_vim.c .

    /** @fn void vimChannelMap(uint32 request, uint32 channel, t_isrFuncPTR handler)
    *   @brief Map selected interrupt request to the selected channel
    *
    *    @param[in] request: Interrupt request number 2..127
    *    @param[in] channel: VIM Channel number 2..127
    *    @param[in] handler: Address of the interrupt handler
    *
    *   This function will map selected interrupt request to the selected channel.
    *
    */
    /* SourceId : VIM_SourceId_002 */
    /* DesignId : VIM_DesignId_002 */
    /* Requirements : HL_SR101 */
    void vimChannelMap(uint32 request, uint32 channel, t_isrFuncPTR handler)
    {
        uint32 i,j;
        i = channel >> 2U;              /* Find the register to configure */
        j = channel - (i << 2U);        /* Find the offset of the type    */
        j = 3U - j;                     /* reverse the byte order         */
        j = j << 3U;                    /* find the bit location          */

        /*Mapping the required interrupt request to the required channel*/
        vimREG->CHANCTRL[i] &= ~(uint32)((uint32)0xFFU << j);
        vimREG->CHANCTRL[i] |= (request << j);

        /*Updating VIMRAM*/
        vimRAM->ISR[channel + 1U] = handler;
    }

    Best regards,
    Miro