Commit Graph

9549 Commits

Author SHA1 Message Date
Tobias Kaiser fb477376da
Do not throw error if RISC-V tselect unimplemented (#542)
* Do not throw error if RISC-V tselect unimplemented

A RISC-V hart without Trigger Module may not implement any of the
associated CSRs such as tselect according to the specification.
riscv_enumerate_triggers previously threw an error in this case, but
only on the first invocation due to r->triggers_enumerated being set
regardless of this. Due to the propagation of this error condition to
disable_triggers and riscv_openocd_step, such a hart would remain
halted after the first 'step' (or 'continue') of a debug session.

This problem can be reproduced with the Ibex RISC-V CPU when
the DbgTriggerEn parameter is set to zero.

This commit changes the behavior of riscv_enumerate_triggers to
return ERROR_OK when tselect was not readable. This fixes the
described malfunction.

Change-Id: Ie813cb119b03702fe708801b5f3581f9bf337243
Signed-off-by: Tobias Kaiser <kaiser@tu-berlin.de>

* Add debug message if RISC-V tselect not readable

Change-Id: Ic3ad5bff9de5c50142cad983f351ce0099cec5c8
Signed-off-by: Tobias Kaiser <kaiser@tu-berlin.de>

* RISC-V triggers: continue if tselect is unreadable

In riscv_enumerate_triggers, even if for one hart tselect cannot be
accessed, other harts might provide trigger support. For this reason,
"continue;" is the appropriate action on a read failure of tselect,
which indicates that triggers are not implemented, instead of
"return ERROR_OK;".

Change-Id: Ied56f3e237b76195a15bfde159532eda9d347d21
Signed-off-by: Tobias Kaiser <kaiser@tu-berlin.de>
2020-10-12 09:16:12 -07:00
Tim Newsome 6c1bd05088
Add memory sample feature (#541)
* Add memory sampling feature.

Currently only gets 10 samples per second, but the overall scaffolding
looks like it works.

Change-Id: I25a2bbcba322f2101c3de598c225f83c902680fa

* Basic memory sample speed-ups.

977 samples/second.

Change-Id: I6ea874f25051aca1cbe3aa2918567a4ee316c4be

* Add base64 dumping of sample buffer.

We can't just dump raw data, because the API we use to get data to the
"user" uses NULL-terminated strings.

Change-Id: I3f33faaa485a74735c13cdaad685e336c1e2095f

* WIP on optimizing PC sampling.

1k samples per second on my laptop, which is roughly double what it was.

Change-Id: I6a77df8aa53118e44928f96d22210df84be45eda

* WIP

Change-Id: I4300692355cb0cf997ec59ab5ca71543b295abb0

* Use small batch to sample memory.

5k samples/second. No error checking.

Change-Id: I8a7f08e49cb153699021e27f8006beb0e6db70ee

* Collect memory samples near continuously.

Rewrite OpenOCD's core loop to get rid of the fixed 100ms delay.
Now collecting 15k samples/second.

Change-Id: Iba5e73e96e8d226a0b5777ecac19453c152dc634

* Fix build.

Change-Id: If2fe7a0c77e0d6545c93fa0d4a013c50a9b9d896

* Fix the mess I left after resolving conflicts.

Change-Id: I96abd47a7834bf8f5e005ba63020f0a0cc429548

* Support 64-bit address in memory sampling.

* Support sampling 64-bit values.

* Better error reporting. WIP on 64-bit support.

* Speed up single 32-bit memory sample.

21k samples/second.

* WIP on review feedback.

Change-Id: I00e453fd685d173b0206d925090beb06c1f057ca

* Make memory sample buffers/config per-target.

Change-Id: I5c2f5997795c7a434e71b36ca4c712623daf993c

* Document, and add bucket clear option.

Change-Id: I922b883adfa787fb4f5a894db872d04fda126cbd
Signed-off-by: Tim Newsome <tim@sifive.com>

* Fix whitespace.

Change-Id: Iabfeb0068d7138d9b252ac127d1b1f949cf19632
Signed-off-by: Tim Newsome <tim@sifive.com>

* Document sample buffer full behavior.

Change-Id: Ib3c30d34b1f9f30cf403afda8fdccb850bc8b4df
Signed-off-by: Tim Newsome <tim@sifive.com>

* Actually clear the sample buffer in dump_sample_buf.

Change-Id: Ifda22643f1e58f69a6382abc90474659d7330ac5
Signed-off-by: Tim Newsome <tim@sifive.com>

* Use compatible string formatting.

Change-Id: Ia5e5333e036c1dbe457bc977fcee41983b9a9b77
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-10-07 14:31:36 -07:00
Tom Hebb e2cfd4e063
Improve support for GD32VF103 MCU (#538)
* riscv: work around buggy hart states during reset in some DMs

As described in the comment this change adds, the GD32VF103 DM reports
that the hart is in more than one state while it is resetting. Because
of this, the current code acknowledges resets before they actually
complete. This sometimes prevents havereset from getting cleared as
intended, leading to a spurious "Hart 0 unexpectedly reset!" message the
next time riscv_is_halted() gets called.

To work around this, check for the absence of the unavailable state
rather than the presence of the running or halted states. This behavior
is also arguably more true to the spec than what exists now: Section 3.2
states that "The system may take an arbitrarily long time to come out of
reset, as reported by allunavail, anyunavail."

Change-Id: I34e90a16233125608bce8e4c2414dbead637600e
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

* riscv: support custom reset-assert scripts

The reset-assert event is used, if present, to override the default
reset logic for ARM and MIPS cores. Do the same for RISC-V so that
devices with buggy ndmreset functionality (like GD32VF103) or
nonstandard reset sequences can specify the appropriate logic in Tcl.

Change-Id: I5e12077d67509853edb8ef3ad3f037f293a5fbb6
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

* tcl/target: support GD32VF103 RISC-V MCU

The GD32VF103 is a low-cost 32-bit RISC-V microcontroller with
peripherals that are more-or-less compatible with the STM32F103 ARM
microcontroller. It is available on several low-cost dev boards, such as
the Sipeed Longan Nano, which is what I am testing on.

Add initial support for this chip, including a workaround for a buggy
ndmreset line (i.e. one that doesn't actually trigger a reset) in its
integrated debug module. Use the existing GD32VF103 flash driver that
was ported from the vendor's code in commit 48e40f3513 ("Add support
for GD32VF103 flash").

Change-Id: Iadac47ceb5437b8e18f3d35901388f10fef9f876
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>

* tcl/target/gd32vf103: add main flash alias

The GD32VF103 creates an alias to either main flash or the bootloader at
0x0, depending on how it was booted. As such, we want to indicate to
debuggers that the memory at 0x0 is flash and so cannot support software
breakpoints. To do this, add an alias to the main flash in the config.
This isn't strictly accurate in the case where we're running the
bootloader, but it still suits our purpose of fixing breakpoint
behavior.

Change-Id: I9eb8462d354f096eee231c0e5e2bffa538a5903e
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2020-10-01 11:06:11 -07:00
Samuel Obuch 6db3ed2c86
Improve riscv expose_[csrs|custom] commands (#536)
* Improve riscv expose_[csrs|custom] commands

* Add option to specify custom name for registers.
* Allow to call commands multiple times without loss of previous data.
* Make sure the commands can only be used in the config phase (before "init").
* Validity checks and warnings.
* Change commands to be per target.
* Fix memory leaks.
* Also fix unrelated memory leaks to keep valgrind happy.

Signed-off-by: Samuel Obuch <sobuch@codasip.com>

* fixes after review

* improve error message
2020-10-01 11:05:41 -07:00
Tom Hebb 2c909f8faa
riscv: remove unused riscv_error_t type (#539)
This seems to be completely unused in these two files. It was probably
accidentally copied from riscv-011.c, where it is used.

Change-Id: I3f7ad8b2d26b005d3ea4438e2b3ec46a6c801792
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2020-09-28 09:46:47 -07:00
Tom Hebb db2e8ad10a
riscv: remove outdated documentation in riscv.c (#540)
These comments appear to have been copied from riscv-011.c, for which
they are accurate. However, it makes no sense to also have them in
riscv.c, because 1) none of the things described are actually in
riscv.c; and 2) riscv-013.c has an entirely different code structure,
meaning everything in the comment is an implementation detail of
riscv-011.c. Remove the copy in riscv.c and just leave the one in
riscv-011.c.

Change-Id: I2873af1522482681325525040b3caad2ddddce9d
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2020-09-28 09:45:18 -07:00
Tim Newsome 13b2ed5ec5
Minor cleanups. (#537)
Requested in http://openocd.zylin.com/#/c/5821/9

Change-Id: I775d9dd3cc8642361d4d129a05053ee3d27b99bb
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-09-28 09:41:08 -07:00
Tim Newsome 675259382b
Minimally describe the BSCAN tunnel interface. (#533)
Change-Id: Ifffa815e6a4a73c551eddf28927583befa743641
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-09-21 14:10:27 -07:00
Jan Matyas 11c4f89b32
Allocate RISC-V arch_info during target creation (#531)
* Allocate RISC-V arch_info during target creation

* Ensured that target->arch_info is allocated as soon as the
  target is created. Needed so that per-target config commands
  (e.g. "riscv set_mem_access") can be executed also in the
  OpenOCD's config phase (before calling "init").

* Added several assert()'s for safety.

Signed-off-by: Jan Matyas <matyas@codasip.com>

* Removed a TODO comment
2020-09-17 13:20:12 -07:00
Tim Newsome 1712dc2c54
{read_from,write_to}_buf -> buf_[sg]et_u{32,64} (#529)
Requested in http://openocd.zylin.com/#/c/5821/7/src/target/riscv/riscv-013.c

Change-Id: I764d77192e902466eed8a6ccf1042b42016afb7e
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-09-15 11:40:37 -07:00
Tim Newsome d4bcd8846a
Make a couple variables static. (#528) 2020-09-15 11:39:32 -07:00
Samuel Obuch 22d771d20c
Allow to put breakpoints in memories without 16 bit access (#525)
* Allow to put breakpoints in memories without 16 bit access

Signed-off-by: Samuel Obuch <sobuch@codasip.com>

* tmp

* tmp

* tmp

* read/write by any size for breakpoints

* fix style for checkpatch
2020-09-14 08:00:59 -07:00
Simon Cook 3a4717193a
Update Signed-off-by Makefile changes to work for out of tree builds (#532)
Change-Id: I617ca9f0eb6a473528646dfb80d75b6bafaa0635
Signed-off-by: Simon Cook <simon.cook@embecosm.com>
2020-09-14 07:58:14 -07:00
Samuel Obuch 2ea18ef7f6
Selection of memory access methods, aampostincrement detection (#508)
* Add flexible selection of memory access methods, detection of aampostincrement.

New configuration command introduced: "riscv set_mem_access".
It allows to specify which RISC-V memory access methods (progbuf,
sysbus and/or abstract access) should be tried and in which order
of priority.

Command "riscv set_prefer_sba" is left and works in backward
compatible way, but is marked as deprecated.

First time abstract memory access is executed, it is tried with
set aampostincrement bit. If the abstract command fails or the
address is not incremented correctly, aampostincrement will not
be used for any subsequent accesses.

Signed-off-by: Samuel Obuch <sobuch@codasip.com>

* remove unnecessary variable

* fix doc
2020-09-10 13:57:51 -07:00
Tim Newsome c3c2f1197b
Attempt to enforce signed-off-by lines in commits. (#523)
* Attempt to enforce signed-off-by lines in commits.

Requested by upstream OpenOCD maintainers.

Change-Id: Iae09058dd690777d4f787cf4c6096233ca7f98ec
Signed-off-by: Tim Newsome <tim@sifive.com>

* Remove unnecessary comment.

Change-Id: If36c6855d46bfc3a1e2e6844d9beac543d212e3a
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-09-10 13:55:45 -07:00
Tim Newsome 2bde4a918a
Add empty usage strings back in. (#526)
Comment on #521 pointed out that they're required.
2020-09-10 13:53:27 -07:00
ZL2WRW 48e40f3513
Add support for GD32VF103 flash (#518)
* Backport of GD32VF103 flash driver from https://github.com/riscv-mcu/riscv-openocd (GPL2 licensed)
Tested with a "Longan Nano" GD32VF103 dev board and seems to be working (flash can be read, erased and written).

* Modify src/flash/nor/gd32vf103.c to comply with Travis CI code style requirements.

* Modified README to include GD32VF103 in list of supported flash devices.
2020-09-07 12:27:08 -07:00
Tim Newsome 5e84c5dd8a
Fix usage for our RISC-V commands. (#521)
Change-Id: Ia4e020637aae2384af223b0210ef2aef6a14b31a
2020-09-03 11:59:48 -07:00
Tim Newsome 9357818bb9
Check malloc/calloc return values. (#517)
Should not affect anything, but requested in
http://openocd.zylin.com/#/c/5821/5/src/target/riscv/batch.c@28

Change-Id: Ib7185bd93eeb918e72872416ab6364f8776cff88
2020-09-03 11:57:25 -07:00
Jiuyang Liu 57b57989b4
user4 0x23 should be MSB. (#519)
Signed-off-by: Jiuyang Liu <jiuyang.liu@sifive.com>
2020-09-01 10:32:31 -07:00
Tim Newsome 0a63eda7f2
Disable signed-off-by requirement. (#520)
Change-Id: Ie84d63bd190dc5843a636037d092457239df4240
2020-08-31 14:15:58 -07:00
Tim Newsome f5a44b0d14
Make checkpatch require Signed-off-by (#516)
* Make checkpatch require Signed-off-by

This will make it easier to send changes contributed here to mainline
OpenOCD.

(Intentionally not including the required line here to make sure I can't
just merge this.)

Change-Id: I089084d38f3e08859d62cf7eface405f37af4799

* Whitespace fix.

This PR isn't building on travis. Maybe because I only changed
.travis.yml. Here's a source change to force a build (hopefully).

Change-Id: I8a828fe1d56a1960bc4bfb91d3d2f3a0790ad571

* Can't check for signoff on sources alone.

Change-Id: I741a299b64bf14857a4e1807b254a7d270b2e466
Signed-off-by: Tim Newsome <tim@sifive.com>

* Actual whitespace fixes.

Why didn't this fail to build before?

Change-Id: I339c03c4ef96546dbef5f16e635921a4fdaf9b35
Signed-off-by: Tim Newsome <tim@sifive.com>
2020-08-31 13:20:46 -07:00
Tim Newsome 91dc0c0c8e
Add SPDX tags for RISC-V files. (#513)
Requested in http://openocd.zylin.com/#/c/5821/3

Change-Id: I95551a3311d8e128300bacdf463da7ab4edf29a0
2020-08-24 15:43:03 -07:00
Tim Newsome ad5f40af8d
Update encoding.h from riscv-opcodes (#514)
Rename dscratch to dscratch0, since that is what it's called in the
spec.

Change-Id: Id6271ae272e979cef69e8ef0577b23452fb84f51
2020-08-24 15:42:45 -07:00
Tim Newsome ca6b1eff1d
Update debug_defines.h from riscv-debug-spec (#515)
A ton of constants got a new prefix, so I made a lot of changes to
match, but no functional changes.

I did define DTM_DMI_MAX_ADDRESS_LENGTH	in batch.c. That definition
never should have been in debug_defines.h, which I missed during code
review.

Change-Id: If5d86660f84bb0a3f2865fb36ef05d6630486d8b
2020-08-24 15:42:29 -07:00
Tim Newsome 920497c62f
Mostly whitespace changes. (#511)
Requested in http://openocd.zylin.com/#/c/5821/3

Change-Id: I75e6d551091396fc6e81b3642ae44bafe358eed7
2020-08-21 12:56:04 -07:00
Tim Newsome c116dc50b2
Update to version 1.0 of the vector spec. (#505)
Accessing registers on targets that implement 0.9 or earlier will no
longer work. If you need that we can talk about making it a config
option.

Change-Id: I953b639cf9a92ee9b0422e035da57c1d07504237
2020-08-18 11:07:34 -07:00
Tim Newsome 53ec10b61d
Create `riscv repeat_read` command (#510)
* WIP, apply stash with conflicts.

Change-Id: Ia794bde419aa29161c68898d20e30527e69f5a31

* Fix conflict resolution problems.

Change-Id: I4cedc348cf613f98cc5a36886f37c568ca644238

* Add repeat_read command.

Only implemented for sba v1 right now, and poorly tested at that.

Change-Id: I1d9ff63e1dea14b3f6a9f8ba4dad53668bf8038b

* Hide bogus address in repeat_read

Change-Id: Ib66c1fa60df9c7fc7cc87880b0fddc52825b48aa

* WIP make repeat read work with progbuf.

Change-Id: I555f8b880c8bf0d1ed0f3f90c7987a5b516a7a79

* WIP

Change-Id: Ic567cea68355ae907e94bd25185a2c9be6fd798d

* Fix error handling when increment is non-zero.

Change-Id: I5a2f3f2ee948fd4e12c0443a542e85b7b5c5791a

* Correctly(?) handle failures when increment is 0.

I'm not 100% convinced that this ensures every read value shows up in
the output, but it ought to work.

Change-Id: I1af3e7174cf9d5e6f293456fb5ead629e17faaaa

* Don't crash when asked to read no data.

Change-Id: I4061b5c720a43a4f828384ab9eacc89557adfa05

* Remove unnecessary comment.

Change-Id: I1be3d699b86299339b3a830ca1ef13c9f5b9fe0f

* Document `riscv repeat_read`.

Change-Id: I4a0f071f38784b2de034f8c1b0ce75d6d2d326b2
2020-08-18 11:01:41 -07:00
Samuel Obuch c1c88dccee
Account for impebreak in size requirements for progbuf (#509)
* Account for impebreak in size requirements for progbuf

* add helper function
2020-08-17 13:07:11 -07:00
Jan Matyas e2d3184eba
Fix of DMI batch scans over 64-bits (#432)
This fixes buffer overrun/data corruption during DMI scan batches
on targets with large value of dtmcs.abits > 30 (unusual, but within
the spec).
2020-08-07 08:39:43 -07:00
Tim Newsome 9ed6707716
Further deprecate `-rtos riscv`. (#499)
* Further deprecate `-rtos riscv`.

Now using `-rtos riscv` will result in a failure, which you can (until
the end of this year) bypass by adding `enable_rtos_riscv` to the
configuration.

Change-Id: Ic714c303dc1b00c19e8956609730c0f83c845cb6

* Make checkpatch happy.

Change-Id: I0469ec37d38ad2eadf25efb5b2b7ac88391c0f51
2020-07-17 14:57:23 -07:00
Ma_124 d076d9bbd7
enable remote_bitbang by default (#498) 2020-07-15 11:32:28 -07:00
Tim Newsome 8b929c6497
Triggers with type=0 aren't real. (#496)
Fixes #491.

Change-Id: Id01adcc68d8c7d95f7e86d49d5d2b0c97c9fb1b0
2020-07-07 11:55:57 -07:00
Tim Newsome bbfc666eba
Merge pull request #494 from riscv/from_upstream
Get changes from upstream
2020-07-02 15:22:47 -07:00
Tim Newsome b50b8da476
Warn if we are asked to read/write 0 bytes. (#492)
Technically that might be OK, but in practice it probably indicates
something went wrong somewhere. Before this change OpenOCD would crash
if it happened.

Change-Id: I2500ba67ec282915dcf2b2488f2aac9fbfdb23a3
2020-07-01 08:28:27 -07:00
Yun Liu 7a3fa1f923
doc: fix missing parameter in dmi_read (#495) 2020-07-01 08:06:29 -07:00
Tim Newsome 7a52af41c1 Fix formatting.
Change-Id: If17f12ad23a7c131eb4ac1344704e62ca24f585d
2020-06-30 11:24:33 -07:00
Tim Newsome 43463b30ed Merge branch 'riscv' into from_upstream
Change-Id: Ia9c5d7c7f0a4913c1af17e042266736943334c7f
2020-06-30 11:04:48 -07:00
Tim Newsome f0151889f0
Don't halt the algorith-running hart because another is halted. (#490)
This logic is a little tortured, but it still passes the semihosting
tests that were the cause for the recent rewrite.

Change-Id: Ic6760bb068621ab2a49feb0cf3998fc6957b5cfc
2020-06-25 17:33:56 -07:00
Tim Newsome 0b1b9e2034
Accept dmstatus.version==3 (0.14) (#489)
Fixes #485.

Change-Id: I60b3d68827ca726558bc28035c0b74c5cf0d9754
2020-06-25 15:34:48 -07:00
Tim Newsome 426d4fa27b Fix build.
Change-Id: Id96e590984eb8488f6367b4c8778e2dc5adf3c1b
2020-06-23 13:11:25 -07:00
Tim Newsome e07613de33 Merge branch 'master' into from_upstream
Conflicts:
      .gitmodules
      .travis.yml
      jimtcl
      src/jtag/core.c
      src/jtag/drivers/ftdi.c
      src/jtag/drivers/libjaylink
      src/jtag/drivers/mpsse.c
      src/jtag/drivers/stlink_usb.c
      src/rtos/hwthread.c
      src/target/riscv/riscv-013.c
      src/target/riscv/riscv.c
      tcl/board/sifive-hifive1-revb.cfg

Change-Id: I2d26ebeffb4c1374730d2e20e6e2a7710403657c
2020-06-23 13:05:43 -07:00
Jaehoon Park 4579dd9358
flash/nor/spi: add micron MT25QU01G (#487)
1Gbit SPI flash on VCU118 Rev. 2.0
2020-06-23 12:39:27 -07:00
Marc Schink 8833c889da libjaylink: Update to latest Git version
This update is for testing the upcoming 0.2.0 release.

Change-Id: I400b09eb3ead4306c83c7980c621124101aaef7e
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5723
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2020-06-23 18:55:53 +01:00
Tim Newsome 03f943ae23
Step/resume off manual hardware triggers (#486)
* Accommodate users setting custom triggers.

RISC-V hardware supports many more triggers than gdb can communicate to
OpenOCD. Accommodate users that set triggers by writing tdata* directly,
by disable/step/reenable when a user has done that.

Note that users must set dmode in tdata1 for this behavior to work
properly. Triggers with dmode=0 are assumed to be set and handled by the
software that is being debugged.

Change-Id: Ib0751689c5553aae3a273395b10f5b98326fa066

* Enumerate triggers when resuming from a trigger

Otherwise when we connect to a target that's already halted due to a
trigger, we won't correctly step past it.

Change-Id: I23b9482fa9597af826770f9cebf247b7ba59f65c

* Also disable/reenable triggers around single step.

Gdb is smart enough to disable/step/resume if it set the triggers, but
if a user set them manually it also needs to happen.

Change-Id: I1251bd47199b6f15f61a93e3a521a53f2b677c5f

* Fix whitespace.

Change-Id: Icc240aecbc7e3e36ce4e4d784f5703304334ca13
2020-06-18 14:47:42 -07:00
Marc Schink 5a79481d3b target/armv7m_trace: Calculate prescaler for external capture devices
This fixes a regression introduced in "2dc88e1479f29ef0141b05bfcd907ad9a3e2d54c"

Change-Id: I04dc19ed30118a4c499b83732700b2ee0fdb67b6
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5610
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2020-06-18 10:11:02 +01:00
Khem Raj 3c6592cf62
riscv: Avoid shadowing read_csr/write_csr macros (#483)
The name conflict is picked by compiler and it fails to compile for rv64
Fixes
src/target/riscv/riscv-011.c:1014:44: error: too many arguments provided to function-like macro invocation
static int read_csr(struct target *target, uint64_t *value, uint32_t csr)
                                           ^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-06-16 11:37:44 -07:00
Edward Fewell 11116ef6ad target/icepick.cfg: Add support for Test TAPs in ICEPick C
In addition to the debug TAPs, the ICEPick C also supports
a bank of Test TAPs (limited functionality intended for
non-debuggable targets). Added support for Test TAPs to
the icepick_c_tapenable routine. Port numbers of 0 to 15
will continue to be handled as a debug TAP number. Test
TAPs will be port numbers of 16 to 31.

This functionality will be needed for doing a flash
mass erase on CC26xx/CC13xx targets. It is possible
for user application to block even adding the Cortex M
TAP to the scan chain, so the only way to unbrick the
target and erase the flash is using a component on a
test TAP of the device's ICEPick router.

Change-Id: I0aa52a08d43a00cbd396efdeadd504fc31c98510
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/5715
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-06-14 14:25:07 +01:00
Marc Schink b7d41ef96a flash/nor/stm32l4x: Fix check for number of arguments
The current version erroneously allows any number of arguments >= 1.

Change-Id: I64156c11b48d411c72bebbf866954818cd036ff2
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5716
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-06-14 14:24:39 +01:00
Tarek BOCHKATI bd6072072e stlink: code factorization by introducing stlink_usb_exit_mode
Change-Id: I4abd6432c4ef969e382bfed96cd19a49d9610000
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5612
Tested-by: jenkins
2020-06-14 14:24:08 +01:00