diff options
author | Tim Newsome <tim@sifive.com> | 2018-05-17 16:47:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-17 16:47:48 -0700 |
commit | bb86173f37c11d1ea305b3e45d6abdaf3d239512 (patch) | |
tree | 14353fe637b742813419aa76fd06a0bbc9643914 /tcl/target/psoc6.cfg | |
parent | 3344db3d0aef8f3b8c033cb2a098e9ca15e8615c (diff) | |
parent | 712d6a5c3aca04e4181e471f796b2da6e04b49ca (diff) | |
download | riscv-openocd-bb86173f37c11d1ea305b3e45d6abdaf3d239512.zip riscv-openocd-bb86173f37c11d1ea305b3e45d6abdaf3d239512.tar.gz riscv-openocd-bb86173f37c11d1ea305b3e45d6abdaf3d239512.tar.bz2 |
Merge pull request #251 from riscv/from_upstream
From upstream
Diffstat (limited to 'tcl/target/psoc6.cfg')
-rw-r--r-- | tcl/target/psoc6.cfg | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tcl/target/psoc6.cfg b/tcl/target/psoc6.cfg index ad9aba5..fc0c711 100644 --- a/tcl/target/psoc6.cfg +++ b/tcl/target/psoc6.cfg @@ -82,19 +82,30 @@ proc psoc6_deassert_post { target } { $target arp_examine global RESET_MODE + global TARGET + if { $RESET_MODE ne "run" } { $target arp_poll $target arp_poll set st [$target curstate] + if { $st eq "reset" } { # we assume running state follows # if reset accidentally halts, waiting is useless catch { $target arp_waitstate running 100 } set st [$target curstate] } + if { $st eq "running" } { echo "$target: Ran after reset and before halt..." - $target arp_halt + if { $target eq "${TARGET}.cm0" } { + # Try to cleanly reset whole system + # and halt the CM0 at entry point + psoc6 reset_halt + $target arp_waitstate halted 100 + } else { + $target arp_halt + } } } } @@ -133,3 +144,7 @@ if { $_ENABLE_CM0 } { # Use CM0+ by default on dual-core devices targets ${TARGET}.cm0 } + +if {[using_jtag]} { + swj_newdap $_CHIPNAME bs -irlen 18 -expected-id 0x2e200069 +} |