Commit Graph

73 Commits

Author SHA1 Message Date
Spencer Oliver fc2abe63fd armv7m: use generic arm::core_mode
To simplify things change over to using the generic core_mode struct rather
than maintaining a armv7m specific one.

Change-Id: Ibf32b785d896fef4f33307fabe0d8eb266f7086f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/966
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-02-02 16:21:41 +00:00
Spencer Oliver 561984c8f6 hla: fix watchpoints not being set
Watchpoints were not being enabled when the hl adapter target was resumed.
This effects both stlink and icdi interfaces.

Change-Id: Ia9f8a9415be97a467cd099b63b6bc9f7f37d0c0d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/931
Tested-by: jenkins
2012-12-23 21:46:02 +00:00
Spencer Oliver 68956e028a cortex: autostep correctly handle user breakpoint
If we halt due to a breakpoint make sure that we do not remove it during a
step, only remove breakpoints we have created.

Change-Id: I060168e54e53637d4fbf3cbcf62072efdb353807
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/947
Tested-by: jenkins
2012-11-06 16:27:19 +00:00
Peter Horn 79fa75e199 cortex_m: Fix single stepping will not return to debug mode sometimes
This occurs when stepping past a breakpoint on a even address with
maskisr option set to auto

With -d3 the following log message appears in this case:

"Debug : Interrupt handlers didn't complete within time,
 leaving target running"

Cause : Given a breakpoint is set on the lower half word and the PC is on
the upper half word. When another breakpoint is now set on the current PC
then resuming the core will not result in a break on the newly set
breakpoint. This has been observed on a STM32F1x, STM32F2x (CM3) but not
on a STM32F0x (CM0). It's not clear if this is a STM32F1/F2 only or a
general CM3 problem.


Change-Id: I384813f3bfdf935373b5e23cdb2d7f243c70cc00
Signed-off-by: Peter Horn <peter.horn@bluewin.ch>
Reviewed-on: http://openocd.zylin.com/864
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-11-06 16:26:54 +00:00
Evan Hunter 6663a788a5 Ensure Cortex-M reset wakes device from sleep (wfi/wfe)
Change-Id: Idb52ca3123bb3e2f7863ba1b82ac9b176d7cb094
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/833
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-31 10:15:02 +00:00
Spencer Oliver 39f3501afb cortex_m: suggest using hardware srst if VECTRESET used
If the target does not support SYSRESETREQ we fall back to using VECTRESET.
This however does not reset the peripherals and we issue a warning to the user
to suggest using a reset-init script.

Also suggest that using hardware srst will give them the same functionality
as using SYSRESETREQ.

Change-Id: Ie1781c4b849fed66c52222e6539735537c879fb3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/802
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-09-06 19:19:03 +00:00
Spencer Oliver 2aab7d3ce2 target: Cortex-M use consistent arm dap access
Purely cosmetic but use the same style as Cortex-A target, this makes
searching refs easier.

Change-Id: I732ad9701f561e2312c5d191f5aaffd3a2f2393d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/731
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-07-11 19:28:48 +00:00
Spencer Oliver 5b170456f7 target: detect correct Cortex-M tar auto increment size
The ADIv5 spec guarentees that tar_autoincr_block will be 10bits.
Make this the default for Cortex-M family until we detect a Cortex-M3/M4,
we then change autoincrement to 12bits.

Change-Id: Ie8c89134aa036879bdd8a3c312cee9715dbc6913
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/730
Tested-by: jenkins
Reviewed-by: simon qian <simonqian.openocd@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-07-11 08:17:42 +00:00
Spencer Oliver e1c40cb1c1 target: disable armv6m unaligned memory access
Change-Id: I42704cf80939ab9c9d4f402d2cd51c196e2fadb3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/645
Tested-by: jenkins
2012-05-21 16:17:10 +00:00
Spencer Oliver ec5e4bae25 stlink: add armv7m stlink handling
This enables us to better handle some of the low level functions that the
stlink does not support. It also enables us to share a few more of the
standard cortex_m3 functions if necessary.

Change-Id: I7a2c57450122012ec189245d8879d8967913e00e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/637
Tested-by: jenkins
2012-05-14 09:38:59 +00:00
Spencer Oliver 6637cf9229 cortex-m3: support connecting under reset
Some targets support connecting while the target's srst is asserted.
Tested on stm32 family.

Change-Id: I9df43623025e37832155aeee7aa099b844b85f16
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/606
Tested-by: jenkins
2012-05-14 09:31:17 +00:00
Simon Qian 7743e0fb43 topic: add reset functions for SWD
Add swd_init_reset and swd_add_reset.
Add adapter_assert_reset and adapter_deassert_reset, and call them instead
of JTAG reset functions.

Change-Id: Ib2551c6fbb45513e0ae0dc331cfe3ee3f922298a
Signed-off-by: Simon Qian <simonqian.openocd@gmail.com>
Reviewed-on: http://openocd.zylin.com/526
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-04-10 12:14:00 +00:00
Mathias K 861df4574d armv7m: detect floating point feature
This patch add fp feature detection on cortex-m4.

Change-Id: I99e9d1bf5534630a22b8ad9c878165683db2d0ba
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/524
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-30 16:08:32 +00:00
Mathias K e2073cc18a stm32: determine all cpu types and use common examine
This patch determine all cpu types and not only
the cortex M3 and the stm32 target use the common
target examine function from the cortex_m sources.

Change-Id: If689dd994b3855284b927fc4b206f420cf32b6c7
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/511
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-14 20:35:59 +00:00
Spencer Oliver 7d1f9bafc7 target: remove unused declaration
arm7_9_prepare_reset_halt is long since gone and the functionality
is implemented in the target's assert_reset handler.

Change-Id: Ib03c730cb39d68e5e3bb42f92af13daf8074e4e2
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/515
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-03-13 16:32:09 +00:00
Spencer Oliver 374127301e build: cleanup src/target directory
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/430
Tested-by: jenkins
2012-02-06 11:00:36 +00:00
Spencer Oliver 3528457ba8 target: move regmaps to armv7m.c
This move will enable use to share with regmaps with the stlink target.

Change-Id: If8f41c7c53323d5074cb22ec3440530c1e402004
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/377
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-18 21:45:42 +00:00
Spencer Oliver 0c2f8b6eb8 cmd: add missing usage vars
we should have caught them all - hopefully.

Change-Id: I35435317fccaf5ad0216244d69f76db6857bb582
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/381
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-18 21:45:02 +00:00
Øyvind Harboe 4668bd264c retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR
Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/300
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-04 17:13:46 +00:00
Mathias K 54f820e8d8 Make cortex_m3 functions public accessible.
Change this functions to make it accessible for other
target implementations.

Change-Id: Ib41fc793cfb4de5439af026c2e8b52e7a9507c85
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/278
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-01-03 21:11:51 +00:00
Øyvind Harboe ed028542ed cortex_m: initialize unused CPU variables to 0 for poll info output
fixes warnings.

Change-Id: I1a9ec09083d4e6269889fb79e6121f25e83eb396
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/163
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-04 09:13:14 +00:00
Øyvind Harboe 2ea7a42e22 cortex_m: add missing error checking
found by clang.

Change-Id: I099c6fe6b044dba36c20221cb439bdcba5a6bb6f
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/152
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
2011-11-01 22:12:59 +00:00
Spencer Oliver 3f8f583964 target: rename cortex_m3.[ch] to cortex_m.[ch]
This rename is in preparation for cortex_m4 support.

Change-Id: Ic08c298ec6ed2aabc2c39db67191f68b3a51f550
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/147
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-01 14:23:08 +00:00