On Mon, May 18, 2020 at 8:18 AM Freddie Chopin <[email protected]> wrote:

> Hello!
>
> Yesterday I was trying to debug a strange behaviour of my code (a bare-
> metal RTOS in C++), which was about the value exact of CONTROL special
> register (or actually the moment this value changed). It seems that
> OpenOCD did NOT update the value of this register, because it always
> reported it as "2", while reading it in the code gave me value "6". The
> same happened on 0.10.0 and current master.
>
> Any idea what is this about?
>
>
CONTROL bit 2 is FPCA which is reset on Exception entry and set on use of
any FP instruction. It's also stored in and restored from the EXC_RETURN
value on entry and return from an exception. The bit lets the core know the
size of the stacked frame (whether it contains the FP regs or not) so it
doesn't have to stack the FP context if it hasn't been modified since the
last stack frame push.

Not sure why Debug entry here would be treated like Exception entry (no
frame is pushed!) but it would explain why OpenOCD reads the CONTROL
register with bit 2 = 0, while the software reads it as 1.

/Andreas
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to