svf: try to reallocate buffers if they're not enough
[openocd.git] / TODO
blob8aac1575915abf1b8f4164006134c2b5ad88fe97
1 // This file is part of the Doxygen Developer Manual
2 /** @page tasks Pending and Open Tasks
4 This page lists pending and open tasks being considered or worked upon
5 by the OpenOCD community.
7 @section thelist The List
9 Most items are open for the taking, but please post to the mailing list
10 before spending much time working on anything lists here.  The community
11 may have evolved an idea since it was added here.
13 Feel free to send patches to add or clarify items on this list, too.
15 @section thelisttcl TCL
17 This section provides possible things to improve with OpenOCD's TCL support.
19 - Fix problem with incorrect line numbers reported for a syntax
20   error in a reset init event.
22 - organize the TCL configurations:
23   - provide more directory structure for boards/targets?
24   - factor configurations into layers (encapsulation and re-use)
26 - Fix handling of variables between multiple command line "-c" and "-f"
27   parameters.  Currently variables assigned through one such parameter
28   command/script are unset before the next one is invoked.
30 - Isolate all TCL command support:
31   - Pure C CLI implementations using --disable-builtin-tcl.
32     - Allow developers to build new dongles using OpenOCD's JTAG core.
33     - At first, provide only low-level JTAG support; target layer and
34       above rely heavily on scripting event mechanisms.
35   - Allow full TCL support? add --with-tcl=/path/to/installed/tcl
36   - Move TCL support out of foo.[ch] and into foo_tcl.[ch] (other ideas?)
37     - See src/jtag/core.c and src/jtag/tcl.c for an example.
38     - allow some of these TCL command modules to be dynamically loadable?
40 @section thelistjtag JTAG
42 This section list issues that need to be resolved in the JTAG layer.
44 @subsection thelistjtagcore JTAG Core
46 The following tasks have been suggested for cleaning up the JTAG layer:
48 - use tap_set_state everywhere to allow logging TAP state transitions
49 - Encapsulate cmd_queue_cur_state and related variable handling.
50 - add slick 32 bit versions of jtag_add_xxx_scan() that avoids
51 buf_set_u32() calls and other evidence of poor impedance match between
52 API and calling code. New API should cut down # of lines in calling
53 code by 100's and make things clearer. Also potentially be supported
54 directly in minidriver API for better embedded host performance.
56 The following tasks have been suggested for adding new core JTAG support:
58 - Improve autodetection of TAPs by supporting tcl escape procedures that
59   can configure discovered TAPs based on IDCODE value ... they could:
60     - Remove guessing for irlen
61     - Allow non-default irmask/ircapture values
62 - SPI/UART emulation:
63   - (ab)use bit-banging JTAG interfaces to emulate SPI/UART
64   - allow SPI to program flash, MCUs, etc.
66 @subsection thelistjtaginterfaces JTAG Interfaces
68 There are some known bugs to fix in JTAG adapter drivers:
70 - For JTAG_STATEMOVE to TAP_RESET, all drivers must ignore the current
71   recorded state.  The tap_get_state() call won't necessarily return
72   the correct value, especially at server startup.  Fix is easy:  in
73   that case, always issue five clocks with TMS high.
74   - amt_jtagaccel.c
75   - arm-jtag-ew.c
76   - bitbang.c
77   - bitq.c
78   - gw16012.c
79   - jlink.c
80   - usbprog.c
81   - vsllink.c
82   - rlink/rlink.c
83 - bug: USBprog is broken with new tms sequence; it needs 7-clock cycles.
84   Fix promised from  Peter Denison openwrt at marshadder.org
85   Workaround: use "tms_sequence long" @par
86   https://lists.berlios.de/pipermail/openocd-development/2009-July/009426.html
88 The following tasks have been suggested for improving OpenOCD's JTAG
89 interface support:
91 - rework USB communication to be more robust.  Two possible options are:
92   -# use libusb-1.0.1 with libusb-compat-0.1.1 (non-blocking I/O wrapper)
93   -# rewrite implementation to use non-blocking I/O
94 - J-Link driver:
95   - fix to work with long scan chains, such as R.Doss's svf test.
96 - FT2232 (libftdi):
97   - make performance comparable to alternatives (on Win32, D2XX is faster)
98   - make usability comparable to alternatives
99 - Autodetect USB based adapters; this should be easy on Linux.  If there's
100   more than one, list the options; otherwise, just select that one.
102 The following tasks have been suggested for adding new JTAG interfaces:
104 - TCP driver: allow client/server for remote JTAG interface control.
105 This requires a client and a server. The server is built into the
106 normal OpenOCD and takes commands from the client and executes
107 them on the interface returning the result of TCP/IP. The client
108 is an OpenOCD which is built with a TCP/IP minidriver. The use
109 of a minidriver is required to capture all the jtag_add_xxx()
110 fn's at a high enough level and repackage these cmd's as
111 TCP/IP packets handled by the server.
113 @section thelistswd Serial Wire Debug
115 - implement Serial Wire Debug interface
117 @section thelistbs Boundary Scan Support
119 - add STAPL support?
120 - add BSDL support?
122 A few possible options for the above:
123   -# Fake a TCL equivalent?
124   -# Integrate an existing library?
125   -# Write a new C implementation a la Jim?
127 Once the above are completed:
128 - add support for programming flash using boundary scan techniques
129 - add integration with a modified gerber view program:
130   - provide means to view the PCB and select pins and traces
131   - allow use-cases such as the following:
132     - @b Stimulus
133       -# Double-click on a pin (or trace) with the mouse.
134     - @b Effects
135       -# The trace starts blinking, and
136       -# OpenOCD toggles the pin(s) 0/1.
138 @section thelisttargets Target Support
140 - Many common ARM cores could be autodetected using IDCODE
141 - general layer cleanup: @par
142   https://lists.berlios.de/pipermail/openocd-development/2009-May/006590.html
143 - regression: "reset halt" between 729(works) and 788(fails): @par
144 https://lists.berlios.de/pipermail/openocd-development/2009-July/009206.html
145 - registers
146   - add flush-value operation, call them all on resume/reset
147 - mcr/mrc target->type support
148   - missing from ARM920t, ARM966e, XScale.
149   It's possible that the current syntax is unable to support read-modify-write
150   operations(see arm966e).
151   - mcr/mrc - retire cp15 commands when there the mrc/mrc commands have been
152   tested from: arm926ejs, arm720t, cortex_a8
153 - ARM7/9:
154   - clean up "arm9tdmi vector_catch". Available for some arm7 cores? @par
155 https://lists.berlios.de/pipermail/openocd-development/2009-October/011488.html
156 https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html
157   - add reset option to allow programming embedded ice while srst is asserted.
158   Some CPUs will gate the JTAG clock when srst is asserted and in this case,
159   it is necessary to program embedded ice and then assert srst afterwards.
160 - ARM926EJS:
161   - reset run/halt/step is not robust; needs testing to map out problems.
162 - ARM11 improvements (MB?)
163   - add support for asserting srst to reset the core.
164   - Single stepping works, but should automatically
165   use hardware stepping if available.
166   - mdb can return garbage data if read byte operation fails for
167   a memory region(16 & 32 byte access modes may be supported). Is this
168   a bug in the .MX31 PDK init script? Try on i.MX31 PDK:
169   mdw 0xb80005f0 0x8, mdh 0xb80005f0 0x10, mdb 0xb80005f0 0x20. mdb returns
170   garabage.
171   - implement missing functionality (grep FNC_INFO_NOTIMPLEMENTED ...)
172 - Thumb2 single stepping: ARM1156T2 needs simulator support
173 - Cortex A8 support (ML)
174   - add target implementation (ML)
175 - Cortex M3 support
176   - when stepping, only write dirtied registers (be faster)
177   - when connecting to halted core, fetch registers (startup is quirky)
178 - Generic ARM run_algorithm() interface
179   - tagged struct wrapping ARM instructions and metadata
180   - not revision-specific (current: ARMv4+ARMv5 -or- ARMv6 -or- ARMv7)
181   - usable with at least arm_nandwrite() and generic CFI drivers
182 - ETM
183   - don't show FIFOFULL registers if they're not supported
184   - use comparators to get more breakpoints and watchpoints
185   - add "etm drivers" command
186   - trace driver init() via examine() paths only, not setup()/reset
187 - MC1322x support (JW/DE?)
188   - integrate and test support from JW (and DE?)
189   - get working with a known good interface (i.e. not today's jlink)
190 - AT91SAM92xx:
191   - improvements for unknown-board-atmel-at91sam9260.cfg (RD)
192 - STR9x: (ZW)
193   - improvements to str912.cfg to be more general purpose
194 - AVR: (SQ)
195   - independently verify implementation
196   - incrementally improve working prototype in trunk. (SQ)
197   - work out how to debug this target
198   - AVR debugging protocol.
199 - FPGA:
200   - Altera Nios Soft-CPU support
201 - Coldfire (suggested by NC)
202   - can we draw from the BDM project?  @par
203     http://bdm.sourceforge.net/
205     or the OSBDM package @par
206     http://forums.freescale.com/freescale/board/message?board.id=OSBDM08&thread.id=422
208 @section thelistsvf SVF/XSVF
210 - develop SVF unit tests
211 - develop XSVF unit tests
213 @section thelistflash Flash Support
215 - finish documentation for the following flash drivers:
216   - avr
217   - pic32mx
218   - ocl
219   - str9xpec
221 - Don't expect writing all-ones to be a safe way to write without
222   changing bit values.  Minimally it loses on flash modules with
223   internal ECC, where it may change the ECC.
224   - NOR flash_write_unlock() does that between sectors
225   - there may be other cases too
227 - Make sure all commands accept either a bank name or a bank number,
228   and be sure both identifiers show up in "flash banks" and "nand list".
229   Right now the user-friendly names are pretty much hidden...
231 @subsection thelistflashcfi CFI
233 - finish implementing bus width/chip width handling (suggested by NC)
234 - factor vendor-specific code into separate source files
235   - add new callback interface for vendor-specific code
236 - investigate/implement "thin wrapper" to use eCos CFI drivers (ØH)
238 @section thelistdebug Debugger Support
240 - add support for masks in watchpoints? @par
241   https://lists.berlios.de/pipermail/openocd-development/2009-October/011507.html
242 - breakpoints can get lost in some circumstances: @par
243   https://lists.berlios.de/pipermail/openocd-development/2009-June/008853.html
244 - add support for masks in watchpoints. The trick is that GDB does not
245   support a breakpoint mask in the remote protocol. One way to work around
246   this is to add a separate command "watchpoint_mask add/rem <addr> <mask>", that
247   is run to register a list of masks that the gdb_server knows to use with
248   a particular watchpoint address.
249 - integrate Keil AGDI interface to OpenOCD? (submitted by Dario Vecchio)
251 @section thelisttesting Testing Suite
253 This section includes several related groups of ideas:
254 - @ref thelistunittests
255 - @ref thelistsmoketests
256 - @ref thelisttestreports
257 - @ref thelisttestgenerichw
259 @subsection thelistunittests Unit Tests
261 - add testing skeleton to provide frameworks for adding tests
262 - implement server unit tests
263 - implement JTAG core unit tests
264 - implement JTAG interface unit tests
265 - implement flash unit tests
266 - implement target unit tests
268 @subsection thelistsmoketests Smoke Test Tools
270 -# extend 'make check' with a smoketest app
271   - checks for OOCD_TEST_CONFIG, etc. in environment (or config file)
272   - if properly set, runs the smoke test with specified parameters
273     - openocd -f ${OOCD_TEST_CONFIG}
274     - implies a modular test suite (see below)
275   - should be able to run some minimal tests with dummy interface:
276     - compare results of baseline sanity checks with expected results
278 -# builds a more complete test suite:
279   - existing testing/examples/ look like a great start
280   - all targets should be tested fully and for all capabilities
281     - we do NOT want a "lowest common denominator" test suite
282     - ... but can we start with one to get going?
283   - probably requires one test configuration file per board/target
284     - modularization can occur here, just like with targets/boards/chips
285     - coverage can increase over time, building up bundles of tests
287 -# add new 'smoketest' Makefile target:
288   - calls 'make check' (and the smoketest app)
289   - gather inputs and output into a report file
291 @subsection thelisttestreports Test Feedback Tools
293 These ideas were first introduced here: @par
294   https://lists.berlios.de/pipermail/openocd-development/2009-May/006358.html
296 - provide report submission scripts for e-mail and web forms
297 - add new Makefile targets to post the report:
298   - 'checkreportsend' -- send to list via e-mail (via sendmail)
299   - 'checkreportpost' -- send web form (via curl or other script)
301 @subsection thelisttestgenerichw Generic Hardware Tester
303 - implement VHDL to use for FPGA-based JTAG TAP testing device
304 - develop test suite that utilizes this testing device
306 @section thelistautotools Autotools Build System
308 - make entire configure process require less user consideration:
309   - automatically detect the features that are available, unless
310     options were specifically provided to configure
311   - provide a report of the drivers that will be build at the end of
312     running configure, so the users can verify which drivers will be
313     built during 'make' (and their options) .
314 - eliminate sources of confusion in @c bootstrap script:
315   -# Make @c bootstrap call 'configure --enable-maintainer-mode \<opts\>'?
316   -# Add @c buildstrap script to assist with bootstrap and configure steps.
317 - automatically build tool-chains required for cross-compiling
318   - produce mingw32, arm-elf, others using in-tree scripts
319   - build all required target code from sources
320 - make JTAG and USB debug output a run-time configuration option
322 @section thelistarchitecture Architectural Tasks
324 The following architectural tasks need to be accomplished and should be
325 fairly easy to complete:
328 - use dynamic allocations for working memory. Scan & fix code
329 for excessive stack allocations. take linux/scripts/checkstack.pl and
330 see what the worst offenders are. Dynamic stack allocations are found
331 at the bottom of the list below.  Example, on amd64:
333  $ objdump -d | checkstack.pl | head -10
334  0x004311e3 image_open [openocd]:                      13464
335  0x00431301 image_open [openocd]:                      13464
336  0x004237a4 target_array2mem [openocd]:                        4376
337  0x0042382b target_array2mem [openocd]:                        4376
338  0x00423e74 target_mem2array [openocd]:                        4360
339  0x00423ef9 target_mem2array [openocd]:                        4360
340  0x00404aed handle_svf_command [openocd]:              2248
341  0x00404b7e handle_svf_command [openocd]:              2248
342  0x00413581 handle_flash_fill_command [openocd]:               2200
343  0x004135fa handle_flash_fill_command [openocd]:               2200
344 - clean-up code to match style guides
345 - factor code to eliminate duplicated functionality
346 - rewrite code that uses casts to access 16-bit and larger types
347   from unaligned memory addresses
348 - libopenocd support: @par
349     https://lists.berlios.de/pipermail/openocd-development/2009-May/006405.html
350 - review and clean up interface/target/flash APIs
352 The following strategic tasks will require ambition, knowledge, and time
353 to complete:
355 - overhaul use of types to improve 32/64-bit portability
356   - types for both host and target word sizes?
357   - can we use GDB's CORE_TYPE support?
358 - Allow N:M:P mapping of servers, targets, and interfaces
359 - loadable module support for interface/target/flash drivers and commands
360   - support both static and dynamic modules.
361   - should probably use libltdl for dynamic library handing.
363 @section thelistadmin Documentation Tasks
365 - Develop milestone and release guidelines, processes, and scripts.
366 - Develop "style" guidelines (and scripts) for maintainers:
367   - reviewing patches
368   - committing to git
369 - Review Users' Guide for documentation errors or omissions
370   - "capture" and "ocd_find" commands
371   - "ocd_" prefix on various stuff
372 - Update Developer's Manual (doxygen output)
373   - Add documentation describing the architecture of each module
374   - Provide more Technical Primers to bootstrap contributor knowledge
377 /** @file
378 This file contains the @ref thelist page.