Alan Bowman [Wed, 25 Jul 2012 18:58:11 +0000 (19:58 +0100)]
Test the incoming debug_level, rather than the current.
The existing code tests the current debug_level for validity, allowing
the user to set it too high and never change it after that. The new
behaviour is to test the debug_level that the user has requested.
Based on ft2232.c but uses the MPSSE layer for low-level access, greatly
simplifying the JTAG logic. Remove all libftdi/FTD2XX code and all layout
specific code. Layout specifications are instead handled in Tcl.
Use a signal abstraction to enable Tcl configuration files to define
outputs for one or several FTDI GPIO. These outputs can then be
controlled using the ftdi_set_signal command. Special signal names are
reserved for nTRST, nSRST and LED (for blink) so that they, if defined,
will be used for their customary purpose.
Depending on the type of buffer attached to the FTDI GPIO, the outputs
have to be controlled differently. In order to support tristateable
signals such as nSRST, both a data GPIO and an output-enable GPIO can be
specified for each signal. The following output buffer configurations are
supported:
* Push-pull with one FTDI output as (non-)inverted data line
* Open drain with one FTDI output as (non-)inverted output-enable
* Tristate with one FTDI output as (non-)inverted data line and another
FTDI output as (non-)inverted output-enable
* Unbuffered, using the FTDI GPIO as a tristate output directly by
switching data and direction as necessary
The data and output-enables are specified as 16-bit bitmasks,
corresponding to the concatenation of the high and low FTDI GPIO
registers. To specify an unbuffered output, use the same bitmask
for both data and output-enable.
The adapter configuration file must also specify default values for the
FTDI data and direction GPIO registers, and the channel being used (if
different from 0).
Change-Id: I287a41d4c696cf5fc74eb10d5e63578b0dc7f826 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/452 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
This is a higher-level libftdi replacement for use when implementing
protocol drivers for FT2232, FT2232H or FT4232H. It takes care of device
open/close and, unlike libftdi, also MPSSE command abstraction, command
queueing, buffer handling and return data parsing.
The FTDI device is accessed through libusb-1.0 in asynchronous mode.
Change-Id: I051adb574dcc39f8ca9cd7f6dbe6ae4aeea5f4c8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/451 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Peter Stuge <peter@stuge.se>
Spencer Oliver [Wed, 27 Jun 2012 22:25:07 +0000 (23:25 +0100)]
target: detect correct Cortex-M tar auto increment size
The ADIv5 spec guarentees that tar_autoincr_block will be 10bits.
Make this the default for Cortex-M family until we detect a Cortex-M3/M4,
we then change autoincrement to 12bits.
Change-Id: Ie8c89134aa036879bdd8a3c312cee9715dbc6913 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/730 Tested-by: jenkins Reviewed-by: simon qian <simonqian.openocd@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Vandra Akos [Fri, 25 May 2012 01:02:55 +0000 (03:02 +0200)]
target.c, jim_target_md using command_print_sameline
jim_target_md is supposed to print out results with command_print in
hexdump format. It was using command_print which appends a newline character
aftre every invocation. Using command_print_sameline instead
Vandra Akos [Thu, 24 May 2012 13:17:34 +0000 (15:17 +0200)]
target/target.c, jim_target_md refractored
- Added a few lines of comment before the function explaining the usage and the
output generated by the command
- Added a few lines of comment in the body explaining what is happening to improve
code readability
- Renamed a few variables to improve readability:
* a -> addr
* b -> dwidth
* c -> count
- Added a new variable, named byte to contain the number of bytes to read, instead
of overwriting the count parameter, to avoid confusion between the two values.
Interface drivers regularly need to keep track of where each part of a long
read buffer should be copied, once that data arrives. Both source and
destination are often at an arbitrary bit offset.
This queued bit-level copy can help with that, by allowing the driver to
perform postponed reads from the receive buffer already when building the
transmit buffer, and have those reads executed at a later time when data is
available.
For simplicity, it uses the linked list implementation list.h imported from
the Linux kernel.
Mike Crowe [Tue, 29 May 2012 20:23:27 +0000 (15:23 -0500)]
topic: flash: description/id added for ATSAM3SD8C
New flash description for ATSAM3SD8C used on SAM3S-EK2 development boards. Name used
is "at91sam3sd8c" and chipid is 0x29ab0a60. Mirrors description of other similar parts.
Change-Id: I7fc4b82e7969451645ab067223663f08b76d866b Signed-off-by: Mike Crowe <mpcrowe@gmail.com>
Reviewed-on: http://openocd.zylin.com/684 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
In the previous iteration, the page counter for erases would not be updated with
the erase size. This patch keeps the page counter synced with the sector counter.
kinetis: update support for all program flash granularities
Updates the Kinetis NOR flash support to handle all known block and sector
sizes. Previously only 2kiB sectors were hard-coded, now all four known
combinations non-volatile sector sizes are supported.
The premise of separating Kinetis Program Flash (PFLASH) from FlexNVM is
also introduced. This means each "block" of flash (in Freescale terms) is
treated as a bank in OpenOCD. Correspondingly, the existing board
configuration for the TWR-K60M512 eval system is updated to recognize two
banks instead of one.
A board config for the TWR-K60F120M is also added.
Bank and sector erase and programming has been checked with both of the
mentioned eval boards.
Change-Id: Iae2d10ebf8f548d0a3698df5430bbbe1ccadc58a Signed-off-by: Christopher Kilgour <techie@whiterocker.com>
Reviewed-on: http://openocd.zylin.com/663 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Jan Dakinevich <jan.dakinevich@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Some versions of Segger's software do not select JTAG interface by default.
Do it in the intial setup.
Firmware version check code still present, with updated set of unsupported.
Note from Segger:
Alright, we were not aware of that OpenOCD does not select the interface
before it starts communicating with the target. A debugger should always
select the appropriate target interface before it starts communicating with the target,
since otherwise it could also happen that a previous session with another debugger
had selected SWD and the interface was not switched again by OpenOCD.
Change-Id: I5b4eab7e0e3625ec32be75a36d89e16d17e899bf Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/667 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
OpenOCD does not work with the latest firmware versions
of Segger J-Link.
Latest working version: V4.42c
Unsupported versions: 4.44 to 4.46f, 4.20 to 4.30
Older versions of firmware can be found here:
http://www.segger.com/j-link-older-versions.html
The firmware versions does not correspond directly with
"Software and documentation pack for Windows", it may be
distinguished by the "compile" date in the information string.
Print an warning message if unsupported firmware version detected.
Change-Id: Id7d1f965b8ce2fdbcd0026a85ddd093e2fa48720 Signed-off-by: Alexander Osipenko <sipych@gmail.com>
Reviewed-on: http://openocd.zylin.com/666 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Liviu Ionescu [Tue, 29 May 2012 11:52:04 +0000 (14:52 +0300)]
docs: J-Link commands added to the manual
The J-Link related commands and configuration commands were added
to the "8.2 Interface Drivers" section of the manual.
(previously they were enumerated as comments).
The 'jlink pid' was marked as Config all other as Command.
A draft of a compatibility note was added, but probably
a table would be more appropriate.
Liviu Ionescu [Tue, 29 May 2012 16:41:02 +0000 (19:41 +0300)]
tools: initial.sh fixed to accept spaces in current path
When changing the path to the hooks folder, the path needs to be
surrounded by quotation marks, to avoid failures when the current
path contains spaces (not only legal, but a common case on
Mac OS X).
Peter Stuge [Mon, 14 May 2012 15:47:09 +0000 (17:47 +0200)]
docs: Fix incorrect -rtos option values
Commit 9ca1592cb9fe4e61ee5bc327345fdfc254c9fe13 started on documentation
for the -rtos option, but some of the documented values were incorrect so
we'll clean up the mess here.
Spencer Oliver [Fri, 11 May 2012 08:39:58 +0000 (09:39 +0100)]
stlink: add armv7m stlink handling
This enables us to better handle some of the low level functions that the
stlink does not support. It also enables us to share a few more of the
standard cortex_m3 functions if necessary.
Change-Id: I7a2c57450122012ec189245d8879d8967913e00e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/637 Tested-by: jenkins
Aurelien Jacobs [Tue, 8 May 2012 18:53:18 +0000 (20:53 +0200)]
cfi: fix write_bank segfault with spansion flash on armv7m
cfi_spansion_write_block() passes an arm_algorithm struct to
target_run_algorithm() which in turn calls armv7m_start_algorithm()
which expect an armv7m_algorithm struct.
As armv7m_algorithm is bigger than arm_algorithm, when
armv7m_start_algorithm() writes in the struct, it overrun the buffer,
writting junk on the stack, which latter on generates a segfault.
This patch ensure we use a properly sized armv7m_algorithm struct
when the target is an armv7m.
Bill Traynor [Tue, 8 May 2012 13:32:35 +0000 (09:32 -0400)]
cfg: Deleted duplicate busblaster.cfg and renamed original.
The busblaster.cfg was contributed on April 23, 2012 and is a
duplicate of dp_busblaster.cfg that was contributed on Oct. 23,
2011. Therefore, deleting the second version. Also, renaming
the original dp_busblaster.cfg to simply busblaster.cfg, as this
name is more concise.
Change-Id: Iccb1f10f53dbbb248b1ff4c6295eaf67c32247c1 Signed-off-by: Bill Traynor <wmat@alphatroop.com>
Reviewed-on: http://openocd.zylin.com/622 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
Bill Traynor [Mon, 7 May 2012 18:38:16 +0000 (14:38 -0400)]
cfg: add default pid/vid pair to beaglebone board cfg.
The newer versions of BeagleBone boards use the default vid/pid
pair for FT2232 debugging. Please see the following README:
http://beagleboard.org/static/beaglebone/latest/README.htm
On revision A3/A4 boards, the VID/PID were chosen to match the
TI XDS100v2 (0x0403/0xA6D0). On A5 and newer revisions when we've
given the authors of CCS the chance to update their software, the
generic FTDI VID/PID (0x0403/0x6010) will be used to simplify
installation of drivers for systems already having those drivers.
Change-Id: I44228eb2029162f23d084eb05bcfef39e615668d Signed-off-by: Bill Traynor <wmat@alphatroop.com>
Reviewed-on: http://openocd.zylin.com/619 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
Spencer Oliver [Thu, 19 Apr 2012 14:51:14 +0000 (15:51 +0100)]
stlink: support srst reset
This adds the ability to support srst reset for the stlink/v2.
stlink/v1 will fallback to using SYSRESETREQ which is a full reset - including peripherals.
To enable the use of the srst add the following to your cfg:
reset_config srst_only
SAM3X - Added support for at91sam3x8h-ES, fixed CIDR for ES2 and production
The first available devkits for the at91sam3x8h had the ES device populated.
The ES device had an error in the CIDR, specifically in the last byte of
which the upper 3 bits identifies the chip family - cortex-m3, arm7tdmi etc.
The problem was fixed on the ES2 devices - Thanks to Pat Hickey for giving me
the heads-up.
Change-Id: I13dd7fbe0cffaf76f948188c9459dc3cf4435570 Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
Reviewed-on: http://openocd.zylin.com/575 Tested-by: jenkins Reviewed-by: Jim Norris <u17263@att.net> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
The SAM4S processors still suffer from the "6 waitstates needed
to program device" errata.
Other relevant changes are:
1. Address of flash memory starts at 0x400000.
2. EWP (Erase page and write page) only works for the first two 8KB "sectors"
3. Because of the EWP not working for all the sectors, normal page writes have
to be used. The default_flash_blank_check is used to check if lockregions
should be erased.
4. The EA (Erase All) command takes 7.3s to complete. (Previous timeout was
500 ms)
5. There are 128 lockable regions of 8KB each.
Implemented default blank checking, and page erase for load_image scenarios.
This is to compensate for the EWP flash commands only working on the
first 2 8KB sectors.