1. 08 Mar, 2019 1 commit
  2. 06 Mar, 2019 1 commit
  3. 04 Mar, 2019 1 commit
  4. 01 Mar, 2019 1 commit
  5. 15 Feb, 2019 1 commit
    • Tomas Vanek's avatar
      target, breakpoints: improve error handling · fd8a3c95
      Tomas Vanek authored
      
      
      handle_bp_command_set() showed the error message
      "Failure setting breakpoint, the same address(IVA) is already used"
      on any error returned from (xxx_)breakpoint_add().
      Paradoxically breakpoint_add() returned ERROR_OK if it detected
      duplicated bp address.
      context_breakpoint_add() and hybrid_breakpoint_add() returned -1
      instead of OpenOCD compatible error if they detected duplicity.
      
      Introduce ERROR_TARGET_DUPLICATE_BREAKPOINT
      Unify error handling to LOG_ERROR() any error in (xxx_)breakpoint_add()
      Remove misleading error messages from handle_bp_command_set()
      handle_bp_command_set() returns error if the target does not implement
      add_context_breakpoint or add_hybrid_breakpoint.
      
      Change-Id: If17dfad1756d82a77028ebdc4b305f9c8e1365ba
      Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
      Reviewed-on: http://openocd.zylin.com/4871
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
      fd8a3c95
  6. 13 Nov, 2018 1 commit
    • Christopher Head's avatar
      Permit null target on TCL connection · ea410488
      Christopher Head authored
      In previous versions of OpenOCD, it was possible to connect to the TCL
      RPC interface without a current target. In `tcl_new_connection`, the
      curent target would be queried by number, and the possibility of a null
      current target was handled properly.
      
      In commit bb9d9c60
      
      , the
      `get_target_by_num` call was replaced by a `get_current_target` call,
      without noticing that `get_current_target` aborts if there is no current
      target, whereas `tcl_new_connection` is perfectly able to handle that
      situation.
      
      Provide a `get_current_target_or_null` function for use by consumers who
      are OK with a null current target, and use it in `tcl_new_connection`.
      
      Change-Id: I06f7e1e149f1169e23c73ba328c7ad9f9425cc2a
      Signed-off-by: default avatarChristopher Head <chead@zaber.com>
      Reviewed-on: http://openocd.zylin.com/4730
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarTomas Vanek <vanekt@fbl.cz>
      Reviewed-by: default avatarFranck Jullien <franck.jullien@gmail.com>
      ea410488
  7. 16 Oct, 2018 2 commits
  8. 01 Oct, 2018 1 commit
    • Antonio Borneo's avatar
      gdb_server: avoid gdb server for virtual targets · 24654759
      Antonio Borneo authored
      
      
      Virtual targets, like mem_ap, do not or cannot implement the required
      functionality to accept a GDB connection. In the case of mem_ap, the
      method get_gdb_reg_list() is missing and a following connection from
      gdb causes OpenOCD to segfault.
      OpenOCD opens a GDB port for each target; it's always possible to
      connect, by mistake, GDB to one virtual target.
      
      Add a method to check if the target supports GDB connections (for the
      moment just checking if get_gdb_reg_list is implemented).
      Skip opening a gdb server for every targets that don't support GDB
      connections.
      
      Change-Id: Ia439a43efe1a9adbb1771cd9d252db8ffa32eb9d
      Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
      Reviewed-on: http://openocd.zylin.com/4676
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
      24654759
  9. 07 Sep, 2018 1 commit
    • Antonio Borneo's avatar
      gdb_server: add per target option "-gdb-port" · ab858feb
      Antonio Borneo authored
      
      
      The argument passed to global config command "gdb_port" is usually,
      but not always, a TCP port number. In case of multiple targets, this
      numeric value is used as the first port of a set of consecutive TCP
      ports assigned one per target.
      If the argument is not a numeric value (e.g. "pipe", "disabled", ...)
      then incrementing it for the next target has no sense.
      
      Add the option "-gdb-port number" to the commands "target create" and
      "$target_name configure" to override, for the specific target, the
      general global configuration.
      
      This permits to use a per target "-gdb-port disabled", when no gdb
      port is required for that specific target.
      
      It also makes possible to choose a custom TCP port number for each
      target, overriding the usual sequence of consecutive port numbers.
      
      Change-Id: I3b9a1910b28ab4bc757e839d0e5d08ffc29f7ab4
      Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
      Reviewed-on: http://openocd.zylin.com/4530
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarChristopher Head <chead@zaber.com>
      Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
      ab858feb
  10. 04 Jun, 2018 1 commit
    • Liviu Ionescu's avatar
      Rework/update ARM semihosting · 2517bae6
      Liviu Ionescu authored
      
      
      In 2016, ARM released the second edition of the semihosting specs
      ("Semihosting for AArch32 and AArch64"), adding support for 64-bits.
      
      To ease the reuse of the semihosting logic for other platforms
      (like RISC-V), the semihosting code was isolated from the ARM
      target and updated to the latest specs.
      
      The new code is already in use since January (in GNU MCU Eclipse
      OpenOCD) and no problems were reported, neither for ARM nor for
      RISC-V targets, after more than 7K downloads.
      
      The 2 new files were formatted with uncrustify.
      
      Change-Id: Ie84dbd86a547323bb8a5d24eab68fc7dad013d96
      Signed-off-by: default avatarLiviu Ionescu <ilg@livius.net>
      Reviewed-on: http://openocd.zylin.com/4518
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
      2517bae6
  11. 10 Apr, 2018 1 commit
    • Tomas Vanek's avatar
      target, flash: prepare infrastructure for multi-block blank check · eb8912ec
      Tomas Vanek authored
      
      
      'flash erase_check' command runs a check algorithm on a target
      if possible. The algorithm is run repeatedly for each flash sector.
      Unfortunately every start and stop of the algorithm impose not negligible
      overhead.
      In practice it means checking is faster than plain read only for
      sectors of size approx 4 kByte or bigger. And checking sectors
      as short as 512 bytes runs approx 4 times slower than plain read.
      
      The patch changes API call target_blank_check_memory() and related
      to take an array of sectors (or arbitrary memory blocks).
      
      Changes in target-specific checking routines are kept minimal.
      They use only the first block from the array and process it by
      the unchanged algorithm.
      
      default_flash_blank_check() routine repeats target_blank_check_memory()
      until all blocks are checked, so it works with both multi-block
      and single-block based checkers.
      
      Change-Id: I0e6c60f2d71364c9c07c09416b04de9268807f5e
      Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
      Reviewed-on: http://openocd.zylin.com/4297
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarAndreas Bolsch <hyphen0break@gmail.com>
      eb8912ec
  12. 30 Mar, 2018 3 commits
  13. 21 Feb, 2018 1 commit
  14. 12 Dec, 2017 1 commit
  15. 23 Apr, 2017 1 commit
  16. 10 Feb, 2017 2 commits
    • Matthias Welwarsky's avatar
      target: add -ctibase config option in addition to -dbgbase · df32af23
      Matthias Welwarsky authored
      
      
      Some vendors don't fully populate the ROM table, e.g. BCM2357 (used in
      Raspberry Pi 3) doesn't list CTI, however it is mandatory for halting
      an ARMv8 core and therefore it's always present (and required),
      regardless of the ROM table listing it or not.
      
      Change-Id: Ia18a4f1b5b931ccd19805b188ebf737c837c6b54
      Signed-off-by: default avatarMatthias Welwarsky <matthias.welwarsky@sysgo.com>
      df32af23
    • Dongxue Zhang's avatar
      target: Add 64-bit target address support · 47b8cf84
      Dongxue Zhang authored
      
      
      Define a target_addr_t type to support 32-bit and 64-bit addresses at
      the same time. Also define matching TARGET_PRI*ADDR format macros as
      well as a convenient TARGET_ADDR_FMT.
      
      In targets that are 32-bit (avr32, nds32, arm7/9/11, fm4, xmc1000)
      be least invasive by leaving the formatting unchanged apart from the
      type;
      for generic code adopt TARGET_ADDR_FMT as unified address format.
      
      Don't silently change gdb formatting here, leave that to later.
      
      Add COMMAND_PARSE_ADDRESS() macro to abstract the address type.
      Implement it using its own parse_target_addr() function, in the hopes
      of catching pointer type mismatches better.
      
      Add '--disable-target64' configure option to revert to previous 32-bit
      target address behavior.
      
      Change-Id: I2e91d205862ceb14f94b3e72a7e99ee0373a85d5
      Signed-off-by: default avatarDongxue Zhang <elta.era@gmail.com>
      Signed-off-by: default avatarDavid Ung <david.ung.42@gmail.com>
      [AF: Default to enabling (Paul Fertser), rename macros, simplify]
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarMatthias Welwarsky <matthias.welwarsky@sysgo.com>
      47b8cf84
  17. 08 Dec, 2016 2 commits
  18. 30 Oct, 2016 1 commit
    • Andreas Färber's avatar
      flash/nor: Add erased_value to drivers and pass it to targets · eaacb900
      Andreas Färber authored
      
      
      struct flash_driver has a default_padded_value field that is similar,
      but it can be changed by the user for the specific purpose of padding.
      
      Add a new erased_value field and initialize it for all targets,
      particularly stm32lx, xmc4xxx and virtual.
      
      Use this value in core.c:default_flash_mem_blank_check(), the slow path.
      
      Extend the target API to pass erased_value down to target code.
      Adding an argument ensures that we catch all callers.
      
      This allows us to merge xmc4xxx.c:xmc4xxx_blank_check_memory() into
      armv7m:armv7m_blank_check_memory().
      
      It further allows us to use default_flash_blank_check() in place of
      xmc4xxx.c:xmc4xxx_flash_blank_check(), adding a potential slow path
      fallback, as well as stm32lx:stm32lx_erase_check(), adding the potential
      armv7m fast path with fallback to default_flash_mem_blank_check().
      
      Fix a mips32 code comment while at it (zeroed -> erased).
      
      The armv4_5 and mips32 target implementations will now error out if an
      erase value other than 0xff is used, causing default_flash_blank_check()
      to fall back to the default_flank_mem_blank_check() slow path.
      
      Change-Id: I39323fbbc4b71c256cd567e439896d0245d4745f
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Reviewed-on: http://openocd.zylin.com/3497
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarTomas Vanek <vanekt@fbl.cz>
      eaacb900
  19. 17 Oct, 2016 1 commit
  20. 19 Jul, 2016 1 commit
  21. 24 May, 2016 2 commits
  22. 05 Sep, 2015 1 commit
  23. 17 May, 2015 1 commit
  24. 25 Mar, 2015 1 commit
  25. 09 Mar, 2015 3 commits
  26. 22 Sep, 2014 1 commit
  27. 17 Mar, 2014 1 commit
  28. 07 Mar, 2014 1 commit
    • Andreas Fritiofson's avatar
      stlink: Use callback to increase frequency of trace data sampling · 17fddb42
      Andreas Fritiofson authored
      
      
      The ST-LINK/V2 has limited internal buffering, such that trace data
      can be missed if the target is generating data at a rate quicker than
      the OpenOCD trace sampling. The issue of lost data is compounded since
      individual TPIU packets may be split across individual STLINK_TRACE_EP
      reads, and misleading results can occur if mid-packet loss occurs.
      
      This patch increases the frequency of checking for pending trace data
      with the aim of minimising such losses. Note: With the limited (I/O
      and memory) bandwidth of the ST-LINK/V2 there cannot, however, be a
      guarantee against trace data loss.
      
      The timer callback is only added when enabling tracing, and is removed
      when tracing is disabled.
      
      Change-Id: Ibde9794b77793d3068f88cb5c1a26f9ceadcbd8a
      Signed-off-by: default avatarJames G. Smith <jsmith@ecoscentric.com>
      Signed-off-by: default avatarAndreas Fritiofson <andreas.fritiofson@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1661
      Tested-by: jenkins
      17fddb42
  29. 01 Dec, 2013 1 commit
  30. 31 Oct, 2013 1 commit
  31. 07 Aug, 2013 2 commits
    • Hsiangkai Wang's avatar
      gdb_server: add target_debug_reason for program exit detection · 399561ea
      Hsiangkai Wang authored
      
      
      Currently, there is no way to notify gdb that program has exited.
      Add new target_debug_reason called DBG_REASON_EXIT to notify gdb
      the condition has occured. If the debug reason is DBG_REASON_EXIT,
      gdb_server will send 'W' packet to tell gdb the process has exited.
      
      Change-Id: I7a371da292716a3e6ac4cc2c31b009a651fe047a
      Signed-off-by: default avatarHsiangkai Wang <hsiangkai@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1242
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      399561ea
    • Hsiangkai Wang's avatar
      gdb_server: support File-I/O Remote Protocol Extension · 0a4c8990
      Hsiangkai Wang authored
      
      
      The File I/O remote protocol extension allows the target to use the
      host's file system and console I/O to perform various system calls.
      
      To use the function, targets need to prepare two callback functions:
      * get_gdb_finish_info: to get file I/O parameters from target
      * gdb_fileio_end: pass file I/O response to target
      
      As target is halted, gdb_server will try to get file-I/O information
      from target through target_get_gdb_fileio_info(). If the callback function
      returns ERROR_OK, gdb_server will initiate a file-I/O request to gdb.
      After gdb finishes system call, gdb will pass response of the system call
      to target through target_gdb_fileio_end() and continue to run(continue or step).
      
      To implement the function, I add a new data structure in struct target,
      called struct gdb_fileio_info, to record file I/O name and parameters.
      
      Details refer to GDB manual "File-I/O Remote Protocol Extension"
      
      Change-Id: I7f4d45e7c9e967b6d898dc79ba01d86bc46315d3
      Signed-off-by: default avatarHsiangkai Wang <hsiangkai@gmail.com>
      Reviewed-on: http://openocd.zylin.com/1102
      
      
      Tested-by: jenkins
      Reviewed-by: default avatarSpencer Oliver <spen@spen-soft.co.uk>
      0a4c8990