texane/stlink — pull request #101 by prattmic (2012-07-09 05:19:33+00:00)
Title: Add support for all core registers on the STM32F4DISCOVERY, including floating point registers.

I have extended stlink to include support for all of the core registers of the device:
* r0-r12
* sp, lr, pc, xpsr
* msp, psp
* control, faultmask, basepri, primask
* s0-31
* fpscr

The ST-LINK on the board did not seem to support all of these registers, but as per section C1.6 of the ARMv7-M Architecture Reference Manual, they can all be read and written with accesses to the Debug Core Register Selection and Data registers.

Thus, I have used the standard ST-LINK memory access capabilities to read and write to the registers. A target descriptor XML document is sent to GDB to explain which registers the target has.

I have built and tested this for the STM32F4DISCOVERY, and the target descriptor should not be sent to GDB for any other boards, and as such they should not be affected by these changes. I have tested on a STM32L-DISCOVERY, and it did not seem to be affected.

It is possible that some of the changes I have made may be extended to other boards to provide better access to registers such as the msp, psp, control, etc. With their own target descriptor document, it should be fairly trivial to add support for them.