TrampolineRTOS / trampoline

Trampoline is a static RTOS for small embedded systems. Its API is aligned with OSEK/VDX OS and AUTOSAR OS 4.2 standards.
GNU General Public License v2.0
599 stars 263 forks source link

goil: code: armv8: Fix ISR id mismatch #162

Closed yhamamachi closed 3 months ago

yhamamachi commented 3 months ago

Currently, interrupt handler has same id so that interrupt doesn't work correctly on envrionment which has multiple ISR. This is caused by the scope of indexISR2 variable.

And, even if this issue is fixed, function order and index is not matched always because function order is change by priotiry. So, non-expected function may be called.

Thus, this patch fixes to use defined variable instead of index.


I tested by using Whitebox SDK v5.x-dev branch which contains following patch. https://github.com/renesas-rcar/whitebox-sdk/commit/4b2d930953f8fa3ec42e834d1705c6bf6750c17d

Log without patch:

-> % grep tpl_central_interrupt_handler examples/cortex-a-r/armv8/spider/sample/sample/*
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(5);

Log with patch:

-> % grep tpl_central_interrupt_handler examples/cortex-a-r/armv8/spider/sample/sample/*
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(coma_err_int_id);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(etha1_err_int_id);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(gwca0_err_int_id);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(gwca0_rx_ts_int_id);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(gwca0_rx_tx_int_id);
examples/cortex-a-r/armv8/spider/sample/sample/tpl_app_config.c:  tpl_central_interrupt_handler(iccomInt_id);
RICCIARDI-Adrien commented 3 months ago

Hi @fsylvestre, do you want to take a look ? I did not work on this part and I'm not a Goil expert at all !

fsylvestre commented 3 months ago

The patch seems great. (Surprised that we have missed that, but could probably explain why some corner cases could generate some failures)