45 Commits

Author SHA1 Message Date
dragonmux
34696c0fec
target: Make the buffers used to program a target's Flash better bounded in lifetime and memory usage 2022-07-13 22:28:33 -04:00
dragonmux
23534ab174 target: Cleanup in target_new() for the check_error callback 2022-03-14 21:37:44 -07:00
Uwe Bonnes
554e34517e Better reporting when monitor command fails. 2021-09-22 21:41:43 +02:00
Uwe Bonnes
6dff2a9f31 target: target_error_check now defaults to not indicate error.
Remove unneeded nop_function from efm32
2021-08-15 16:43:29 +02:00
Björn Mellström
711a87f7ba Fix some warnings when compiling with -Wshadow
There are still a few more places that would need to be corrected
before -Wshadow could be added by default.
2021-06-03 12:55:28 +02:00
Uwe Bonnes
e4421799ba More header cleanup 2021-05-15 12:54:51 +02:00
Uwe Bonnes
52bffa70cf rp: Handle flash.
- Beware, after reset, only a valid flash payload get mapped to XIP!
  Only 0 is read from flash when flash image is not valid
2021-04-21 21:55:03 +02:00
Uwe Bonnes
23f942ac8c Raspberry RP2040: Recognize. No flash handling yet. 2021-04-21 21:50:35 +02:00
fabalthazar
6d6cfd6c98 Comprehensive STM32G03/4/5/6/7/8/B/C driver 2021-03-29 21:42:40 +02:00
Uwe Bonnes
8e2f6937d5 hosted: Run target specific monitor commands with -M "command" .
Lists available commands: "blackmagic -M help"
Quote multi argument monitor commands, e.g. STM32F1: blackmagic -M "option help"
2021-02-15 17:47:29 +01:00
Uwe Bonnes
165560edd8 cl_utils: target selection '-n' argument needs optarg.
foreach now returns the number of targets.
2021-02-15 17:47:29 +01:00
Uwe Bonnes
44bfb62715 Adiv5: Print Designer/Partno when device is not recognized
t->idcode is now 16 bit.
2020-10-07 20:12:35 +02:00
Uwe Bonnes
dc3fd2eb06 Classify debug messages
Firmware BMP with ENABLE_DEBUG=1 will print WARN and INFO as before.
PC-Hosted BMPwill alway print to stderr. Warn is printed unconditional,
INFO, GDB, TARGET, DONGLE and WIRE will print if their appropriate bit in
cl_debuglevel is set via the -v verbose command line argument.
INFO will go to stdout with -t or -l.
2020-06-05 14:59:30 +02:00
Uwe Bonnes
966ac4036d target.c: Check for valid flash structure. 2020-06-05 14:59:30 +02:00
Uwe Bonnes
05adcd9bf5 remote.c: Compile only relevant functions.
Do no compile firmware functions when compiling pc-hosted.
2020-06-05 14:59:30 +02:00
Koen De Vleeschauwer
9f8c7be360 semihosting 2020-05-02 12:55:29 +02:00
Koen De Vleeschauwer
8851504a41 new semihosting commands 2020-04-23 09:43:46 +02:00
Uwe Bonnes
470c8e8cf1 target_flash_erase: Do not crash when requesting erase of unavailable flash.
Allow to erase from command line.
2019-12-13 14:59:42 +01:00
Uwe Bonnes
fae2966b72 Target: Default to nop-function() for all exported target functions.
Fixes #522.
2019-09-23 17:42:29 +02:00
Gareth McMullin
20cad17ce3 target: Implement generic multi-register read/write 2019-09-01 20:38:38 +02:00
Gareth McMullin
9f4cf4124e target: Add new methods for read/write individual regs. 2019-09-01 20:38:38 +02:00
Uwe Bonnes
e29f2b4fb9 jtag/swd: Rename defines/make variables to allow removal of weak attribute
jtagtap.c is libopencm3 generic. Move to common.
2019-07-18 20:54:10 +02:00
Uwe Bonnes
dd3cb193f3 Indicate the Core in the Target list. 2019-07-17 17:38:21 +02:00
David R. Piegdon
02b2fdb2ae fix overwriting of still-needed value (refs #487)
this fixes a bug that was introduced in blackmagic PR #475 which lead to
firmware crashes when connecting to a BMP more than once without a
power-cycle.
2019-06-24 16:45:18 +02:00
Richard Meadows
600bc9f029 Generate DEBUG warnings and return if malloc/calloc fail.
This is will make debugging earier if this does happen, rather than
dereferencing the null pointer (or passing it to memcpy, or worse).

blackmagic PR #475
2019-05-26 18:56:12 +02:00
Uwe Bonnes
f3cacba219 libftdi: Flush buffer with detach. 2018-05-30 19:21:03 +02:00
Uwe Bonnes
5f404cdbc0 Construct memory map on the stack
The memory map uses 1k of SRAM and is only needed during attach. Release
after use lowers pressure on SRAM.
2018-04-23 10:51:04 +12:00
Gareth McMullin
00decb3718 target: Separate function to free memory map. 2018-04-23 10:48:05 +12:00
Gareth McMullin
048e8447a5 target: Only support buffered flash writes 2017-10-13 08:58:37 +13:00
Uwe Bonnes
120a2d9378 target: Fix calculation of erase size. 2017-10-05 22:11:01 +02:00
Uwe Bonnes
a7815fff3d target.c: No need to split write while still in same flash block. 2017-10-04 21:52:29 +02:00
Uwe Bonnes
25610e5ec5 target: Fix unconsistant use of tmplen. 2017-10-04 21:52:29 +02:00
stoyan shopov
01e3582525 fixed a bug in the breakpoint removal code 2017-04-28 13:22:59 +03:00
Gareth McMullin
3d2fa6d233 target: Add new targets to end of list.
This shows targets enumerated in their natural order,
rather than in reverse.
2017-03-27 14:59:54 +13:00
Gareth McMullin
ca364a889e Fix #145
Don't tc_printf in the probe.
tc_printf fixed to not crash of no controller connected.
2016-08-22 09:56:24 +12:00
Gareth McMullin
779e0b5d15 Print sizes in memory map using 32-bit formatting for newlib-nano. 2016-08-08 13:42:03 +12:00
Gareth McMullin
f131460168 Don't use zx format with printf. Doesn't work with newlib.
Fixes #144.
2016-07-19 10:45:46 +12:00
Gareth McMullin
9a45d89b4a target: Remove target_check_error from external interface. 2016-07-13 08:31:09 +12:00
Gareth McMullin
9aacc18f60 target: Restructure internal break/watch handling.
cortexa: Implement soft breakpoints.
2016-07-13 08:31:09 +12:00
Gareth McMullin
9136cf4c98 target: target_halt_wait and target_check_hw_wp replaced with target_halt_poll.
The new function returns a stop reason which must be translated in gdb server.
In the case of a watchpoint hit, the address is returned by a pointer parameter.
Simplify the extenal interface for set/clear breaki-/watchpoints.
2016-07-13 08:31:09 +12:00
Gareth McMullin
ab06243e93 target: Use size_t instead of unsigned in syscall interface. 2016-07-13 08:31:09 +12:00
Gareth McMullin
26fab877da target: Provide errno definitions and fallback for unimplemented syscalls. 2016-07-13 08:31:09 +12:00
Gareth McMullin
82cb6c8e83 target: Use target_addr for flash routines. 2016-07-13 08:31:09 +12:00
Gareth McMullin
aeaca988c3 target: Use new target_addr type consistently in external interface.
Flash routines still use uint32_t internally.
2016-07-13 08:31:09 +12:00
Gareth McMullin
b494279fe5 Move target files into separate directory. 2016-07-13 08:31:09 +12:00