Commit Graph

40 Commits

Author SHA1 Message Date
Marc Schink 73b676c2fd helper/fileio: Remove nested struct
Change-Id: I1a3afbddcf950689da58e0df8850a05f558d7879
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3222
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-02-29 21:04:47 +00:00
Christian Eggers 9b2577742c Constify received GDB packet
v2:
- Split work into separate patches

The received packet will not be altered in any of the processing functions.
Some it can be made "const".

Change-Id: I7bb410224cf6daa74a6c494624176ccb9ae638ac
Signed-off-by: Christian Eggers <ceggers@gmx.de>
Reviewed-on: http://openocd.zylin.com/1919
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04 20:17:34 +00:00
Spencer Oliver 08d4411b59 update files to correct FSF address
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1426
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2013-06-05 19:52:42 +00:00
Spencer Oliver 374127301e build: cleanup src/target directory
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/430
Tested-by: jenkins
2012-02-06 11:00:36 +00:00
Øyvind Harboe 19167a7af6 image: fix spelling mistake
struct imageection => struct imagesection

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-09-27 16:29:51 +02:00
Bradey Honsinger f85ad1e52a image loading: fix problem with offsets > 0x80000000
Fixes bug that prevented users from specifying a base address of
0x80000000 or higher in image commands (flash write_image, etm image,
xscale trace_image).

image.base_address is an offset from the start address contained in
the image file (if there is one), or from 0 (for binary files). As a
signed 32-bit int, it couldn't be greater than 0x7fffffff, which is a
problem when trying to write a binary file to flash above that
address. Changing it to a 64-bit long long keeps it as a signed
offset, but allows it to cover the entire 32-bit address space.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-16 10:11:40 +01:00
Zachary T Welch 14ed20967f change #include "fileio.h" to <helper/fileio.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "fileio.h"

the following form should be used.

	#include <helper/fileio.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:51 -08:00
Zachary T Welch 51862bb98c fileio: improve API types
Use size_t instead of uint32_t when specifying file sizes.  Update all
consumers up through the layers to use size_t when required.  These
changes should be safe, but the higher-levels will need to be updated
further to receive the intended benefits (i.e. large file support).

Add error checking for fileio_read and file_write.  Previously, all
errors were being silently ignored, so this change might cause some
problems for some people in some cases.  However, it gives us the chance
to handle any errors that do occur at higher-levels, rather than burying
our heads in the sand.
2009-11-16 15:47:09 -08:00
Zachary T Welch 0f1163e823 target_t -> struct target
Remove misleading typedef and redundant suffix from struct target.
2009-11-13 11:58:14 -08:00
Zachary T Welch dfecfd5fd4 image_t -> struct image
Remove misleading typedef and redundant suffix from struct image.

Also removes the typedef from enum image_type, as it is used in
image.h only.
2009-11-13 11:58:13 -08:00
Zachary T Welch d90063ffc5 image_elf_t -> struct image_elf
Remove misleading typedef and redundant suffix from struct image_elf.
2009-11-13 11:58:13 -08:00
Zachary T Welch ef36a7fb3b image_mot_t -> struct image_mot
Remove misleading typedef and redundant suffix from struct image_mot.
2009-11-13 11:58:11 -08:00
Zachary T Welch b154972bdb image_memory_t -> struct image_memory
Remove misleading typedef and redundant suffix from struct image_memory.
2009-11-13 11:58:11 -08:00
Zachary T Welch 1a4ff43a7c image_ihex_t -> struct image_ihex
Remove misleading typedef and redundant suffix from struct image_ihex.
2009-11-13 11:58:11 -08:00
Zachary T Welch a87faf5b66 image_binary_t -> struct image_binary
Remove misleading typedef and redundant suffix from struct image_binary.
2009-11-13 11:58:11 -08:00
Zachary T Welch 24df46d067 image_section_t -> struct image_section
Remove misleading typedef and redundant suffix from struct image_section.
2009-11-13 11:58:11 -08:00
Zachary T Welch 9f212b01be fileio_t -> struct fileio
Remove useless structure typedef.
2009-11-13 11:58:04 -08:00
Zachary T Welch ca594adb5a add const keyword to some APIs
Add 'const' keyword to 'char *' parameters to allow command handlers to
pass constant string arguments.  These changes allow the 'args' command
handler to be changed to 'const' in a subsequent patch.
2009-11-11 11:53:22 -08:00
Zachary T Welch 3885ab5a5a src/target: remove 'extern' and wrap headers
Remove extern keywords from function prototypes and wrap long lines.
2009-11-09 09:44:33 -08:00
Franck HÉRÉSON 053a763aa6 bugfix: stack corruption loading IHex images
The Hex parser uses a fixed number of sections.  When the
number of sections in the file is greater than that, the
stack get corrupted and a CHECKSUM ERROR is detected
which is very confusing.

This checks the number of sections read, and increases
IMAGE_MAX_SECTIONS so it works on my file.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-28 10:24:55 -07:00
oharboe 8b994145b8 Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17 19:54:25 +00:00
zwelch 3c2eabd20f Transform 'u32' to 'uint32_t' in src/target
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2279 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:09:35 +00:00
zwelch 86173cdbdd Transform 'u8' to 'uint8_t' in src/target
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:04:08 +00:00
zwelch 56504fdd73 Audit and eliminate redundant #include directives in other target files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1715 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:56:37 +00:00
ntfreak 0cba0d4df3 - remove target specific variant and use target->variant member
- fix build warning in cortex_m3
- code cleanup - remove trailing lf and convert c++ comments

git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-13 12:44:39 +00:00
oharboe 0a3b6213bb Laurentiu Cocanu <laurentiu.cocanu@zylin.com> - Added additional error checks mostly to src/target/target.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@1041 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-13 06:52:05 +00:00
ntfreak 68c598e88d - added myself to copyright on files i remember adding large contributions for over the years
- cleaned up headers to match rest of code
- added missing svn props for previously added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-20 10:50:53 +00:00
oharboe 526fe3d83e added yours sincerely for files where I feel that I've made non-trivial contributions.
git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25 06:54:17 +00:00
oharboe 219b7f30b9 - image.c and fileio.c now uses logging to propagate error strings.
More precise, less code.
- removed unused code in fileio.c
- Windows should now find debug_handler.bin

git-svn-id: svn://svn.berlios.de/openocd/trunk@390 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-29 11:42:37 +00:00
ntfreak e27696f6b0 - add verify_image command
- add support for gdb qCRC packet (compare-sections command)

git-svn-id: svn://svn.berlios.de/openocd/trunk@210 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-10-22 08:44:34 +00:00
drath 6ae83f5cf8 Patch by Michael Schwingen that
- adds support for the Altium universal JTAG cable
 - adds support for "wiggler2" cable (basically a wiggler with added LED, documentation coming soon)
 - adds LED support. The LED is turned on during data transfer - works fine on Altium and wiggler2.
 - adds PORT_EXIT pattern that is written to port when exiting, in order to turn off power on cables that get their power from parallel port data lines
 - move port writes (with the system-specific ifdefs) to one central function

- increased image cache size to 2KB (might require more adaptive cache handling, e.g. LRU)



git-svn-id: svn://svn.berlios.de/openocd/trunk@204 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-09-05 06:22:37 +00:00
drath 20e4e77cdf - renamed M5960 USB JTAG to "flyswatter"
- make ep93xx and at91rm9200 bitbang JTAG interfaces dependant on ARM host (thanks to Vincent Palatin)
- various whitespace fixes
- removed various warnings
- add support for Debian GNU/kFreeBSD (thanks to Uwe Hermann)
- fix OpenOCD compilation for various platforms (thanks to Uwe Hermann and Vincent Palatin)
- switched order of JTAG chain examination and validation (examine first, then multiple validation tries even if examination failed)
- added target_request subsystem to handle requests from the target (debug messages and tracepoints implemented, future enhancements might include
semihosting, all ARM7/9 only for now)
- added support for GDB vFlashXXX packets (thanks to Pavel Chromy)
- added support for receiving data via ARM7/9 DCC
- reworked flash writing. the 'flash write' command is now deprecated and replaced by 'flash write_binary' (old syntax and behaviour) and 'flash
write_image' (write image files (bin, hex, elf, s19) to a target).
- added support for AMD/ST/SST 29F400B non-cfi flashes



git-svn-id: svn://svn.berlios.de/openocd/trunk@190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-08-10 19:44:06 +00:00
drath dbd95cb8a2 - calculate cycles since last executed instruction when cycle-accurate tracing is enabled
- increase memory pseudo-image cache size to 1024 byte for improved trace analysis performance
- added OpenOCD+trace as an ETM capture driver example implementation
- new usbprog driver (thanks to Benedikt Sauter)


git-svn-id: svn://svn.berlios.de/openocd/trunk@186 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-31 10:07:32 +00:00
ntfreak f251b925ff - motorola s19 file loader added
- added checksum support to intel hex file loader
- elf file loader now ignores any bss sections
- mingw build now always opens files in binary mode

git-svn-id: svn://svn.berlios.de/openocd/trunk@185 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-07-31 09:15:59 +00:00
ntfreak 4b97f3cbb9 - added mingw elf patches from Vincent Palatin
- added str9x programming using flash controller tap (str9xpec), including option bytes and device lock/unlock
- inttypes.h now used for long long printf style declarations

git-svn-id: svn://svn.berlios.de/openocd/trunk@174 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-16 14:45:55 +00:00
drath 3d026ce943 - added support for pseudo image type "mem", currently only used for etm analysis: "etm image <target#> <dummy base address> mem"
git-svn-id: svn://svn.berlios.de/openocd/trunk@173 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-15 14:10:23 +00:00
drath 53d1f9b2ca - added manpage for OpenOCD (thanks to Uwe Hermann)
- fixed bug in ARM926EJ-S cache handling that caused cache linefills to be disabled after first debug entry
- added support for auto image type detection (thanks to Vincent Palatin)
- further work on ETM trace decoding (tested with a ETB interface using an ETM in normal 16-bit port mode, still experimental)



git-svn-id: svn://svn.berlios.de/openocd/trunk@169 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-06-14 09:47:00 +00:00
drath 7087b66f19 - add support for ELF images (thanks to Vincent Palatin for this patch)
git-svn-id: svn://svn.berlios.de/openocd/trunk@161 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-31 11:17:54 +00:00
drath f94d66d7c5 - reworked image handling to support multiple sections (tested with ihex file containing gaps)
This checkin is still experimental, not recommended for general use



git-svn-id: svn://svn.berlios.de/openocd/trunk@159 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-30 15:47:18 +00:00
drath cbefac0be0 - add missing image handling files
git-svn-id: svn://svn.berlios.de/openocd/trunk@156 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-05-29 12:04:20 +00:00