Erhan Kurubas [Thu, 25 Aug 2022 14:06:40 +0000 (17:06 +0300)]
server: add function to get openocd shutdown status
In the app-trace module we are polling the target in the while loops
outside of the server.c
In that loops, we need to catch ctrl+c signal by checking shutdown_openocd
status
Tim Newsome [Fri, 8 Jul 2022 20:02:13 +0000 (13:02 -0700)]
target/riscv: Update with latest encoding from riscv-opcodes
This gets us a clearly labeled BSD-3-Clause header, which should be
compatible with OpenOCD and Fedora, and also make it clear what the
license actually is.
See https://github.com/riscv/riscv-openocd/pull/710,
https://github.com/riscv/riscv-openocd/pull/713, and
https://github.com/riscv/riscv-openocd/pull/717.
Change-Id: I992b4f3bb230edb9f281e2278dd41c712098ed4c Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7084 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Thu, 5 May 2022 15:23:49 +0000 (17:23 +0200)]
doc: how to use QEMU to test big-endian build
Document the process of using buildroot to build a big-endian
binary of OpenOCD and using QEMU User Mode Emulation for running
the big-endian binary on a little-endian host PC.
Change-Id: Ic5fe26e353a4cf69e57af3c23ae7fa4b25347b2b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6968 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tomas Vanek [Mon, 15 Aug 2022 17:18:18 +0000 (19:18 +0200)]
server/server: fix target timer timing
The change 6363: Call poll at a fixed interval
switched from target_call_timer_callbacks() to target_call_timer_callbacks_now().
It breaks the timing as all timers callbacks are called every time
one timer expires.
Revert this part of change and use target_call_timer_callbacks().
Fixes: db16b3dc5b06 (Call poll at a fixed interval.)
Change-Id: Ib5b7774de9694d40c55d2a4109d0d1582fc5008b Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7118 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Sat, 23 Apr 2022 14:14:15 +0000 (16:14 +0200)]
tcl/target: stm32[fl]4x: document the settings for trace
While reviewing on gerrit the change
https://review.openocd.org/6932/
it get clear that the missing documentation on stm32f4x's code
was triggering errors in the new change.
OpenOCD is currently unable to read traces, but these can be
hopefully be read with some other tool.
Document the settings for enabling trace on stm32[fl]4x.
Change-Id: Ibae77a53de16375d3d500e728678740095547009 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6945 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Antonio Borneo [Mon, 8 Nov 2021 19:14:46 +0000 (20:14 +0100)]
tcl/target: replace event trace-config
With commit dc7b32ea4a00 ("armv7m_trace: get rid of the old tpiu
code") the target's event "trace-config" has been deprecated.
Create the TPIU device.
Replace the target's event "trace-config" with tpiu's event
"pre-enable" in the STM32 devices that require enabling the trace
clock _before_ programming the TPIU.
Make the script multi-instance-able in case it's used for JTAG
chained devices.
Uniform the code in STM32F4x with the other scripts.
Remove the empty event from STM32WLx.
Change-Id: Ifda219c3c5f37e03072a88168611cf505eb630b7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6681 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tomas Vanek [Tue, 2 Aug 2022 07:16:21 +0000 (09:16 +0200)]
jtag/drivers/kitprog: workaround serious firmware problem
Since commit 88f429ead019fd6df96ec15f0d897385f3cef0d0
5321: target/cortex_m: faster reading of all CPU registers
debugging with a kitprog adapter freezes at debug entry.
How to replicate:
openocd -f interface/kitprog.cfg -f target/psoc4.cfg
Connect to telnet server.
Make sure the target is running:
resume
Halt the target:
halt
Without this patch OpenOCD freezes in kitprog_hid_command()
in library call hid_write().
Reduce the number of SWD transactions sent in one USB bulk write
as a workaround, simply use shorter buffer.
For details see the comment in src/jtag/drivers/kitprog.c
Change-Id: I0116894d5ebf1655f6011f0d35acdbbc178cd48c Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7107 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Paul Fertser [Sat, 7 Aug 2021 18:55:30 +0000 (21:55 +0300)]
flash: nor: use binary prefixes consistently
When printing memory sizes standard ISO 80000-1 prefixes should be used.
Also a space should be added between any number and its unit according
to papers publication rules.
Change-Id: Id1d35e210766b55c201de4e80ac165d8d0414d0a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/6416 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Erhan Kurubas [Sat, 20 Aug 2022 20:22:47 +0000 (23:22 +0300)]
target/xtensa: fix clang analyzer warnings and gcc12 build errors
Fix Unused code Dead assignment at line 657
Fix Memory error Double free at line 2851
Fix Memory error Memory leak at line 2530
Fix error: 'a3' may be used uninitialized at line 758
Fix error: '%04x' directive writing between 4 and 8 bytes
into a region of size 5 at line 2471
Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I0382a622bc7c4108a335fd741816577e79240397
Reviewed-on: https://review.openocd.org/c/openocd/+/7137 Tested-by: jenkins Reviewed-by: Ian Thompson <ianst@cadence.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Ian Thompson [Sat, 25 Jun 2022 05:27:32 +0000 (22:27 -0700)]
target: add generic Xtensa LX support
Generic Xtensa LX support extends the original Espressif/Xtensa
patch-set to support arbitrary Xtensa configurations, as defined in
a core-specific .cfg file. Not yet fully-featured. Additional
functionality to be added:
- Xtensa NX support
- DAP/SWD support
- File-IO support
- Generic Xtensa multi-core support
Valgrind-clean, no new Clang analyzer warnings
Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I08e7bf8fa57c25b5d0cb75a1aa7a2ac13a380c52
Reviewed-on: https://review.openocd.org/c/openocd/+/7055 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Steve Marple [Tue, 17 May 2022 20:51:17 +0000 (21:51 +0100)]
drivers/am335xgpio: Migrate to adapter gpio commands
Use the new "adapter gpio" commands to configure the GPIOs used by the
am335xgpio driver. The AM335x has 4 GPIO 'chips' (chip number 0-3
inclusive), with each one providing 32 GPIOs (gpio_num 0-31 inclusive).
Change-Id: I7c63c0e4763657ea51790c43fc40d32b7c3580bb Signed-off-by: Steve Marple <stevemarple@googlemail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6984 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Steve Marple [Wed, 4 May 2022 21:51:48 +0000 (22:51 +0100)]
jtag/adapter: Add command 'adapter gpio'
Most adapters define their own commands to obtain the GPIO number and
other GPIO configuration information such as chip number, output drive
type, active high/low.
Define a general command 'adapter gpio' as replacement for the
driver-specific ones.
Change-Id: I1ca9ca94f0c7df5713172e9f62ffb0ad64e9ee97 Signed-off-by: Steve Marple <stevemarple@googlemail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6967 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The S_RESET_ST sticky bit is reset after DHCSR read.
It is set at power-on reset and keeps active until the debuger reads DHCSR.
Ignore S_RESET_ST at the very first read after OpenOCD start
and suppress possibly misleading message "external reset detected"
if we cannot guarantee the reset happened recently.
While on it add a TODO comment.
Change-Id: I15217c2ca6f69ac97aff8be86bce67cba94a42cd Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7109 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Mon, 30 May 2022 13:32:24 +0000 (15:32 +0200)]
openocd: prevent target polling during 'init'
The command 'init' causes the execution of few lower level
commands, e.g. 'target init', and switches from command mode
COMMAND_CONFIG to COMMAND_EXEC, with an intermediate switch back
to mode COMMAND_CONFIG.
A timed target polling can occur during the execution of 'init'
and the target's status can trigger the execution of some events.
E.g. if a target has been left halted by a previous execution of
OpenOCD, the first poll will find the target halted, calling the
corresponding 'halted' event.
The event handler can use commands that can only be executed in
mode COMMAND_EXEC. If the poll happens while OpenOCD is in mode
COMMAND_CONFIG, the triggered handler will fail.
Prevent the target polling to operate during the execution of the
'init' command.
Change-Id: Ia435a5d2039be9b247e2336616dab53ed5d983ac Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7007 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Antonio Borneo [Mon, 30 May 2022 20:49:12 +0000 (22:49 +0200)]
target: add API to temporarily mask target polling
The same flag 'jtag_poll' is currently used as local data for the
command 'poll' and to temporarily mask the target polling.
This can cause unexpected behavior if the command 'poll' is
executed while polling is temporarily masked.
Add a new flag 'jtag_poll_en' to hold the temporarily mask
condition and keep 'jtag_poll' for the 'poll' command only.
While there, change the initial assignment of 'jtag_poll' using
the proper boolean value.
Change-Id: I18dcf7c65b07aefadf046caaa2fcd2d74fa6fbae Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7009 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Ian Thompson [Mon, 1 Aug 2022 22:22:32 +0000 (15:22 -0700)]
gdb_server: add "not supported" Z-packet reply
GDB remote serial protocol specifies breakpoint/watchpoint packet
responses can be an empty string to indicate the specified breakpoint
type is not supported. Add support for this response alongside existing
"OK", "E NN" replies.
Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: Iaf6280e4c936eb95a92bc80cc74d451ebb328dc3
Reviewed-on: https://review.openocd.org/c/openocd/+/7102 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
After a certain RTOS has been configured there is no mechanism
to go back to no RTOS support. It may be useful for debugging
purposes. With the provided modification, the "none" option
of RTOS is provided as a valid option.
It has been tested in two different board (Cortex M4 and Cortex M33).
Documentation has also been updated.
Signed-off-by: Asier Llano <allano@hubbell.com>
Change-Id: I602210bff31ccadd41c41e9454c52b5fffa1671e
Reviewed-on: https://review.openocd.org/c/openocd/+/7092 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tomas Vanek [Mon, 1 Aug 2022 17:28:18 +0000 (19:28 +0200)]
target/arm: do not expose 'arm reg', 'arm mcr/mrc' commands on Cortex-M
Tcl commands 'arm reg', 'arm mcr/mrc' do not work on M-profile based devices.
Isolate them from 'arm core_state' and 'arm disassemble' and do not chain
them from armv7m_command_handlers.
Change-Id: I2c6befdf82575e95cf05ed158ab5e6faa1a182c3 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7101 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Tomas Vanek [Mon, 1 Aug 2022 17:06:35 +0000 (19:06 +0200)]
target/arm: make 'arm core_state' command compatible with Cortex-M
Tcl command 'arm core_state' was exposed even on Cortex-M devices.
However it returned message "Unsupported Command" without error status
on such device.
Set the only possible arm->core_state ARM_STATE_THUMB in armv7m init.
Block setting core_state to arm on Cortex-M.
Change-Id: I9525553ac8863a6cf77bbacbcd57e354b6cfe1ca Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7100 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Tomas Vanek [Tue, 2 Aug 2022 09:33:07 +0000 (11:33 +0200)]
target/cortex_m: prevent segmentation fault in cortex_m_poll()
If a Cortex-M MCU become unresponsive during a debug session and
re-examination fails to find MEM-AP, debug_ap pointer is set to NULL.
Eventual call of cortex_m_poll() dereferences debug_ap.
Check debug_ap validity at the begin of cortex_m_poll().
Change-Id: I9519f48760c91a48a9e5e8c34634d247098cb14a Fixes: 35a503b08d14 (arm_adi_v5: add ap refcount and add get/put around ap use) Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7108 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tomas Vanek [Sat, 30 Jul 2022 10:15:43 +0000 (12:15 +0200)]
target: fix unaligned return of target_get_working_area_avail()
The working area allocation routines use 4 byte word alignment.
In the corner case the size of the working area is not aligned,
target_alloc_working_area() of size = target_get_working_area_avail()
will fail because the size gets aligned up and does not fit to the area
which size is aligned down.
Align down the result of target_get_working_area_avail() to cope with that
corner case.
While on it use fancy ALIGN_... macros instead of bitwise and operator.
Change-Id: Ia2a1e861c401c2c78fe6323379a3776fb4f47b06 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7096 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Kinetis 100 MHz rev 1.x devices have no SMC and hence need different
checking of the run mode. Details about the differences between rev 1.x
and 2.x of the Kinetis 100 MHz series can be found here:
https://www.nxp.com.cn/docs/en/application-note/AN4445.pdf
Signed-off-by: Martin Hierholzer <martin.hierholzer@desy.de>
Change-Id: Ib705385a931275159bdae9b31caecc6ec9c0da1e
Reviewed-on: https://review.openocd.org/c/openocd/+/7015 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Frank Dischner [Mon, 18 Apr 2022 02:24:28 +0000 (21:24 -0500)]
FreeRTOS: Always show current execution before scheduler is started
Previously, if the target was halted before the FreeRTOS scheduler was
started but after at least one thread was created, then the current thread
would be set to whichever thread had the highest priority. In addition to
being misleading, because that thread is not actually running, it can
cause issues with gdb. For instance, breaking somewhere before the first
thread is created will show the current execution as the current thread,
but stepping over a line that creates a thread will cause the current
thread to switch to the newly created thread and the current execution to
disappear. The sudden disappearance of the current execution thread seems
to confuse some versions of gdb.
With this change, the value of xSchedulerRunning is checked to determine
whether the scheduler has been started. If it hasn't, then a fake
'current execution' thread is always created and made the current thread.
Signed-off-by: Frank Dischner <frank.dischner@gmail.com>
Change-Id: Ide0fe7d9ffb9fac95cee4c805735f434c7c4934d
Reviewed-on: https://review.openocd.org/c/openocd/+/6935 Tested-by: jenkins Reviewed-by: Asier Llano <asierllano@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Frank Dischner [Mon, 18 Apr 2022 02:12:39 +0000 (21:12 -0500)]
FreeRTOS: Fix current thread ID when no threads are active
When there are no rtos threads or none are active, a fake thread with
ID 1 is created for the current execution, but the current thread ID was
never set to this new fake ID. This would lead to an incorrect attempt to
read stacked registers for this fake thread. Explicitly setting the
current thread ID to the fake ID ensures that the registers are read from
the core instead of calling freertos_get_thread_reg_list.
Signed-off-by: Frank Dischner <frank.dischner@gmail.com>
Change-Id: I694509a0e01df089429b20ff1b879fc0592b532d
Reviewed-on: https://review.openocd.org/c/openocd/+/6934 Tested-by: jenkins Reviewed-by: Asier Llano <asierllano@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Ben Bender [Tue, 5 Oct 2021 07:58:57 +0000 (10:58 +0300)]
arm_adi_v5: Adding Nuvoton NPCX quirk
We found that the NPCX has an issue with the byte lanes so that non byte
aligned writes aren't working. To overcome this, for byte accesses we
copy the byte to be written to all of the byte lanes.
Antonio Borneo [Mon, 26 Apr 2021 06:57:28 +0000 (08:57 +0200)]
helper/jim-nvp: avoid camelcase error by deprecated API
Commit b8e18d292eb6 ("helper/jim-nvp: comply with coding style
[1/2]") tags as deprecated the old CamelCase API of jim-nvp, so
that old patches already in gerrit or in user's local git can
still build while dumping a deprecated message.
So far, we have not found any such case, so the deprecated API can
be safely dropped in preparation of v0.12.0-rc1.
Drop the compile flag "-Wno-error=deprecated-declarations" and the
deprecated API.
Change-Id: I52ce47eda69a51c2dd29aac15f16e285492d89b4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7052 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 23:26:22 +0000 (01:26 +0200)]
openocd: src: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I30cd66ac7d737f1973c68fdbb841ffcf00e917c4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7072 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 23:24:07 +0000 (01:24 +0200)]
openocd: src/target: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I255ad17235ff1e01bf0aa4deed4d944e1d693ddb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7071 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 23:10:12 +0000 (01:10 +0200)]
openocd: src/rtos: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: If0194089baded7f58dc5d87a35d6e0aff9f43785 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7070 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 23:06:45 +0000 (01:06 +0200)]
openocd: src/jtag: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ie873d12bb0fb838d0d6252e6b9ca3c2118853e9a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7069 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 22:58:56 +0000 (00:58 +0200)]
openocd: src/helper: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I7851617e2682f97ccc3927e3941aadef2df63b54 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7068 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 22:53:35 +0000 (00:53 +0200)]
openocd: src/flash: replace the GPL-2.0-or-later license tag
Replace the FSF boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ic7db91fe37d1139d42c99e303b3243b6c8fe3ea2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7067 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 21:10:08 +0000 (23:10 +0200)]
openocd: src: fix incorrect SPDX tags
The SPDX tag is aimed at machine handling and it's thus expected
to be placed in the first line in specific format.
Move the SPDX tag to the first line and fix it where needed.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ie9a05f530009d482a4116eebd147fd7e1ee3d41e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7066 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 09:44:00 +0000 (11:44 +0200)]
openocd: src: fix incorrect GPL license tag
Use the standard SPDX tag, where it was incorrectly applied.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Iaec63abc6e0a38e5b0ae0ea7f5ecee7ca007bbbd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7065 Tested-by: jenkins
Antonio Borneo [Mon, 27 Jun 2022 08:04:43 +0000 (10:04 +0200)]
openocd: src: replace the incomplete GPL-2.0-or-later license tag
Few files have the FSF boilerplate without the latest statement on
where to get the GPL license.
Manually replace the FSF boilerplate with the SPDX tag.
While there, reorganize the copyright statement.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I0c908d01c010e24f9c7e94885e7fbed4ecf26a86 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7063 Tested-by: jenkins
Antonio Borneo [Mon, 27 Jun 2022 13:01:17 +0000 (15:01 +0200)]
openocd: src: replace the GPL and BSD-Source-Code license tags
Add the new license text in the license pool.
Replace the GPL and BSD boilerplates with the SPDX tag.
Add the copyright owner of Atmel, as it was explicitly listed in
the BSD boilerplate text.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ibb117dbf8402269be3e5ba4f4c472162494d813f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7062 Tested-by: jenkins
Antonio Borneo [Mon, 27 Jun 2022 13:44:05 +0000 (15:44 +0200)]
openocd: src: replace the GPL with eCos exception 2.0 license tag
Add the license exception text in the license pool.
Add the exception chapter in license-rules.txt
Replace the boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ied513b7c9c0722ed2a9c11dbdff3fbf59f1b41ce Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7061 Tested-by: jenkins
Antonio Borneo [Mon, 27 Jun 2022 08:31:09 +0000 (10:31 +0200)]
openocd: src: replace the BSD-2-Clause-Views license tag
Add the license text in the license pool.
Replace the BSD boilerplate with the SPDX tag.
Add the copyright owner of Jim Project, as it was explicitly
listed in the boilerplate text.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I6dd004b1945773c10539016ce733d1fbfe776a9d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7060 Tested-by: jenkins
Antonio Borneo [Mon, 27 Jun 2022 08:32:34 +0000 (10:32 +0200)]
openocd: src: replace the BSD-3-Clause license tag
Replace the BSD boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I5a8cab2051eee7eb99adf67f9631b0827c1359de Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7059 Tested-by: jenkins
Antonio Borneo [Sun, 26 Jun 2022 09:07:45 +0000 (11:07 +0200)]
openocd: src: add GPL license tag on files that miss it
Some file miss completely the license tag.
Add the SPDX tag, using the same GPL-2.0-or-later license of the
OpenOCD project.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I1fb51e722232d14f050458a820c3041de3dc9138 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7058 Tested-by: jenkins
Pavel Kirienko [Sun, 9 Jan 2022 19:05:01 +0000 (21:05 +0200)]
semihosting: fix return value of SYS_READ and SYS_WRITE
ARM/RISC-V semihosting calls SYS_READ/SYS_WRITE require
inversion of the result value as described in
"Semihosting for AArch32 and AArch64". Prior to
this patch, this was done correctly only if
(semihosting->is_fileio==false).
This patch has been tested with STM32F446.
Change-Id: I1b34c8d8393f7dfa66ee6539904a2eaf8f9154b0 Signed-off-by: Pavel Kirienko <pavel.kirienko@gmail.com> Fixes: https://sourceforge.net/p/openocd/tickets/232/
Reviewed-on: https://review.openocd.org/c/openocd/+/6803 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Sat, 25 Jun 2022 10:40:24 +0000 (12:40 +0200)]
target: esp_xtensa_smp: fix clang report
The variable 'smp_break' is only set and used in case of smp.
But clang cannot track if 'target->smp' get modified between the
set and the use of 'smp_break', so it consider possible to use
'smp_break' uninitialized.
Erhan Kurubas [Mon, 20 Jun 2022 13:34:10 +0000 (15:34 +0200)]
semihosting: move semihosting_result_t from riscv.h to the semihosting_common.h
These enum values are useful for the arch level semihosting call handlers.
Currently riscv uses them, we also need similar return codes for the xtensa.
R. Diez [Sat, 18 Jun 2022 14:23:00 +0000 (16:23 +0200)]
configure: provide advice if PKG_PROG_PKG_CONFIG unavailable
These are the misleading error messages that this change prevents:
configure.ac:13: error: possibly undefined macro: AC_MSG_WARN
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:48: error: possibly undefined macro: AC_DEFINE
configure.ac:342: error: possibly undefined macro: AC_MSG_ERROR
configure.ac:608: error: possibly undefined macro: AC_MSG_NOTICE
Change-Id: I21bcc7715eeac0f3d0bcc60bba6801e6a895cdd0 Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7035 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Sun, 19 Jun 2022 20:10:47 +0000 (22:10 +0200)]
helper: fix build with mingw gcc 12.1.0
New mingw compiler correctly complains for using a freed memory
area:
src/helper/configuration.c: In function 'get_home_dir':
src/helper/configuration.c:182:29: error: dangling pointer 'home'
to 'homepath' may be used [-Werror=dangling-pointer=]
182 | home_path = alloc_printf("%s/%s", home, append_path);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In fact the variable 'homepath' is declared inside an 'if' branch
and is not available outside.
Move the declaration of 'homepath' to have it available in a wider
context.
Change-Id: I4a43a03c007c9f0d5c4cee962a9f7cc83ca49637 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: Dietmar May <dietmar.may@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7038 Tested-by: jenkins Reviewed-by: Dietmar May <dietmar.may@outlook.com>
Antonio Borneo [Sun, 12 Jun 2022 21:51:51 +0000 (23:51 +0200)]
tcl: add SPDX tag
For historical reasons, no license information was added to the
tcl files. This makes trivial adding the SPDX tag through script:
fgrep -rL SPDX tcl | while read a;do \
sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n
}' $a;done
With no specific license information from the author, let's extend
the OpenOCD project license GPL-2.0-or-later to the files.
Change-Id: Ief3da306a6e1978de7dfb8f552f9ff23151f9944 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7030 Tested-by: jenkins
Antonio Borneo [Sun, 12 Jun 2022 21:50:59 +0000 (23:50 +0200)]
tcl/interface: add SPDX tag
For historical reasons, no license information was added to the
tcl files. This makes trivial adding the SPDX tag through script:
fgrep -rL SPDX tcl/interface | while read a;do \
sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n
}' $a;done
With no specific license information from the author, let's extend
the OpenOCD project license GPL-2.0-or-later to the files.
Change-Id: I7bd6a628e9e153fc477cddf9b97087a39ec48aa7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7029 Tested-by: jenkins
Antonio Borneo [Sun, 12 Jun 2022 21:48:05 +0000 (23:48 +0200)]
tcl/board: add SPDX tag
For historical reasons, no license information was added to the
tcl files. This makes trivial adding the SPDX tag through script:
fgrep -rL SPDX tcl/board | while read a;do \
sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n
}' $a;done
With no specific license information from the author, let's extend
the OpenOCD project license GPL-2.0-or-later to the files.
Antonio Borneo [Sun, 12 Jun 2022 21:42:27 +0000 (23:42 +0200)]
tcl/target: add SPDX tag
For historical reasons, no license information was added to the
tcl files. This makes trivial adding the SPDX tag through script:
fgrep -rL SPDX tcl/ target| while read a;do \
sed -i '1{i# SPDX-License-Identifier: GPL-2.0-or-later\n
}' $a;done
With no specific license information from the author, let's extend
the OpenOCD project license GPL-2.0-or-later to the files.
Change-Id: I7b2610300b24cccd07bfa6fb5f1266970d5d3a1b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7027 Tested-by: jenkins
Antonio Borneo [Mon, 13 Jun 2022 14:41:11 +0000 (16:41 +0200)]
aarch64: fix handling of 'reset halt'
Commit 6c0151623cb0 ("aarch64: add support for "reset halt"")
introduces the register setting to halt at reset vector, but:
- does not consider the case 'srst_pulls_trst' that makes useless
setting the registers as they will be erased by the pulled trst;
- does not clean sticky errors in case of 'srst_gates_jtag'.
Avoid any register initialization on 'srst_pulls_trst' and move
the cleaning of sticky errors in the common block.
Change-Id: I6f839f06f7b091e234ede31ec18096e51f017bcd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 6c0151623cb0 ("aarch64: add support for "reset halt"")
Reviewed-on: https://review.openocd.org/c/openocd/+/7034 Tested-by: jenkins Reviewed-by: Christian Hoff <christian.hoff@advantest.com>
Custom user syscalls can be handled with target events in the TCL scripts.
This patch gives another opportunity to handle custom syscalls in the c files.
Besides that some utility functions are also exported for the custom handlers.
Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ice13d527540a0de0b2a8abda912ae3dcff3834b7
Reviewed-on: https://review.openocd.org/c/openocd/+/6889 Tested-by: jenkins Reviewed-by: Ian Thompson <ianst@cadence.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>