You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(37) |
Sep
|
Oct
|
Nov
|
Dec
|
From: David B. <dbr...@us...> - 2010-01-23 07:52:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 82c3c47825b25012fef60df0a8a89110337cd40d (commit) from b7fa16eeacb368dca8862168088bc6c491f0ffb1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 82c3c47825b25012fef60df0a8a89110337cd40d Author: David Brownell <dbr...@us...> Date: Fri Jan 22 22:49:42 2010 -0800 NEWS updates Summarize most ARM11 and Cortex-A8 updates as "acting much more like other ARMs", and mention code sharing. Clarify a few other points, including support for "reset-assert" on all ARMs except Cortex-M (which doesn't exactly need it). Signed-off-by: David Brownell <dbr...@us...> diff --git a/NEWS b/NEWS index c4abd13..f7bf1d3 100644 --- a/NEWS +++ b/NEWS @@ -13,25 +13,29 @@ Target Layer: General - new "reset-assert" event, for systems without SRST ARM + - supports "reset-assert" event (except on Cortex-M3) - renamed "armv4_5" command prefix as "arm" - recognize TrustZone "Secure Monitor" mode - "arm regs" command output changed - register names use "sp" not "r13" - add top-level "mcr" and "mrc" commands, replacing various core-specific operations - - basic semihosting support + - basic semihosting support (ARM7/ARM9 only, for now) ARM11 - - Preliminary ETM and ETB hookup - - accelerated "flash erase_check" - - accelerated GDB memory checksum - - support "arm regs" command - - can access all core modes and registers - - watchpoint support + - Should act much more like other ARM cores: + * Preliminary ETM and ETB hookup + * accelerated "flash erase_check" + * accelerated GDB memory checksum + * support "arm regs" command + * can access all core modes and registers + * watchpoint support + - Shares some core debug code with Cortex-A8 Cortex-A8 - - support "arm regs" command - - can access all core modes and registers - - supports "reset-assert" event (used on OMAP3530) - - watchpoint support + - Should act much more like other ARM cores: + * support "arm regs" command + * can access all core modes and registers + * watchpoint support + - Shares some core debug code with ARM11 Cortex-M3 - Exposed DWT registers like cycle counter - vector_catch settings not clobbered by resets ----------------------------------------------------------------------- Summary of changes: NEWS | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-23 07:37:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b7fa16eeacb368dca8862168088bc6c491f0ffb1 (commit) from 4960c9018f2560b11ede91cde8a68dc56c690159 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b7fa16eeacb368dca8862168088bc6c491f0ffb1 Author: David Brownell <dbr...@us...> Date: Fri Jan 22 22:37:15 2010 -0800 ARM11: fix breakpoints with GDB This fixes a bug whereby GDB's breakpoints weren't activated. The root cause is a confused interface to resume(). Fix by almost ignoring the "handle breakpoints" parameter; it only seems related to the case of skipping breakpoint-at-PC. Update a few coments to clarify what's happening. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm11.c b/src/target/arm11.c index 082930a..8b7b69c 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -498,12 +498,9 @@ static int arm11_resume(struct target *target, int current, if (!debug_execution) target_free_all_working_areas(target); - /* Set up breakpoints */ - if (handle_breakpoints) - { - /* check if one matches PC and step over it if necessary */ - - struct breakpoint * bp; + /* Should we skip over breakpoints matching the PC? */ + if (handle_breakpoints) { + struct breakpoint *bp; for (bp = target->breakpoints; bp; bp = bp->next) { @@ -514,9 +511,11 @@ static int arm11_resume(struct target *target, int current, break; } } + } - /* set all breakpoints */ - + /* activate all breakpoints */ + if (true) { + struct breakpoint *bp; unsigned brp_num = 0; for (bp = target->breakpoints; bp; bp = bp->next) @@ -542,7 +541,8 @@ static int arm11_resume(struct target *target, int current, arm11_sc7_set_vcr(arm11, arm11_vcr); } - arm11_leave_debug_state(arm11, handle_breakpoints); + /* activate all watchpoints and breakpoints */ + arm11_leave_debug_state(arm11, true); arm11_add_IR(arm11, ARM11_RESTART, TAP_IDLE); @@ -953,6 +953,7 @@ static int arm11_write_memory_inner(struct target *target, if (retval != ERROR_OK) return retval; + /* load r0 with buffer address */ /* MRC p14,0,r0,c0,c5,0 */ retval = arm11_run_instr_data_to_core1(arm11, 0xee100e15, address); if (retval != ERROR_OK) @@ -975,11 +976,13 @@ static int arm11_write_memory_inner(struct target *target, for (size_t i = 0; i < count; i++) { + /* load r1 from DCC with byte data */ /* MRC p14,0,r1,c0,c5,0 */ retval = arm11_run_instr_data_to_core1(arm11, 0xee101e15, *buffer++); if (retval != ERROR_OK) return retval; + /* write r1 to memory */ /* strb r1, [r0], #1 */ /* strb r1, [r0] */ retval = arm11_run_instr_no_data1(arm11, @@ -1002,11 +1005,13 @@ static int arm11_write_memory_inner(struct target *target, uint16_t value; memcpy(&value, buffer + i * sizeof(uint16_t), sizeof(uint16_t)); + /* load r1 from DCC with halfword data */ /* MRC p14,0,r1,c0,c5,0 */ retval = arm11_run_instr_data_to_core1(arm11, 0xee101e15, value); if (retval != ERROR_OK) return retval; + /* write r1 to memory */ /* strh r1, [r0], #2 */ /* strh r1, [r0] */ retval = arm11_run_instr_no_data1(arm11, @@ -1021,6 +1026,7 @@ static int arm11_write_memory_inner(struct target *target, } case 4: { + /* stream word data through DCC directly to memory */ /* increment: STC p14,c5,[R0],#4 */ /* no increment: STC p14,c5,[R0]*/ uint32_t instr = !no_increment ? 0xeca05e01 : 0xed805e00; ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-22 02:04:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 4960c9018f2560b11ede91cde8a68dc56c690159 (commit) via 08b0be94b5fd13a8afe4f070bc7b471cc5c3423d (commit) via f06148612be714f74174bb86fe95f49df07c32fa (commit) from 98f7c2127b8800e2597493eea2c7ba5c88940b86 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4960c9018f2560b11ede91cde8a68dc56c690159 Author: David Brownell <dbr...@us...> Date: Thu Jan 21 16:45:00 2010 -0800 Various doc/comment updates Doxygen: don't be needlessly verbose; alphabetically sort members TODO: add random bits; clarify which manuals are referenced ARM disassembler: mention a few opcodes that still aren't handled Signed-off-by: David Brownell <dbr...@us...> diff --git a/Doxyfile.in b/Doxyfile.in index f6e3ced..658f667 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -384,7 +384,7 @@ HIDE_SCOPE_NAMES = NO # will put a list of the files that are included by a file in the documentation # of that file. -SHOW_INCLUDE_FILES = YES +SHOW_INCLUDE_FILES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. @@ -403,7 +403,7 @@ SORT_MEMBER_DOCS = YES # by member name. If set to NO (the default) the members will appear in # declaration order. -SORT_BRIEF_DOCS = NO +SORT_BRIEF_DOCS = YES # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) @@ -692,13 +692,13 @@ SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. -INLINE_SOURCES = YES +INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. -STRIP_CODE_COMMENTS = NO +STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented diff --git a/TODO b/TODO index 41d3457..aa2277c 100644 --- a/TODO +++ b/TODO @@ -142,6 +142,8 @@ Once the above are completed: https://lists.berlios.de/pipermail/openocd-development/2009-May/006590.html - regression: "reset halt" between 729(works) and 788(fails): @par https://lists.berlios.de/pipermail/openocd-development/2009-July/009206.html +- registers + - add flush-value operation, call them all on resume/reset - mcr/mrc target->type support - missing from ARM920t, ARM966e, XScale. It's possible that the current syntax is unable to support read-modify-write @@ -170,10 +172,18 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html - Thumb2 single stepping: ARM1156T2 needs simulator support - Cortex A8 support (ML) - add target implementation (ML) +- Cortex M3 support + - when stepping, only write dirtied registers (be faster) + - when connecting to halted core, fetch registers (startup is quirky) - Generic ARM run_algorithm() interface - tagged struct wrapping ARM instructions and metadata - not revision-specific (current: ARMv4+ARMv5 -or- ARMv6 -or- ARMv7) - usable with at least arm_nandwrite() and generic CFI drivers +- ETM + - don't show FIFOFULL registers if they're not supported + - use comparators to get more breakpoints and watchpoints + - add "etm drivers" command + - trace driver init() via examine() paths only, not setup()/reset - MC1322x support (JW/DE?) - integrate and test support from JW (and DE?) - get working with a known good interface (i.e. not today's jlink) @@ -356,9 +366,11 @@ to complete: - Develop milestone and release guidelines, processes, and scripts. - Develop "style" guidelines (and scripts) for maintainers: - reviewing patches - - committing to Subversion -- Review The Guide for OpenOCD Users for documentation errors or omissions -- Update The Manual for OpenOCD Developers: + - committing to git +- Review Users' Guide for documentation errors or omissions + - "capture" and "ocd_find" commands + - "ocd_" prefix on various stuff +- Update Developer's Manual (doxygen output) - Add documentation describing the architecture of each module - Provide more Technical Primers to bootstrap contributor knowledge diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index 587131b..f02053f 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -50,6 +50,7 @@ * except as coprocessor 10/11 operations * * Most ARM instructions through ARMv6 are decoded, but some * of the post-ARMv4 opcodes may not be handled yet + * CPS, SDIV, UDIV, LDREX*, STREX*, QASX, ... * * NEON instructions are not understood (ARMv7-A) * * - Thumb/Thumb2 decoding commit 08b0be94b5fd13a8afe4f070bc7b471cc5c3423d Author: David Brownell <dbr...@us...> Date: Thu Jan 21 16:15:41 2010 -0800 User's Guide secton on target hardware setup Highlight the needs to properly jumper development boards; to make the OpenOCD configuration match the jumpering; and to have a usable "reset-init" method when debugging early boot code. Specific mention of the "ATX Mode" that seems useful on many i.MX boards, forcing NAND boot. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 05b6f4e..ee5c723 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -23,7 +23,7 @@ of the Open On-Chip Debugger (OpenOCD). @item Copyright @copyright{} 2007-2008 Spencer Oliver @email{spen@@spen-soft.co.uk} @item Copyright @copyright{} 2008 Oyvind Harboe @email{oyvind.harboe@@zylin.com} @item Copyright @copyright{} 2008 Duane Ellis @email{openocd@@duaneellis.com} -@item Copyright @copyright{} 2009 David Brownell +@item Copyright @copyright{} 2009-2010 David Brownell @end itemize @quotation @@ -1027,6 +1027,86 @@ various kinds of message. @end itemize +@section Target Hardware Setup + +Chip vendors often provide software development boards which +are highly configurable, so that they can support all options +that product boards may require. @emph{Make sure that any +jumpers or switches match the system configuration you are +working with.} + +Common issues include: + +@itemize @bullet + +@item @b{JTAG setup} ... +Boards may support more than one JTAG configuration. +Examples include jumpers controlling pullups versus pulldowns +on the nTRST and/or nSRST signals, and choice of connectors +(e.g. which of two headers on the base board, +or one from a daughtercard). +For some Texas Instruments boards, you may need to jumper the +EMU0 and EMU1 signals (which OpenOCD won't currently control). + +@item @b{Boot Modes} ... +Complex chips often support multiple boot modes, controlled +by external jumpers. Make sure this is set up correctly. +For example many i.MX boards from NXP need to be jumpered +to "ATX mode" to start booting using the on-chip ROM, when +using second stage bootloader code stored in a NAND flash chip. + +Such explicit configuration is common, and not limited to +booting from NAND. You might also need to set jumpers to +start booting using code loaded from an MMC/SD card; external +SPI flash; Ethernet, UART, or USB links; NOR flash; OneNAND +flash; some external host; or various other sources. + + +@item @b{Memory Addressing} ... +Boards which support multiple boot modes may also have jumpers +to configure memory addressing. One board, for example, jumpers +external chipselect 0 (used for booting) to address either +a large SRAM (which must be pre-loaded via JTAG), NOR flash, +or NAND flash. When it's jumpered to address NAND flash, that +board must also be told to start booting from on-chip ROM. + +Your @file{board.cfg} file may also need to be told this jumper +configuration, so that it can know whether to declare NOR flash +using @command{flash bank} or instead declare NAND flash with +@command{nand device}; and likewise which probe to perform in +its @code{reset-init} handler. + +A closely related issue is bus width. Jumpers might need to +distinguish between 8 bit or 16 bit bus access for the flash +used to start booting. + +@item @b{Peripheral Access} ... +Development boards generally provide access to every peripheral +on the chip, sometimes in multiple modes (such as by providing +multiple audio codec chips). +This interacts with software +configuration of pin multiplexing, where for example a +given pin may be routed either to the MMC/SD controller +or the GPIO controller. It also often interacts with +configuration jumpers. One jumper may be used to route +signals to an MMC/SD card slot or an expansion bus (which +might in turn affect booting); others might control which +audio or video codecs are used. + +@end itemize + +Plus you should of course have @code{reset-init} event handlers +which set up the hardware to match that jumper configuration. +That includes in particular any oscillator or PLL used to clock +the CPU, and any memory controllers needed to access external +memory and peripherals. Without such handlers, you won't be +able to access those resources without working target firmware +which can do that setup ... this can be awkward when you're +trying to debug that target firmware. Even if there's a ROM +bootloader which handles a few issues, it rarely provides full +access to all board-specific capabilities. + + @node Config File Guidelines @chapter Config File Guidelines commit f06148612be714f74174bb86fe95f49df07c32fa Author: David Brownell <dbr...@us...> Date: Thu Jan 21 13:39:22 2010 -0800 ADIv5 header cleanup (+ #defines) Update the comments about DP registers and some of the bitfields. Remove inappropriate (and unused) DP_ZERO declaration. Add some (currently unused) #defines needed for SWD protocol support, based on previous patches from Andreas Fritiofson and Simon Qian. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 675a173..861a13d 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -42,22 +42,42 @@ #define JTAG_ACK_OK_FAULT 0x2 #define JTAG_ACK_WAIT 0x1 +/* three-bit ACK values for SWD access (sent LSB first) */ +#define SWD_ACK_OK 0x4 +#define SWD_ACK_WAIT 0x2 +#define SWD_ACK_FAULT 0x1 + #define DPAP_WRITE 0 #define DPAP_READ 1 -/* A[3:0] for DP registers (for JTAG, stored in DPACC) */ -#define DP_ZERO 0 -#define DP_CTRL_STAT 0x4 -#define DP_SELECT 0x8 -#define DP_RDBUFF 0xC +/* A[3:0] for DP registers; A[1:0] are always zero. + * - JTAG accesses all of these via JTAG_DP_DPACC, except for + * IDCODE (JTAG_DP_IDCODE) and ABORT (JTAG_DP_ABORT). + * - SWD accesses these directly, sometimes needing SELECT.CTRLSEL + */ +#define DP_IDCODE 0 /* SWD: read */ +#define DP_ABORT 0 /* SWD: write */ +#define DP_CTRL_STAT 0x4 /* r/w */ +#define DP_WCR 0x4 /* SWD: r/w (mux CTRLSEL) */ +#define DP_RESEND 0x8 /* SWD: read */ +#define DP_SELECT 0x8 /* JTAG: r/w; SWD: write */ +#define DP_RDBUFF 0xC /* read-only */ + +/* Fields of the DP's AP ABORT register */ +#define DAPABORT (1 << 0) +#define STKCMPCLR (1 << 1) /* SWD-only */ +#define STKERRCLR (1 << 2) /* SWD-only */ +#define WDERRCLR (1 << 3) /* SWD-only */ +#define ORUNERRCLR (1 << 4) /* SWD-only */ /* Fields of the DP's CTRL/STAT register */ #define CORUNDETECT (1 << 0) #define SSTICKYORUN (1 << 1) /* 3:2 - transaction mode (e.g. pushed compare) */ +#define SSTICKYCMP (1 << 4) #define SSTICKYERR (1 << 5) -#define READOK (1 << 6) -#define WDATAERR (1 << 7) +#define READOK (1 << 6) /* SWD-only */ +#define WDATAERR (1 << 7) /* SWD-only */ /* 11:8 - mask lanes for pushed compare or verify ops */ /* 21:12 - transaction counter */ #define CDBGRSTREQ (1 << 26) ----------------------------------------------------------------------- Summary of changes: Doxyfile.in | 8 ++-- TODO | 18 +++++++- doc/openocd.texi | 82 ++++++++++++++++++++++++++++++++++++++++- src/target/arm_adi_v5.h | 34 +++++++++++++--- src/target/arm_disassembler.c | 1 + 5 files changed, 128 insertions(+), 15 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-21 16:22:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 98f7c2127b8800e2597493eea2c7ba5c88940b86 (commit) from dfba7fa949ae12089aa02dab557a46520c816d28 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 98f7c2127b8800e2597493eea2c7ba5c88940b86 Author: Ãyvind Harboe <oyv...@zy...> Date: Thu Jan 21 10:16:42 2010 +0100 target: print reason why GDB halts If GDB halts unexpectedly, print reason: srst assert or power out detected. If polling fails, then things are a bit trickier. We do not want to spam telnet or the log with polling failed messages. Leave that case be w/a comment in a code for now. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index ff5aef3..1eb65a6 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1767,6 +1767,7 @@ static int handle_target(void *priv) int did_something = 0; if (runSrstAsserted) { + LOG_INFO("Waking up GDB, srst asserted detected."); target_call_event_callbacks_all(TARGET_EVENT_GDB_HALT); Jim_Eval(interp, "srst_asserted"); did_something = 1; @@ -1778,6 +1779,7 @@ static int handle_target(void *priv) } if (runPowerDropout) { + LOG_INFO("Waking up GDB, power dropout detected."); target_call_event_callbacks_all(TARGET_EVENT_GDB_HALT); Jim_Eval(interp, "power_dropout"); did_something = 1; @@ -1820,6 +1822,14 @@ static int handle_target(void *priv) /* polling may fail silently until the target has been examined */ if ((retval = target_poll(target)) != ERROR_OK) { + /* FIX!!!!! If we add a LOG_INFO() here to output a line in GDB + * *why* we are aborting GDB, then we'll spam telnet when the + * poll is failing persistently. + * + * If we could implement an event that detected the + * target going from non-pollable to pollable, we could issue + * an error only upon the transition. + */ target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); return retval; } ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-21 15:59:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via dfba7fa949ae12089aa02dab557a46520c816d28 (commit) via bc088b302bd0bb43cc9097a9f0b2e7369b0e04e2 (commit) from 1350b6aad074c1556604c5969dee43f294371461 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dfba7fa949ae12089aa02dab557a46520c816d28 Author: Edgar Grimberg <edg...@zy...> Date: Thu Jan 21 12:08:19 2010 +0100 interface: Changed parport address to LPT1 Changed the parport address to LPT1, since it's the most obvious default value. Signed-off-by: Edgar Grimberg <edg...@zy...> diff --git a/tcl/interface/parport.cfg b/tcl/interface/parport.cfg index 22be8f3..0f18ce9 100644 --- a/tcl/interface/parport.cfg +++ b/tcl/interface/parport.cfg @@ -1,10 +1,8 @@ # -# Parallel port wiggler (many clones available) on port 0xc8b8 +# Parallel port wiggler (many clones available) on port 0x378 # -# REVISIT this address seems very wrong. -# Surely 0x378/LPT1 or 0x278/LPT2 ... +# Addresses: 0x378/LPT1 or 0x278/LPT2 ... interface parport -parport_port 0xc8b8 +parport_port 0x378 parport_cable wiggler - commit bc088b302bd0bb43cc9097a9f0b2e7369b0e04e2 Author: Edgar Grimberg <edg...@zy...> Date: Thu Jan 21 13:42:25 2010 +0100 target: Fixed format problem for mdh Fixed format problem for mdh. It needs to display 4 chars. Signed-off-by: Edgar Grimberg <edg...@zy...> diff --git a/src/target/target.c b/src/target/target.c index c56265c..ff5aef3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2170,7 +2170,7 @@ static void handle_md_output(struct command_context *cmd_ctx, const char *value_fmt; switch (size) { case 4: value_fmt = "%8.8x "; break; - case 2: value_fmt = "%4.2x "; break; + case 2: value_fmt = "%4.4x "; break; case 1: value_fmt = "%2.2x "; break; default: /* "can't happen", caller checked */ ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 2 +- tcl/interface/parport.cfg | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-21 15:57:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 1350b6aad074c1556604c5969dee43f294371461 (commit) from 60cb5bdd30ec3265cbb5c1c667f5c98cbbb84aab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1350b6aad074c1556604c5969dee43f294371461 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jan 20 23:36:57 2010 +0100 gdb_server: handle stepi/continue packet while target is running with more grace Rather than issuing a halt and then stepi/resume, just wait for target to halt. Issue a sterner warning via gdb console that any gdb register changes will be ignored in this case. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index f3e0575..17ca439 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2212,12 +2212,13 @@ static int gdb_input_inner(struct connection *connection) log_add_callback(gdb_log_callback, connection); bool nostep = false; + bool already_running = false; if (target->state == TARGET_RUNNING) { - LOG_WARNING("The target is already running. Halt target before stepi/continue."); - retval = target_halt(target); - if (retval == ERROR_OK) - retval = target_wait_state(target, TARGET_HALTED, 100); + LOG_WARNING("WARNING! The target is already running. " + "All changes GDB did to registers will be discarded! " + "Waiting for target to halt."); + already_running = true; } else if (target->state != TARGET_HALTED) { LOG_WARNING("The target is not in the halted nor running stated, stepi/continue ignored."); @@ -2233,7 +2234,7 @@ static int gdb_input_inner(struct connection *connection) } gdb_con->sync = false; - if ((retval!=ERROR_OK) || nostep) + if ((retval!=ERROR_OK) || (!already_running && nostep)) { /* Either the target isn't in the halted state, then we can't * step/continue. This might be early setup, etc. @@ -2253,11 +2254,15 @@ static int gdb_input_inner(struct connection *connection) */ gdb_con->frontend_state = TARGET_RUNNING; target_call_event_callbacks(target, TARGET_EVENT_GDB_START); - int retval = gdb_step_continue_packet(connection, target, packet, packet_size); - if (retval != ERROR_OK) + + if (!already_running) { - /* we'll never receive a halted condition... issue a false one.. */ - gdb_frontend_halted(target, connection); + int retval = gdb_step_continue_packet(connection, target, packet, packet_size); + if (retval != ERROR_OK) + { + /* we'll never receive a halted condition... issue a false one.. */ + gdb_frontend_halted(target, connection); + } } } } ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-21 08:22:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 60cb5bdd30ec3265cbb5c1c667f5c98cbbb84aab (commit) from dbecb13b240867e12e43dba032a45891000bffe9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 60cb5bdd30ec3265cbb5c1c667f5c98cbbb84aab Author: Ãyvind Harboe <oyv...@zy...> Date: Thu Jan 21 08:11:39 2010 +0100 ecos: add missing PRId8 definition Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/types.h b/src/helper/types.h index 03ab5f0..1010dcd 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -172,6 +172,7 @@ static inline void h_u16_to_be(uint8_t* buf, int val) #define SCNx32 "x" #define PRIi32 "i" #define PRIu32 "u" +#define PRId8 PRId32 typedef CYG_ADDRWORD intptr_t; typedef int64_t intmax_t; ----------------------------------------------------------------------- Summary of changes: src/helper/types.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-01-21 00:12:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via dbecb13b240867e12e43dba032a45891000bffe9 (commit) from 2a0c9b08d7ee0c1b0eb5b593d18f68d0c910927d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dbecb13b240867e12e43dba032a45891000bffe9 Author: Spencer Oliver <nt...@us...> Date: Wed Jan 20 23:09:20 2010 +0000 BUILD: remove cygwin gcc 3.4.4 build warnings Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 762e318..adce4d9 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -1675,8 +1675,8 @@ static int cortex_m3_examine(struct target *target) return retval; if (((cpuid >> 4) & 0xc3f) == 0xc23) - LOG_DEBUG("Cortex-M3 r%dp%d processor detected", - (cpuid >> 20) & 0xf, (cpuid >> 0) & 0xf); + LOG_DEBUG("Cortex-M3 r%" PRId8 "p%" PRId8 " processor detected", + (uint8_t)((cpuid >> 20) & 0xf), (uint8_t)((cpuid >> 0) & 0xf)); LOG_DEBUG("cpuid: 0x%8.8" PRIx32 "", cpuid); /* NOTE: FPB and DWT are both optional. */ diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 11d5a43..7d91d42 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -968,7 +968,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are /* write program into RAM */ mips32_pracc_write_mem32(ejtag_info, source->address, ARRAY_SIZE(handler_code), handler_code); - LOG_DEBUG("%s using 0x%.8x for write handler\n", __func__, source->address); + LOG_DEBUG("%s using 0x%.8" PRIx32 " for write handler\n", __func__, source->address); jmp_code[1] |= UPPER16(source->address); jmp_code[2] |= LOWER16(source->address); diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 1a65c50..5f5aa72 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -981,7 +981,7 @@ int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t int retval; int write = 1; - LOG_DEBUG("address: 0x%8.8x, count: 0x%8.8x", address, count); + LOG_DEBUG("address: 0x%8.8" PRIx32 ", count: 0x%8.8" PRIx32 "", address, count); if (target->state != TARGET_HALTED) { ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m3.c | 4 ++-- src/target/mips32_pracc.c | 2 +- src/target/mips_m4k.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 20:08:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 2a0c9b08d7ee0c1b0eb5b593d18f68d0c910927d (commit) from 22d25e69213c49395ee0d40f6cc1eda935873ed2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2a0c9b08d7ee0c1b0eb5b593d18f68d0c910927d Author: David Brownell <dbr...@us...> Date: Wed Jan 20 11:07:42 2010 -0800 Cortex-M3 vector_catch testing support The "cm3-ftest.cfg" can be used to verify that OpenOCD handles certain faults correctly: - Test #1: it ignores faults that it wasn't told to catch - Test #2: if vector_catch is told to catch, it catches The "fault.c" generates ASM code to trigger faults, while the config script loads and runs pre-compiled code. This covers most, but not all, of the vector_catch options. Signed-off-by: David Brownell <dbr...@us...> diff --git a/testing/examples/cortex/cm3-ftest.cfg b/testing/examples/cortex/cm3-ftest.cfg new file mode 100644 index 0000000..2dae249 --- /dev/null +++ b/testing/examples/cortex/cm3-ftest.cfg @@ -0,0 +1,143 @@ +# +# For each named Cortex-M3 vector_catch flag VECTOR ... +# bus_err state_err +# chk_err nocp_err +# mm_err reset +# +# BUT NYET hard_err, int_err (their test cases don't yet work) ... +# +# Do the following: +# +# - Test #1: verify that OpenOCD ignores exceptions by default +# + l_VECTOR (loads testcase to RAM) +# + fault triggers loop-to-self exception "handler" +# + "halt" +# + observe fault "handling" -- loop-to-self from load_and_run (below) +# +# - Test #2: verify that "vector_catch" makes OpenOCD stops ignoring them +# + cortex_m3 vector_catch none +# + cortex_m3 vector_catch VECTOR +# + l_VECTOR (loads testcase to RAM) +# + fault triggers vector catch hardware +# + observe OpenOCD entering debug state with no assistance +# +# NOTE "reset" includes the NVIC, so that test case gets its reset vector +# from the flash, not from the vector table set up here. Which means that +# for that vector_catch option, the Test #1 (above) "observe" step won't +# use the SRAM address. +# + +# we can fully automate test #2 +proc vector_test {tag} { + halt + # REVISIT -- annoying, we'd like to scrap vector_catch output + cortex_m3 vector_catch none + cortex_m3 vector_catch $tag + eval "l_$tag" +} + +# +# Load and start one vector_catch test case. +# +# name -- tag for the vector_catch flag being tested +# halfwords -- array of instructions (some wide, some narrow) +# n_instr -- how many instructions are in $halfwords +# +proc load_and_run { name halfwords n_instr } { + reset halt + + # Load code at beginning of SRAM. + echo "# code to trigger $name vector" + set addr 0x20000000 + + # ocd_array2mem should be faster, though we'd need to + # compute the resulting $addr ourselves + foreach opcode $halfwords { + mwh $addr $opcode + incr addr 2 + } + + # create default loop-to-self at $addr ... it serves as + # (a) "main loop" on error + # (b) handler for all exceptions that get triggered + mwh $addr 0xe7fe + + # disassemble, as sanity check and what's-happening trace + cortex_m3 disassemble 0x20000000 [expr 1 + $n_instr ] + + # Assume that block of code is at most 16 halfwords long. + # Create a basic table of loop-to-self exception handlers. + mww 0x20000020 $addr 16 + # Store its address in VTOR + mww 0xe000ed08 0x20000020 + # Use SHCSR to ensure nothing escalates to a HardFault + mww 0xe000ed24 0x00070000 + + # now start, trigering the $name vector catch logic + resume 0x20000000 +} + +#proc l_hard_err {} { +# IMPLEMENT ME +# FORCED -- escalate something to HardFault +#} + +#proc l_int_err {} { +# IMPLEMENT ME +# STKERR -- exception stack BusFault +#} + +# BusFault, escalates to HardFault +proc l_bus_err {} { + # PRECISERR -- assume less than 512 MBytes of SRAM + load_and_run bus_err { + 0xf06f 0x4040 + 0x7800 + } 2 +} + +# UsageFault, escalates to HardFault +proc l_state_err {} { + # UNDEFINSTR -- issue architecturally undefined instruction + load_and_run state_err { + 0xde00 + } 1 +} + +# UsageFault, escalates to HardFault +proc l_chk_err {} { + # UNALIGNED -- LDM through unaligned pointer + load_and_run chk_err { + 0xf04f 0x0001 + 0xe890 0x0006 + } 2 +} + +# UsageFault, escalates to HardFault +proc l_nocp_err {} { + # NOCP -- issue cp14 DCC instruction + load_and_run nocp_err { + 0xee10 0x0e15 + } 1 +} + +# MemManage, escalates to HardFault +proc l_mm_err {} { + # IACCVIOL -- instruction fetch from an XN region + load_and_run mm_err { + 0xf04f 0x4060 + 0x4687 + } 2 +} + +proc l_reset {} { + # issue SYSRESETREQ via AIRCR + load_and_run reset { + 0xf04f 0x0104 + 0xf2c0 0x51fa + 0xf44f 0x406d + 0xf100 0x000c + 0xf2ce 0x0000 + 0x6001 + } 6 +} diff --git a/testing/examples/cortex/fault.c b/testing/examples/cortex/fault.c new file mode 100644 index 0000000..9a5fe19 --- /dev/null +++ b/testing/examples/cortex/fault.c @@ -0,0 +1,152 @@ +/* + * COMPILE: arm-none-eabi-gcc -mthumb -march=armv7-m ... + * ... plus, provide at least a default exception vector table. + * + * RUN: this is best run from SRAM. It starts at main() then triggers + * a fault before more than a handful of instructions have executed. + * Run each test case in two modes: + * + * (1) Faults caught on the Cortex-M3. Default handlers are usually + * loop-to-self NOPs, so a debugger won't notice faults until they + * halt the core and examine xSPR and other registers. + * + * To verify the fault triggered, issue "halt" from OpenOCD; you + * should be told about the fault and (some of) its details. + * Then it's time to run the next test. + * + * NOTE however that "reset" will restart everything; verify that + * case by observing your reset handler doing its normal work. + * + * (2) Faults intercepted by OpenOCD "vector_catch ..." commands. + * + * OpenOCD should tell you about the fault, and show the same + * details, without your "halt" command. + * + * Someday, a fancy version of this code could provide a vector table and + * fault handlers which use semihosting (when that works on Cortex-M3) to + * report what happened, again without needing a "halt" command. + */ + + +/* These symbols match the OpenOCD "cortex_m3 vector_catch" bit names. */ +enum vc_case { + hard_err, + int_err, + bus_err, + state_err, + chk_err, + nocp_err, + mm_err, + reset, +}; + +/* REVISIT come up with a way to avoid recompiling, maybe: + * - write it in RAM before starting + * - compiled-in BKPT, manual patch of r0, then resume + * - ... + */ + +#ifndef VC_ID +#warning "no VC_ID ... using reset" +#define VC_ID reset +#endif + +int main(void) __attribute__ ((externally_visible, noreturn)); + +/* + * Trigger various Cortex-M3 faults to verify that OpenOCD behaves OK + * in terms of its vector_catch handling. + * + * Fault handling should be left entirely up to the application code + * UNLESS a "vector_catch" command tells OpenOCD to intercept a fault. + * + * See ARMv7-M architecure spec table B1-9 for the list of faults and + * their mappings to the vector catch bits. + */ +int main(void) +{ + /* One test case for each vector catch bit. We're not doing + * hardware testing; so it doesn't matter when some DEMCR bits + * could apply in multiple ways. + */ + switch (VC_ID) { + + /* "cortex_m3 vector_catch hard_err" */ + case hard_err: + /* FORCED - Fault escalation */ + + /* FIXME code this */ + break; + + /* "cortex_m3 vector_catch int_err" */ + case int_err: + /* STKERR -- Exception stack BusFault */ + + /* FIXME code this */ + break; + + /* "cortex_m3 vector_catch bus_err" */ + case bus_err: + /* PRECISERR -- precise data bus read + * Here we assume a Cortex-M3 with 512 MBytes SRAM is very + * unlikely, so the last SRAM byte isn't a valid address. + */ + __asm__ volatile( + "mov r0, #0x3fffffff\n" + "ldrb r0, [r0]\n" + ); + break; + + /* "cortex_m3 vector_catch state_err" */ + case state_err: + /* UNDEFINSTR -- architectural undefined instruction */ + __asm__ volatile(".hword 0xde00"); + break; + + /* "cortex_m3 vector_catch chk_err" */ + case chk_err: + /* UNALIGNED ldm */ + __asm__ volatile( + "mov r0, #1\n" + "ldm r0, {r1, r2}\n" + ); + break; + + /* "cortex_m3 vector_catch nocp_err" */ + case nocp_err: + /* NOCP ... Cortex-M3 has no coprocessors (like CP14 DCC), + * but these instructions are allowed by ARMv7-M. + */ + __asm__ volatile("mrc p14, 0, r0, c0, c5, 0"); + break; + + /* "cortex_m3 vector_catch mm_err" */ + case mm_err: + /* IACCVIOL -- instruction fetch from an XN region */ + __asm__ volatile( + "mov r0, #0xe0000000\n" + "mov pc, r0\n" + ); + break; + + /* "cortex_m3 vector_catch reset" */ + case reset: + __asm__ volatile( + /* r1 = SYSRESETREQ */ + "mov r1, #0x0004\n" + /* r1 |= VECTKEY */ + "movt r1, #0x05fa\n" + /* r0 = &AIRCR */ + "mov r0, #0xed00\n" + "add r0, #0xc\n" + "movt r0, #0xe000\n" + /* AIRCR = ... */ + "str r1, [r0, #0]\n" + ); + break; + } + + /* don't return */ + while (1) + continue; +} ----------------------------------------------------------------------- Summary of changes: testing/examples/cortex/cm3-ftest.cfg | 143 +++++++++++++++++++++++++++++++ testing/examples/cortex/fault.c | 152 +++++++++++++++++++++++++++++++++ 2 files changed, 295 insertions(+), 0 deletions(-) create mode 100644 testing/examples/cortex/cm3-ftest.cfg create mode 100644 testing/examples/cortex/fault.c hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 19:47:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 22d25e69213c49395ee0d40f6cc1eda935873ed2 (commit) via 6f2b88448fff59d00f625d0d361a7b9abf6bd673 (commit) from d036f1700171e0f8056d616a198f17b9be5719e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 22d25e69213c49395ee0d40f6cc1eda935873ed2 Author: David Brownell <dbr...@us...> Date: Wed Jan 20 10:46:53 2010 -0800 board configs -- unique names for flash chips Don't give the same names to both flash chips on two OMAP boards. For OSK, enable DCC downloads (removing a warning). Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/board/omap2420_h4.cfg b/tcl/board/omap2420_h4.cfg index 12efa05..d789e25 100644 --- a/tcl/board/omap2420_h4.cfg +++ b/tcl/board/omap2420_h4.cfg @@ -8,7 +8,5 @@ reset_config trst_and_srst separate # Board configs can vary a *LOT* ... parts, jumpers, etc. # This GP board boots from cs0 using NOR (2x32M), and also # has 64M NAND on cs6. -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x04000000 0x02000000 2 2 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x06000000 0x02000000 2 2 $_TARGETNAME +flash bank h4.u10 cfi 0x04000000 0x02000000 2 2 $_TARGETNAME +flash bank h4.u11 cfi 0x06000000 0x02000000 2 2 $_TARGETNAME diff --git a/tcl/board/osk5912.cfg b/tcl/board/osk5912.cfg index c33ae28..f4378f8 100644 --- a/tcl/board/osk5912.cfg +++ b/tcl/board/osk5912.cfg @@ -19,10 +19,8 @@ etm_dummy config $_TARGETNAME # standard boards populate two 16 MB chips, but manufacturing # options or an expansion board could change this config. -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x00000000 0x01000000 2 2 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME cfi 0x01000000 0x01000000 2 2 $_TARGETNAME +flash bank osk.u1 cfi 0x00000000 0x01000000 2 2 $_TARGETNAME +flash bank osk.u2 cfi 0x01000000 0x01000000 2 2 $_TARGETNAME proc osk5912_init {} { omap5912_reset @@ -32,3 +30,5 @@ proc osk5912_init {} { flash probe 1 } $_TARGETNAME configure -event reset-init { osk5912_init } + +arm7_9 dcc_downloads enable commit 6f2b88448fff59d00f625d0d361a7b9abf6bd673 Author: David Brownell <dbr...@us...> Date: Wed Jan 20 10:43:32 2010 -0800 gdb_server: correctly report flash sector sizes Report each region of same-size sectors separately, instead of incorrectly reporting that every sector has the same size. This is a longstanding bug on NOR flash chips with non-uniform sector sizes. It was largely hidden by other bugs in flash handling. When some of those were recently fixed, this one was exposed as a regression on str710. [oyv...@zy...: update the loop to behave on str7 ] Signed-off-by: Ãyvind Harboe <oyv...@zy...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 6ed7243..f3e0575 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1613,22 +1613,6 @@ static int decode_xfer_read(char *buf, char **annex, int *ofs, unsigned int *len return 0; } -static int gdb_calc_blocksize(struct flash_bank *bank) -{ - uint32_t i; - uint32_t block_size = 0xffffffff; - - /* loop through all sectors and return smallest sector size */ - - for (i = 0; i < (uint32_t)bank->num_sectors; i++) - { - if (bank->sectors[i].size < block_size) - block_size = bank->sectors[i].size; - } - - return block_size; -} - static int compare_bank (const void * a, const void * b) { struct flash_bank *b1, *b2; @@ -1666,7 +1650,6 @@ static int gdb_memory_map(struct connection *connection, int offset; int length; char *separator; - int blocksize; uint32_t ram_start = 0; int i; @@ -1683,6 +1666,7 @@ static int gdb_memory_map(struct connection *connection, * it has no concept of non-cacheable read/write memory (i/o etc). * * FIXME Most non-flash addresses are *NOT* RAM! Don't lie. + * Current versions of GDB assume unlisted addresses are RAM... */ banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count()); @@ -1701,29 +1685,60 @@ static int gdb_memory_map(struct connection *connection, compare_bank); for (i = 0; i < flash_get_bank_count(); i++) { + int j; + unsigned sector_size = 0; + uint32_t start, end; + p = banks[i]; + start = p->base; + end = p->base + p->size; if (ram_start < p->base) xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" " "length=\"0x%x\"/>\n", - ram_start, p->base-ram_start); + ram_start, p->base - ram_start); - /* If device has uneven sector sizes, eg. str7, lpc - * we pass the smallest sector size to gdb memory map - * - * FIXME Don't lie about flash regions with different - * sector sizes; just tell GDB about each region as - * if it were a separate flash device. + /* Report adjacent groups of same-size sectors. So for + * example top boot CFI flash will list an initial region + * with several large sectors (maybe 128KB) and several + * smaller ones at the end (maybe 32KB). STR7 will have + * regions with 8KB, 32KB, and 64KB sectors; etc. */ - blocksize = gdb_calc_blocksize(p); + for (j = 0; j < p->num_sectors; j++) { + unsigned group_len; + + /* Maybe start a new group of sectors. */ + if (sector_size == 0) { + start = p->base + p->sectors[j].offset; + xml_printf(&retval, &xml, &pos, &size, + "<memory type=\"flash\" " + "start=\"0x%x\" ", + start); + sector_size = p->sectors[j].size; + } + + /* Does this finish a group of sectors? + * If not, continue an already-started group. + */ + if (j == p->num_sectors -1) + group_len = (p->base + p->size) - start; + else if (p->sectors[j + 1].size != sector_size) + group_len = p->base + p->sectors[j + 1].offset + - start; + else + continue; + + xml_printf(&retval, &xml, &pos, &size, + "length=\"0x%x\">\n" + "<property name=\"blocksize\">" + "0x%x</property>\n" + "</memory>\n", + group_len, + sector_size); + sector_size = 0; + } - xml_printf(&retval, &xml, &pos, &size, - "<memory type=\"flash\" start=\"0x%x\" " - "length=\"0x%x\">\n" \ - "<property name=\"blocksize\">0x%x</property>\n" \ - "</memory>\n", \ - p->base, p->size, blocksize); ram_start = p->base + p->size; } ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 77 +++++++++++++++++++++++++++------------------ tcl/board/omap2420_h4.cfg | 6 +-- tcl/board/osk5912.cfg | 8 ++-- 3 files changed, 52 insertions(+), 39 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 19:33:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d036f1700171e0f8056d616a198f17b9be5719e0 (commit) from 87cb29dcfe1e6900620319c3f90ed67f8ebefa0e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d036f1700171e0f8056d616a198f17b9be5719e0 Author: Michael Grzeschik <m.g...@pe...> Date: Wed Jan 20 19:06:13 2010 +0100 tcl/target/at91sam3u4e.cfg: changed case in dependent file openocd does not start with the target configfile due to the case in the dependent config file. Signed-off-by: Michael Grzeschik <m.g...@pe...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/target/at91sam3u4e.cfg b/tcl/target/at91sam3u4e.cfg index 242b53e..e549185 100644 --- a/tcl/target/at91sam3u4e.cfg +++ b/tcl/target/at91sam3u4e.cfg @@ -1,5 +1,5 @@ # common stuff -source [find target/at91sam3uxx.cfg] +source [find target/at91sam3uXX.cfg] # size is automatically "calculated" by probing set _FLASHNAME $_CHIPNAME.flash ----------------------------------------------------------------------- Summary of changes: tcl/target/at91sam3u4e.cfg | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-20 15:12:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 87cb29dcfe1e6900620319c3f90ed67f8ebefa0e (commit) from ff976cdb29686ae9aa47687c35402c66978956d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 87cb29dcfe1e6900620319c3f90ed67f8ebefa0e Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jan 20 15:11:09 2010 +0100 testing: fix str710 test case now builds Make the test case easily adjustable in size. str710 has very peculiar flash sector layout, nice for testing, but a larget test_rom.elf is required. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/testing/examples/STR710Test/.gitignore b/testing/examples/STR710Test/.gitignore new file mode 100644 index 0000000..a2d3f5a --- /dev/null +++ b/testing/examples/STR710Test/.gitignore @@ -0,0 +1,2 @@ +.dep +src/main.lst diff --git a/testing/examples/STR710Test/prj/hitex_str7_ram.ld b/testing/examples/STR710Test/prj/hitex_str7_ram.ld index 7ea221a..a0b2a3c 100644 --- a/testing/examples/STR710Test/prj/hitex_str7_ram.ld +++ b/testing/examples/STR710Test/prj/hitex_str7_ram.ld @@ -82,17 +82,17 @@ SECTIONS { *(.init) *(.fini) - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } >DATA . = ALIGN(4); diff --git a/testing/examples/STR710Test/prj/hitex_str7_rom.ld b/testing/examples/STR710Test/prj/hitex_str7_rom.ld index c5c4de4..11ac4b6 100644 --- a/testing/examples/STR710Test/prj/hitex_str7_rom.ld +++ b/testing/examples/STR710Test/prj/hitex_str7_rom.ld @@ -83,17 +83,17 @@ SECTIONS { *(.init) *(.fini) - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__preinit_array_end = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__init_array_end = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } >CODE . = ALIGN(4); diff --git a/testing/examples/STR710Test/src/main.c b/testing/examples/STR710Test/src/main.c index 99f2d26..c60b9f6 100644 --- a/testing/examples/STR710Test/src/main.c +++ b/testing/examples/STR710Test/src/main.c @@ -41,6 +41,20 @@ */ #include "typedefs.h" +/* Increase the size of this dummy global data to create a larger ROM image */ +static const char test[] = + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa" + "ljasdfljkasdfljsaflsjadflksjadflksjadfasdfsadfsa"; + + + /*=========================================================================*/ /* DEFINE: All Structures and Common Constants */ /*=========================================================================*/ ----------------------------------------------------------------------- Summary of changes: testing/examples/STR710Test/.gitignore | 2 ++ testing/examples/STR710Test/prj/hitex_str7_ram.ld | 12 ++++++------ testing/examples/STR710Test/prj/hitex_str7_rom.ld | 12 ++++++------ testing/examples/STR710Test/src/main.c | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 testing/examples/STR710Test/.gitignore hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-20 14:52:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ff976cdb29686ae9aa47687c35402c66978956d6 (commit) from 0c3a4b4d818554ea00dc993d31cea9f3e0d1a87d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ff976cdb29686ae9aa47687c35402c66978956d6 Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Jan 20 13:04:56 2010 +0100 arm7/9: add nags upon reset about options to improve performance arm7_9 fast_memory_access and working area nags added. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index ca1d84f..509e91e 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2760,6 +2760,16 @@ int arm7_9_check_reset(struct target *target) LOG_WARNING("NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'."); } + if (get_target_reset_nag() && (target->working_area_size == 0)) + { + LOG_WARNING("NOTE! Severe performance degradation without working memory enabled."); + } + + if (get_target_reset_nag() && !arm7_9->fast_memory_access) + { + LOG_WARNING("NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'."); + } + return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/target/arm7_9_common.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-01-20 10:08:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 0c3a4b4d818554ea00dc993d31cea9f3e0d1a87d (commit) from 20d1ef70e8417da7efc8a032992ee7672a19e296 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0c3a4b4d818554ea00dc993d31cea9f3e0d1a87d Author: Spencer Oliver <nt...@us...> Date: Tue Jan 19 21:00:55 2010 +0000 ARMV7M: handle bkpt instruction on resume/step Skip over a bkpt instruction if found on resume/step. Only software breakpoints known to OpenOCD are currently handled. So this handles the special case of either a user added bkpt or library added, eg. semi-hosting support. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 233fb95..c172a27 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -694,6 +694,44 @@ int armv7m_blank_check_memory(struct target *target, return ERROR_OK; } +int armv7m_maybe_skip_bkpt_inst(struct target *target, bool *inst_found) +{ + struct armv7m_common *armv7m = target_to_armv7m(target); + struct reg *r = armv7m->core_cache->reg_list + 15; + bool result = false; + + + /* if we halted last time due to a bkpt instruction + * then we have to manually step over it, otherwise + * the core will break again */ + + if (target->debug_reason == DBG_REASON_BREAKPOINT) + { + uint16_t op; + uint32_t pc = buf_get_u32(r->value, 0, 32); + + pc &= ~1; + if (target_read_u16(target, pc, &op) == ERROR_OK) + { + if ((op & 0xFF00) == 0xBE00) + { + pc = buf_get_u32(r->value, 0, 32) + 2; + buf_set_u32(r->value, 0, 32, pc); + r->dirty = true; + r->valid = true; + result = true; + LOG_DEBUG("Skipping over BKPT instruction"); + } + } + } + + if (inst_found) { + *inst_found = result; + } + + return ERROR_OK; +} + /*--------------------------------------------------------------------------*/ /* diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 86caae2..9787e30 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -171,6 +171,8 @@ int armv7m_checksum_memory(struct target *target, int armv7m_blank_check_memory(struct target *target, uint32_t address, uint32_t count, uint32_t* blank); +int armv7m_maybe_skip_bkpt_inst(struct target *target, bool *inst_found); + extern const struct command_registration armv7m_command_handlers[]; #endif /* ARMV7M_H */ diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 48f8114..762e318 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -638,6 +638,16 @@ static int cortex_m3_resume(struct target *target, int current, r->valid = true; } + /* if we halted last time due to a bkpt instruction + * then we have to manually step over it, otherwise + * the core will break again */ + + if (!breakpoint_find(target, buf_get_u32(r->value, 0, 32)) + && !debug_execution) + { + armv7m_maybe_skip_bkpt_inst(target, NULL); + } + resume_pc = buf_get_u32(r->value, 0, 32); armv7m_restore_context(target); @@ -690,6 +700,7 @@ static int cortex_m3_step(struct target *target, int current, struct swjdp_common *swjdp = &armv7m->swjdp_info; struct breakpoint *breakpoint = NULL; struct reg *pc = armv7m->core_cache->reg_list + 15; + bool bkpt_inst_found = false; if (target->state != TARGET_HALTED) { @@ -709,14 +720,23 @@ static int cortex_m3_step(struct target *target, int current, cortex_m3_unset_breakpoint(target, breakpoint); } + armv7m_maybe_skip_bkpt_inst(target, &bkpt_inst_found); + target->debug_reason = DBG_REASON_SINGLESTEP; armv7m_restore_context(target); target_call_event_callbacks(target, TARGET_EVENT_RESUMED); - /* set step and clear halt */ - cortex_m3_write_debug_halt_mask(target, C_STEP, C_HALT); + /* if no bkpt instruction is found at pc then we can perform + * a normal step, otherwise we have to manually step over the bkpt + * instruction - as such simulate a step */ + if (bkpt_inst_found == false) + { + /* set step and clear halt */ + cortex_m3_write_debug_halt_mask(target, C_STEP, C_HALT); + } + mem_ap_read_atomic_u32(swjdp, DCB_DHCSR, &cortex_m3->dcb_dhcsr); /* registers are now invalid */ @@ -735,6 +755,7 @@ static int cortex_m3_step(struct target *target, int current, LOG_DEBUG("target stepped dcb_dhcsr = 0x%" PRIx32 " nvic_icsr = 0x%" PRIx32, cortex_m3->dcb_dhcsr, cortex_m3->nvic_icsr); + return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/target/armv7m.c | 38 ++++++++++++++++++++++++++++++++++++++ src/target/armv7m.h | 2 ++ src/target/cortex_m3.c | 25 +++++++++++++++++++++++-- 3 files changed, 63 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 09:05:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 20d1ef70e8417da7efc8a032992ee7672a19e296 (commit) from 44aaba3d08bebbd809aabbe1c05d5aecb54eff12 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 20d1ef70e8417da7efc8a032992ee7672a19e296 Author: David Brownell <dbr...@us...> Date: Wed Jan 20 00:04:17 2010 -0800 User's guide: mention lpc2000 checksum issue Folk almost certainly want to have OpenOCD compute the checksum when they modify the vector table. However, that almost guarantees that "verify_image" will fail. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index a0fc0fb..05b6f4e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -4185,13 +4185,19 @@ which must appear in the following order: @itemize @item @var{variant} ... required, may be -@var{lpc2000_v1} (older LPC21xx and LPC22xx) -@var{lpc2000_v2} (LPC213x, LPC214x, LPC210[123], LPC23xx and LPC24xx) -or @var{lpc1700} (LPC175x and LPC176x) +@option{lpc2000_v1} (older LPC21xx and LPC22xx) +@option{lpc2000_v2} (LPC213x, LPC214x, LPC210[123], LPC23xx and LPC24xx) +or @option{lpc1700} (LPC175x and LPC176x) @item @var{clock_kHz} ... the frequency, in kiloHertz, at which the core is running -@item @var{calc_checksum} ... optional (but you probably want to provide this!), +@item @option{calc_checksum} ... optional (but you probably want to provide this!), telling the driver to calculate a valid checksum for the exception vector table. +@quotation Note +If you don't provide @option{calc_checksum} when you're writing the vector +table, the boot ROM will almost certainly ignore your flash image. +However, if you do provide it, +with most tool chains @command{verify_image} will fail. +@end quotation @end itemize LPC flashes don't require the chip and bus width to be specified. ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 08:33:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 44aaba3d08bebbd809aabbe1c05d5aecb54eff12 (commit) via bf1e9a83c877f1439fe0e7b170ba897e11d08b1b (commit) from 4f310aa0c962930eec7bfb22aface78f8dd91bb9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 44aaba3d08bebbd809aabbe1c05d5aecb54eff12 Author: David Brownell <dbr...@us...> Date: Tue Jan 19 23:32:54 2010 -0800 gdb_server -- subroutinize memory map logic Put the memory map logic into its own subroutine. This will make it a bit easier to package bugfixes, and simplifies the query packet handling. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index b2527d2..6ed7243 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1647,9 +1647,121 @@ static int compare_bank (const void * a, const void * b) } } -static int gdb_query_packet(struct connection *connection, +static int gdb_memory_map(struct connection *connection, struct target *target, char *packet, int packet_size) { + /* We get away with only specifying flash here. Regions that are not + * specified are treated as if we provided no memory map(if not we + * could detect the holes and mark them as RAM). + * Normally we only execute this code once, but no big deal if we + * have to regenerate it a couple of times. + */ + + struct flash_bank *p; + char *xml = NULL; + int size = 0; + int pos = 0; + int retval = ERROR_OK; + struct flash_bank **banks; + int offset; + int length; + char *separator; + int blocksize; + uint32_t ram_start = 0; + int i; + + /* skip command character */ + packet += 23; + + offset = strtoul(packet, &separator, 16); + length = strtoul(separator + 1, &separator, 16); + + xml_printf(&retval, &xml, &pos, &size, "<memory-map>\n"); + + /* Sort banks in ascending order. We need to report non-flash + * memory as ram (or rather read/write) by default for GDB, since + * it has no concept of non-cacheable read/write memory (i/o etc). + * + * FIXME Most non-flash addresses are *NOT* RAM! Don't lie. + */ + banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count()); + + for (i = 0; i < flash_get_bank_count(); i++) { + p = get_flash_bank_by_num(i); + if (p == NULL) { + free(banks); + retval = ERROR_FAIL; + gdb_send_error(connection, retval); + return retval; + } + banks[i] = p; + } + + qsort(banks, flash_get_bank_count(), sizeof(struct flash_bank *), + compare_bank); + + for (i = 0; i < flash_get_bank_count(); i++) { + p = banks[i]; + + if (ram_start < p->base) + xml_printf(&retval, &xml, &pos, &size, + "<memory type=\"ram\" start=\"0x%x\" " + "length=\"0x%x\"/>\n", + ram_start, p->base-ram_start); + + /* If device has uneven sector sizes, eg. str7, lpc + * we pass the smallest sector size to gdb memory map + * + * FIXME Don't lie about flash regions with different + * sector sizes; just tell GDB about each region as + * if it were a separate flash device. + */ + blocksize = gdb_calc_blocksize(p); + + xml_printf(&retval, &xml, &pos, &size, + "<memory type=\"flash\" start=\"0x%x\" " + "length=\"0x%x\">\n" \ + "<property name=\"blocksize\">0x%x</property>\n" \ + "</memory>\n", \ + p->base, p->size, blocksize); + ram_start = p->base + p->size; + } + + if (ram_start != 0) + xml_printf(&retval, &xml, &pos, &size, + "<memory type=\"ram\" start=\"0x%x\" " + "length=\"0x%x\"/>\n", + ram_start, 0-ram_start); + /* ELSE a flash chip could be at the very end of the 32 bit address + * space, in which case ram_start will be precisely 0 + */ + + free(banks); + banks = NULL; + + xml_printf(&retval, &xml, &pos, &size, "</memory-map>\n"); + + if (retval != ERROR_OK) { + gdb_send_error(connection, retval); + return retval; + } + + if (offset + length > pos) + length = pos - offset; + + char *t = malloc(length + 1); + t[0] = 'l'; + memcpy(t + 1, xml + offset, length); + gdb_put_packet(connection, t, length + 1); + + free(t); + free(xml); + return ERROR_OK; +} + +static int gdb_query_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) +{ struct command_context *cmd_ctx = connection->cmd_ctx; struct gdb_connection *gdb_connection = connection->priv; @@ -1747,112 +1859,9 @@ static int gdb_query_packet(struct connection *connection, return ERROR_OK; } - else if (strstr(packet, "qXfer:memory-map:read::") && (flash_get_bank_count() > 0)) - { - /* We get away with only specifying flash here. Regions that are not - * specified are treated as if we provided no memory map(if not we - * could detect the holes and mark them as RAM). - * Normally we only execute this code once, but no big deal if we - * have to regenerate it a couple of times. */ - - struct flash_bank *p; - char *xml = NULL; - int size = 0; - int pos = 0; - int retval = ERROR_OK; - - int offset; - int length; - char *separator; - int blocksize; - - /* skip command character */ - packet += 23; - - offset = strtoul(packet, &separator, 16); - length = strtoul(separator + 1, &separator, 16); - - xml_printf(&retval, &xml, &pos, &size, "<memory-map>\n"); - - /* - sort banks in ascending order, we need to make non-flash memory be ram(or rather - read/write) by default for GDB. - GDB does not have a concept of non-cacheable read/write memory. - */ - struct flash_bank **banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count()); - int i; - - for (i = 0; i < flash_get_bank_count(); i++) - { - p = get_flash_bank_by_num(i); - if (p == NULL) - { - free(banks); - retval = ERROR_FAIL; - gdb_send_error(connection, retval); - return retval; - } - banks[i]=p; - } - - qsort(banks, flash_get_bank_count(), sizeof(struct flash_bank *), compare_bank); - - uint32_t ram_start = 0; - for (i = 0; i < flash_get_bank_count(); i++) - { - p = banks[i]; - - if (ram_start < p->base) - { - xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" length=\"0x%x\"/>\n", - ram_start, p->base-ram_start); - } - - /* if device has uneven sector sizes, eg. str7, lpc - * we pass the smallest sector size to gdb memory map */ - blocksize = gdb_calc_blocksize(p); - - xml_printf(&retval, &xml, &pos, &size, "<memory type=\"flash\" start=\"0x%x\" length=\"0x%x\">\n" \ - "<property name=\"blocksize\">0x%x</property>\n" \ - "</memory>\n", \ - p->base, p->size, blocksize); - ram_start = p->base + p->size; - } - if (ram_start != 0) - { - xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" length=\"0x%x\"/>\n", - ram_start, 0-ram_start); - } else - { - /* a flash chip could be at the very end of the 32 bit address space, in which case - ram_start will be precisely 0 */ - } - - free(banks); - banks = NULL; - - xml_printf(&retval, &xml, &pos, &size, "</memory-map>\n"); - - if (retval != ERROR_OK) - { - gdb_send_error(connection, retval); - return retval; - } - - if (offset + length > pos) - { - length = pos - offset; - } - - char *t = malloc(length + 1); - t[0] = 'l'; - memcpy(t + 1, xml + offset, length); - gdb_put_packet(connection, t, length + 1); - - free(t); - free(xml); - return ERROR_OK; - } + else if (strstr(packet, "qXfer:memory-map:read::") + && (flash_get_bank_count() > 0)) + return gdb_memory_map(connection, target, packet, packet_size); else if (strstr(packet, "qXfer:features:read:")) { char *xml = NULL; commit bf1e9a83c877f1439fe0e7b170ba897e11d08b1b Author: David Brownell <dbr...@us...> Date: Tue Jan 19 23:30:36 2010 -0800 gdb_server -- symbol cleanup Make most methods static; net minor object code shrink. Likewise various data symbols; no net change. Shrink some overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index d656745..b2527d2 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -74,7 +74,7 @@ static struct gdb_connection *current_gdb_connection; static int gdb_breakpoint_override; static enum breakpoint_type gdb_breakpoint_override_type; -extern int gdb_error(struct connection *connection, int retval); +static int gdb_error(struct connection *connection, int retval); static unsigned short gdb_port = 3333; static unsigned short gdb_port_next = 0; static const char DIGITS[16] = "0123456789abcdef"; @@ -89,15 +89,17 @@ int gdb_actual_connections; /* set if we are sending a memory map to gdb * via qXfer:memory-map:read packet */ /* enabled by default*/ -int gdb_use_memory_map = 1; +static int gdb_use_memory_map = 1; /* enabled by default*/ -int gdb_flash_program = 1; +static int gdb_flash_program = 1; /* if set, data aborts cause an error to be reported in memory read packets - * see the code in gdb_read_memory_packet() for further explanations */ -int gdb_report_data_abort = 0; + * see the code in gdb_read_memory_packet() for further explanations. + * Disabled by default. + */ +static int gdb_report_data_abort; -int gdb_last_signal(struct target *target) +static int gdb_last_signal(struct target *target) { switch (target->debug_reason) { @@ -117,7 +119,8 @@ int gdb_last_signal(struct target *target) } } -int check_pending(struct connection *connection, int timeout_s, int *got_data) +static int check_pending(struct connection *connection, + int timeout_s, int *got_data) { /* a non-blocking socket will block if there is 0 bytes available on the socket, * but return with as many bytes as are available immediately @@ -284,14 +287,14 @@ static inline int gdb_get_char_fast(struct connection *connection, int* next_cha } -int gdb_get_char(struct connection *connection, int* next_char) +static int gdb_get_char(struct connection *connection, int* next_char) { struct gdb_connection *gdb_con = connection->priv; return gdb_get_char_fast(connection, next_char, &gdb_con->buf_p, &gdb_con->buf_cnt); } -int gdb_putback_char(struct connection *connection, int last_char) +static int gdb_putback_char(struct connection *connection, int last_char) { struct gdb_connection *gdb_con = connection->priv; @@ -311,7 +314,7 @@ int gdb_putback_char(struct connection *connection, int last_char) /* The only way we can detect that the socket is closed is the first time * we write to it, we will fail. Subsequent write operations will * succeed. Shudder! */ -int gdb_write(struct connection *connection, void *data, int len) +static int gdb_write(struct connection *connection, void *data, int len) { struct gdb_connection *gdb_con = connection->priv; if (gdb_con->closed) @@ -336,7 +339,8 @@ int gdb_write(struct connection *connection, void *data, int len) return ERROR_SERVER_REMOTE_CLOSED; } -int gdb_put_packet_inner(struct connection *connection, char *buffer, int len) +static int gdb_put_packet_inner(struct connection *connection, + char *buffer, int len) { int i; unsigned char my_checksum = 0; @@ -359,7 +363,8 @@ int gdb_put_packet_inner(struct connection *connection, char *buffer, int len) int gotdata; for (;;) { - if ((retval = check_pending(connection, 0, &gotdata)) != ERROR_OK) + retval = check_pending(connection, 0, &gotdata); + if (retval != ERROR_OK) return retval; if (!gotdata) break; @@ -477,7 +482,7 @@ int gdb_put_packet_inner(struct connection *connection, char *buffer, int len) return ERROR_OK; } -int gdb_put_packet(struct connection *connection, char *buffer, int len) +static int gdb_put_packet(struct connection *connection, char *buffer, int len) { struct gdb_connection *gdb_con = connection->priv; gdb_con->busy = 1; @@ -616,7 +621,8 @@ static __inline__ int fetch_packet(struct connection *connection, int *checksum_ return ERROR_OK; } -int gdb_get_packet_inner(struct connection *connection, char *buffer, int *len) +static int gdb_get_packet_inner(struct connection *connection, + char *buffer, int *len) { int character; int retval; @@ -691,7 +697,7 @@ int gdb_get_packet_inner(struct connection *connection, char *buffer, int *len) return ERROR_OK; } -int gdb_get_packet(struct connection *connection, char *buffer, int *len) +static int gdb_get_packet(struct connection *connection, char *buffer, int *len) { struct gdb_connection *gdb_con = connection->priv; gdb_con->busy = 1; @@ -700,7 +706,7 @@ int gdb_get_packet(struct connection *connection, char *buffer, int *len) return retval; } -int gdb_output_con(struct connection *connection, const char* line) +static int gdb_output_con(struct connection *connection, const char* line) { char *hex_buffer; int i, bin_size; @@ -722,7 +728,7 @@ int gdb_output_con(struct connection *connection, const char* line) return retval; } -int gdb_output(struct command_context *context, const char* line) +static int gdb_output(struct command_context *context, const char* line) { /* this will be dumped to the log and also sent as an O packet if possible */ LOG_USER_N("%s", line); @@ -767,7 +773,8 @@ static void gdb_frontend_halted(struct target *target, struct connection *connec } } -int gdb_target_callback_event_handler(struct target *target, enum target_event event, void *priv) +static int gdb_target_callback_event_handler(struct target *target, + enum target_event event, void *priv) { int retval; struct connection *connection = priv; @@ -795,7 +802,7 @@ int gdb_target_callback_event_handler(struct target *target, enum target_event e return ERROR_OK; } -int gdb_new_connection(struct connection *connection) +static int gdb_new_connection(struct connection *connection) { struct gdb_connection *gdb_connection = malloc(sizeof(struct gdb_connection)); struct gdb_service *gdb_service = connection->service->priv; @@ -851,7 +858,7 @@ int gdb_new_connection(struct connection *connection) return ERROR_OK; } -int gdb_connection_closed(struct connection *connection) +static int gdb_connection_closed(struct connection *connection) { struct gdb_service *gdb_service = connection->service->priv; struct gdb_connection *gdb_connection = connection->priv; @@ -898,14 +905,15 @@ int gdb_connection_closed(struct connection *connection) return ERROR_OK; } -void gdb_send_error(struct connection *connection, uint8_t the_error) +static void gdb_send_error(struct connection *connection, uint8_t the_error) { char err[4]; snprintf(err, 4, "E%2.2X", the_error); gdb_put_packet(connection, err, 3); } -int gdb_last_signal_packet(struct connection *connection, struct target *target, char* packet, int packet_size) +static int gdb_last_signal_packet(struct connection *connection, + struct target *target, char* packet, int packet_size) { char sig_reply[4]; int signal; @@ -935,7 +943,8 @@ static int gdb_reg_pos(struct target *target, int pos, int len) * The format of reg->value is little endian * */ -void gdb_str_to_target(struct target *target, char *tstr, struct reg *reg) +static void gdb_str_to_target(struct target *target, + char *tstr, struct reg *reg) { int i; @@ -968,7 +977,8 @@ static int hextoint(int c) } /* copy over in register buffer */ -void gdb_target_to_reg(struct target *target, char *tstr, int str_len, uint8_t *bin) +static void gdb_target_to_reg(struct target *target, + char *tstr, int str_len, uint8_t *bin) { if (str_len % 2) { @@ -987,7 +997,8 @@ void gdb_target_to_reg(struct target *target, char *tstr, int str_len, uint8_t * } } -int gdb_get_registers_packet(struct connection *connection, struct target *target, char* packet, int packet_size) +static int gdb_get_registers_packet(struct connection *connection, + struct target *target, char* packet, int packet_size) { struct reg **reg_list; int reg_list_size; @@ -1037,7 +1048,8 @@ int gdb_get_registers_packet(struct connection *connection, struct target *targe return ERROR_OK; } -int gdb_set_registers_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_set_registers_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { int i; struct reg **reg_list; @@ -1095,7 +1107,8 @@ int gdb_set_registers_packet(struct connection *connection, struct target *targe return ERROR_OK; } -int gdb_get_register_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_get_register_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { char *reg_packet; int reg_num = strtoul(packet + 1, NULL, 16); @@ -1130,7 +1143,8 @@ int gdb_get_register_packet(struct connection *connection, struct target *target return ERROR_OK; } -int gdb_set_register_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_set_register_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { char *separator; uint8_t *bin_buf; @@ -1176,7 +1190,7 @@ int gdb_set_register_packet(struct connection *connection, struct target *target return ERROR_OK; } -int gdb_error(struct connection *connection, int retval) +static int gdb_error(struct connection *connection, int retval) { switch (retval) { @@ -1207,7 +1221,8 @@ int gdb_error(struct connection *connection, int retval) * * 8191 bytes by the looks of it. Why 8191 bytes instead of 8192????? */ -int gdb_read_memory_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_read_memory_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { char *separator; uint32_t addr = 0; @@ -1281,7 +1296,8 @@ int gdb_read_memory_packet(struct connection *connection, struct target *target, return retval; } -int gdb_write_memory_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_write_memory_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { char *separator; uint32_t addr = 0; @@ -1338,7 +1354,8 @@ int gdb_write_memory_packet(struct connection *connection, struct target *target return retval; } -int gdb_write_memory_binary_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_write_memory_binary_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { char *separator; uint32_t addr = 0; @@ -1386,7 +1403,8 @@ int gdb_write_memory_binary_packet(struct connection *connection, struct target return ERROR_OK; } -int gdb_step_continue_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_step_continue_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { int current = 0; uint32_t address = 0x0; @@ -1419,7 +1437,8 @@ int gdb_step_continue_packet(struct connection *connection, struct target *targe return retval; } -int gdb_breakpoint_watchpoint_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_breakpoint_watchpoint_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { int type; enum breakpoint_type bp_type = BKPT_SOFT /* dummy init to avoid warning */; @@ -1523,8 +1542,11 @@ int gdb_breakpoint_watchpoint_packet(struct connection *connection, struct targe return ERROR_OK; } -/* print out a string and allocate more space as needed, mainly used for XML at this point */ -void xml_printf(int *retval, char **xml, int *pos, int *size, const char *fmt, ...) +/* print out a string and allocate more space as needed, + * mainly used for XML at this point + */ +static void xml_printf(int *retval, char **xml, int *pos, int *size, + const char *fmt, ...) { if (*retval != ERROR_OK) { @@ -1591,7 +1613,7 @@ static int decode_xfer_read(char *buf, char **annex, int *ofs, unsigned int *len return 0; } -int gdb_calc_blocksize(struct flash_bank *bank) +static int gdb_calc_blocksize(struct flash_bank *bank) { uint32_t i; uint32_t block_size = 0xffffffff; @@ -1625,7 +1647,8 @@ static int compare_bank (const void * a, const void * b) } } -int gdb_query_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_query_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { struct command_context *cmd_ctx = connection->cmd_ctx; struct gdb_connection *gdb_connection = connection->priv; @@ -1881,7 +1904,8 @@ int gdb_query_packet(struct connection *connection, struct target *target, char return ERROR_OK; } -int gdb_v_packet(struct connection *connection, struct target *target, char *packet, int packet_size) +static int gdb_v_packet(struct connection *connection, + struct target *target, char *packet, int packet_size) { struct gdb_connection *gdb_connection = connection->priv; struct gdb_service *gdb_service = connection->service->priv; @@ -2028,11 +2052,12 @@ int gdb_v_packet(struct connection *connection, struct target *target, char *pac return ERROR_OK; } -int gdb_detach(struct connection *connection, struct target *target) +static int gdb_detach(struct connection *connection, struct target *target) { struct gdb_service *gdb_service = connection->service->priv; - target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_DETACH); + target_call_event_callbacks(gdb_service->target, + TARGET_EVENT_GDB_DETACH); return gdb_put_packet(connection, "OK", 2); } @@ -2052,9 +2077,6 @@ static void gdb_log_callback(void *priv, const char *file, unsigned line, gdb_output_con(connection, string); } -/* Do not allocate this on the stack */ -char gdb_packet_buffer[GDB_BUFFER_SIZE]; - static void gdb_sig_halted(struct connection *connection) { char sig_reply[4]; @@ -2063,8 +2085,11 @@ static void gdb_sig_halted(struct connection *connection) } -int gdb_input_inner(struct connection *connection) +static int gdb_input_inner(struct connection *connection) { + /* Do not allocate this on the stack */ + static char gdb_packet_buffer[GDB_BUFFER_SIZE]; + struct gdb_service *gdb_service = connection->service->priv; struct target *target = gdb_service->target; char *packet = gdb_packet_buffer; @@ -2077,10 +2102,9 @@ int gdb_input_inner(struct connection *connection) do { packet_size = GDB_BUFFER_SIZE-1; - if ((retval = gdb_get_packet(connection, packet, &packet_size)) != ERROR_OK) - { + retval = gdb_get_packet(connection, packet, &packet_size); + if (retval != ERROR_OK) return retval; - } /* terminate with zero */ packet[packet_size] = 0; @@ -2112,32 +2136,48 @@ int gdb_input_inner(struct connection *connection) break; case 'q': case 'Q': - retval = gdb_query_packet(connection, target, packet, packet_size); + retval = gdb_query_packet(connection, + target, packet, + packet_size); break; case 'g': - retval = gdb_get_registers_packet(connection, target, packet, packet_size); + retval = gdb_get_registers_packet( + connection, target, + packet, packet_size); break; case 'G': - retval = gdb_set_registers_packet(connection, target, packet, packet_size); + retval = gdb_set_registers_packet( + connection, target, + packet, packet_size); break; case 'p': - retval = gdb_get_register_packet(connection, target, packet, packet_size); + retval = gdb_get_register_packet( + connection, target, + packet, packet_size); break; case 'P': - retval = gdb_set_register_packet(connection, target, packet, packet_size); + retval = gdb_set_register_packet( + connection, target, + packet, packet_size); break; case 'm': - retval = gdb_read_memory_packet(connection, target, packet, packet_size); + retval = gdb_read_memory_packet( + connection, target, + packet, packet_size); break; case 'M': - retval = gdb_write_memory_packet(connection, target, packet, packet_size); + retval = gdb_write_memory_packet( + connection, target, + packet, packet_size); break; case 'z': case 'Z': retval = gdb_breakpoint_watchpoint_packet(connection, target, packet, packet_size); break; case '?': - gdb_last_signal_packet(connection, target, packet, packet_size); + gdb_last_signal_packet( + connection, target, + packet, packet_size); break; case 'c': case 's': @@ -2199,14 +2239,19 @@ int gdb_input_inner(struct connection *connection) } break; case 'v': - retval = gdb_v_packet(connection, target, packet, packet_size); + retval = gdb_v_packet( + connection, target, + packet, packet_size); break; case 'D': retval = gdb_detach(connection, target); extended_protocol = 0; break; case 'X': - if ((retval = gdb_write_memory_binary_packet(connection, target, packet, packet_size)) != ERROR_OK) + retval = gdb_write_memory_binary_packet( + connection, target, + packet, packet_size); + if (retval != ERROR_OK) return retval; break; case 'k': @@ -2261,7 +2306,7 @@ int gdb_input_inner(struct connection *connection) return ERROR_OK; } -int gdb_input(struct connection *connection) +static int gdb_input(struct connection *connection) { int retval = gdb_input_inner(connection); struct gdb_connection *gdb_con = connection->priv; @@ -2297,8 +2342,7 @@ static int gdb_target_start(struct target *target, uint16_t port) return ERROR_OK; } -/* FIXME static */ -int gdb_target_add_one(struct target *target) +static int gdb_target_add_one(struct target *target) { if (gdb_port == 0 && server_use_pipes == 0) { diff --git a/src/server/gdb_server.h b/src/server/gdb_server.h index 17e40fe..d7a6ad0 100644 --- a/src/server/gdb_server.h +++ b/src/server/gdb_server.h @@ -36,7 +36,6 @@ struct gdb_service struct target *target; }; -int gdb_target_add_one(struct target *target); int gdb_target_add_all(struct target *target); int gdb_register_commands(struct command_context *command_context); ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 387 +++++++++++++++++++++++++++-------------------- src/server/gdb_server.h | 1 - 2 files changed, 220 insertions(+), 168 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-20 00:02:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 4f310aa0c962930eec7bfb22aface78f8dd91bb9 (commit) from fb4239866c6a9aa429b58be7488a93ec1245597b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4f310aa0c962930eec7bfb22aface78f8dd91bb9 Author: Andreas Fritiofson <and...@gm...> Date: Sat Nov 21 16:53:31 2009 +0100 update win32 script search path The default script search path on Windows is out of date with the current layout (from installation and documentation), which makes the standard script library not be found after a normal ./configure && make && make install under msys/MinGW. The same should hold true for cygwin native builds (not verified). Update search path to ../share/openocd/scripts not ../lib/openocd, relative to the openocd executable. Signed-off-by: Andreas Fritiofson <and...@gm...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/options.c b/src/helper/options.c index 573026a..63c5b05 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -74,21 +74,21 @@ static void add_default_dirs(void) add_script_search_dir(strExePath); } /* - * Add support for the default (as of 20080121) layout when - * using autotools and cygwin to build native MinGW binary. + * Add support for the default (as of 20091118) layout when + * using autotools and cygwin/MinGW to build native binary. * Path separator is converted to UNIX style so that MinGW is * pleased. * * bin/openocd.exe - * lib/openocd/event/at91eb40a_reset.cfg - * lib/openocd/target/at91eb40a.cfg + * share/openocd/scripts/interface/dummy.cfg + * share/openocd/scripts/target/at91eb40a.cfg */ { char strExePath [MAX_PATH]; char *p; GetModuleFileName (NULL, strExePath, MAX_PATH); *strrchr(strExePath, '\\') = 0; - strcat(strExePath, "/../lib/"PACKAGE); + strcat(strExePath, "/../share/"PACKAGE"/scripts"); for (p = strExePath; *p; p++) { if (*p == '\\') *p = '/'; ----------------------------------------------------------------------- Summary of changes: src/helper/options.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-19 22:57:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via fb4239866c6a9aa429b58be7488a93ec1245597b (commit) from 924bf27596f31ab8e79fbb4de702be4a9fa12874 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fb4239866c6a9aa429b58be7488a93ec1245597b Author: David Brownell <dbr...@us...> Date: Tue Jan 19 13:56:33 2010 -0800 NOR: fix diagnostic The "NOR: last_addr also needs correction when checking alignment" patch omitted a necessary update to the key diagnostic; fix. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index 277da38..2c61519 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -408,7 +408,7 @@ static int flash_iterate_address_range(struct target *target, LOG_ERROR("address range 0x%8.8x .. 0x%8.8x " "is not sector-aligned", (unsigned) (c->base + addr), - (unsigned) (last_addr - 1)); + (unsigned) (c->base + last_addr - 1)); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } ----------------------------------------------------------------------- Summary of changes: src/flash/nor/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-19 11:14:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 924bf27596f31ab8e79fbb4de702be4a9fa12874 (commit) via c795b0d8f143a52e0b7196c6e353b381ac04f8ae (commit) via cdcb9b0885cdb2ca2a212536ab68acc2e9bc7fad (commit) from 5ab34b28ce3378a0a36b122a07af4f0f4769a24f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 924bf27596f31ab8e79fbb4de702be4a9fa12874 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jan 18 21:54:58 2010 +0100 zy1000: flush jtag buffer before changing speed It is conceivable that there could be commands in the queue when a speed change request comes in. Flush the hw queue before changing speed. Not observed, found by inspection. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 9070f2e..2c205b7 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -199,6 +199,9 @@ void zy1000_reset(int trst, int srst) int zy1000_speed(int speed) { + /* flush JTAG master FIFO before setting speed */ + waitIdle(); + if (speed == 0) { /*0 means RCLK*/ commit c795b0d8f143a52e0b7196c6e353b381ac04f8ae Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jan 19 09:46:49 2010 +0100 zy1000: print out PCB revision upon boot Simplify debugging a bit. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/ecosboard.c b/src/ecosboard.c index de2a42c..2e73585 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -956,7 +956,11 @@ int main(int argc, char *argv[]) diag_init_putc(_zylinjtag_diag_write_char); // We want this in the log. - diag_printf("Zylin ZY1000.\n"); +#ifdef CYGPKG_HAL_NIOS2 + diag_printf("Zylin ZY1000 PCB revc.\n"); +#else + diag_printf("Zylin ZY1000 PCB revb.\n"); +#endif err = mount("", "/ram", "ramfs"); if (err < 0) commit cdcb9b0885cdb2ca2a212536ab68acc2e9bc7fad Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jan 19 09:47:21 2010 +0100 flash: add error messages upon incorrect arguments to flash iteration According to OpenOCD error handling rules the error is logged at where it occurs(same site where an exception would have been thrown). Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index aedaa86..277da38 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -324,14 +324,20 @@ static int flash_iterate_address_range(struct target *target, { /* special case, erase whole bank when length is zero */ if (addr != c->base) + { + LOG_ERROR("Whole bank access must start at beginning of bank."); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; + } return callback(c, 0, c->num_sectors - 1); } /* check whether it all fits in this bank */ if (addr + length - 1 > c->base + c->size - 1) + { + LOG_ERROR("Flash access does not fit into bank."); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; + } /** @todo: handle erasures that cross into adjacent banks */ ----------------------------------------------------------------------- Summary of changes: src/ecosboard.c | 6 +++++- src/flash/nor/core.c | 6 ++++++ src/jtag/zy1000/zy1000.c | 3 +++ 3 files changed, 14 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-18 22:19:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5ab34b28ce3378a0a36b122a07af4f0f4769a24f (commit) from 56d2c86500be87c87150bcfc1b2fe59ece9a45f4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5ab34b28ce3378a0a36b122a07af4f0f4769a24f Author: David Brownell <dbr...@us...> Date: Mon Jan 18 13:17:05 2010 -0800 vsllink -- add comment Previous patch deserved *inline* comment, not just in git revision history. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index 5c9a8db..65c3bf1 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -476,6 +476,9 @@ static int vsllink_init(void) } VSLLINK_USB_TIMEOUT = to_tmp; + /* Some older firmware versions sometimes fail if the + * voltage isn't read first. + */ vsllink_simple_command(0x01); result = vsllink_usb_read(vsllink_handle); if (result != 2) ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/vsllink.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-18 21:42:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 56d2c86500be87c87150bcfc1b2fe59ece9a45f4 (commit) from 0b641dac717ffe1391cc53dc33ad78ba79a26d2c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 56d2c86500be87c87150bcfc1b2fe59ece9a45f4 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jan 18 14:45:08 2010 +0100 commands: allow scan_chain command to be executed during config Adding taps and then dumping them is quite reasonable thing to do in a config script. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index f48993f..ffb5d27 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -1674,7 +1674,7 @@ static const struct command_registration jtag_command_handlers[] = { { .name = "scan_chain", .handler = handle_scan_chain_command, - .mode = COMMAND_EXEC, + .mode = COMMAND_ANY, .help = "print current scan chain configuration", }, { ----------------------------------------------------------------------- Summary of changes: src/jtag/tcl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <da...@pa...> - 2010-01-18 09:09:28
|
On Sunday 17 January 2010, Øyvind Harboe wrote: > I would have like to see this comment in the *code* rather than > the commit message though.... -ENOPATCH. :) > An interesting feature of an IDE would be to be able to display/hide > commit messages for code... Easily done with gitweb. I think at least one "git blame" cousin supports that too. |
From: David B. <dbr...@us...> - 2010-01-18 08:39:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 0b641dac717ffe1391cc53dc33ad78ba79a26d2c (commit) from daa1ff3535c2dc1f6ae6da2b740cdf23f4f5f7a6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0b641dac717ffe1391cc53dc33ad78ba79a26d2c Author: simon qian <sim...@gm...> Date: Sun Jan 17 23:37:15 2010 -0800 read target voltage first in vsllink The very first command after init command should be "read target voltage". This is a tweak for the Old Versaloon firmware. Without this, in most most cases, it works. Under Ubuntu9.04, there is a chance that the USB will fail. The problem disappears if I read target voltage first. For the lastest Versaloon firmware, it's OK. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index d301290..5c9a8db 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -476,6 +476,14 @@ static int vsllink_init(void) } VSLLINK_USB_TIMEOUT = to_tmp; + vsllink_simple_command(0x01); + result = vsllink_usb_read(vsllink_handle); + if (result != 2) + LOG_WARNING("Fail to get target voltage"); + else + LOG_INFO("Target runs at %d mV", vsllink_usb_in_buffer[0] + + (vsllink_usb_in_buffer[1] << 8)); + // connect to vsllink vsllink_connect(); // initialize function pointers ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/vsllink.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-16 21:32:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via daa1ff3535c2dc1f6ae6da2b740cdf23f4f5f7a6 (commit) from 183765707fb4d819b790b9431b83a9bf637fadc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit daa1ff3535c2dc1f6ae6da2b740cdf23f4f5f7a6 Author: richard vegh <veg...@gm...> Date: Sat Jan 16 12:27:45 2010 -0800 NAND: lpc3180 crashes on LPC3250 The LPC3180 NAND driver was crashing on some large page chips. Fix: - Crash and related functionality (don't memset too much OOB data) - Some debug messages - Command handling now works [dbr...@us...: whitespace/linelength/message cleanup] Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/flash/nand/lpc3180.c b/src/flash/nand/lpc3180.c index 51ab34b..acb5f58 100644 --- a/src/flash/nand/lpc3180.c +++ b/src/flash/nand/lpc3180.c @@ -500,9 +500,10 @@ static int lpc3180_write_page(struct nand_device *nand, uint32_t page, uint8_t * return ERROR_NAND_OPERATION_NOT_SUPPORTED; } - if (oob && (oob_size > 6)) + if (oob && (oob_size > 24)) { - LOG_ERROR("LPC3180 MLC controller can't write more than 6 bytes of OOB data"); + LOG_ERROR("LPC3180 MLC controller can't write more " + "than 6 bytes for each quarter's OOB data"); return ERROR_NAND_OPERATION_NOT_SUPPORTED; } @@ -559,10 +560,10 @@ static int lpc3180_write_page(struct nand_device *nand, uint32_t page, uint8_t * data += thisrun_data_size; } - memset(oob_buffer, 0xff, (nand->page_size == 512) ? 6 : 24); + memset(oob_buffer, 0xff, 6); if (oob) { - memcpy(page_buffer, oob, thisrun_oob_size); + memcpy(oob_buffer, oob, thisrun_oob_size); oob_size -= thisrun_oob_size; oob += thisrun_oob_size; } @@ -570,8 +571,10 @@ static int lpc3180_write_page(struct nand_device *nand, uint32_t page, uint8_t * /* write MLC_ECC_ENC_REG to start encode cycle */ target_write_u32(target, 0x200b8008, 0x0); - target_write_memory(target, 0x200a8000, 4, 128, page_buffer + (quarter * 512)); - target_write_memory(target, 0x200a8000, 1, 6, oob_buffer + (quarter * 6)); + target_write_memory(target, 0x200a8000, + 4, 128, page_buffer); + target_write_memory(target, 0x200a8000, + 1, 6, oob_buffer); /* write MLC_ECC_AUTO_ENC_REG to start auto encode */ target_write_u32(target, 0x200b8010, 0x0); @@ -760,7 +763,6 @@ static int lpc3180_controller_ready(struct nand_device *nand, int timeout) { struct lpc3180_nand_controller *lpc3180_info = nand->controller_priv; struct target *target = lpc3180_info->target; - uint8_t status = 0x0; if (target->state != TARGET_HALTED) { @@ -768,20 +770,35 @@ static int lpc3180_controller_ready(struct nand_device *nand, int timeout) return ERROR_NAND_OPERATION_FAILED; } + LOG_DEBUG("lpc3180_controller_ready count start=%d", timeout); + do { if (lpc3180_info->selected_controller == LPC3180_MLC_CONTROLLER) { + uint8_t status; + /* Read MLC_ISR, wait for controller to become ready */ target_read_u8(target, 0x200b8048, &status); - if (status & 2) + if (status & 2) { + LOG_DEBUG("lpc3180_controller_ready count=%d", + timeout); return 1; + } } else if (lpc3180_info->selected_controller == LPC3180_SLC_CONTROLLER) { - /* we pretend that the SLC controller is always ready */ - return 1; + uint32_t status; + + /* Read SLC_STAT and check READY bit */ + target_read_u32(target, 0x20020018, &status); + + if (status & 1) { + LOG_DEBUG("lpc3180_controller_ready count=%d", + timeout); + return 1; + } } alive_sleep(1); @@ -801,6 +818,8 @@ static int lpc3180_nand_ready(struct nand_device *nand, int timeout) return ERROR_NAND_OPERATION_FAILED; } + LOG_DEBUG("lpc3180_nand_ready count start=%d", timeout); + do { if (lpc3180_info->selected_controller == LPC3180_MLC_CONTROLLER) @@ -810,8 +829,11 @@ static int lpc3180_nand_ready(struct nand_device *nand, int timeout) /* Read MLC_ISR, wait for NAND flash device to become ready */ target_read_u8(target, 0x200b8048, &status); - if (status & 1) + if (status & 1) { + LOG_DEBUG("lpc3180_nand_ready count end=%d", + timeout); return 1; + } } else if (lpc3180_info->selected_controller == LPC3180_SLC_CONTROLLER) { @@ -820,8 +842,11 @@ static int lpc3180_nand_ready(struct nand_device *nand, int timeout) /* Read SLC_STAT and check READY bit */ target_read_u32(target, 0x20020018, &status); - if (status & 1) + if (status & 1) { + LOG_DEBUG("lpc3180_nand_ready count end=%d", + timeout); return 1; + } } alive_sleep(1); @@ -844,7 +869,7 @@ COMMAND_HANDLER(handle_lpc3180_select_command) } unsigned num; - COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], num); + COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], num); struct nand_device *nand = get_nand_device_by_num(num); if (!nand) { ----------------------------------------------------------------------- Summary of changes: src/flash/nand/lpc3180.c | 51 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 38 insertions(+), 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-15 22:03:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 183765707fb4d819b790b9431b83a9bf637fadc5 (commit) from 6c4a643d632c6cff647c5099bd450d1e417903ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 183765707fb4d819b790b9431b83a9bf637fadc5 Author: David Brownell <dbr...@us...> Date: Fri Jan 15 13:02:45 2010 -0800 ADIv5 improved diagnostic Don't just complain about an invalid ACK; say what the value was, to help troubleshooting. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 1a86458..ba5db3b 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -305,8 +305,9 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) } else { - LOG_WARNING("Invalid ACK " - "in JTAG-DP transaction"); + LOG_WARNING("Invalid ACK %#x" + "in JTAG-DP transaction", + swjdp->ack); return ERROR_JTAG_DEVICE_ERROR; } ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |