[OpenOCD-devel] [PATCH]: 1a2418b target/riscv: Fix read_memory_progbuf_inner loop
This is an automated email from Gerrit. Hellosun Wu (wujiheng...@gmail.com) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5341 -- gerrit commit 1a2418bf4171d5a01f057ae6f58d37d434177808 Author: Hellosun Wu Date: Tue Nov 5 15:17:21 2019 +0800 target/riscv: Fix read_memory_progbuf_inner loop On 32bits machine, the read_memory_progbuf_inner loop will get wrong result after (i-2) sign extionsion to uint64_t. For example: i = 0, read_addr = 0x8, size = 0x4 The result of 'read_addr + (i-2) * size' will be 0x1 not 0x0 Change-Id: Ic6f773e517d85cdf285e4d47fa5200a6ba392980 Signed-off-by: Hellosun Wu diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 5683e5a..06e99bf 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2233,7 +2233,7 @@ static int read_memory_progbuf_inner(struct target *target, target_addr_t addres /* Now read whatever we got out of the batch. */ dmi_status_t status = DMI_STATUS_SUCCESS; - for (size_t i = 0; i < reads; i++) { + for (uint64_t i = 0; i < reads; i++) { riscv_addr_t receive_addr = read_addr + (i-2) * size; assert(receive_addr < address + size * count); if (receive_addr < address) -- ___ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel
[OpenOCD-devel] Latest DAPLink firmware doesn't work with OpenOCD.
Dear OpenOCD developers, I've bought the SWDAP probe from ARM (see https://github.com/ARMmbed/mbed-HDK-Eagle-Projects/tree/master/DAPLink/Probes/SWDAP , distributed by L-Tek). This probe works fine with OpenOCD. But when I flash the latest DAPLink firmware v0254 onto the probe (see https://github.com/ARMmbed/DAPLink), it doesn't work anymore. Even earlier DAPLink firmware versions v0253 and v0252 make OpenOCD crash. Please have a look at my StackOverflow question, where I explain all the details: https://electronics.stackexchange.com/questions/465577/daplink-firmware-doesnt-operate-with-openocd You can also have a look at the GitHub issue on DAPLink (but the StackOverflow question goes into more details): https://github.com/ARMmbed/DAPLink/issues/665 It's not sure if the problem originates from the DAPLink firmware or from OpenOCD. Kind greetings, Kristof Mulier ___ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel
[OpenOCD-devel] [openocd:tickets] Re: #254 “Error: this statement may fall through” when compiling from source
The fallthrough warning is already fixed in master branch thanks to http://openocd.zylin.com/4174 so you just need to fetch a more recent version. The warning about deprecated header file is fixed by http://openocd.zylin.com/5317 but not merged yet. If you can test it and add a review on gerrit, it could help getting it merged. --- ** [tickets:#254] “Error: this statement may fall through” when compiling from source** **Status:** new **Milestone:** 0.9.0 **Created:** Sun Nov 03, 2019 01:48 AM UTC by Miguel PA **Last Updated:** Sun Nov 03, 2019 10:37 PM UTC **Owner:** nobody I'm trying to compile from source newset version 0.10, but when running `make` I get ~~~ libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -I./jimtcl -I./jimtcl -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -g -O2 -MT src/svf/svf.lo -MD -MP -MF src/svf/.deps/svf.Tpo -c src/svf/svf.c -o src/svf/svf.o src/svf/svf.c: In function ‘svf_read_command_from_file’: src/svf/svf.c:663:7: error: this statement may fall through [-Werror=implicit-fallthrough=] 663 | i = -1; | ~~^~~~ src/svf/svf.c:664:4: note: here 664 |case '\r': |^~~~ src/svf/svf.c:667:8: error: this statement may fall through [-Werror=implicit-fallthrough=] 667 | if (!cmd_pos) |^ src/svf/svf.c:669:4: note: here 669 |default: |^~~ ~~~ I'm using version 0.10.0, but the ticket milestone option did not listed this version --- Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is subscribed to https://sourceforge.net/p/openocd/tickets/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.___ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel