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.