aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-05-02coding style: src: remove empty lines at end of text filesAntonio Borneo14-16/+0
Empty lines at end of text files are useless. Remove them. Change-Id: Ibac9b36682d58f81e34ca2b51e6260e7d472fb0e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5172 Tested-by: jenkins
2020-04-24bitbang: Fix FTBFS with GCC 10Andreas Fritiofson1-1/+1
GCC 10 defaults to -fno-common which breaks the sharing of bitbang_swd struct between bitbang drivers due to a missing extern. Change-Id: I2b4122f7939cec91a72284006748f99a23548324 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/5592 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-04-24flash/nor/stm32l4x: cast wrpxxr_mask to uint16_to to printIlya Kharin1-1/+1
Fix build error on Mac OS X Catalina (10.15.4) caused by formatting stm32l4_info->wrpxxr_mask, which is uint32_t, as uint16_t in the debug log message. Adding casting to uint16_t before substitution because only lower 16 bits are significant for debug purposes. Change-Id: Iddb87cd156dfc84ab1f91cd15a1ddee6b646d412 Signed-off-by: Ilya Kharin <akscram@gmail.com> Reviewed-on: http://openocd.zylin.com/5590 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-24ftdi: Report an error if no ftdi_vid_pid is specifiedLeonard Crestez1-0/+5
By default the list of VID/PID is empty so if ftdi_vid_pid is not called then no matches are attempted. The only message is at -d3: Command 'init' failed with error code -100" Check for this condition explicitly to make life easier for people configuring adapters. Change-Id: If0f93370c9e9ddc9700aae7c346c1c6dd319152e Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-on: http://openocd.zylin.com/5440 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-24target/armv8: Add ARM target name on halt statusKevin Burke1-1/+2
The CPU target name is added to the HALT status message so the user can see which target halted at the designated program counter. Tested on an Ampere eMAG8180 and Quicksilver silicon Change-Id: I51e6f21296c85a822df28c5b7c4068e8ff66f29e Signed-off-by: Kevin Burke <kevinb@os.amperecomputing.com> Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Reviewed-on: http://openocd.zylin.com/5571 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-21target/armv7m: minor fixes of target algo exit point checkTomas Vanek2-7/+9
Introduce a new ERROR_TARGET_ALGO_EXIT as currently used ERROR_TARGET_TIMEOUT should be reserved for the timeout only. Do not load PC directly from CPU HW as the register value has already been cached. Change-Id: I0d3630da41fd021676789dc12b52545cc0432ba8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5329 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-21flash/nor: add flash mdw/h/b commandsTomas Vanek1-0/+82
Some flash banks are not mapped in the target memory (e.g. SPI flash, some special pages). Add flash version of mdw/h/b which reads data using the flash driver. Change-Id: I66910e0a69cf523fe5ca1ed6ce7b9e8e176aef4a Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4776 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-21nrf5: Refresh the watchdog while flashingAurélien Martin1-2/+12
If watchdog is enabled, there's no way we can disable it while the flashing firmware is running. (Halt disables it, but software reset doesn't.) So let's have the flashing firmware refresh the watchdog regularly, in case it has been enabled by previously running software. Failure to do so could lead to a watchdog reset in the middle of the chip bieng programmed. Change-Id: I79d41593948aae0080480e891552e1c2ee3ccbd0 Signed-off-by: Aurélien Martin <martaurel@gmail.com> Reviewed-on: http://openocd.zylin.com/5266 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-04-21nrf5: Include generated loader codeAurélien Martin1-24/+4
Dump legacy hexadecimal machine code Change-Id: I336efa461058bccc3894131cb22473785b68479c Signed-off-by: Aurélien Martin <martaurel@gmail.com> Reviewed-on: http://openocd.zylin.com/5267 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-04-21Remove BUILD_TARGET64Florian Fainelli9-49/+3
BUILD_TARGET64 creates a larger test matrix and mostly gates the building of the aarch64/armv8 target, make that unconditional, which would help fixing any issues with 64-bit address types anyway. Rebased by Antonio Borneo after commit 1fbe8450a9dd ("mips: Add MIPS64 support") Change-Id: I219f62b744d540d9dde9a42e6b63fd7d91df3dbb Suggested-by: Matthias Welwarsky <matthias@welwarsky.de> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5240 Tested-by: jenkins
2020-04-21jtag/drivers: add debugging support for Mellanox BlueField SoCLiming Sun3-0/+532
This commits adds debugging support for the Mellanox BlueField SoC via rshim, which is an interface accessible from external USB or PCIe (for SmartNIC case) via the rshim driver. It implements the arm dap interfaces based on the existing dapdirect framework. Change-Id: I18eb1c54293ec2c581f853e0e55b3f96d7978b56 Signed-off-by: Liming Sun <lsun@mellanox.com> Reviewed-on: http://openocd.zylin.com/5457 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-20jtag/drivers/ulink: fix clang static analyzer warningsTomas Vanek1-8/+9
scan-build-9: Description: Potential leak of memory pointed to by 'cmd' File: /home/vanekt/openocd/scanbuild9/../src/jtag/drivers/ulink.c Line: 1075 Description: Potential leak of memory pointed to by 'cmd' File: /home/vanekt/openocd/scanbuild9/../src/jtag/drivers/ulink.c Line: 1275 ulink_append_xxx_cmd() functions allocate memory for cmd and then call ulink_allocate_payload(), which allocates cmd->payload_out or cmd->payload_in. ulink_append_queue() checks the size of queue and if the new payload does not fit, calls ulink_execute_queued_commands() and then ulink_post_process_queue(). If any of these two fails, an error is returned, allocated cmd struct leaks and the queue is left in an undefined state. Change ulink_append_queue() flow to proceed to appending cmd to the queue even in the case of fail in previous ulink_execute_queued_commands() or ulink_post_process_queue(). In case of fail then clear the queue including the last appended cmd. Change-Id: I967c07af19e9020c93bcb4ef403cf1f557dd1db1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5370 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-20jtag/drivers/ulink: fix clang static analyzer warningTomas Vanek1-6/+9
scan-build-9: Description: Access to field 'payload_in' results in a dereference of a null pointer (loaded from field 'queue_start') File: src/jtag/drivers/ulink.c Line: 2216 Set input/output_signals conditionally if ulink_append_get_signals_cmd() and ulink_execute_queued_commands() returns no error. Do not fail driver initialisation as the signals are only printed. Change-Id: I6c842f0e9a604712abf7444a2fa95ba5810de1ff Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5520 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-20jtag/drivers/ulink: fix clang static analyzer warningTomas Vanek1-0/+1
scan-build-9: Description: Potential leak of memory pointed to by 'tdo_buffer' File: src/jtag/drivers/ulink.c Line: 1629 Free the buffer before error return. Change-Id: Ic47651a5ae78c7a47ae4fcbad225f329b14c45cb Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5519 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-20flash/nand/core: fix clang static analyzer warningTomas Vanek1-7/+24
core.c:446: The left operand of '>>' is a garbage value There are many places where an error code returned from nand->controller operations are ignored. To keep the change minimal, the error checks are added only to reading of extended nand info as it was suspected to be the cause of the warning. Addition of the error checks did not fix the warning. scan-build-9 report was inspected and IMHO the warning is bogus: the term (nand->device->erase_size == 0) cannot give false at line 395 and then evaluate true at line 462. Fixed by zeroing id_buff. Change-Id: I97ed7ce0fdf1aa23d746d5fb898bacd050e20ae8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5518 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-20target/arc: remove saving context during resetEvgeniy Didin1-1/+3
In arc_poll() function we handle the cases, when jtag indicates, that processor is halted, but target->state is not TARGET_HALTED. In case, when processor was halted and target->state was TARGET_RUNNING, we should save context. At the same time if target->state was TARGET_RESET we do not need to save context. Changes: 16.04: Fix - Move setting target->state = TARGET_HALT after "target->state == TARGET_RUNNIG" check, otherwise this check makes no sense Change-Id: I92ab6ec71cf58273bb8401d14a562035de3deab4 Signed-off-by: Evgeniy Didin <didin@synopsys.com> Reviewed-on: http://openocd.zylin.com/5524 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-04-15Revert "rtos/FreeRTOS: Fix FreeRTOS thread list reading"Tomas Vanek1-16/+23
This reverts commit 6568d29cc1d0d94daafec5bdb73de7d4f17da257. The reverted change caused some tasks were missing in thread list. While on it add a comment explaining the relation of uxTopUsedPriority and configMAX_PRIORITIES, introduce config_max_priorities and change types to unsigned. Change-Id: I4371c8882470d13ee7360ef21b132c56ecb95af8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5577 Tested-by: jenkins
2020-04-13flash/nor/efm32: Chip support extension (EFM32GG12B Giant)tscn921-0/+1
For flash/nor/efm32 the EFM32GG12B Giant chip has been added to the efm32_family along with its respective series and msc_rebase. Testen on EFM32GG12B390F board Change-Id: Idd7dfa93f26ac22566aed1be28f30db678cc0a25 Signed-off-by: tscn92 <tscn@kamstrup.com> Reviewed-on: http://openocd.zylin.com/5567 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-04-13server: set connection::input_pending type to boolTarek BOCHKATI3-6/+6
Change-Id: Ifae8ac2761a7a8fa12732b71c2de456e7558bd2b Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5565 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-04-13server/gdb_server: set gdb_connection::ctrl_c type to boolTarek BOCHKATI1-6/+6
Change-Id: I828b83b181f7a222ee2e6cb67eb337c6cd8712ac Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5566 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-04-12Entering SWIM mode on ST-LINK does not update swim status word.Ake Rehnman1-3/+2
As a consequence of a previous failed SWIM command any subsequent attempts to enter SWIM mode fails. Change stlink_usb_mode_enter to use stlink_usb_xfer_noerrcheck instead. Change-Id: I5c6a1a8e68d3dc77ec37264880383366fa6a75d9 Signed-off-by: Ake Rehnman <ake.rehnman@gmail.com> Reviewed-on: http://openocd.zylin.com/5547 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-12stlink: always use a valid endpointTarek BOCHKATI1-3/+3
In order to extend the driver to support stlink-server over TCP, we should always use a valid endpoint, as stlink-server is not permissive and do not accept the invalid STLINK_NULL_EP. STLINK_NULL_EP value was used for commands without an expected reply, this value could be replaced with a valid endpoint without any impact when the size is set to zero. Change-Id: I003ad364e03d3a10bc036772db86310d996cbe81 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5455 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-12jtag: flush queue after reset for drivers using old reset modelAntonio Borneo1-0/+5
Not all the jtag drivers have been migrated to the new reset model and for those only we need to flush the jtag queue to make the reset working with command 'adapter [de]assert ...'. Add a queue flush and a FIXME comment to remove both when all the drivers would be migrated. Change-Id: Ib6667f987b1be2bce492841040302e742dd1cad1 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5430 Tested-by: jenkins
2020-04-12gdb_server: print the target associated to the gdb portAntonio Borneo1-1/+1
While running OpenOCD on multi-target SoC, it's not immediate to detect which target is associated to each GDB port. The log only reports: Info : Listening on port 3333 for gdb connections and a verbose debug log is required to get such info. Promote to LOG_INFO() the existing debug message that already reports the association, obtaining for each port: Info : starting gdb server for stm32mp15x.cpu0 on 3333 Info : Listening on port 3333 for gdb connections Change-Id: I1bd75655a3449222c959e6e82f5e0f8f5acd908a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5525 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-12cortex_m: remove deprecation for soft_reset_haltAntonio Borneo1-4/+4
The command "soft_reset_halt" is deprecated since mid 2013 with the commit 146dfe32956d ("cortex_m: deprecate soft_reset_halt"). Nevertheless it is still extremely useful with multicore chips where it allows to reset only one of the cores, option not available through asserting the chip-wide srst. It also get useful to handle the reset on some problematic chip, as in http://openocd.zylin.com/5489 Replace the warning about deprecation with a more light debug message. Change-Id: I52de6359475ba31014ae77e596a87fe88b252177 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5514 Tested-by: jenkins Reviewed-by: Edward Fewell <efewell@ti.com> Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-12cortex_a: don't wait for target halted in deassert_reset()Antonio Borneo1-1/+3
The tcl script src/target/startup.tcl has already the proper centralized support to wait for all targets to halt after the command "reset halt". The extra wait in cortex_a_deassert_reset() is not required. This extra wait is also an issue for multi-core support, because waiting for one core to halt can delay the halt request to the other cores. Replace the indirect call to cortex_a_halt(), that embeds the wait for halt, with a low-level halt sequence. The on-going work on the reset framework is compatible with this change; in fact it keeps in startup.tcl the wait for targets to halt, even if current code proposal for cortex_a simply removes the function cortex_a_deassert_reset(). Change-Id: Ic661c3791a29ba7d520e31f85a61f939a646feb5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5472 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-12stlink: remove only instance of useconds_tAntonio Borneo1-1/+1
The usleep() function, and its associated useconds_t type specifier, has been obsoleted by POSIX.1-2008. OpenOCD has 28 call to usleep(), that should be migrated to the replacement nanosleep(), but due to the different prototype int nanosleep(const struct timespec *req, struct timespec *rem); this can take some effort. The type useconds_t is used in only one case, where it's used both as parameter of usleep() and as value passed to LOG_DEBUG(). Due to different implementation of useconds_t, there are cases that trigger a compile warning in LOG_DEBUG() when useconds_t is more than 32 bit. E.g. with unistd.h in MinGW 4.x, useconds_t is defined as unsigned long, thus being 32 or 64 bits depending on the target. Replace the only instance of useconds_t. Change-Id: I21724f8b06780abdb003a57222ff1d6840ff5419 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5544 Tested-by: jenkins Reviewed-by: Ake Rehnman <ake.rehnman@gmail.com>
2020-04-12flash/nor/nrf5: pass unsigned char to isalnum()Antonio Borneo1-3/+7
In newlib, the argument of isalnum() and the similar functions in ctype.h is checked to be either an int or an unsigned char. Using a normal (signed) char triggers a compile time warning warning: array subscript has type ‘char’ [-Wchar-subscripts] Rewrite the function to separate the internal unsigned char operations from the (signed) char parameter. Change-Id: I5f19115f0b2de2b5b35dc07ef4b58a96161268ee Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reported-by: Åke Rehnman <ake.rehnman@gmail.com> Fixes: 5da746fa09 ("flash/nor/nrf5: detect newer devices without HWID table") Reviewed-on: http://openocd.zylin.com/5545 Tested-by: jenkins Reviewed-by: Ake Rehnman <ake.rehnman@gmail.com>
2020-04-12sysfsgpio: minor fix for bool typesAntonio Borneo1-9/+9
Return bool value in functions that return bool. Change return type to bool to function is_gpio_valid(). Change-Id: Ic2e62be737772b22e69881c034956549f659370b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5552 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2020-04-09target: added events TARGET_EVENT_STEP_START and _ENDJan Matyas2-2/+16
Events TARGET_EVENT_STEP_START and TARGET_EVENT_STEP_END have been added - analogous to already existing events TARGET_EVENT_RESUME_*. This is an example of a concrete use case where having these events is important: In RISC-V processors without Debug Program Buffer, OpenOCD cannot execute fence/fence.i when resuming or single- stepping. With these events implemented, the user can instead provide custom operations to achieve that same effect prior to resuming the processor. Change-Id: I786348ff08940759d99b0f24e9e0ed5a44581094 Signed-off-by: Jan Matyas <matyas@codasip.com> Reviewed-on: http://openocd.zylin.com/5551 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com>
2020-04-05flash/stm32h7x: Use proper flash regs base for bank 1Sasha Kozaruk1-5/+10
On stm32h747 writing/erasing bank 1 didn't work. It was because the flash register base was always set for bank 0. Tested on STM32H747I-DISCO board. Change-Id: I7e8c43ecdda9dc70b114905f5ec6a6753ca29d82 Signed-off-by: Sasha Kozaruk <alkhozar@gmail.com> Reviewed-on: http://openocd.zylin.com/5534 Reviewed-by: Christopher Head <chead@zaber.com> Tested-by: jenkins
2020-04-05stlink: remove 18 MHz jtag freq for stlink v2Laurent LEMELE1-1/+0
While stlink v2 allows setting the jtag clock frequency till a max of 18 MHz, the firmware seams unstable and not properly working. Remove the entry for 18 MHz, at least until a fix get available. Change-Id: I503e1b6a5709b5fbf1f1147fd3b5f34a0c5ee98c Signed-off-by: Laurent LEMELE <laurent.lemele@st.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5465 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-05stlink: fix speed setting in dap modeLaurent LEMELE1-1/+6
stlink accepts a set of values for "adapter speed". Fix the api khz() to return one of the allowed speed values. Change-Id: Iac640b6f76935891ca25ac168cab3809707f19d9 Signed-off-by: Laurent LEMELE <laurent.lemele@st.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5464 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2020-04-05armv8: log the register name which we failed to read or writeTarek BOCHKATI1-0/+7
when openocd fails to read armv8 register, the user is not informed which register has caused the error. for example, in AArch32 state ESR_EL3 read/write is not supported, thus armv8_dpm_read_current_registers is always failing without mentioning which register has caused the error. Change-Id: I24c5abbda9fac24fb77a01777ed15261aeaaf800 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5516 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-05flash/nor/cfi: Minor code cleanupsMarc Schink1-45/+30
Change-Id: I2d45fcc5b9d232db66218aab5fef3add5830bcd7 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5463 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-05flash/stm32f1x: fix maximum flash size for some devicesTarek BOCHKATI1-2/+18
For STM32F0xxx, according to RM0360 Rev 4 and RM0091 Rev 9, the accurate flash sizes are in RM0360, Table 4 and 5 DEV_ID=0x440 => F030x8 => 64K (64 * 1K) F05xxx => idem DEV_ID=0x442 => F030xC => 256K (128 * 2K) F09xxx => idem DEV_ID=0x444 => F030x4 => 16K (16 * 1K) F030x6 => 32K (32 * 1K) DEV_ID=0x445 => F070x6 => 32K (32 * 1K) F04xxx => idem DEV_ID=0x448 => F070xB => 128K (64 * 2K) For STM32 F100xx HD VL (0x428), max_flash_size_kb is 512 (was 128) refer to RM0041 Rev5: Table 5. Flash module organization (high-density value line devices) => (256 page of 2 Kbytes each) Change-Id: I4ead13093f8f4b8ec900482ee049a6fc83dcc664 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5444 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-05cmsis_dap_usb: Light up the leds while connectedRoman Elshin1-8/+11
Tested with Keil ULINK2 CMSIS-DAP. Change-Id: I331224d23412bed8b2dea25abacbf9096ddd18b1 Signed-off-by: Roman Elshin <roxmail@list.ru> Reviewed-on: http://openocd.zylin.com/5385 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-04-05flash/nor: Change missing protect_check message from WARN to Info.Edward Fewell1-1/+1
Change the current message when a flash driver does not implement the protect_check function to LOG_INFO() from LOG_WARNING(). The user is still notified that the procedure isn't available, but changes the tone to indicate this is expected with this flash driver and not something that necessarily is a problem to fix. Change-Id: If8a2e86a23c852d562346ca36734e5d02df4a851 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/5539 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-27target/arc_cmd: Improve argument checks for commandsEvgeniy Didin1-5/+7
Add more argument check for "add-reg" command. Changes since first revision: -Removed arguments limitation(50 maximum) for "arc_set_reg_exists". Changes: 25.03: Removed inconsistency in "add-reg" function. Actually "-type" option is optional and if it is not set, register type is "int". Change-Id: Ia21e6baf4fbda162f7811cd0fe305fc86ddafcfd Signed-off-by: Evgeniy Didin <didin@synopsys.com> Reviewed-on: http://openocd.zylin.com/5523 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2020-03-26target: Add possibility to remove all breakpointsMarc Schink1-5/+10
Change-Id: I46acd57956846d66bef974e0538452462b197cd0 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4916 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-26target: Add function to remove all breakpointsMarc Schink2-1/+30
Change-Id: I4718926844a2c8bcfd78d7a8792f6ded293548ef Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4915 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-24avrf.c: Add ATmega256RFR2 to known flash listLars Poeschel1-0/+1
This adds the ATmega256RFR2 to the list of know devices for flashing. Change-Id: Ib24a508762aaa84ba08ba37409db2ae674b46288 Signed-off-by: Lars Pöschel <poeschell+openocd@mailbox.org> Reviewed-on: http://openocd.zylin.com/5504 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-24avrf.c: Use extended addressing for flash > 0x20000Lars Poeschel1-0/+15
The current method used for flash addressing uses 16 bit. Every access to flash is 16 bit wide. With 16 address bits one can address 0x10000 unique locations á 16 bits thats 0x20000 bytes. For flashes bigger than that avrs have an extended addressing with more than 16 address bits. This is now implemented and used for flashs larger than 0x20000 bytes. Change-Id: Id8b6337dde3830fb3c56b9042872e040bb67c12d Signed-off-by: Lars Pöschel <poeschell+openocd@mailbox.org> Reviewed-on: http://openocd.zylin.com/5502 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-24jtag: fix command "adapter [de]assert" with dap directAntonio Borneo1-1/+2
The commit fafe6dfc9cd8 ("adapter: add command "adapter [de]assert srst|trst [[de]assert srst|trst]"") was proposed in gerrit well before commit a61ec3c1d73d ("adi_v5_dapdirect: add support for adapter drivers that provide DAP API") get merged, so it didn't include a complete support for dap direct. The merge upstream of the two commits lacks the support by command "adapter [de]assert" for dap direct Let command command "adapter [de]assert" handle dap direct. Change-Id: I1a69f8ee877c8fd57598ed4ad9d71da61d15457c Fixes: commit fafe6dfc9cd8 ("adapter: add command "adapter [de]assert srst|trst [[de]assert srst|trst]"") Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5515 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-24drivers: xds110: Add support of alternate XDS110 configurationsEdward Fewell1-23/+52
The XDS110 supports alternate configurations, each of which has a unique vid/pid: 0451/bef3 -- Standard (legacy) configuration 0451/bef4 -- Drag-n-Drop configuration 1cbe/02a5 -- CMSIS-DAP 2.0 on BULK interface configuration It's not important to OpenOCD what the differences are except that OpenOCD needs to know how to connect using the different vid/pids and, in the case of the last one, use a different interface for the debug connection. Updated the XDS110 source to search for all possible configurations, and updated the udev rules file to enable user access to the alternate configuraitons. For the curious, you can download the latest XDS emupack from software-dl.ti.com/ccs/esd/documents/xdsdebugprobes/emu_xds_software_package_download.html Install to an empty directory, and documentation for the XDS110 is located in the .../ccs_base/common/uscif/xds110 of the installation. Updated for comments in code review. Changed const variable names to lower case. Reworked interface/endpoint setting to use arrays suggestion. Change-Id: Icc9d11c6618f43d87ae8171c78ebf238800d3ac2 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/5494 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-03-24drivers: xds110: Clean up command syntax and documentationEdward Fewell2-25/+29
Arrange all commands under a top level xds110 command. Fix documentation to properly reflect the current functionality. Also updated the links in the document to the new permanent links for the XDS110 only support. Patch updated for comments from code review. Return ERROR_COMMAND_SYNTAX_ERROR for wrong number of args in commands. Added deprecated commands to src/jtag/startup.tcl. Change-Id: Ica45f65e1fdf7fa72866f4e28c4f6bce428d8ac9 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/5495 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-03-24drivers: xds110: Add support TCK changes in firmware updateEdward Fewell1-46/+112
Starting with XDS110 firmware version 3.0.0.0, the peak TCK frequency became 14,000 kHz. So the delay count calculation in the current driver has been updated to use the new formula for setting the TCK speed depending on which version of the firmware is detected. And because of the changes, the default TCK settings for the XDS110 based Launchpads can be adjusted to take advantage of the higher TCK performance. Note that the values used have been determined through testing in the automated test labs to be the highest TCK frequency with the XDS110 that are still reliable. Different boards have a different peak TCK setting that should be safe. Change-Id: I4d66e90d8fac8272641ba4db4a3a510e3b444d86 Signed-off-by: Edward Fewell <efewell@ti.com> Reviewed-on: http://openocd.zylin.com/5493 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-03-23flash/stm32l4x: add support of STM32WB3x devicesTarek BOCHKATI1-0/+15
STM32WB3x devices' flash are quite similar to STM32WB5x, except the maximum flash size, which is 512K for WB3x and 1M for WB5x Change-Id: I3098d7153a7429e0e72c75cec962c05768b0b018 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5475 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-23flash/stm32l4x: add support of STM32WLEx devicesTarek BOCHKATI2-2/+24
STM32WLEx devices are based on arm Cortex-M4 running at 48MHz, contains a single bank of maximum 256 Kbytes of flash memory. there is 3 variants with different Flash/RAM sizes: STM32WLE5JC : 256K/64K STM32WLE5JB : 128K/48K STM32WLE5J8 : 64K/20K the work-area size is set to 20 kb to fit in STM32WLE5J8 Change-Id: Ie8e186fe4be97cbc25c53ef0ade4b4dbbcee6f66 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5450 Tested-by: jenkins Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-03-22stlink: workaround serial bug with old ST-Link DFUTarek BOCHKATI1-1/+82
Old ST-LINK DFU returns an incorrect serial in the USB descriptor example for the following serial "57FF72067265575742132067" - the correct descriptor serial is: 0x32, 0x03, 0x35, 0x00, 0x37, 0x00, 0x46, 0x00, 0x46, 0x00 ... this contains the length (0x32 = 50), the type (0x3 = DT_STRING) and the serial in unicode format. the serial part is: 0x0035, 0x0037, 0x0046, 0x0046 ... >> 57FF ... this format could be read correctly by 'libusb_get_string_descriptor_ascii' so this case is managed by libusb_helper::string_descriptor_equal - the buggy DFU is not doing any unicode conversion and returns a raw serial data in the descriptor: 0x1a, 0x03, 0x57, 0x00, 0xFF, 0x00, 0x72, 0x00 ... >> 57 FF 72 ... based on the length (0x1a = 26) we could easily decide if we have to fixup the serial and then we have just to convert the raw data into printable characters using sprintf example for an old ST-LINK/V2 standalone: before : 'W?rreWWB g' after : '57FF72067265575742132067' => same as the displayed value in STM32CubeProgrammer tested using these commands using the buggy serial -c "hla_serial \x57\x3f\x72\x06\x72\x65\x57\x57\x42\x13\x20\x67" using the computed serial -c "hla_serial 57FF72067265575742132067" Change-Id: I1213818257663eeb8e76f419087d3127d0524842 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5396 Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>