I'm running FreeRTOS inside a Zynq ARM. On a ARM system I get an data abort exception. The exception is raised because of an unaligned address given to memcpy(). I would now like to get the caller of memcpy(). That is: i would like to retrive the value of "lr" when within memcpy, before the exception happended. I can set a breakpoint to the data exception vector, but when the breakpoint hits the "lr" is banked away. Is it possible to retrive the "lr" of the usermode bank from within abort mode? Maybe with a cp15 coprocessor read? Thanks Konrad
Solution: Inside FreeRTOS_DataAbortHandler I added a breakpoint and the lines
# define MODE_USR 0x00000010
# define I_BIT 0x80
# define F_BIT 0x40
mrs r1, cpsr
msr cpsr_c, #(MODE_USR|I_BIT|F_BIT)
after stepping through the last line I can see the pre-abort stacktrace in XSDK.