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
600 stars 265 forks source link

copy paste error in masking lower ISR2 interrupts #68

Closed Virtex6 closed 6 years ago

Virtex6 commented 6 years ago

I had the problem that when sending a message from a ISR2 the kernel has crashed. This was caused by an index out of bounds in the function tpl_mask_isr2_priority. The result of the index calculation was negative, so the resulting function call has crashed the system.

I first fixed it with an boundary check (maybe usefull at all?) but now I think it is a copy and paste error in line 668 of tpl_os_kernel.c.

The line is if (TPL_KERN_REF(kern).s_running->type == IS_ROUTINE) but it should be if (TPL_KERN_REF(kern).s_elected->type == IS_ROUTINE).

The platform was STM32F407.

jlbirccyn commented 6 years ago

Yes you are right.

However, there is a problem left. At OS start, s_running is NULL. I investigate the problem today.