Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From upstream #935

Merged
merged 51 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
faeae51
target/espressif: check common_magic instead of gdb_arch string
erhankur Mar 14, 2023
6ecd99f
target/adi_v5_swd: update comment about SWD capability
tom-van Mar 14, 2023
415715d
target/adi_v5_jtag: fix endianness error in transaction replay
tom-van Mar 14, 2023
86827a9
svf: fix leaking file descriptor
borneoa Mar 10, 2023
f8631c3
svf: fix memory leak on error during command execution
borneoa Mar 10, 2023
5f6ceeb
svf: make command 'svf' syntax consistent
borneoa Mar 10, 2023
1ec8b83
helper: command: rewrite command 'ocd_find' as COMMAND_HANDLER
borneoa Dec 18, 2022
d05c686
transport: rewrite command 'transport select' as COMMAND_HANDLER
borneoa Dec 18, 2022
80fc9fa
flash: nor: rewrite command 'flash list' as COMMAND_HANDLER
borneoa Dec 18, 2022
842a12f
helper: util: rewrite command 'ms' as COMMAND_HANDLER
borneoa Dec 18, 2022
880ae3f
openocd: rewrite command 'version' as COMMAND_HANDLER
borneoa Dec 18, 2022
0332da1
rtt: rewrite command 'rtt channellist' as COMMAND_HANDLER
borneoa Dec 18, 2022
21e6252
target: aarch64: rewrite commands 'aarch64 mcr/mrc' as COMMAND_HANDLER
borneoa Dec 19, 2022
c4f2337
target: armv4_5: rewrite commands 'arm mcr/mrc' as COMMAND_HANDLER
borneoa Dec 19, 2022
5da4ef2
target: cti: rewrite command 'cti names' as COMMAND_HANDLER
borneoa Dec 19, 2022
19e2a0d
jtag: rewrite command 'adapter name' as COMMAND_HANDLER
borneoa Dec 18, 2022
2774125
jtag: rewrite command 'jtag names' as COMMAND_HANDLER
borneoa Dec 19, 2022
ff0fdcf
jtag: rewrite command 'jtag arp_init' as COMMAND_HANDLER
borneoa Dec 19, 2022
254598b
jtag: rewrite command 'jtag arp_init-reset' as COMMAND_HANDLER
borneoa Dec 19, 2022
fbb7a50
jtag: rewrite command 'flush_count' as COMMAND_HANDLER
borneoa Dec 19, 2022
f76e67a
target: arm_dap: rewrite command 'dap names' as COMMAND_HANDLER
borneoa Dec 19, 2022
8fa6db6
target: arm_tpiu_swo: rewrite command 'tpiu disable' as COMMAND_HANDLER
borneoa Dec 19, 2022
5d39a88
target: arm_tpiu_swo: rewrite command 'tpiu enable' as COMMAND_HANDLER
borneoa Dec 19, 2022
90ddac1
target: arm_tpiu_swo: rewrite command 'tpiu names' as COMMAND_HANDLER
borneoa Dec 19, 2022
6f8c27d
target: arm_tpiu_swo: rewrite command 'tpiu init' as COMMAND_HANDLER
borneoa Dec 19, 2022
584986a
target: rewrite command 'read_memory' as COMMAND_HANDLER
borneoa Dec 19, 2022
113ba58
target: rewrite command 'target curstate' as COMMAND_HANDLER
borneoa Dec 19, 2022
cca6479
target: rewrite command 'was_examined' as COMMAND_HANDLER
borneoa Dec 19, 2022
2dda0e3
target: rewrite command 'examine_deferred' as COMMAND_HANDLER
borneoa Dec 19, 2022
583efa6
target: rewrite command 'arp_halt_gdb' as COMMAND_HANDLER
borneoa Dec 19, 2022
26f4578
target: rewrite command 'target current' as COMMAND_HANDLER
borneoa Dec 19, 2022
d9d6981
target: rewrite command 'target types' as COMMAND_HANDLER
borneoa Dec 19, 2022
12b405a
target: rewrite command 'target names' as COMMAND_HANDLER
borneoa Dec 19, 2022
e9a7221
target: rewrite command 'target smp' as COMMAND_HANDLER
borneoa Dec 19, 2022
f0e8f7b
tcl/board/calao-usb-a9260: fix and refactor broken support
wsakernel Mar 3, 2023
b939224
tcl/board: add Calao USB-A9G20
wsakernel Mar 5, 2023
c1b14d6
flash/nor: missing fileio_close.
Mar 20, 2023
4b9b55a
github/workflow: increase delete-tag-and-release version
erhankur Mar 24, 2023
99ec576
github/workflow: build libjaylink from source
erhankur Mar 25, 2023
41037eb
rtos/FreeRTOS: some optimization of freertos_update_threads()
Du-Chao Mar 22, 2023
18aacc8
src/target/mips_m4k : fix condition on overlapping workspace data area
boblegal31 Mar 29, 2023
55e04e3
src/target/mips_m4k : add fast read method
boblegal31 Mar 29, 2023
90ce9da
helper/list: remove unused hlist_*
borneoa Mar 14, 2023
c8de1b8
helper/list: re-align with Linux kernel 6.3-rc1
borneoa Mar 14, 2023
7e0797d
ipdbg: whitespaces
danselmi Dec 14, 2022
561f27f
helper/compiler fix build with gcc on MacOS
borneoa Apr 2, 2023
e87fa5e
tcl: zynq_7000: add missing id codes
danselmi Nov 30, 2022
ffd9638
tcl: cpld/xilinx-xc7: remove virtex-7 devices with ir-length > 6
danselmi Nov 30, 2022
0384fe5
doc: drop "resume will wait 5 seconds"
tom-van Apr 4, 2023
53fcf14
Merge commit '0384fe5d596f42388f8b84d42959d899f29388ab' into from_ups…
timsifive Oct 16, 2023
d6060b5
Copy snapshot.yml from upstream
timsifive Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Copyright (C) 2020 by Tarek BOUCHKATI <tarek.bouchkati@gmail.com>

on: pull_request
on: push

name: OpenOCD Snapshot

Expand Down Expand Up @@ -30,7 +30,7 @@ jobs:
echo "LIBUSB1_SRC=$PWD/libusb-${LIBUSB1_VER}" >> $GITHUB_ENV
- name: Prepare hidapi
env:
HIDAPI_VER: 0.11.2
HIDAPI_VER: 0.13.1
run: |
mkdir -p $DL_DIR && cd $DL_DIR
wget "https://github.com/libusb/hidapi/archive/hidapi-${HIDAPI_VER}.tar.gz"
Expand All @@ -56,6 +56,16 @@ jobs:
wget "https://github.com/aquynh/capstone/archive/${CAPSTONE_VER}.tar.gz"
tar -xzf ${CAPSTONE_VER}.tar.gz
echo "CAPSTONE_SRC=$PWD/capstone-${CAPSTONE_VER}" >> $GITHUB_ENV
- name: Prepare libjaylink
env:
LIBJAYLINK_VER: 0.3.1
run: |
mkdir -p $DL_DIR && cd $DL_DIR
wget https://gitlab.zapb.de/libjaylink/libjaylink/-/archive/${LIBJAYLINK_VER}/libjaylink-${LIBJAYLINK_VER}.tar.gz
tar -xzf libjaylink-${LIBJAYLINK_VER}.tar.gz
cd libjaylink-${LIBJAYLINK_VER}
./autogen.sh
echo "LIBJAYLINK_SRC=$PWD" >> $GITHUB_ENV
- name: Package OpenOCD for windows
env:
MAKE_JOBS: 2
Expand All @@ -64,7 +74,7 @@ jobs:
HIDAPI_CONFIG: --enable-shared --disable-static --disable-testgui
LIBFTDI_CONFIG: -DSTATICLIBS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF
CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no"
CAPSTONE_CFLAGS: -I$(CAPSTONE_SRC)/include/capstone
LIBJAYLINK_CONFIG: --enable-shared --disable-static
run: |
# check if there is tag pointing at HEAD, otherwise take the HEAD SHA-1 as OPENOCD_TAG
OPENOCD_TAG="`git tag --points-at HEAD`"
Expand All @@ -83,16 +93,31 @@ jobs:
# add missing dlls
cd $HOST-root/usr
cp `$HOST-gcc --print-file-name=libwinpthread-1.dll` ./bin/
# required by libftdi1.dll. For the gcc-mingw-10.3.x or later "libgcc_s_dw2-1.dll" will need to be copied.
cp `$HOST-gcc --print-file-name=libgcc_s_sjlj-1.dll` ./bin/
# prepare the artifact
ARTIFACT="openocd-${OPENOCD_TAG}-${HOST}.tar.gz"
tar -czf $ARTIFACT *
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> $GITHUB_ENV
echo "ARTIFACT_PATH=$PWD/$ARTIFACT" >> $GITHUB_ENV
echo "ARTIFACT_NAME=openocd-windows-${OPENOCD_TAG}" >> $GITHUB_ENV
- name: Publish OpenOCD packaged for windows
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_PATH }}
- name: Delete 'latest' Release
uses: dev-drprasad/delete-tag-and-release@v0.2.1
with:
delete_release: true
tag_name: ${{ env.RELEASE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_NAME }}
commit: ${{ github.sha }}
draft: false
artifacts: ${{ env.ARTIFACT_PATH }}
prerelease: ${{ env.IS_PRE_RELEASE }}
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions contrib/cross-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,22 @@ WORK_DIR=$PWD
: ${HIDAPI_SRC:=/path/to/hidapi}
: ${LIBFTDI_SRC:=/path/to/libftdi}
: ${CAPSTONE_SRC:=/path/to/capstone}
: ${LIBJAYLINK_SRC:=/path/to/libjaylink}

OPENOCD_SRC=`readlink -m $OPENOCD_SRC`
LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC`
HIDAPI_SRC=`readlink -m $HIDAPI_SRC`
LIBFTDI_SRC=`readlink -m $LIBFTDI_SRC`
CAPSTONE_SRC=`readlink -m $CAPSTONE_SRC`
LIBJAYLINK_SRC=`readlink -m $LIBJAYLINK_SRC`

HOST_TRIPLET=$1
BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build
LIBUSB1_BUILD_DIR=$BUILD_DIR/libusb1
HIDAPI_BUILD_DIR=$BUILD_DIR/hidapi
LIBFTDI_BUILD_DIR=$BUILD_DIR/libftdi
CAPSTONE_BUILD_DIR=$BUILD_DIR/capstone
LIBJAYLINK_BUILD_DIR=$BUILD_DIR/libjaylink
OPENOCD_BUILD_DIR=$BUILD_DIR/openocd

## Root of host file tree
Expand Down Expand Up @@ -158,6 +161,16 @@ libdir=${exec_prefix}/lib \
includedir=${prefix}/include/capstone\n\n;' $CAPSTONE_PC_FILE
fi

# libjaylink build & install into sysroot
if [ -d $LIBJAYLINK_SRC ] ; then
mkdir -p $LIBJAYLINK_BUILD_DIR
cd $LIBJAYLINK_BUILD_DIR
$LIBJAYLINK_SRC/configure --build=`$LIBJAYLINK_SRC/config.guess` --host=$HOST_TRIPLET \
--with-sysroot=$SYSROOT --prefix=$PREFIX \
$LIBJAYLINK_CONFIG
make -j $MAKE_JOBS
make install DESTDIR=$SYSROOT
fi

# OpenOCD build & install into sysroot
mkdir -p $OPENOCD_BUILD_DIR
Expand Down
19 changes: 10 additions & 9 deletions doc/openocd.texi
Original file line number Diff line number Diff line change
Expand Up @@ -8811,7 +8811,6 @@ 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.
OpenOCD will wait 5 seconds for the target to resume.
@end deffn

@deffn {Command} {step} [address]
Expand Down Expand Up @@ -9132,8 +9131,10 @@ format. Optional @option{start} and @option{end} parameters allow to
limit the address range.
@end deffn

@deffn {Command} {version}
Displays a string identifying the version of this OpenOCD server.
@deffn {Command} {version} [git]
Returns a string identifying the version of this OpenOCD server.
With option @option{git}, it returns the git version obtained at compile time
through ``git describe''.
@end deffn

@deffn {Command} {virt2phys} virtual_address
Expand Down Expand Up @@ -11665,8 +11666,8 @@ way to represent JTAG test patterns in text files.
In a debug session using JTAG for its transport protocol,
OpenOCD supports running such test files.

@deffn {Command} {svf} @file{filename} [@option{-tap @var{tapname}}] [@option{[-]quiet}] @
[@option{[-]nil}] [@option{[-]progress}] [@option{[-]ignore_error}] @
@deffn {Command} {svf} @file{filename} [@option{-tap @var{tapname}}] [@option{-quiet}] @
[@option{-nil}] [@option{-progress}] [@option{-ignore_error}] @
[@option{-noreset}] [@option{-addcycles @var{cyclecount}}]
This issues a JTAG reset (Test-Logic-Reset) and then
runs the SVF script from @file{filename}.
Expand All @@ -11680,11 +11681,11 @@ Command options:
specified by the SVF file with HIR, TIR, HDR and TDR commands;
instead, calculate them automatically according to the current JTAG
chain configuration, targeting @var{tapname};
@item @option{[-]quiet} do not log every command before execution;
@item @option{[-]nil} ``dry run'', i.e., do not perform any operations
@item @option{-quiet} do not log every command before execution;
@item @option{-nil} ``dry run'', i.e., do not perform any operations
on the real interface;
@item @option{[-]progress} enable progress indication;
@item @option{[-]ignore_error} continue execution despite TDO check
@item @option{-progress} enable progress indication;
@item @option{-ignore_error} continue execution despite TDO check
errors.
@item @option{-noreset} omit JTAG reset (Test-Logic-Reset) before executing
content of the SVF file;
Expand Down
49 changes: 19 additions & 30 deletions src/flash/nor/tcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
if (buf_cnt != length) {
LOG_ERROR("Short read");
free(buffer);
fileio_close(fileio);
return ERROR_FAIL;
}

Expand Down Expand Up @@ -1325,40 +1326,27 @@ COMMAND_HANDLER(handle_flash_banks_command)
return ERROR_OK;
}

static int jim_flash_list(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
COMMAND_HANDLER(handle_flash_list)
{
if (argc != 1) {
Jim_WrongNumArgs(interp, 1, argv,
"no arguments to 'flash list' command");
return JIM_ERR;
}

Jim_Obj *list = Jim_NewListObj(interp, NULL, 0);
if (CMD_ARGC != 0)
return ERROR_COMMAND_SYNTAX_ERROR;

for (struct flash_bank *p = flash_bank_list(); p; p = p->next) {
Jim_Obj *elem = Jim_NewListObj(interp, NULL, 0);

Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->name, -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "driver", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->base));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "size", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->size));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "bus_width", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->bus_width));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "chip_width", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->chip_width));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "target", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, target_name(p->target), -1));

Jim_ListAppendElement(interp, list, elem);
command_print(CMD,
"{\n"
" name %s\n"
" driver %s\n"
" base " TARGET_ADDR_FMT "\n"
" size 0x%" PRIx32 "\n"
" bus_width %u\n"
" chip_width %u\n"
" target %s\n"
"}",
p->name, p->driver->name, p->base, p->size, p->bus_width, p->chip_width,
target_name(p->target));
}

Jim_SetResult(interp, list);

return JIM_OK;
return ERROR_OK;
}

COMMAND_HANDLER(handle_flash_init_command)
Expand Down Expand Up @@ -1405,8 +1393,9 @@ static const struct command_registration flash_config_command_handlers[] = {
{
.name = "list",
.mode = COMMAND_ANY,
.jim_handler = jim_flash_list,
.handler = handle_flash_list,
.help = "Returns a list of details about the flash banks.",
.usage = "",
},
COMMAND_REGISTRATION_DONE
};
Expand Down
20 changes: 10 additions & 10 deletions src/helper/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,19 +662,19 @@ void command_done(struct command_context *cmd_ctx)
}

/* find full path to file */
static int jim_find(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
COMMAND_HANDLER(handle_find)
{
if (argc != 2)
return JIM_ERR;
const char *file = Jim_GetString(argv[1], NULL);
char *full_path = find_file(file);
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;

char *full_path = find_file(CMD_ARGV[0]);
if (!full_path)
return JIM_ERR;
Jim_Obj *result = Jim_NewStringObj(interp, full_path, strlen(full_path));
return ERROR_COMMAND_ARGUMENT_INVALID;

command_print(CMD, "%s", full_path);
free(full_path);

Jim_SetResult(interp, result);
return JIM_OK;
return ERROR_OK;
}

COMMAND_HANDLER(handle_echo)
Expand Down Expand Up @@ -1165,7 +1165,7 @@ static const struct command_registration command_builtin_handlers[] = {
{
.name = "ocd_find",
.mode = COMMAND_ANY,
.jim_handler = jim_find,
.handler = handle_find,
.help = "find full path to file",
.usage = "file",
},
Expand Down
6 changes: 4 additions & 2 deletions src/helper/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
* clang for Apple defines
* #define __nonnull _Nonnull
* that is a per argument attribute, incompatible with the gcc per function attribute __nonnull__.
* Undefine it to keep compatibility among compilers.
* gcc for Apple includes sys/cdefs.h from MacOSX.sdk that defines
* #define __nonnull
* In both cases, undefine __nonnull to keep compatibility among compilers and platforms.
*/
#if defined(__clang__) && defined(__APPLE__)
#if defined(__APPLE__)
# undef __nonnull
#endif
#ifndef __nonnull
Expand Down
Loading
Loading