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 HalCogen VIM init bug

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Code generated by HalCoGen 4.2.0  for TMS570LC4357 contain in HL_sys_vim.c this code:

    /* Initialize VIM table */
    {
        uint32 i;

        for (i = 0U; i < (VIM_CHANNELS + 1U); i++)
        {
            vimRAM->ISR[i] = s_vim_init[i];
        }
    }

But it contain bug. VIM_CHANNELS=128 and s_vim_init array have 128 items. Last run of the loop acess to  s_vim_init[128], BUG!

Except this access to vimRAM->ISR[128] overload VIM memory a write to vimRAM->ISR[0] invalid value from memory followed s_vim_init. Not nice.

  • Hi guys, no reaction?
  • Jiri,

    I agree this is a bug. Probably doesn't cause any noticeable problem because the VIM RAM region is defined as a wrap-around in the memory map and this loop is clearing / writing 0's. But it does make you think we should check the use of VIM_CHANNELS.
    Aside from the normal potential confusing of whether or not numbering begins with 0 or 1, we have the phantom interrupt vector that takes the first entry of the VIM RAM yet has no associated channel that can add to the confusion on this one.

    I'll submit a CQ for this issue.


    EDIT:  Submitted ticket # is SDOCM00114451.

  • Problem is that "phantom interrupt" will be executed, when I clear interrupt reason earlier than in interupt. In this case VIM unit execute phantom/dummy interrupt. (TRM Table 36-12. DMM Interrupt Offset 1 Register (DMMOFF1) Field Descriptions)
    But after this initialization it contain invalid value (some program data following table).