59 Commits

Author SHA1 Message Date
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
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
b644724520 Overhaul of semihosting. Remove dependence of target on gdb_packet. 2016-07-13 08:31:09 +12:00
Gareth McMullin
b03cc59bea target: Add target controller structure for indirect calls back to host. 2016-07-13 08:31:09 +12:00
Gareth McMullin
5c5f76d60e target: Remove last accesses to private structure from outside.
Only include target_internal.h from inside target files.
2016-07-13 08:31:09 +12:00
Gareth McMullin
07f27d1b70 Hide target list internals form command.c
Remove unused support for extended target structure size.
2016-07-13 08:31:09 +12:00
Gareth McMullin
72790893ae target: move mmio routines out of public interface.
Fix crc routine to use buffered reads on stm32.
2016-07-13 08:31:09 +12:00
Gareth McMullin
e28e158721 Move *scan prototypes to target.h. 2016-07-13 08:31:09 +12:00
Gareth McMullin
4e04c1dded Split out non-public target stuff into new header.
Wrap target methods with functions instead of macros.
2016-07-13 08:31:09 +12:00
David Lawrence
4addec0a21 lpc15xx support 2016-07-05 16:53:47 -04:00
Gareth McMullin
60f3be501e Pass breakpoint length to target. 2016-04-19 13:24:05 -07:00
Gareth McMullin
459bae4ea1 ADIv5 structural changes.
- Probe ROM table
- Mem-AP no longer pretends to be a target
- AP no longer provides priv pointer
2016-04-19 13:24:05 -07:00
Gareth McMullin
cd1d72257f Cleanup of SRST handling.
- Remove connect_assert_srst global.
- Attach functions always release reset.
- Platforms provide a method to poll the reset pin.
- Reset on scan is all internal to command.c
- Reset is released on a failed scan.  Fixes #111
2016-04-19 13:12:16 -07:00
Richard Meadows
fa7cccff23 [efm32] Formatting fixes 2015-11-14 14:56:03 +00:00
Richard Meadows
07f7571dd1 Add basic support for EFM32/EZR32 chips
Tested with EZR32LG230
2015-10-23 19:58:44 +01:00
Uwe Bonnes
2336a313e4 Add STM32L4 handling. No option write handling yet. 2015-08-22 12:59:56 +02:00
Gareth McMullin
09b781f1c1 target: Remove old flash interface. 2015-04-11 16:05:41 -07:00
Gareth McMullin
45328ea124 Add buffering support for flash drivers.
Some devices can get a significant boost in performance by writing to
flash memories one page at a time.  Generic function to do this are
provided at the target layer and may be used by flash drivers.
2015-04-11 16:05:40 -07:00
Gareth McMullin
36f749fed9 Fix flash buffer alignment in target layer. 2015-04-03 21:21:30 -07:00
Gareth McMullin
7202db5860 Add new functions to wrap flash driver erase/write/done operations. 2015-04-03 21:20:01 -07:00
Gareth McMullin
691d21989a Add function to add simple flash driver to target.
Clean up ram/flash/memory map on target destruction.
2015-04-03 21:18:16 -07:00
Gareth McMullin
0fc635b3f8 Add functions for dynamically generating the XML memory map. 2015-04-03 21:18:16 -07:00
Gareth McMullin
21d464293c gdb: don't access target fields directly. 2015-03-29 18:06:13 -07:00
Gareth McMullin
c2cde32716 Improve cortexm_read/write_regs. Use more sensible return types. 2015-03-29 17:37:03 -07:00
Gareth McMullin
1e54139f4a target: Remove pc_read/pc_write methods. 2015-03-28 20:15:33 -07:00
Gareth McMullin
4313b64bbe Add a flash_done target method. 2015-03-26 20:47:57 -07:00
Gareth McMullin
64c79e1d03 Consistently name target var 't' in cortexm. 2015-03-26 20:47:57 -07:00
Gareth McMullin
2bf54f9a72 Replace adiv5_ap_mem* functions with inline wrappers to target mem*. 2015-03-15 16:02:09 -07:00
Gareth McMullin
ee3af96a73 Consolidate target_mem_read* and target_mem_write* methods.
There are now only mem_read and mem_write, that must
handle all alignments.  These methods return void, errors must be
checked with target_check_error.
2015-03-15 14:31:57 -07:00
Gareth McMullin
6f5b1873d7 Use size_t for sizes in flash functions. Fix all sign compare warnings. 2015-03-14 15:18:22 -07:00
Marc Singer
e0a8ce5a88 STM32L0x target support.
Target support for stm32l0's and stm32l1's including option bytes and
data EEPROM.  This module will superceed the previous stm32l1 driver.

o Program flash write and erase.
o Options modification and interpretive status.
o Stubs for program flash writes and erases.  Stubs are modestly
  faster than non-stub version.   The stm32l0 will not execute stubs
  when the MCU has crashed.  A monitor option may be used to force
  non-stub flash writes.
o Stubs generated from C++ code and converted to arrays of half-words.
o Writes to data EEPROM supoprted when loading segments.
o EEPROM data monitor command to write words.
o Stubs supported on stm32l1.
2015-03-08 16:17:34 -07:00
Gareth McMullin
4d4813de87 Clean up includes everywhere.
All source files include general.h first and before anything else.
This inlcludes platform.h and platform_support.h
No header file needs to include to include any of these, but should include
any others needed for it's own declarations.
2015-03-01 22:16:04 -08:00
Richard Meadows
565795e168 Added support for SAMD10/11/21, and list of tested SAM D devices
This allows blackmagic to be used with the new Arduino Zero board via
the unpopulated SWD header on the east end of the board.
2015-01-18 22:35:59 +00:00
Gareth McMullin
9c5ffd61f7 First cut at Freescale Kinetis support. 2015-01-06 22:26:00 +13:00
Vegard Storheil Eriksen
9434299613 Add support for halfword memory accesses. 2014-10-21 00:12:50 +02:00
Richard Eoin Meadows
945a2802d5 Atmel SAMD20 support 2014-09-03 21:17:41 +12:00
Mike
34d0f64529 Nordic nRF51 series support 2014-05-01 15:09:59 +01:00
Gareth McMullin
8c877d6dfa Fix trailing whitespace everywhere. 2013-06-17 15:53:32 +12:00
Gareth McMullin
5020d1f05d Move semihosting support to cortexm.c.
Try to implement more syscalls.
2013-05-18 15:33:58 +12:00
Paul Fertser
e0fc21a2a7 adiv5_swdp: allow to connect to a sleeping target by pulling SRST
This patch introduces a new command, "connect_srst [enable|disable]"
which allows to enable special mode in which SRST would be pulled low
before the SWD scan till attaching to a target.

Since on Cortex-Mx the SRST signal doesn't gate JTAG and SWD, it's
possible to connect to a target while holding reset, ask it to stop at
reset vector and only then deassert reset, thus allowing to attach to
the kind of firmware that goes immediately to sleep or disables
debugging by other means early on start.

Tested on an STM32VLDiscovery board with STM32F100 configured to go to
STOP mode and executing WFI in the very beginning of main().

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2013-05-14 12:32:44 +12:00
Gareth McMullin
2637f072a1 Probe function return bool, true if device identified.
Correctly identify LM3S3748.
2012-11-03 23:53:25 +13:00
Gareth McMullin
e1c1162a1a Recognise LPC43xx dual core devices. 2012-11-03 21:33:28 +13:00
Gareth McMullin
0990c2224c Allow target attachment to timeout and report failure.
This is needed for if the target device is held in reset.
2012-11-03 16:42:46 +13:00
Vegard Storheil Eriksen
faa43fdc92 Added support for STM32L1. 2012-10-25 21:44:26 +02:00
Gareth McMullin
0433d3d12a cortexm: Moved all static data to the heap. 2012-07-05 21:26:26 +12:00
Gareth McMullin
00c4dbfb11 ADIv5 AP and DP are now allocated on the heap and reference counted.
They are unref'd and free'd automatically when the target list is
destroyed.
2012-07-05 19:23:28 +12:00
Gareth McMullin
d64cec686a Signal on halt is now returned by target_halt_wait().
Fault unwinding is now handled internally in target implementation.
GDB server doesn't need to know about it.
2012-06-30 20:29:08 +12:00
Gareth McMullin
466bb66424 Made cur_target, last_target static in gdb_main.c.
Added target destroy notify mechanism.
2012-06-27 21:26:08 +12:00
Gareth McMullin
03fdd23e9c Added mechanism for target driver to add new monitor commands. 2012-06-24 21:41:32 +12:00