I'm running ChibiOS 2.6.9.
I've tried to run my board at OS tick speed shorter than 1ms. When I do so, I'm going to core trap "Machine Check Interrupt (IVOR1)".
OS goes there from the _port_switch function, which in my case is:
Code: Select all
_port_switch:
e_subi r1, r1, 0x50 ; Size of the intctx structure.
se_mflr r0
e_stw r0, 84(r1) ; LR into the caller frame.
mfcr r0
e_stw r0, 0(r1) ; CR.
e_stmw r14, 4(r1) ; GPR14...GPR31.
e_stw r1, 12(r4) ; Store swapped-out stack.
e_lwz r1, 12(r3) ; Load swapped-in stack.
e_lmw r14, 4(r1) ; GPR14...GPR31.
e_lwz r0, 0(r1) ; CR.
mtcr r0
e_lwz r0, 84(r1) ; LR from the caller frame.
mtlr r0
e_addi r1, r1, 80 ; Size of the intctx structure.
se_blr
When execution reach e_lmw r14, 4(r1) row, IVOR1 is hit. I saw, that at this point SP (r1) is zero, which cannot be the case, so somewhere, something is wrong. Any idea how to find what is not OK?
As a try to locate the exact problem, I've tried to switch CH_DBG_SYSTEM_STATE_CHECK to TRUE, but in this case very first task creation (chThdCreateStatic) hits chDbgPanic("SV#4") in dbg_check_lock. Any idea why this happens? Obviously, I didn't misplaced chSysLock(), since this is legacy ChibiOS code... What is wrong with my setup?
I could provide full code for evaluation.