stlink: fix open AP for v2j37 and v3j7 91/5691/3
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 21 May 2020 11:24:32 +0000 (13:24 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 24 May 2020 20:36:02 +0000 (21:36 +0100)
commit7456e6bac5a3f13818d16660f3cd049a73a6e3fb
tree4cf8e80a296da18e68c55828b8224b6f04632020
parentb342c67f7786fd17734763902dcb0c39286834a0
stlink: fix open AP for v2j37 and v3j7

The new stlink firmware requires opening the AP before issuing
any operation.
In the current code we have a 'questionable' check about the core
model to set the TAR autoincrement, that is issued without opening
the AP, thus causing a STLINK_BAD_AP_ERROR.

Modify the AP open API to handle this case and open AP#0 before
the memory access to check the core model.

Change-Id: I576955b5094bd41d63ff1fbad7b4fd9433253321
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-on: http://openocd.zylin.com/5691
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
src/jtag/drivers/stlink_usb.c

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)