Commit Graph

58 Commits

Author SHA1 Message Date
Zachary T Welch
0796dfff89 use FLASH_BANK_COMMAND_HANDLER macro
Defines all flash_bank_command handlers using the new macro.
2009-11-13 10:51:46 -08:00
Zachary T Welch
cfc4d5c6b7 use COMMAND_HANDLER macro to define all commands 2009-11-13 10:51:45 -08:00
Zachary T Welch
2351641b8f {pic32m,stm32}x.c: remove useless declarations
Remove useless forward declarations.
Moves command registrations to end of files.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:48 -08:00
Zachary T Welch
aa9351ba46 Improve stm32x.c command argument parsing. 2009-11-05 18:19:19 -08:00
dbrownell
48e96a18ed Enhancement: stm32 flash protection error message
This patch modifies an error message which, in its original state,
I find somewhat unhelpful. So a small hint was added.

Signed-off-by: Johnny Halfmoon <jhalfmoon at milksnot.com>


git-svn-id: svn://svn.berlios.de/openocd/trunk@2738 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-20 23:54:13 +00:00
ntfreak
f486f86c6c - correct stm32 connectivity line programming as per latest manual
git-svn-id: svn://svn.berlios.de/openocd/trunk@2439 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-01 10:15:53 +00:00
zwelch
dc575dc5bf Remove whitespace that occurs before ')'.
- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:47:42 +00:00
zwelch
f90d8fa45f Remove whitespace that occurs after '('.
- Replace '([ \t]*' with '('.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:46:23 +00:00
zwelch
fb1a9b2cb2 - Fixes '[|]' whitespace
- Replace ')\([|]\)(' with ') \1 ('.
- Replace ')\([|]\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\([|]\)(' with '\1 \2 ('.
- Replace '\(\w\)\([|]\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:15 +00:00
zwelch
84df52f9ea - Fixes '=' whitespace
- Replace ')\(=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:42:54 +00:00
zwelch
aea6815462 - Fixes '<<' whitespace
- Replace ')\(<<\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(<<\)(' with '\1 \2 ('.
- Replace '\(\w\)\(<<\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2370 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:41:13 +00:00
zwelch
53d605e12c - Fixes '!=' whitespace
- Replace ')\(!=\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(!=\)(' with '\1 \2 ('.
- Replace '\(\w\)\(!=\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:38:12 +00:00
zwelch
9af5e445b7 - Replace 'switch(' with 'switch ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:36:56 +00:00
zwelch
e43979e702 - Replace 'if(' with 'if ('.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2357 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:35:09 +00:00
duane
bf509dbafa C99 printf() -Werror fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2330 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-21 03:19:55 +00:00
zwelch
1840226d55 Transform 'u32' to 'uint32_t' in src/flash.
- Replace '\([^_]\)u32' with '\1uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2280 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:10:25 +00:00
zwelch
f876d5e9c7 Transform 'u16' to 'uint16_t'
- Replace '\([^_]\)u16' with '\1uint16_t'.
- Replace '^u16' with 'uint16_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:07:59 +00:00
zwelch
310be8a838 Transform 'u8' to 'uint8_t' in src/flash
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2275 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:06:25 +00:00
zwelch
278ca633da David Brownell <david-b@pacbell.net>:
Remove broken whitespace ... mostly at end of line, but
also in some cases blocks of inappropriate empty lines.

And spell "comamnd" right. :)


git-svn-id: svn://svn.berlios.de/openocd/trunk@1972 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-01 03:05:26 +00:00
zwelch
fbe8cf72a5 Add target_run_algorithm wrapper:
- replaces all calls to target->type->run_algorithm.
- add documentation in target_s to warn not to invoke callback directly.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 09:38:20 +00:00
zwelch
fbcb57baf8 Audit and eliminate redundant #include directives in src/flash sources.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1712 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:30:41 +00:00
zwelch
fdf114ab0a Fix stm32x and pic32mx flash pointer cast alignment warnings, simplify their last word handling.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1626 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-07 00:21:59 +00:00
mlu
7d61acebd8 Clear FLASH_SR error flags after flash errors to avoid reset befor further flash operations.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1571 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 21:08:39 +00:00
oharboe
a88532bc60 Zach Welch <zw@superlucidity.net> fix signed/unsigned comparisons
git-svn-id: svn://svn.berlios.de/openocd/trunk@1466 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-19 08:16:58 +00:00
mifi
0bba832713 The following patches was applied:
- openocd-flash-static-keyword-v3.patch
- openocd-lpc2000-fix-erase-obo.patch
- openocd-jlink-fix-sign-ptr-warn.patch
- openocd-wextra-etm.patch
- openocd-wextra-jtag.patch
- openocd-add-new-tap-symbols-v6.patch

Many thanks to  Zach Welch <zw(at)superlucidity.net>

git-svn-id: svn://svn.berlios.de/openocd/trunk@1462 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-18 10:08:13 +00:00
mlu
ba4e2c43fb Improved (for humans) error reporting for flash programming errors.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1456 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-14 17:17:38 +00:00
mlu
c008618be9 Cortex-M3 cleanup and performance patch
git-svn-id: svn://svn.berlios.de/openocd/trunk@1438 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-02 12:16:19 +00:00
ntfreak
58f4bd4a3c - stm32x flash driver - add support for stm32105/107 (connectivity line)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1383 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-02-26 10:06:00 +00:00
ntfreak
ab28153685 - stm32x flash driver: add support for low density devices
git-svn-id: svn://svn.berlios.de/openocd/trunk@1189 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-11-27 12:14:46 +00:00
oharboe
d34e01f51d search and replace usleep(1000) with alive_sleep(1) to avoid GDB timeouts.
git-svn-id: svn://svn.berlios.de/openocd/trunk@942 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-19 16:40:35 +00:00
oharboe
330cf5a6bb fixed not halted error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@925 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-17 19:40:17 +00:00
ntfreak
be00c7d0c4 - more fixes to high density stm32x flash driver
- updated copyright for original author

git-svn-id: svn://svn.berlios.de/openocd/trunk@859 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-23 14:49:41 +00:00
ntfreak
dad28d0659 - fix bug with stm32 high density write protection
git-svn-id: svn://svn.berlios.de/openocd/trunk@858 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-22 14:30:52 +00:00
ntfreak
b979c22bcc - stm32 flash driver correctly handles early silicon
git-svn-id: svn://svn.berlios.de/openocd/trunk@808 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-15 10:21:43 +00:00
ntfreak
5c8ebfbed2 - probe incorrect for high density stm32 flash
git-svn-id: svn://svn.berlios.de/openocd/trunk@708 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-11 11:12:24 +00:00
ntfreak
ba8c605da4 - stm32 erase will use mass_erase if all banks selected
git-svn-id: svn://svn.berlios.de/openocd/trunk@706 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-06 09:29:21 +00:00
ntfreak
61933601bb - luminary, stm32 and str7 flash driver error cleanup
git-svn-id: svn://svn.berlios.de/openocd/trunk@700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-06-04 09:18:42 +00:00
ntfreak
938e01d0c3 - moved flash erase_check target code to target.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@694 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-27 21:23:47 +00:00
ntfreak
6945fb26c8 - corrected error with stm32 page calculation
git-svn-id: svn://svn.berlios.de/openocd/trunk@686 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-26 11:04:20 +00:00
ntfreak
7f19b91c80 - update sectors on stm32x mass erase
git-svn-id: svn://svn.berlios.de/openocd/trunk@681 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-24 14:19:42 +00:00
ntfreak
155c3d763c - add support for newer high density stm32 parts
git-svn-id: svn://svn.berlios.de/openocd/trunk@674 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-05-23 15:49:19 +00:00
ntfreak
26414b39d4 - stm32x default to 128k if flash size failed.
git-svn-id: svn://svn.berlios.de/openocd/trunk@627 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-29 17:07:23 +00:00
ntfreak
9c3dec377e - single core context used, removed debug context as thought unnecessary.
- DCRDR now used to access special core registers - info is currently omitted from the cortex_m3 TRM ARM have told me this is the preferred access method and the docs will be updated soon.
- now checks for User Thread Mode and Thread mode when halted.
- removed repeated function declarations from command.c
- cortex_m3_prepare_reset_halt removed, updated cortex_m3_assert_reset to suit

git-svn-id: svn://svn.berlios.de/openocd/trunk@558 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-10 11:43:48 +00:00
oharboe
d3f0549f08 - Work on fixing erase check. Many implementations are plain broken.
Wrote a default flash erase check fn which uses CFI's target algorithm
w/fallback to memory reads. 
- "flash info" no longer prints erase status as it is stale. 
- "flash erase_check" now prints erase status. erase check can take a 
*long* time. Work in progress
- arm7/9 with seperate srst & trst now supports reset init/halt
after a power outage. arm7/9 no longer makes any assumptions
about state of target when reset is asserted.
- fixes for srst & trst capable arm7/9 with reset init/halt
- prepare_reset_halt retired. This code needs to be inside
assert_reset anyway
- haven't been able to get stm32 write algorithm to work. Fallback
flash write does work. Haven't found a version of openocd trunk
where this works.
- added target_free_all_working_areas_restore() which can
let be of restoring backups. This is needed when asserting
reset as the target must be assumed to be an unknown state.
Added some comments to working areas API
- str9 reset script fixes
- some guidelines
- fixed dangling callbacks upon reset timeout 


git-svn-id: svn://svn.berlios.de/openocd/trunk@536 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-03 14:00:17 +00:00
ntfreak
d47e1b8f36 - rename log functions to stop conflicts under win32 (wingdi)
git-svn-id: svn://svn.berlios.de/openocd/trunk@523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-25 15:45:17 +00:00
ntfreak
189ef12a52 - correct spelling typo in stm32x flash driver
git-svn-id: svn://svn.berlios.de/openocd/trunk@467 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-07 11:29:08 +00:00
oharboe
86ca2270f4 Pavel Chromy cleaned up checks for halted, error messages, etc.
git-svn-id: svn://svn.berlios.de/openocd/trunk@374 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-28 10:44:41 +00:00
oharboe
bcb0124b15 dos2unix fix.
git-svn-id: svn://svn.berlios.de/openocd/trunk@339 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 08:01:21 +00:00
oharboe
815c3b3533 - "flash write_binary" is now "flash write_bank" to clarify the focus of the
command and reduce confusion with "flash write_image".
- retired deprecated "flash erase" & "flash write".
- added flash_driver_protect/write/erase() that are wafer thin frontend
 functions to low level driver functions. They implement checks
 that were inconsistently handled by the drivers, e.g. check for
 target halted was done in a spotty fashion.
- use return ERROR_COMMAND_SYNTAX_ERROR to print out
 syntax of command instead of having lots of inlined replicas of
 the command line syntax(some of which were wrong).
- use logging instead of dubious translation of error values to
 human understandable explanations of why things failed.
 The lower levels log the precise reason and the higher
 levels can ammend context as the error propagates up
 the call stack.
- simplified flash API slightly with logging instead of
 allocating and returning information that the caller then
 has to translate into print statements.



git-svn-id: svn://svn.berlios.de/openocd/trunk@337 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 07:32:52 +00:00
ntfreak
c65f7cf2fa - added check for revA silicon in stm32 flash driver
git-svn-id: svn://svn.berlios.de/openocd/trunk@294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-14 10:02:51 +00:00