-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge up to fd7b66c5eb038185b72953821204ec9bb8ce49d1 from upstream #1132
Conversation
Add documentation for the commands 'ms'. Change-Id: I247adce1c586c4f4cd36d044d48298c370635e67 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8432 Tested-by: jenkins
Commit 53b94fa ("binarybuffer: Fix str_to_buf() parsing function") introduces the helper command_parse_str_to_buf() to parse as number a string on TCL command-line. The parameter 'radix' can specify the base (decimal, octal, hexadecimal, or auto-detected). TCL is supposed to use decimal numbers by default, while octal and hexadecimal numbers must be prefixed respectively with '0' and '0x' (or '0X'). This would require the helper to always run auto-detection of the base, thus always set the 'radix' parameter to zero. This makes the parameter useless. Keeping the 'radix' parameter can open the door to future abuse of TCL syntax, E.g. a command can require an octal value without the mandatory TCL '0' prefix; the octal value cannot be the result of TCL expression. To prevent any future abuse of the 'radix' parameter, drop it. Change-Id: I88855bd83b4e08e8fdcf86a2fa5ef3269dd4ad57 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8393 Tested-by: jenkins Reviewed-by: Jan Matyas <[email protected]>
With 'radix' always zero and '_detected_radix' always NULL, drop the two parameters and simplify str_to_buf(). While there: - drop some redundant assert(), - drop the re-check for the base prefix, - simplify str_strip_number_prefix_if_present() and rename it, as the prefix MUST be present, - fix a minor typo, - update the doxygen description of str_to_buf(). Change-Id: I1abdc8ec0587b23881953d3094101c04d5bb1c58 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8394 Tested-by: jenkins Reviewed-by: Jan Matyas <[email protected]>
The name 'buf_len' is misleading, as it usually refers to the byte length of a buffer. Here we use it for the length in bits. Rename it as 'buf_bitsize'. While there, fix checkpatch error by changing the index type to 'unsigned int'. Change-Id: I78855ed79a346d996d9c0100d94d14c64a36b228 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8395 Tested-by: jenkins Reviewed-by: Jan Matyas <[email protected]>
The function str_to_buf() can be simplified by writing directly the intermediate results in the output buffer. Such simplification improves the readability and also makes scan-build happy, as it does not trigger anymore the warning: src/helper/binarybuffer.c:328:8: warning: Use of memory allocated with size zero [unix.Malloc] if ((b256_buf[(buf_len / 8)] & mask) != 0x0) { Change-Id: I1cef9a1ec5ff0e5841ba582610f273e89e7a81da Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8396 Reviewed-by: Jan Matyas <[email protected]> Tested-by: jenkins
The Linux checkpatch script used by OpenOCD reports hits either as error, warning and check. Such classification is meaningful for Linux maintainers, but for OpenOCD Jenkins they are all considered as errors. Having such classification in the checkpatch report by Jenkins is misleading for developers that expect 'warnings' to be probably ignored by maintainers, while having no idea what 'checks' means. This patch flattens all the checkpatch reports to 'error' only. Checkpatch can trigger false positives. OpenOCD uses the tag Checkpatch-ignore: in the commit message to prevent Jenkins to report the error, as described in HACKING. Change-Id: I1d3164ba1f725c0763dfe362192ffa669b3856e6 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8424 Reviewed-by: Karl Palsson <[email protected]> Tested-by: jenkins
While at it, fix some small coding style issues. Change-Id: Ifb8e78b55d29a06d69a3ce71d12d0040777aef13 Signed-off-by: Marc Schink <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8423 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Add part numbers for: - Cortex-A65AE, - Cortex-M52, - Cortex-M55, - Cortex-R52+, - STAR-MC1. Change-Id: I6282768896dd727e803a071139816494470744f1 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8319 Tested-by: jenkins
Some targets start up with the sticky overrun bit set. On such targets we need to clear it in order to avoid subsequent incorrect reads. Change-Id: I3e939a9e092de6fcea9494d3179a3386aa1701d2 Signed-off-by: Peter Collingbourne <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8420 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
Reduce the amount of boilerplate by moving cti_regs into its only user, making it a local variable and removing the now-redundant p_val pointer. Change-Id: I778cc1e960532fae1ac1a952c6ff19c54e578a5f Signed-off-by: Peter Collingbourne <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8421 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
This is useful for setting a reset catch on a CPU that is being brought out of reset. Change-Id: Id8fe9bc3f75fd170f207f470a9f3b0faba7f24c1 Signed-off-by: Peter Collingbourne <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8422 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Change-Id: I233efb5b18de5f043fdc976807437db0a94236d1 Signed-off-by: Marc Schink <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/7056 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
OpenOCD disables breakpoints on step/resume if they match the current code position. This is a non-obvious behavior that should be documented Change-Id: Id762066569ec6452869a58dfcd9df88c8a14d6ab Signed-off-by: Parshintsev Anatoly <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8388 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Open output file in binary mode to disable EOL conversion on Windows (and sometimes cygwin depending on installation settings and path). Change-Id: I38276dd1af011ce5781b0264b7cbb08c32a1a2ad Signed-off-by: Richard Allen <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8278 Reviewed-by: Karl Palsson <[email protected]> Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Instead of making people type this in all the time, just default to "SEGGER RTT" so more things work out of the box. Change-Id: I147142cf0a755e635d3f66e047be2eb5049cf511 Signed-off-by: Karl Palsson <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8354 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Needed e.g. for flash drivers handling secure mode. Signed-off-by: Tomas Vanek <[email protected]> Change-Id: If6cb49609140d06a73bcf2e446b6a634d6326e80 Reviewed-on: https://review.openocd.org/c/openocd/+/8435 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Integer values are interpreted by TCL as decimal, binary, octal or hexadecimal if prepended with '0d', '0b', '0o' or '0x' respectively. The case of '0' prefix has been interpreted as octal till TCL 8.6 but is interpreted as part of a decimal number by JimTCL and from TCL 9. Align str_to_buf() to latest TCL syntax by: - addding support for '0d', '0b' and '0o' prefix; - dropping support for '0' prefix. Change-Id: I708ef72146d75b7bf429df329a0269cf48700a44 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8465 Tested-by: jenkins Reviewed-by: Jan Matyas <[email protected]>
Use mbstowcs() to get required length of wide character string and include space for terminating null wide character. Change-Id: I668de6f0acc9b3ec5aca033d870dd9ef354f9077 Signed-off-by: Marcus Nilsson <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8232 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Tomas Vanek <[email protected]>
stm32l4x option_write works like stm32h7x option_write, i.e. expects the value to write after reg_offset and optionally reg_mask after the value. Change-Id: I57fb4fb1dbf7f43fe063b48f4db2dd5f2ef0ade0 Signed-off-by: Ondřej Hošek <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8464 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]> Reviewed-by: Antonio Borneo <[email protected]>
If no mask is given, the value in the option register is replaced completely. If a mask is set, only those bits that are set in the mask are transferred into the option register; the others remain unchanged. Change-Id: If488a10f92d7dcc0e0f192aef5e67c255fd529c3 Signed-off-by: Ondřej Hošek <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8466 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
virtex2 refresh replaced virtex2 program, but the even older programming commands like xc6s_program still suggest the old, now-removed program command. This changes the warnings to suggest the command that is still there, and also adds some indication that you will need to use the .pld name instead of the .tap name. Change-Id: I292da62a95a9b414c69cdb1bba8a28dfd16a7336 Signed-off-by: Adam Novak <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8468 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Daniel Anselmi <[email protected]>
Change-Id: Id2b00fbc8ba627f4465c109fbde6e010faaff9d2 Signed-off-by: Parshintsev Anatoly <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8462 Reviewed-by: Jan Matyas <[email protected]> Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
Support Digilent Anvyl board JTAG chain Change-Id: I6fb52284429af6c98c19411fc8bc3ab983dfa9b8 Signed-off-by: Adam Novak <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8467 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
The _targets has to be global as it is accessed at the end of this file. This is already the case for setup_a5x {}, assure it is the same way for setup_crx{} . Without this change, the _targets at the end of this file is empty in case the Cortex-R is the boot core, fix this. Change-Id: I4979e3125ec7d93bbd56eee0096ae1d9c5f6a565 Signed-off-by: Marek Vasut <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8470 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
Looks like 7f2d3e2 introduced a regression by incorrectly assigning threads. The title of the commit message says that the intention was to "derive threadid from SMP index", this is not what happens, however. Instead threadid is assigned based on an index of all examined targets in an SMP group. This introduces two logical errors. *Error 1* Here is the code that assigns threads to harts: ``` foreach_smp_target(head, target->smp_targets) { struct target *curr = head->target; if (!target_was_examined(curr)) continue; threadid_t tid = threads_found + 1; hwthread_fill_thread(rtos, curr, threads_found, tid); ``` Now, imagine a situation when we have two targets: `target.A` and `target.B`. Let's assume that `target.A` is NOT examined (it could be under reset, for example). Then, according to the algorithm when assigning thread identifiers `target.B` will be assigned tid of 1. The respected inferior on GDB side will be called `Thread 1`. Now, imagine that `target.A` activates and succefully examined - OpenOCD will re-assign thread identifiers. And now on GDB side `Thread 1` will represent the state of `target.A`. Which is incorrect. *Error 2* The reverse mapping between `threadid` and targets does not take the state of targets into account. ``` static struct target * hwthread_find_thread(struct target *target, threadid_t thread_id) ... threadid_t tid = 1; foreach_smp_target(head, target->smp_targets) { if (thread_id == tid) head->target; ++tid; } ``` So the constructed mapping is incorrect. Since in example above `Thread 1` will get mapped to `target.A`. *Solution:* It seems that threadids should be assigned based on position of the thread in an smp group disregarding the target state. Change-Id: Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5 Signed-off-by: Parshintsev Anatoly <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8471 Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Mark Zhuang <[email protected]> Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <[email protected]>
When multiple jlink programmers are connected and no specific serial or USB location is specified, print out the detected serial numbers. Signed-off-by: Marcus Nilsson <[email protected]> Change-Id: I280da2b85363f7054c5f466637120427cadcf7d1 Reviewed-on: https://review.openocd.org/c/openocd/+/8356 Reviewed-by: Mark Zhuang <[email protected]> Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
Sipeed USB-JTAG/TTL Debugger is a compact FT2232D-based JTAG adapter. Change-Id: Ibc9075723f47cd9b49ba4bb39e3d292e7d80bed7 Signed-off-by: Jun Yan <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8472 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
Flash banks created in kinetis_create_missing_banks did not populate bank->minimal_write_gap. The default value of 0 was interpreted as FLASH_WRITE_CONTINUOUS. This created unnecessary large padding if your binary had a gap in the populated flash. It also caused flash errors when loading with GDB because the erroneously padded pages were not erased first. Tested using an S32k148 using s32k.cfg. Change-Id: I9b7af698e29ac2c4f5fc8ecd82fa7f4b1a0d43f1 Signed-off-by: daniellizewski <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8463 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Tomas Vanek <[email protected]>
This updates the flash driver to support more than one bank. This is required to support the cc1352p7 which has two banks. This only have been tested on a cc1352p7. The loader has been built using a gcc-arm-none-eabi-4_8-2014q3 toolchain. Change-Id: Ia813421ececd96d6e2fd4dae910ad60fcc3d3c88 Signed-off-by: Alexandre Bailon <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8192 Tested-by: jenkins Reviewed-by: Vaishnav M A <[email protected]> Reviewed-by: Antonio Borneo <[email protected]>
This adds support for TI CC13X2X7 / CC26X2X7 family. For further details, see https://www.ti.com/lit/ug/swcu192/swcu192.pdf. Change-Id: Ifd9b505716ddf0abbdd00f617e50a93a3d4fbe6a Signed-off-by: Alexandre Bailon <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8193 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Vaishnav M A <[email protected]>
This adds support of TI LP-CC1352P7 evaluation kit. For further details, see https://www.ti.com/tool/LP-CC1352P7. Change-Id: I4aba160dbf4920febb7897458d06450e7d134147 Signed-off-by: Alexandre Bailon <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8194 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins Reviewed-by: Vaishnav M A <[email protected]>
…t functions Change-Id: Ieca5b4e690c9713ad60dc9d8c223c2d64822e2f5 Signed-off-by: Parshintsev Anatoly <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8427 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]> Reviewed-by: Jan Matyas <[email protected]> Reviewed-by: Antonio Borneo <[email protected]>
Simplify the code using the target endianness independent API. Change-Id: I39f720d0db9cf24eb41d7f359e4321bbc2045658 Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8474 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
Use the TRAX interface DEBUGPC if available. Otherwise use default stop-and-go profiling. ESP32-S3, before this patch: Internal: 8 samples/second FT2232H: 12 samples/second After this patch: Internal: 18ksamples/second FT2232H: 100ksamples/second Change-Id: I681f0bccf4263c1e24f38be511e3b3aec8bf4d60 Signed-off-by: Richard Allen <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8431 Reviewed-by: Erhan Kurubas <[email protected]> Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Ian Thompson <[email protected]> Reviewed-by: Yurii Shutkin <[email protected]>
Could be handy for dummy transfer size detection. Signed-off-by: Tomas Vanek <[email protected]> Change-Id: Ibb485218f6c2ff9066910bb58be0fc614b77add3 Reviewed-on: https://review.openocd.org/c/openocd/+/8438 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins Reviewed-by: Andreas Bolsch <[email protected]>
Two different sizes uint8_t and uint32_t was used for this value without a good reason. Signed-off-by: Tomas Vanek <[email protected]> Change-Id: I4bb60cc5397ffd0d37e7034e3930e62793140c8d Reviewed-on: https://review.openocd.org/c/openocd/+/8439 Reviewed-by: Andreas Bolsch <[email protected]> Tested-by: jenkins
Have verified with JLink: openocd -f interface/jlink.cfg -f board/nxp_imx8mp-evk.cfg -c "gdb_breakpoint_override hard" Change-Id: I74f8766b8c5334ca5758c2672c283ff2405de4c3 Signed-off-by: Jiafei Pan <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8352 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
Current script does not enforces the check for the SPDX tag in the linker scripts. Add the extension '.ld' in the OpenOCD specific part. Change-Id: I1cb6bc52e9dd86d99a26393085c7e2c9e8bac11f Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8475 Tested-by: jenkins
Add basic connection details with Key Stone K1 Change-Id: I3e51d4194cfd3b7fe8ae395e0aca0fa4799dfb73 Signed-off-by: liangzhen <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8361 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
- Xtensa LX8 is fully supported in addition to prior LX and NX cores. Change-Id: I2f3f0a21ce1518b3ced6d241f0ab84c65af64423 Signed-off-by: Ian Thompson <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8362 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
The README file contains a mixture of Markdown and non-Markdown syntax. Refurbish the document and use only Markdown syntax according to the specification in [1]. [1] https://www.markdownguide.org/ Change-Id: If58f4e2971dc798a03a78841226804ab1f2d33c8 Signed-off-by: Marc Schink <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8387 Reviewed-by: Antonio Borneo <[email protected]> Tested-by: jenkins
This is the fast path for when there is a mismatch in the leading whole bytes, which means we should return true to indicate not equal like all the other cases here and in the surrounding functions. Otherwise we'll incorrectly report _buf1 == _buf2 if and only if there are mismatches in the leading whole bytes. This was introduced during the refactor and optimisation referenced below. The only in-tree caller of this is jtag_check_value_inner, which will just fail to catch some errors. However, downstream in riscv-openocd it gets used in the riscv target to determine whether an IR scan is needed to select the debug module, and with an IRLEN >= 8 this breaks resetting if the encoding for the DMI isn't all-ones in its leading whole bytes (to match BYPASS), since it will believe they are the same and not do an IR scan, failing (with "At least one TAP shouldn't be in BYPASS mode") in the subsequent DR scan due to the TAP still being recorded as having bypass set (and really having an instruction of either BYPASS or IDCODE). Fixes: e4ee891 ("improve buf_cmp and buf_cmp_mask helpers") Change-Id: Ic4f7ed094429abc4c06a775eb847a8b3ddf2e2d6 Signed-off-by: Jessica Clarke <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8489 Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Evgeniy Naydanov <[email protected]> Reviewed-by: Tomas Vanek <[email protected]> Tested-by: jenkins
Testing fails due to a bug in upstream. |
Backports the fix for riscv-collab#1131. Commit 0bf3373 ("target/breakpoints: Use 'unsigned int' for length") introduces a bug. Link: https://review.openocd.org/c/openocd/+/7056/comment/3c4d9185_83614e2a/ Change-Id: I9f5f67050698a83c27f84965f6de031e2cad492d
There was a conflict: 1. commit 2cd8ebf ("breakpoints: use 64-bit type for watchpoint mask and value") 2. commit 0bf3373 ("target/breakpoints: Use 'unsigned int' for length") The second commit was created erlier, but merged later so the types of `mask` and `value` became `uint32_t` in `watchpoint_add_internal()`. This created a bug: `WATCHPOINT_IGNORE_DATA_VALUE_MASK` is defined as `(~(uint64_t)0)`. Truncation to uint32_t makes it so the comparisons with the constant don't work. Change-Id: I19c414c351f52aff72a60330d83c29db7bbca375 Signed-off-by: Evgeniy Naydanov <[email protected]>
f430a01
to
4c45762
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Testing fails due to a bug in upstream. (...) I'm going to cherry-pick the fix.
I can see that the fix has been already cherry-picked into this branch. So this PR is good to go.
Thank you.
Backports the fix for #1131.
Commit 0bf3373 ("target/breakpoints: Use 'unsigned int' for length") introduces a bug.
Link: https://review.openocd.org/c/openocd/+/7056/comment/3c4d9185_83614e2a/