debugasm wrote on Thursday, October 20, 2016:
I’m using freeRTOS for a quick test. I’m going to use the functionality
of “EXCEPTION_HANDLERS” on Microblaze CPU.
I created the MicroBlaze CPU with these settings for “exceptions”:
PARAMETER C_M_AXI_I_BUS_EXCEPTION = 1
PARAMETER C_M_AXI_D_BUS_EXCEPTION = 1
PARAMETER C_ILL_OPCODE_EXCEPTION = 1
PARAMETER C_OPCODE_0x0_ILLEGAL = 1
PARAMETER C_USE_STACK_PROTECTION = 1
PARAMETER C_UNALIGNED_EXCEPTIONS = 1
PARAMETER C_PVR = 2
I compiled the BSP in Eclipse activating exceptions:
PARAMETER MICROBLAZE_EXCEPTIONS = true
In “FreeRTOSConfig.h” I have activate installation of exception handling:
#define configINSTALL_EXCEPTION_HANDLERS 1
The compilation is successful.
The system works, I blink two LEDs with two separate tasks, using a
third task where the serial run I try to start a routine that triggers
an exception:
...
unsigned crash_instructions[10];
typedef void (*crash_instructions_t) (void);
crash_instructions_t crash_instructions_p;
crash_instructions[0] = 0;
crash_instructions[1] = 1;
crash_instructions[2] = 2;
crash_instructions[3] = 3;
crash_instructions_p = (crash_instructions_t) crash_instructions;
(*crash_instructions_p)();
...
I put a breakpoint at 0x20 “vectorhwexception” and one on the
“vPortExceptionHandle” function.
Once I triggered the exception I have the first break at 0x20
“vectorhwexception”, but once again given the “run” the
“VPortExceptionHandle” function is never called, and debugging ends.
Performing “vectorhwexception” step by step, I notice that the execution
is always crashes here:
...
ori r6, r0, 7;
cmp r6, r5, r6;
bgti r6, handle_other_ex_tail;
ori r5, r0, 0x7;
handle_other_ex_tail:
PUSH_REG(7); <<<<< block on this instruction
PUSH_REG(8);
PUSH_REG(9);
PUSH_REG(10);
PUSH_REG(11);
PUSH_REG(12);
PUSH_REG(15);
PUSH_REG(18);
...
I had a look to the example supplied with freeRTOS: “MicroBlaze_Kintex7_EthernetLite”
but not well-known differences, excluding exception of FP and DIV.
What could it be ?
debugasm