You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: openocd-gerrit <ope...@us...> - 2024-09-15 09:06:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 0efedd7bd7e1531a47028d9b32e9406502a59ca7 (commit) from f0bad430df8e9fe0ff5323756a19ad2baa52e9f6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0efedd7bd7e1531a47028d9b32e9406502a59ca7 Author: Marcus Nilsson <bra...@gm...> Date: Wed Aug 7 11:24:04 2024 +0200 drivers/jlink: Print serial numbers when multiple devices are connected 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 <bra...@gm...> Change-Id: I280da2b85363f7054c5f466637120427cadcf7d1 Reviewed-on: https://review.openocd.org/c/openocd/+/8356 Reviewed-by: Mark Zhuang <mar...@sp...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index a94f3a4ab..1b2fb4e30 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -564,6 +564,20 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device) if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) { LOG_ERROR("Multiple devices found, specify the desired device"); + LOG_INFO("Found devices:"); + for (size_t i = 0; devs[i]; i++) { + uint32_t serial; + ret = jaylink_device_get_serial_number(devs[i], &serial); + if (ret == JAYLINK_ERR_NOT_AVAILABLE) { + continue; + } else if (ret != JAYLINK_OK) { + LOG_WARNING("jaylink_device_get_serial_number() failed: %s", + jaylink_strerror(ret)); + continue; + } + LOG_INFO("Device %zu serial: %" PRIu32, i, serial); + } + jaylink_free_devices(devs, true); jaylink_exit(jayctx); return ERROR_JTAG_INIT_FAILED; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/jlink.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-15 09:05:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f0bad430df8e9fe0ff5323756a19ad2baa52e9f6 (commit) from cbed09ee9bdbba27ca93f5883b79595f7e9d347d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f0bad430df8e9fe0ff5323756a19ad2baa52e9f6 Author: Parshintsev Anatoly <ana...@sy...> Date: Fri Aug 30 22:45:07 2024 +0300 rtos/hwthread: fix threadid generation Looks like 7f2d3e2925 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 <ana...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8471 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Mark Zhuang <mar...@sp...> Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evg...@sy...> diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 748e71c3d..4fe841902 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -133,7 +133,7 @@ static int hwthread_update_threads(struct rtos *rtos) if (!target_was_examined(curr)) continue; - threadid_t tid = threads_found + 1; + threadid_t tid = threadid_from_target(curr); hwthread_fill_thread(rtos, curr, threads_found, tid); /* find an interesting thread to set as current */ ----------------------------------------------------------------------- Summary of changes: src/rtos/hwthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:42:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via cbed09ee9bdbba27ca93f5883b79595f7e9d347d (commit) from 75b418faa7b9849a118c86ccac019d2d9ea235af (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cbed09ee9bdbba27ca93f5883b79595f7e9d347d Author: Marek Vasut <mar...@gm...> Date: Fri Aug 23 01:29:02 2024 +0200 tcl/target: Make sure R-Car Gen3 _targets variable is global 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 <mar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8470 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/target/renesas_rcar_gen3.cfg b/tcl/target/renesas_rcar_gen3.cfg index 8dc0e7a0d..73b3003a9 100644 --- a/tcl/target/renesas_rcar_gen3.cfg +++ b/tcl/target/renesas_rcar_gen3.cfg @@ -159,6 +159,7 @@ proc setup_a5x {core_name dbgbase ctibase num boot} { proc setup_crx {core_name dbgbase ctibase num boot} { global _CHIPNAME global _DAPNAME + global _targets for { set _core 0 } { $_core < $num } { incr _core } { set _TARGETNAME $_CHIPNAME.$core_name set _CTINAME $_TARGETNAME.cti ----------------------------------------------------------------------- Summary of changes: tcl/target/renesas_rcar_gen3.cfg | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:41:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 75b418faa7b9849a118c86ccac019d2d9ea235af (commit) from f9b2a1a2bdfb6ff2f12281b2827b9c3b5278b41b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 75b418faa7b9849a118c86ccac019d2d9ea235af Author: Adam Novak <int...@gm...> Date: Sun Aug 25 22:36:29 2024 -0400 tcl/board: Support for Digilent Anvyl board Support Digilent Anvyl board JTAG chain Change-Id: I6fb52284429af6c98c19411fc8bc3ab983dfa9b8 Signed-off-by: Adam Novak <int...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8467 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/digilent_anvyl.cfg b/tcl/board/digilent_anvyl.cfg new file mode 100644 index 000000000..e82002877 --- /dev/null +++ b/tcl/board/digilent_anvyl.cfg @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# Digilent Anvyl with Xilinx Spartan-6 FPGA +# https://digilent.com/reference/programmable-logic/anvyl/start +# Almost the same setup as the Digilent Nexys Video board or the Digilent HS1 +# adapter. +adapter driver ftdi +adapter speed 30000 + +ftdi device_desc "Digilent USB Device" +ftdi vid_pid 0x0403 0x6010 + +# channel 0 is the JTAG channel +# channel 1 is a user serial channel to pins on the FPGA +ftdi channel 0 + +# just TCK TDI TDO TMS, no reset +ftdi layout_init 0x0088 0x008b +reset_config none + +# Enable sampling on falling edge for high JTAG speeds. +ftdi tdo_sample_edge falling + +transport select jtag + +source [find cpld/xilinx-xc6s.cfg] +source [find cpld/jtagspi.cfg] ----------------------------------------------------------------------- Summary of changes: .../{digilent_nexys_video.cfg => digilent_anvyl.cfg} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) copy tcl/board/{digilent_nexys_video.cfg => digilent_anvyl.cfg} (52%) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:41:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f9b2a1a2bdfb6ff2f12281b2827b9c3b5278b41b (commit) from 324469da57f1b061674ac45a3b1f7fbc3b11fdfe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f9b2a1a2bdfb6ff2f12281b2827b9c3b5278b41b Author: Parshintsev Anatoly <ana...@sy...> Date: Tue Aug 20 16:07:17 2024 +0300 jtag_vpi: fix signed/unsigned comparison jtag_vpi_stableclocks Change-Id: Id2b00fbc8ba627f4465c109fbde6e010faaff9d2 Signed-off-by: Parshintsev Anatoly <ana...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8462 Reviewed-by: Jan Matyas <jan...@co...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index 5745a2cd0..a19060c2a 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -461,7 +461,7 @@ static int jtag_vpi_stableclocks(unsigned int num_cycles) unsigned int cycles_remain = num_cycles; int nb_bits; int retval; - const int CYCLES_ONE_BATCH = sizeof(tms_bits) * 8; + const unsigned int CYCLES_ONE_BATCH = sizeof(tms_bits) * 8; /* use TMS=1 in TAP RESET state, TMS=0 in all other stable states */ memset(&tms_bits, (tap_get_state() == TAP_RESET) ? 0xff : 0x00, sizeof(tms_bits)); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/jtag_vpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:39:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 324469da57f1b061674ac45a3b1f7fbc3b11fdfe (commit) from 7e271c91516ce106ceec6af952b9e02641b203cd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 324469da57f1b061674ac45a3b1f7fbc3b11fdfe Author: Adam Novak <int...@gm...> Date: Sun Aug 25 22:51:22 2024 -0400 cpld: update warning to suggest virtex2 refresh 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 <int...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8468 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Daniel Anselmi <dan...@gm...> diff --git a/tcl/cpld/xilinx-xc6s.cfg b/tcl/cpld/xilinx-xc6s.cfg index 92b260577..862c4aa89 100644 --- a/tcl/cpld/xilinx-xc6s.cfg +++ b/tcl/cpld/xilinx-xc6s.cfg @@ -35,7 +35,7 @@ set XC6S_JSTART 0x0c set XC6S_BYPASS 0x3f proc xc6s_program {tap} { - echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program'" + echo "DEPRECATED! use 'virtex2 refresh XXXX.pld' not 'xc6s_program'" global XC6S_JSHUTDOWN XC6S_JPROGRAM XC6S_JSTART XC6S_BYPASS irscan $tap $XC6S_JSHUTDOWN irscan $tap $XC6S_JPROGRAM @@ -45,7 +45,7 @@ proc xc6s_program {tap} { #xtp038 and xc3sprog approach proc xc6s_program_iprog {tap} { - echo "DEPRECATED! use 'virtex2 program ...' not 'xc6s_program_iprog'" + echo "DEPRECATED! use 'virtex2 refresh XXXX.pld' not 'xc6s_program_iprog'" global XC6S_JSHUTDOWN XC6S_JSTART XC6S_BYPASS XC6S_CFG_IN irscan $tap $XC6S_JSHUTDOWN runtest 16 diff --git a/tcl/cpld/xilinx-xc7.cfg b/tcl/cpld/xilinx-xc7.cfg index f5b073374..6f8f4ae5c 100644 --- a/tcl/cpld/xilinx-xc7.cfg +++ b/tcl/cpld/xilinx-xc7.cfg @@ -49,7 +49,7 @@ set XC7_JSTART 0x0c set XC7_BYPASS 0x3f proc xc7_program {tap} { - echo "DEPRECATED! use 'virtex2 program ...' not 'xc7_program'" + echo "DEPRECATED! use 'virtex2 refresh XXXX.pld' not 'xc7_program'" global XC7_JSHUTDOWN XC7_JPROGRAM XC7_JSTART XC7_BYPASS irscan $tap $XC7_JSHUTDOWN irscan $tap $XC7_JPROGRAM diff --git a/tcl/cpld/xilinx-xcu.cfg b/tcl/cpld/xilinx-xcu.cfg index 4d7f26c88..63a67da20 100644 --- a/tcl/cpld/xilinx-xcu.cfg +++ b/tcl/cpld/xilinx-xcu.cfg @@ -109,7 +109,7 @@ set XCU_JSTART 0x0c set XCU_BYPASS 0x3f proc xcu_program {tap} { - echo "DEPRECATED! use 'virtex2 program ...' not 'xcu_program'" + echo "DEPRECATED! use 'virtex2 refresh XXXX.pld' not 'xcu_program'" global XCU_JSHUTDOWN XCU_JPROGRAM XCU_JSTART XCU_BYPASS irscan $tap $XCU_JSHUTDOWN irscan $tap $XCU_JPROGRAM ----------------------------------------------------------------------- Summary of changes: tcl/cpld/xilinx-xc6s.cfg | 4 ++-- tcl/cpld/xilinx-xc7.cfg | 2 +- tcl/cpld/xilinx-xcu.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:39:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 7e271c91516ce106ceec6af952b9e02641b203cd (commit) from ca72d23c3b9df2ffa9e18cb5e3b4ccc2194ff329 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7e271c91516ce106ceec6af952b9e02641b203cd Author: OndÅej HoÅ¡ek <ond...@gm...> Date: Sun Aug 25 23:50:07 2024 +0200 flash/stm32l4x: option_write usage: mask is optional 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 <ond...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8466 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index bb6e9ef04..9235dd787 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -2622,7 +2622,7 @@ static const struct command_registration stm32l4_exec_command_handlers[] = { .name = "option_write", .handler = stm32l4_handle_option_write_command, .mode = COMMAND_EXEC, - .usage = "bank_id reg_offset value mask", + .usage = "bank_id reg_offset value [mask]", .help = "Write device option bit fields with provided value.", }, { ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32l4x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:39:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ca72d23c3b9df2ffa9e18cb5e3b4ccc2194ff329 (commit) from e01e180f6248590348bad5c354c6b4e0cf1a956a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ca72d23c3b9df2ffa9e18cb5e3b4ccc2194ff329 Author: OndÅej HoÅ¡ek <ond...@gm...> Date: Sun Aug 25 13:54:15 2024 +0200 doc: fix stm32l4x option_write usage 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 <ond...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8464 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index dee431301..2e48d8e20 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -8075,7 +8075,7 @@ The above example will read out the FLASH_OPTR register which contains the RDP option byte, Watchdog configuration, BOR level etc. @end deffn -@deffn {Command} {stm32l4x option_write} num reg_offset reg_mask +@deffn {Command} {stm32l4x option_write} num reg_offset value [reg_mask] Write an option byte register of the stm32l4x device. The @var{num} parameter is a value shown by @command{flash banks}, @var{reg_offset} is the register offset of the Option byte to write, and @var{reg_mask} is the mask ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:38:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e01e180f6248590348bad5c354c6b4e0cf1a956a (commit) from 4680d6ebdf142f9dd1acdc439d4e146ed36a290b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e01e180f6248590348bad5c354c6b4e0cf1a956a Author: Marcus Nilsson <bra...@gm...> Date: Mon May 6 11:40:00 2024 +0200 drivers/cmsis_dap: Fix buffer overflow in cmsis_dap_hid_open() 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 <bra...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8232 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/drivers/cmsis_dap_usb_hid.c b/src/jtag/drivers/cmsis_dap_usb_hid.c index 98ccc3e38..aeec685b9 100644 --- a/src/jtag/drivers/cmsis_dap_usb_hid.c +++ b/src/jtag/drivers/cmsis_dap_usb_hid.c @@ -121,8 +121,12 @@ static int cmsis_dap_hid_open(struct cmsis_dap *dap, uint16_t vids[], uint16_t p break; if (cur_dev->serial_number) { - size_t len = (strlen(serial) + 1) * sizeof(wchar_t); - wchar_t *wserial = malloc(len); + size_t len = mbstowcs(NULL, serial, 0) + 1; + wchar_t *wserial = malloc(len * sizeof(wchar_t)); + if (!wserial) { + LOG_ERROR("unable to allocate serial number buffer"); + return ERROR_FAIL; + } mbstowcs(wserial, serial, len); if (wcscmp(wserial, cur_dev->serial_number) == 0) { ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/cmsis_dap_usb_hid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-09-07 11:37:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 4680d6ebdf142f9dd1acdc439d4e146ed36a290b (commit) from e09bb72da50c9a9878565af23ee8d5465c11526d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4680d6ebdf142f9dd1acdc439d4e146ed36a290b Author: Antonio Borneo <bor...@gm...> Date: Sun Aug 25 15:38:07 2024 +0200 binarybuffer: str_to_buf(): align prefix to TCL syntax 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8465 Tested-by: jenkins Reviewed-by: Jan Matyas <jan...@co...> diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 509f24f0b..423739a9d 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -192,50 +192,12 @@ char *buf_to_hex_str(const void *_buf, unsigned buf_len) return str; } -static bool str_has_hex_prefix(const char *s) -{ - /* Starts with "0x" or "0X" */ - return (s[0] == '0') && (s[1] == 'x' || s[1] == 'X'); -} - -static bool str_has_octal_prefix(const char *s) -{ - /* - starts with '0', - * - has at least two characters, and - * - the second character is not 'x' or 'X' */ - return (s[0] == '0') && (s[1] != '\0') && (s[1] != 'x') && (s[1] != 'X'); -} - -/** - * Try to identify the radix of the number by looking at its prefix. - * No further validation of the number is preformed. +/* + * TCL standard prefix is '0b', '0o', '0d' or '0x' respectively for binary, + * octal, decimal or hexadecimal. + * The prefix '0' is interpreted by TCL <= 8.6 as octal, but is ignored and + * interpreted as part of a decimal number by JimTCL and by TCL >= 9. */ -static unsigned int str_radix_guess(const char *str) -{ - if (str_has_hex_prefix(str)) - return 16; - - if (str_has_octal_prefix(str)) - return 8; - - /* Otherwise assume a decimal number. */ - return 10; -} - -/** Strip leading "0x" or "0X" from hex numbers or "0" from octal numbers. */ -static const char *str_strip_number_prefix(const char *str, unsigned int radix) -{ - switch (radix) { - case 16: - return str + 2; - case 8: - return str + 1; - case 10: - default: - return str; - } -} - int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) { assert(str); @@ -243,9 +205,34 @@ int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) assert(buf_bitsize > 0); uint8_t *buf = _buf; - unsigned int radix = str_radix_guess(str); - - str = str_strip_number_prefix(str, radix); + unsigned int radix = 10; /* default when no prefix */ + + if (str[0] == '0') { + switch (str[1]) { + case 'b': + case 'B': + radix = 2; + str += 2; + break; + case 'o': + case 'O': + radix = 8; + str += 2; + break; + case 'd': + case 'D': + radix = 10; + str += 2; + break; + case 'x': + case 'X': + radix = 16; + str += 2; + break; + default: + break; + } + } const size_t str_len = strlen(str); if (str_len == 0) ----------------------------------------------------------------------- Summary of changes: src/helper/binarybuffer.c | 79 ++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 46 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:44:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e09bb72da50c9a9878565af23ee8d5465c11526d (commit) from e7a060090ee82bc6904338df54740c4331926ec4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e09bb72da50c9a9878565af23ee8d5465c11526d Author: Tomas Vanek <va...@fb...> Date: Mon Feb 5 11:51:24 2024 +0100 target/cortex_m: add DSCSR_CDSKEY bit definition Needed e.g. for flash drivers handling secure mode. Signed-off-by: Tomas Vanek <va...@fb...> Change-Id: If6cb49609140d06a73bcf2e446b6a634d6326e80 Reviewed-on: https://review.openocd.org/c/openocd/+/8435 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/cortex_m.h b/src/target/cortex_m.h index 726fca290..144f24560 100644 --- a/src/target/cortex_m.h +++ b/src/target/cortex_m.h @@ -150,6 +150,7 @@ struct cortex_m_part_info { #define VC_CORERESET BIT(0) /* DCB_DSCSR bit and field definitions */ +#define DSCSR_CDSKEY BIT(17) #define DSCSR_CDS BIT(16) /* NVIC registers */ ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.h | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:43:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e7a060090ee82bc6904338df54740c4331926ec4 (commit) from 5cb184a732c998eed1d4e1a54c682d204f6f34d2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e7a060090ee82bc6904338df54740c4331926ec4 Author: Karl Palsson <kar...@ma...> Date: Tue Jan 16 13:52:56 2024 +0000 rtt: default the ID to "SEGGER RTT" 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 <kar...@ma...> Reviewed-on: https://review.openocd.org/c/openocd/+/8354 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index db787fdb2..dee431301 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -9541,11 +9541,12 @@ Channels are exposed via raw TCP/IP connections. One or more RTT servers can be assigned to each channel to make them accessible to an unlimited number of TCP/IP connections. -@deffn {Command} {rtt setup} address size ID +@deffn {Command} {rtt setup} address size [ID] Configure RTT for the currently selected target. Once RTT is started, OpenOCD searches for a control block with the identifier @var{ID} starting at the memory address @var{address} within the next @var{size} bytes. +ID defaults to the string "SEGGER RTT" @end deffn @deffn {Command} {rtt start} @@ -9588,7 +9589,7 @@ on the target device. @example resume -rtt setup 0x20000000 2048 "SEGGER RTT" +rtt setup 0x20000000 2048 rtt start rtt server start 9090 0 diff --git a/src/rtt/tcl.c b/src/rtt/tcl.c index 2b8822fce..bae71b6ce 100644 --- a/src/rtt/tcl.c +++ b/src/rtt/tcl.c @@ -19,8 +19,14 @@ COMMAND_HANDLER(handle_rtt_setup_command) { struct rtt_source source; - if (CMD_ARGC != 3) + const char *DEFAULT_ID = "SEGGER RTT"; + const char *selected_id; + if (CMD_ARGC < 2 || CMD_ARGC > 3) return ERROR_COMMAND_SYNTAX_ERROR; + if (CMD_ARGC == 2) + selected_id = DEFAULT_ID; + else + selected_id = CMD_ARGV[2]; source.find_cb = &target_rtt_find_control_block; source.read_cb = &target_rtt_read_control_block; @@ -38,7 +44,7 @@ COMMAND_HANDLER(handle_rtt_setup_command) rtt_register_source(source, get_current_target(CMD_CTX)); - if (rtt_setup(address, size, CMD_ARGV[2]) != ERROR_OK) + if (rtt_setup(address, size, selected_id) != ERROR_OK) return ERROR_FAIL; return ERROR_OK; @@ -218,7 +224,7 @@ static const struct command_registration rtt_subcommand_handlers[] = { .handler = handle_rtt_setup_command, .mode = COMMAND_ANY, .help = "setup RTT", - .usage = "<address> <size> <ID>" + .usage = "<address> <size> [ID]" }, { .name = "start", ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 5 +++-- src/rtt/tcl.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:43:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5cb184a732c998eed1d4e1a54c682d204f6f34d2 (commit) from ff22f78d4605d7037a70fa36232986c7396f2946 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5cb184a732c998eed1d4e1a54c682d204f6f34d2 Author: Richard Allen <rs...@gm...> Date: Wed May 15 12:29:05 2024 -0500 target: fix profiler output on Windows 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 <rs...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8278 Reviewed-by: Karl Palsson <ka...@tw...> Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/target.c b/src/target/target.c index b1a26f9e3..9d1d2f550 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4209,7 +4209,7 @@ static void write_gmon(uint32_t *samples, uint32_t sample_num, const char *filen uint32_t start_address, uint32_t end_address, struct target *target, uint32_t duration_ms) { uint32_t i; - FILE *f = fopen(filename, "w"); + FILE *f = fopen(filename, "wb"); if (!f) return; write_string(f, "gmon"); ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:42:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ff22f78d4605d7037a70fa36232986c7396f2946 (commit) from 0bf3373e808a097fdf50fc04f987c26b35ddf09d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ff22f78d4605d7037a70fa36232986c7396f2946 Author: Parshintsev Anatoly <ana...@sy...> Date: Thu Jul 4 20:52:13 2024 +0300 doc: document that breakpoints are disabled on step/resume 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 <ana...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8388 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index c78638276..db787fdb2 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -9273,11 +9273,19 @@ power consumption (because the CPU is needlessly clocked). @deffn {Command} {resume} [address] Resume the target at its current code position, or the optional @var{address} if it is provided. + +@b{NOTE:} targets are expected to temporary disable breakpoints +if they match the address of the current code position +or the @var{address} provided by user. @end deffn @deffn {Command} {step} [address] Single-step the target at its current code position, or the optional @var{address} if it is provided. + +@b{NOTE:} targets are expected to temporary disable breakpoints +if they match the address of the current code position +or the @var{address} provided by user. @end deffn @anchor{resetcommand} ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:41:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 0bf3373e808a097fdf50fc04f987c26b35ddf09d (commit) from 941fa8538f2ad491f365a3818caa7534aaf29ea3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0bf3373e808a097fdf50fc04f987c26b35ddf09d Author: Marc Schink <de...@za...> Date: Wed Jul 31 09:35:03 2024 +0200 target/breakpoints: Use 'unsigned int' for length Change-Id: I233efb5b18de5f043fdc976807437db0a94236d1 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/7056 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index c39a98057..2fbb69e07 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -38,7 +38,7 @@ static int bpwp_unique_id; static int breakpoint_add_internal(struct target *target, target_addr_t address, - uint32_t length, + unsigned int length, enum breakpoint_type type) { struct breakpoint *breakpoint = target->breakpoints; @@ -101,7 +101,7 @@ fail: static int context_breakpoint_add_internal(struct target *target, uint32_t asid, - uint32_t length, + unsigned int length, enum breakpoint_type type) { struct breakpoint *breakpoint = target->breakpoints; @@ -151,7 +151,7 @@ static int context_breakpoint_add_internal(struct target *target, static int hybrid_breakpoint_add_internal(struct target *target, target_addr_t address, uint32_t asid, - uint32_t length, + unsigned int length, enum breakpoint_type type) { struct breakpoint *breakpoint = target->breakpoints; @@ -207,7 +207,7 @@ static int hybrid_breakpoint_add_internal(struct target *target, int breakpoint_add(struct target *target, target_addr_t address, - uint32_t length, + unsigned int length, enum breakpoint_type type) { if (target->smp) { @@ -233,7 +233,7 @@ int breakpoint_add(struct target *target, int context_breakpoint_add(struct target *target, uint32_t asid, - uint32_t length, + unsigned int length, enum breakpoint_type type) { if (target->smp) { @@ -255,7 +255,7 @@ int context_breakpoint_add(struct target *target, int hybrid_breakpoint_add(struct target *target, target_addr_t address, uint32_t asid, - uint32_t length, + unsigned int length, enum breakpoint_type type) { if (target->smp) { @@ -500,7 +500,7 @@ struct breakpoint *breakpoint_find(struct target *target, target_addr_t address) } static int watchpoint_add_internal(struct target *target, target_addr_t address, - uint32_t length, enum watchpoint_rw rw, uint64_t value, uint64_t mask) + unsigned int length, enum watchpoint_rw rw, uint32_t value, uint32_t mask) { struct watchpoint *watchpoint = target->watchpoints; struct watchpoint **watchpoint_p = &target->watchpoints; @@ -556,7 +556,7 @@ bye: } LOG_TARGET_DEBUG(target, "added %s watchpoint at " TARGET_ADDR_FMT - " of length 0x%8.8" PRIx32 " (WPID: %d)", + " of length 0x%8.8x (WPID: %d)", watchpoint_rw_strings[(*watchpoint_p)->rw], (*watchpoint_p)->address, (*watchpoint_p)->length, @@ -566,7 +566,7 @@ bye: } int watchpoint_add(struct target *target, target_addr_t address, - uint32_t length, enum watchpoint_rw rw, uint64_t value, uint64_t mask) + unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask) { if (target->smp) { struct target_list *head; diff --git a/src/target/breakpoints.h b/src/target/breakpoints.h index 64c0ce2a5..0789267c7 100644 --- a/src/target/breakpoints.h +++ b/src/target/breakpoints.h @@ -26,7 +26,7 @@ enum watchpoint_rw { struct breakpoint { target_addr_t address; uint32_t asid; - int length; + unsigned int length; enum breakpoint_type type; bool is_set; unsigned int number; @@ -40,7 +40,7 @@ struct breakpoint { struct watchpoint { target_addr_t address; - uint32_t length; + unsigned int length; uint64_t mask; uint64_t value; enum watchpoint_rw rw; @@ -52,11 +52,12 @@ struct watchpoint { int breakpoint_clear_target(struct target *target); int breakpoint_add(struct target *target, - target_addr_t address, uint32_t length, enum breakpoint_type type); + target_addr_t address, unsigned int length, enum breakpoint_type type); int context_breakpoint_add(struct target *target, - uint32_t asid, uint32_t length, enum breakpoint_type type); + uint32_t asid, unsigned int length, enum breakpoint_type type); int hybrid_breakpoint_add(struct target *target, - target_addr_t address, uint32_t asid, uint32_t length, enum breakpoint_type type); + target_addr_t address, uint32_t asid, unsigned int length, + enum breakpoint_type type); int breakpoint_remove(struct target *target, target_addr_t address); int breakpoint_remove_all(struct target *target); @@ -70,7 +71,7 @@ static inline void breakpoint_hw_set(struct breakpoint *breakpoint, unsigned int int watchpoint_clear_target(struct target *target); int watchpoint_add(struct target *target, - target_addr_t address, uint32_t length, + target_addr_t address, unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask); int watchpoint_remove(struct target *target, target_addr_t address); int watchpoint_remove_all(struct target *target); diff --git a/src/target/target.c b/src/target/target.c index 09396d878..b1a26f9e3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3950,7 +3950,7 @@ static int handle_bp_command_list(struct command_invocation *cmd) } static int handle_bp_command_set(struct command_invocation *cmd, - target_addr_t addr, uint32_t asid, uint32_t length, int hw) + target_addr_t addr, uint32_t asid, unsigned int length, int hw) { struct target *target = get_current_target(cmd->ctx); int retval; @@ -4067,7 +4067,7 @@ COMMAND_HANDLER(handle_wp_command) while (watchpoint) { char wp_type = (watchpoint->rw == WPT_READ ? 'r' : (watchpoint->rw == WPT_WRITE ? 'w' : 'a')); command_print(CMD, "address: " TARGET_ADDR_FMT - ", len: 0x%8.8" PRIx32 + ", len: 0x%8.8x" ", r/w/a: %c, value: 0x%8.8" PRIx64 ", mask: 0x%8.8" PRIx64, watchpoint->address, ----------------------------------------------------------------------- Summary of changes: src/target/breakpoints.c | 18 +++++++++--------- src/target/breakpoints.h | 13 +++++++------ src/target/target.c | 4 ++-- 3 files changed, 18 insertions(+), 17 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:41:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 941fa8538f2ad491f365a3818caa7534aaf29ea3 (commit) from fc1e73b9cf4264350f445479a5a08833582e0cc3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 941fa8538f2ad491f365a3818caa7534aaf29ea3 Author: Peter Collingbourne <pc...@go...> Date: Wed Jul 31 19:05:06 2024 -0700 arm_cti: Add CTIDEVCTL to register list 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 <pc...@go...> Reviewed-on: https://review.openocd.org/c/openocd/+/8422 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c index 422513e3e..97d1fb34b 100644 --- a/src/target/arm_cti.c +++ b/src/target/arm_cti.c @@ -189,6 +189,7 @@ static const struct { { CTI_APPCLEAR, "APPCLR" }, { CTI_APPPULSE, "APPPULSE" }, { CTI_INACK, "INACK" }, + { CTI_DEVCTL, "DEVCTL" }, }; static int cti_find_reg_offset(const char *name) diff --git a/src/target/arm_cti.h b/src/target/arm_cti.h index cfcde6560..1513f0254 100644 --- a/src/target/arm_cti.h +++ b/src/target/arm_cti.h @@ -39,6 +39,7 @@ #define CTI_CHIN_STATUS 0x138 #define CTI_CHOU_STATUS 0x13C #define CTI_GATE 0x140 +#define CTI_DEVCTL 0x150 #define CTI_UNLOCK 0xFB0 #define CTI_CHNL(x) (1 << x) ----------------------------------------------------------------------- Summary of changes: src/target/arm_cti.c | 1 + src/target/arm_cti.h | 1 + 2 files changed, 2 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:40:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via fc1e73b9cf4264350f445479a5a08833582e0cc3 (commit) from 7eb9a48f2d53a773d822b7a2b93f53c09acb48d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fc1e73b9cf4264350f445479a5a08833582e0cc3 Author: Peter Collingbourne <pc...@go...> Date: Wed Jul 31 19:02:42 2024 -0700 arm_cti: Clean up the list of CTI registers 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 <pc...@go...> Reviewed-on: https://review.openocd.org/c/openocd/+/8421 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c index 0ea853e49..422513e3e 100644 --- a/src/target/arm_cti.c +++ b/src/target/arm_cti.c @@ -157,41 +157,38 @@ int arm_cti_clear_channel(struct arm_cti *self, uint32_t channel) return arm_cti_write_reg(self, CTI_APPCLEAR, CTI_CHNL(channel)); } -static uint32_t cti_regs[28]; - static const struct { uint32_t offset; const char *label; - uint32_t *p_val; } cti_names[] = { - { CTI_CTR, "CTR", &cti_regs[0] }, - { CTI_GATE, "GATE", &cti_regs[1] }, - { CTI_INEN0, "INEN0", &cti_regs[2] }, - { CTI_INEN1, "INEN1", &cti_regs[3] }, - { CTI_INEN2, "INEN2", &cti_regs[4] }, - { CTI_INEN3, "INEN3", &cti_regs[5] }, - { CTI_INEN4, "INEN4", &cti_regs[6] }, - { CTI_INEN5, "INEN5", &cti_regs[7] }, - { CTI_INEN6, "INEN6", &cti_regs[8] }, - { CTI_INEN7, "INEN7", &cti_regs[9] }, - { CTI_INEN8, "INEN8", &cti_regs[10] }, - { CTI_OUTEN0, "OUTEN0", &cti_regs[11] }, - { CTI_OUTEN1, "OUTEN1", &cti_regs[12] }, - { CTI_OUTEN2, "OUTEN2", &cti_regs[13] }, - { CTI_OUTEN3, "OUTEN3", &cti_regs[14] }, - { CTI_OUTEN4, "OUTEN4", &cti_regs[15] }, - { CTI_OUTEN5, "OUTEN5", &cti_regs[16] }, - { CTI_OUTEN6, "OUTEN6", &cti_regs[17] }, - { CTI_OUTEN7, "OUTEN7", &cti_regs[18] }, - { CTI_OUTEN8, "OUTEN8", &cti_regs[19] }, - { CTI_TRIN_STATUS, "TRIN", &cti_regs[20] }, - { CTI_TROUT_STATUS, "TROUT", &cti_regs[21] }, - { CTI_CHIN_STATUS, "CHIN", &cti_regs[22] }, - { CTI_CHOU_STATUS, "CHOUT", &cti_regs[23] }, - { CTI_APPSET, "APPSET", &cti_regs[24] }, - { CTI_APPCLEAR, "APPCLR", &cti_regs[25] }, - { CTI_APPPULSE, "APPPULSE", &cti_regs[26] }, - { CTI_INACK, "INACK", &cti_regs[27] }, + { CTI_CTR, "CTR" }, + { CTI_GATE, "GATE" }, + { CTI_INEN0, "INEN0" }, + { CTI_INEN1, "INEN1" }, + { CTI_INEN2, "INEN2" }, + { CTI_INEN3, "INEN3" }, + { CTI_INEN4, "INEN4" }, + { CTI_INEN5, "INEN5" }, + { CTI_INEN6, "INEN6" }, + { CTI_INEN7, "INEN7" }, + { CTI_INEN8, "INEN8" }, + { CTI_OUTEN0, "OUTEN0" }, + { CTI_OUTEN1, "OUTEN1" }, + { CTI_OUTEN2, "OUTEN2" }, + { CTI_OUTEN3, "OUTEN3" }, + { CTI_OUTEN4, "OUTEN4" }, + { CTI_OUTEN5, "OUTEN5" }, + { CTI_OUTEN6, "OUTEN6" }, + { CTI_OUTEN7, "OUTEN7" }, + { CTI_OUTEN8, "OUTEN8" }, + { CTI_TRIN_STATUS, "TRIN" }, + { CTI_TROUT_STATUS, "TROUT" }, + { CTI_CHIN_STATUS, "CHIN" }, + { CTI_CHOU_STATUS, "CHOUT" }, + { CTI_APPSET, "APPSET" }, + { CTI_APPCLEAR, "APPCLR" }, + { CTI_APPPULSE, "APPPULSE" }, + { CTI_INACK, "INACK" }, }; static int cti_find_reg_offset(const char *name) @@ -224,10 +221,11 @@ COMMAND_HANDLER(handle_cti_dump) struct arm_cti *cti = CMD_DATA; struct adiv5_ap *ap = cti->ap; int retval = ERROR_OK; + uint32_t values[ARRAY_SIZE(cti_names)]; for (size_t i = 0; (retval == ERROR_OK) && (i < ARRAY_SIZE(cti_names)); i++) retval = mem_ap_read_u32(ap, - cti->spot.base + cti_names[i].offset, cti_names[i].p_val); + cti->spot.base + cti_names[i].offset, &values[i]); if (retval == ERROR_OK) retval = dap_run(ap->dap); @@ -237,7 +235,7 @@ COMMAND_HANDLER(handle_cti_dump) for (size_t i = 0; i < ARRAY_SIZE(cti_names); i++) command_print(CMD, "%8.8s (0x%04"PRIx32") 0x%08"PRIx32, - cti_names[i].label, cti_names[i].offset, *cti_names[i].p_val); + cti_names[i].label, cti_names[i].offset, values[i]); return JIM_OK; } ----------------------------------------------------------------------- Summary of changes: src/target/arm_cti.c | 64 +++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:40:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 7eb9a48f2d53a773d822b7a2b93f53c09acb48d9 (commit) from d3f50ea9145aa6cbe9232ab29736aebbd60763cd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7eb9a48f2d53a773d822b7a2b93f53c09acb48d9 Author: Peter Collingbourne <pc...@go...> Date: Tue Jul 30 18:03:33 2024 -0700 arm_adi_v5: Also clear sticky overrun bit on init 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 <pc...@go...> Reviewed-on: https://review.openocd.org/c/openocd/+/8420 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 8a97d7a52..3a5afc605 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -795,11 +795,12 @@ int dap_dp_init(struct adiv5_dap *dap) dap->dp_ctrl_stat = CDBGPWRUPREQ | CSYSPWRUPREQ; /* - * This write operation clears the sticky error bit in jtag mode only and - * is ignored in swd mode. It also powers-up system and debug domains in - * both jtag and swd modes, if not done before. + * This write operation clears the sticky error and overrun bits in jtag + * mode only and is ignored in swd mode. It also powers-up system and + * debug domains in both jtag and swd modes, if not done before. */ - retval = dap_queue_dp_write(dap, DP_CTRL_STAT, dap->dp_ctrl_stat | SSTICKYERR); + retval = dap_queue_dp_write(dap, DP_CTRL_STAT, + dap->dp_ctrl_stat | SSTICKYERR | SSTICKYORUN); if (retval != ERROR_OK) return retval; ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:39:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d3f50ea9145aa6cbe9232ab29736aebbd60763cd (commit) from 16429f6252c0d4b985d882e53ff476fe42fa0125 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d3f50ea9145aa6cbe9232ab29736aebbd60763cd Author: Antonio Borneo <bor...@gm...> Date: Fri Jun 7 14:42:58 2024 +0200 target: arm_adi_v5: add more CoreSight P/N Add part numbers for: - Cortex-A65AE, - Cortex-M52, - Cortex-M55, - Cortex-R52+, - STAR-MC1. Change-Id: I6282768896dd727e803a071139816494470744f1 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8319 Tested-by: jenkins diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 9129acecf..8a97d7a52 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1453,11 +1453,13 @@ static const struct dap_part_nums { { ARM_ID, 0x4af, "Cortex-A15 ROM", "(ROM Table)", }, { ARM_ID, 0x4b5, "Cortex-R5 ROM", "(ROM Table)", }, { ARM_ID, 0x4b8, "Cortex-R52 ROM", "(ROM Table)", }, + { ARM_ID, 0x4bd, "Cortex-R52+ ROM", "(ROM Table)", }, { ARM_ID, 0x4c0, "Cortex-M0+ ROM", "(ROM Table)", }, { ARM_ID, 0x4c3, "Cortex-M3 ROM", "(ROM Table)", }, { ARM_ID, 0x4c4, "Cortex-M4 ROM", "(ROM Table)", }, { ARM_ID, 0x4c7, "Cortex-M7 PPB ROM", "(Private Peripheral Bus ROM Table)", }, { ARM_ID, 0x4c8, "Cortex-M7 ROM", "(ROM Table)", }, + { ARM_ID, 0x4c9, "STAR ROM", "(ROM Table)", }, { ARM_ID, 0x4e0, "Cortex-A35 ROM", "(v7 Memory Map ROM Table)", }, { ARM_ID, 0x4e4, "Cortex-A76 ROM", "(ROM Table)", }, { ARM_ID, 0x906, "CoreSight CTI", "(Cross Trigger)", }, @@ -1499,6 +1501,7 @@ static const struct dap_part_nums { { ARM_ID, 0x9ae, "Cortex-A17 PMU", "(Performance Monitor Unit)", }, { ARM_ID, 0x9af, "Cortex-A15 PMU", "(Performance Monitor Unit)", }, { ARM_ID, 0x9b6, "Cortex-R52 PMU/CTI/ETM", "(Performance Monitor Unit/Cross Trigger/ETM)", }, + { ARM_ID, 0x9bb, "Cortex-R52+ PMU/CTI/ETM", "(Performance Monitor Unit/Cross Trigger/ETM)", }, { ARM_ID, 0x9b7, "Cortex-R7 PMU", "(Performance Monitor Unit)", }, { ARM_ID, 0x9d3, "Cortex-A53 PMU", "(Performance Monitor Unit)", }, { ARM_ID, 0x9d7, "Cortex-A57 PMU", "(Performance Monitor Unit)", }, @@ -1533,6 +1536,10 @@ static const struct dap_part_nums { { ARM_ID, 0xd0b, "Cortex-A76 Debug", "(Debug Unit)", }, { ARM_ID, 0xd0c, "Neoverse N1", "(Debug Unit)", }, { ARM_ID, 0xd13, "Cortex-R52 Debug", "(Debug Unit)", }, + { ARM_ID, 0xd16, "Cortex-R52+ Debug", "(Debug Unit)", }, + { ARM_ID, 0xd21, "STAR Debug", "(Debug Unit)", }, + { ARM_ID, 0xd22, "Cortex-M55 Debug", "(Debug Unit)", }, + { ARM_ID, 0xd43, "Cortex-A65AE Debug", "(Debug Unit)", }, { ARM_ID, 0xd49, "Neoverse N2", "(Debug Unit)", }, { 0x017, 0x120, "TI SDTI", "(System Debug Trace Interface)", }, /* from OMAP3 memmap */ { 0x017, 0x343, "TI DAPCTL", "", }, /* from OMAP3 memmap */ @@ -1552,6 +1559,9 @@ static const struct dap_part_nums { { 0x1eb, 0x211, "Tegra 210 ROM", "(ROM Table)", }, { 0x1eb, 0x302, "Denver Debug", "(Debug Unit)", }, { 0x1eb, 0x402, "Denver PMU", "(Performance Monitor Unit)", }, + { 0x575, 0x132, "STAR SCS", "(System Control Space)", }, + { 0x575, 0x4d2, "Cortex-M52 ROM", "(ROM Table)", }, + { 0x575, 0xd24, "Cortex-M52 Debug", "(Debug Unit)", }, }; static const struct dap_part_nums *pidr_to_part_num(unsigned int designer_id, unsigned int part_num) ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 10 ++++++++++ 1 file changed, 10 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:37:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 16429f6252c0d4b985d882e53ff476fe42fa0125 (commit) from ceae51ad74ba3a16be3e7ee2df4743a6df3cd097 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 16429f6252c0d4b985d882e53ff476fe42fa0125 Author: Marc Schink <de...@za...> Date: Thu Aug 1 09:22:02 2024 +0200 target/arm_cti: Use suitable data types While at it, fix some small coding style issues. Change-Id: Ifb8e78b55d29a06d69a3ce71d12d0040777aef13 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8423 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c index 7637ad015..0ea853e49 100644 --- a/src/target/arm_cti.c +++ b/src/target/arm_cti.c @@ -196,9 +196,7 @@ static const struct { static int cti_find_reg_offset(const char *name) { - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(cti_names); i++) { + for (size_t i = 0; i < ARRAY_SIZE(cti_names); i++) { if (!strcmp(name, cti_names[i].label)) return cti_names[i].offset; } @@ -227,7 +225,7 @@ COMMAND_HANDLER(handle_cti_dump) struct adiv5_ap *ap = cti->ap; int retval = ERROR_OK; - for (int i = 0; (retval == ERROR_OK) && (i < (int)ARRAY_SIZE(cti_names)); i++) + for (size_t i = 0; (retval == ERROR_OK) && (i < ARRAY_SIZE(cti_names)); i++) retval = mem_ap_read_u32(ap, cti->spot.base + cti_names[i].offset, cti_names[i].p_val); @@ -237,7 +235,7 @@ COMMAND_HANDLER(handle_cti_dump) if (retval != ERROR_OK) return JIM_ERR; - for (int i = 0; i < (int)ARRAY_SIZE(cti_names); i++) + for (size_t i = 0; i < ARRAY_SIZE(cti_names); i++) command_print(CMD, "%8.8s (0x%04"PRIx32") 0x%08"PRIx32, cti_names[i].label, cti_names[i].offset, *cti_names[i].p_val); @@ -323,7 +321,6 @@ COMMAND_HANDLER(handle_cti_ack) int retval = arm_cti_ack_events(cti, 1 << event); - if (retval != ERROR_OK) return retval; @@ -437,6 +434,7 @@ static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti) return JIM_OK; } + static int cti_create(struct jim_getopt_info *goi) { struct command_context *cmd_ctx; @@ -538,7 +536,6 @@ COMMAND_HANDLER(cti_handle_names) return ERROR_OK; } - static const struct command_registration cti_subcommand_handlers[] = { { .name = "create", ----------------------------------------------------------------------- Summary of changes: src/target/arm_cti.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:37:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ceae51ad74ba3a16be3e7ee2df4743a6df3cd097 (commit) from bfd3110e59f5b13c075823c654f1a51cfcd66d4d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ceae51ad74ba3a16be3e7ee2df4743a6df3cd097 Author: Antonio Borneo <bor...@gm...> Date: Thu Aug 1 10:43:41 2024 +0200 checkpatch: only report error on hit 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8424 Reviewed-by: Karl Palsson <ka...@tw...> Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 26589beab..a2f89eac8 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -2384,6 +2384,10 @@ sub show_type { sub report { my ($level, $type, $msg) = @_; + # OpenOCD specific: Begin: Flatten ERROR, WARNING and CHECK as ERROR + $level = 'ERROR'; + # OpenOCD specific: End + if (!show_type($type) || (defined $tst_only && $msg !~ /\Q$tst_only\E/)) { return 0; @@ -7638,9 +7642,15 @@ sub process { print report_dump(); if ($summary && !($clean == 1 && $quiet == 1)) { print "$filename " if ($summary_file); + if (!$OpenOCD) { print "total: $cnt_error errors, $cnt_warn warnings, " . (($check)? "$cnt_chk checks, " : "") . "$cnt_lines lines checked\n"; + } # $OpenOCD + # OpenOCD specific: Begin: Report total as errors + my $total = $cnt_error + $cnt_warn + $cnt_chk; + print "total: $total errors, $cnt_lines lines checked\n"; + # OpenOCD specific: End } if ($quiet == 0) { ----------------------------------------------------------------------- Summary of changes: tools/scripts/checkpatch.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:37:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bfd3110e59f5b13c075823c654f1a51cfcd66d4d (commit) from bee5999a447880dda271926bbbd7d49dc5f4fbe9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bfd3110e59f5b13c075823c654f1a51cfcd66d4d Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 14 14:59:34 2024 +0200 binarybuffer: str_to_buf(): simplify it and fix scan-build error 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8396 Reviewed-by: Jan Matyas <jan...@co...> Tested-by: jenkins diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index dd1449276..509f24f0b 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -175,19 +175,6 @@ uint32_t flip_u32(uint32_t value, unsigned int num) return c; } -static int ceil_f_to_u32(float x) -{ - if (x < 0) /* return zero for negative numbers */ - return 0; - - uint32_t y = x; /* cut off fraction */ - - if ((x - y) > 0.0) /* if there was a fractional part, increase by one */ - y++; - - return y; -} - char *buf_to_hex_str(const void *_buf, unsigned buf_len) { unsigned len_bytes = DIV_ROUND_UP(buf_len, 8); @@ -252,7 +239,10 @@ static const char *str_strip_number_prefix(const char *str, unsigned int radix) int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) { assert(str); + assert(_buf); + assert(buf_bitsize > 0); + uint8_t *buf = _buf; unsigned int radix = str_radix_guess(str); str = str_strip_number_prefix(str, radix); @@ -261,86 +251,49 @@ int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) if (str_len == 0) return ERROR_INVALID_NUMBER; - float factor = 0.0; - if (radix == 16) - factor = 0.5; /* log(16) / log(256) = 0.5 */ - else if (radix == 10) - factor = 0.41524; /* log(10) / log(256) = 0.41524 */ - else if (radix == 8) - factor = 0.375; /* log(8) / log(256) = 0.375 */ - else - assert(false); - - const unsigned int b256_len = ceil_f_to_u32(str_len * factor); - - /* Allocate a buffer for digits in base-256 notation */ - uint8_t *b256_buf = calloc(b256_len, 1); - if (!b256_buf) { - LOG_ERROR("Unable to allocate memory"); - return ERROR_FAIL; - } + const size_t buf_len = DIV_ROUND_UP(buf_bitsize, 8); + memset(buf, 0, buf_len); /* Go through the zero-terminated buffer * of input digits (ASCII) */ - for (unsigned int i = 0; str[i]; i++) { - uint32_t tmp = str[i]; - if ((tmp >= '0') && (tmp <= '9')) { - tmp = (tmp - '0'); - } else if ((tmp >= 'a') && (tmp <= 'f')) { - tmp = (tmp - 'a' + 10); - } else if ((tmp >= 'A') && (tmp <= 'F')) { - tmp = (tmp - 'A' + 10); + for (; *str; str++) { + unsigned int tmp; + const char c = *str; + + if ((c >= '0') && (c <= '9')) { + tmp = c - '0'; + } else if ((c >= 'a') && (c <= 'f')) { + tmp = c - 'a' + 10; + } else if ((c >= 'A') && (c <= 'F')) { + tmp = c - 'A' + 10; } else { /* Characters other than [0-9,a-f,A-F] are invalid */ - free(b256_buf); return ERROR_INVALID_NUMBER; } - if (tmp >= radix) { - /* Encountered a digit that is invalid for the current radix */ - free(b256_buf); + /* Error on invalid digit for current radix */ + if (tmp >= radix) return ERROR_INVALID_NUMBER; - } - /* Add the current digit (tmp) to the intermediate result - * in b256_buf (base-256 digits) */ - for (unsigned int j = 0; j < b256_len; j++) { - tmp += (uint32_t)b256_buf[j] * radix; - b256_buf[j] = (uint8_t)(tmp & 0xFFu); + /* Add the current digit (tmp) to the intermediate result in buf */ + for (unsigned int j = 0; j < buf_len; j++) { + tmp += buf[j] * radix; + buf[j] = tmp & 0xFFu; tmp >>= 8; } - /* The b256_t buffer is large enough to contain the whole result. */ - assert(tmp == 0); - } - - /* The result must not contain more bits than buf_bitsize. */ - /* Check the whole bytes: */ - for (unsigned int j = DIV_ROUND_UP(buf_bitsize, 8); j < b256_len; j++) { - if (b256_buf[j] != 0x0) { - free(b256_buf); + /* buf should be large enough to contain the whole result. */ + if (tmp != 0) return ERROR_NUMBER_EXCEEDS_BUFFER; - } } - /* Check the partial byte: */ + + /* Check the partial most significant byte */ if (buf_bitsize % 8) { const uint8_t mask = 0xFFu << (buf_bitsize % 8); - if ((b256_buf[(buf_bitsize / 8)] & mask) != 0x0) { - free(b256_buf); + if ((buf[buf_len - 1] & mask) != 0x0) return ERROR_NUMBER_EXCEEDS_BUFFER; - } - } - - /* Copy the digits to the output buffer */ - uint8_t *buf = _buf; - for (unsigned int j = 0; j < DIV_ROUND_UP(buf_bitsize, 8); j++) { - if (j < b256_len) - buf[j] = b256_buf[j]; - else - buf[j] = 0; } - free(b256_buf); return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/helper/binarybuffer.c | 99 +++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 73 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:36:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bee5999a447880dda271926bbbd7d49dc5f4fbe9 (commit) from 8a3efbf21fda2ac673c401f8b9ec82d300c2af29 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bee5999a447880dda271926bbbd7d49dc5f4fbe9 Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 14 12:31:53 2024 +0200 binarybuffer: str_to_buf(): rename buf_len as buf_bitsize 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8395 Tested-by: jenkins Reviewed-by: Jan Matyas <jan...@co...> diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index da6e10bab..dd1449276 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -249,7 +249,7 @@ static const char *str_strip_number_prefix(const char *str, unsigned int radix) } } -int str_to_buf(const char *str, void *_buf, unsigned int buf_len) +int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize) { assert(str); @@ -314,18 +314,18 @@ int str_to_buf(const char *str, void *_buf, unsigned int buf_len) assert(tmp == 0); } - /* The result must not contain more bits than buf_len. */ + /* The result must not contain more bits than buf_bitsize. */ /* Check the whole bytes: */ - for (unsigned int j = DIV_ROUND_UP(buf_len, 8); j < b256_len; j++) { + for (unsigned int j = DIV_ROUND_UP(buf_bitsize, 8); j < b256_len; j++) { if (b256_buf[j] != 0x0) { free(b256_buf); return ERROR_NUMBER_EXCEEDS_BUFFER; } } /* Check the partial byte: */ - if (buf_len % 8) { - const uint8_t mask = 0xFFu << (buf_len % 8); - if ((b256_buf[(buf_len / 8)] & mask) != 0x0) { + if (buf_bitsize % 8) { + const uint8_t mask = 0xFFu << (buf_bitsize % 8); + if ((b256_buf[(buf_bitsize / 8)] & mask) != 0x0) { free(b256_buf); return ERROR_NUMBER_EXCEEDS_BUFFER; } @@ -333,7 +333,7 @@ int str_to_buf(const char *str, void *_buf, unsigned int buf_len) /* Copy the digits to the output buffer */ uint8_t *buf = _buf; - for (unsigned j = 0; j < DIV_ROUND_UP(buf_len, 8); j++) { + for (unsigned int j = 0; j < DIV_ROUND_UP(buf_bitsize, 8); j++) { if (j < b256_len) buf[j] = b256_buf[j]; else diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index 6cff86bd9..103a48c5c 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -198,10 +198,10 @@ void *buf_set_buf(const void *src, unsigned src_start, * number is detected between decimal, hexadecimal and octal. * @param str Input number, zero-terminated string * @param _buf Output buffer, allocated by the caller - * @param buf_len Output buffer size in bits + * @param buf_bitsize Output buffer size in bits * @returns Error on invalid or overflowing number */ -int str_to_buf(const char *str, void *_buf, unsigned int buf_len); +int str_to_buf(const char *str, void *_buf, unsigned int buf_bitsize); char *buf_to_hex_str(const void *buf, unsigned size); ----------------------------------------------------------------------- Summary of changes: src/helper/binarybuffer.c | 14 +++++++------- src/helper/binarybuffer.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:36:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8a3efbf21fda2ac673c401f8b9ec82d300c2af29 (commit) via ea859e1cd042578ea17994b56ac15be216eefe4a (commit) from a414ffaf65171bf2d1ed289397befca3cbf8b967 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8a3efbf21fda2ac673c401f8b9ec82d300c2af29 Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 14 12:09:15 2024 +0200 binarybuffer: simplify the prototype of str_to_buf() 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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8394 Tested-by: jenkins Reviewed-by: Jan Matyas <jan...@co...> diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 3e09143c6..da6e10bab 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -225,49 +225,37 @@ static bool str_has_octal_prefix(const char *s) */ static unsigned int str_radix_guess(const char *str) { - assert(str); - if (str_has_hex_prefix(str)) return 16; if (str_has_octal_prefix(str)) return 8; - /* Otherwise assume a decadic number. */ + /* Otherwise assume a decimal number. */ return 10; } /** Strip leading "0x" or "0X" from hex numbers or "0" from octal numbers. */ -static void str_strip_number_prefix_if_present(const char **_str, unsigned int radix) +static const char *str_strip_number_prefix(const char *str, unsigned int radix) { - assert(radix == 16 || radix == 10 || radix == 8); - assert(_str); - - const char *str = *_str; - assert(str); - - if (radix == 16 && str_has_hex_prefix(str)) - str += 2; - else if (radix == 8 && str_has_octal_prefix(str)) - str += 1; - - /* No prefix to strip for radix == 10. */ - - *_str = str; + switch (radix) { + case 16: + return str + 2; + case 8: + return str + 1; + case 10: + default: + return str; + } } -int str_to_buf(const char *str, void *_buf, unsigned int buf_len, - unsigned int radix, unsigned int *_detected_radix) +int str_to_buf(const char *str, void *_buf, unsigned int buf_len) { - assert(radix == 0 || radix == 8 || radix == 10 || radix == 16); - - if (radix == 0) - radix = str_radix_guess(str); + assert(str); - if (_detected_radix) - *_detected_radix = radix; + unsigned int radix = str_radix_guess(str); - str_strip_number_prefix_if_present(&str, radix); + str = str_strip_number_prefix(str, radix); const size_t str_len = strlen(str); if (str_len == 0) diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index 441374330..6cff86bd9 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -194,15 +194,14 @@ void *buf_set_buf(const void *src, unsigned src_start, /** * Parse an unsigned number (provided as a zero-terminated string) - * into a bit buffer whose size is buf_len bits. + * into a bit buffer whose size is buf_len bits. The base of the + * number is detected between decimal, hexadecimal and octal. * @param str Input number, zero-terminated string * @param _buf Output buffer, allocated by the caller * @param buf_len Output buffer size in bits - * @param radix Base of the input number - 16, 10, 8 or 0. - * 0 means auto-detect the radix. + * @returns Error on invalid or overflowing number */ -int str_to_buf(const char *str, void *_buf, unsigned int buf_len, - unsigned int radix, unsigned int *_detected_radix); +int str_to_buf(const char *str, void *_buf, unsigned int buf_len); char *buf_to_hex_str(const void *buf, unsigned size); diff --git a/src/helper/command.c b/src/helper/command.c index b5dd927f2..907869325 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1365,7 +1365,7 @@ COMMAND_HELPER(command_parse_str_to_buf, const char *str, void *buf, unsigned in assert(str); assert(buf); - int ret = str_to_buf(str, buf, buf_len, 0, NULL); + int ret = str_to_buf(str, buf, buf_len); if (ret == ERROR_OK) return ret; commit ea859e1cd042578ea17994b56ac15be216eefe4a Author: Antonio Borneo <bor...@gm...> Date: Sun Jul 14 11:28:49 2024 +0200 helper: command: drop radix parameter from command_parse_str_to_buf() Commit 53b94fad58ab ("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 <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8393 Tested-by: jenkins Reviewed-by: Jan Matyas <jan...@co...> diff --git a/src/helper/command.c b/src/helper/command.c index 15a9b4a08..b5dd927f2 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1360,37 +1360,18 @@ int command_parse_bool_arg(const char *in, bool *out) return ERROR_COMMAND_SYNTAX_ERROR; } -static const char *radix_to_str(unsigned int radix) -{ - switch (radix) { - case 16: return "hexadecimal"; - case 10: return "decadic"; - case 8: return "octal"; - } - assert(false); - return ""; -} - -COMMAND_HELPER(command_parse_str_to_buf, const char *str, void *buf, unsigned int buf_len, - unsigned int radix) +COMMAND_HELPER(command_parse_str_to_buf, const char *str, void *buf, unsigned int buf_len) { assert(str); assert(buf); - int ret = str_to_buf(str, buf, buf_len, radix, NULL); + int ret = str_to_buf(str, buf, buf_len, 0, NULL); if (ret == ERROR_OK) return ret; /* Provide a clear error message to the user */ if (ret == ERROR_INVALID_NUMBER) { - if (radix == 0) { - /* Any radix is accepted, so don't include it in the error message. */ - command_print(CMD, "'%s' is not a valid number", str); - } else { - /* Specific radix is required - tell the user what it is. */ - command_print(CMD, "'%s' is not a valid number (requiring %s number)", - str, radix_to_str(radix)); - } + command_print(CMD, "'%s' is not a valid number", str); } else if (ret == ERROR_NUMBER_EXCEEDS_BUFFER) { command_print(CMD, "Number %s exceeds %u bits", str, buf_len); } else { diff --git a/src/helper/command.h b/src/helper/command.h index 7a044e619..b224bd022 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -519,14 +519,12 @@ COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label); /** * Parse a number (base 10, base 16 or base 8) and store the result - * into a bit buffer. + * into a bit buffer. Use the prefixes '0' and '0x' for base 8 and 16, + * otherwise defaults to base 10. * * In case of parsing error, a user-readable error message is produced. - * - * If radix = 0 is given, the function guesses the radix by looking at the number prefix. */ -COMMAND_HELPER(command_parse_str_to_buf, const char *str, void *buf, unsigned int buf_len, - unsigned int radix); +COMMAND_HELPER(command_parse_str_to_buf, const char *str, void *buf, unsigned int buf_len); /** parses an on/off command argument */ #define COMMAND_PARSE_ON_OFF(in, out) \ diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 10a7dd3f8..624b4e4c2 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -89,7 +89,7 @@ static COMMAND_HELPER(handle_jtag_command_drscan_fields, struct scan_field *fiel } fields[field_count].out_value = t; - int ret = CALL_COMMAND_HANDLER(command_parse_str_to_buf, CMD_ARGV[i + 1], t, bits, 0); + int ret = CALL_COMMAND_HANDLER(command_parse_str_to_buf, CMD_ARGV[i + 1], t, bits); if (ret != ERROR_OK) return ret; fields[field_count].in_value = t; diff --git a/src/target/target.c b/src/target/target.c index b6159c72b..09396d878 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3133,7 +3133,7 @@ COMMAND_HANDLER(handle_reg_command) return ERROR_FAIL; } - int retval = CALL_COMMAND_HANDLER(command_parse_str_to_buf, CMD_ARGV[1], buf, reg->size, 0); + int retval = CALL_COMMAND_HANDLER(command_parse_str_to_buf, CMD_ARGV[1], buf, reg->size); if (retval != ERROR_OK) { free(buf); return retval; @@ -4835,8 +4835,7 @@ COMMAND_HANDLER(handle_set_reg_command) return ERROR_FAIL; } - int retval = CALL_COMMAND_HANDLER(command_parse_str_to_buf, - reg_value, buf, reg->size, 0); + int retval = CALL_COMMAND_HANDLER(command_parse_str_to_buf, reg_value, buf, reg->size); if (retval != ERROR_OK) { free(buf); return retval; ----------------------------------------------------------------------- Summary of changes: src/helper/binarybuffer.c | 42 +++++++++++++++--------------------------- src/helper/binarybuffer.h | 9 ++++----- src/helper/command.c | 25 +++---------------------- src/helper/command.h | 8 +++----- src/jtag/tcl.c | 2 +- src/target/target.c | 5 ++--- 6 files changed, 28 insertions(+), 63 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2024-08-25 12:36:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a414ffaf65171bf2d1ed289397befca3cbf8b967 (commit) from ac63cd00d792331914db0b6edd3f427c30eec3fa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a414ffaf65171bf2d1ed289397befca3cbf8b967 Author: Antonio Borneo <bor...@gm...> Date: Mon Aug 12 13:39:36 2024 +0200 doc: document command 'ms' Add documentation for the commands 'ms'. Change-Id: I247adce1c586c4f4cd36d044d48298c370635e67 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8432 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 794762fa2..c78638276 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -9621,6 +9621,12 @@ Add or replace help text on the given @var{command_name}. Add or replace usage text on the given @var{command_name}. @end deffn +@deffn {Command} {ms} +Returns current time since the Epoch in ms +(See: @url{https://en.wikipedia.org/wiki/Epoch_(computing)}). +Useful to compute delays in TCL. +@end deffn + @node Architecture and Core Commands @chapter Architecture and Core Commands @cindex Architecture Specific Commands ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 6 ++++++ 1 file changed, 6 insertions(+) hooks/post-receive -- Main OpenOCD repository |