Indicate the Core in the Target list.
This commit is contained in:
parent
c44cb904b0
commit
dd3cb193f3
|
@ -225,7 +225,8 @@ bool cmd_swdp_scan(void)
|
|||
static void display_target(int i, target *t, void *context)
|
||||
{
|
||||
(void)context;
|
||||
gdb_outf("%2d %c %s\n", i, target_attached(t)?'*':' ', target_driver_name(t));
|
||||
gdb_outf("%2d %c %s %s\n", i, target_attached(t)?'*':' ',
|
||||
target_driver_name(t), target_core_name(t));
|
||||
}
|
||||
|
||||
bool cmd_targets(void)
|
||||
|
|
|
@ -46,6 +46,7 @@ target *target_attach_n(int n, struct target_controller *);
|
|||
void target_detach(target *t);
|
||||
bool target_attached(target *t);
|
||||
const char *target_driver_name(target *t);
|
||||
const char *target_core_name(target *t);
|
||||
|
||||
/* Memory access functions */
|
||||
bool target_mem_map(target *t, char *buf, size_t len);
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* Written by Gareth McMullin <gareth@blacksphere.co.nz>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* it under tSchreibe Objekte: 100% (21/21), 3.20 KiB | 3.20 MiB/s, Fertig.
|
||||
he terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
|
@ -269,6 +270,7 @@ bool cortexm_probe(ADIv5_AP_t *ap, bool forced)
|
|||
}
|
||||
|
||||
adiv5_ap_ref(ap);
|
||||
uint32_t identity = ap->idr & 0xff;
|
||||
struct cortexm_priv *priv = calloc(1, sizeof(*priv));
|
||||
if (!priv) { /* calloc failed: heap exhaustion */
|
||||
DEBUG("calloc: failed in %s\n", __func__);
|
||||
|
@ -284,6 +286,20 @@ bool cortexm_probe(ADIv5_AP_t *ap, bool forced)
|
|||
t->mem_write = cortexm_mem_write;
|
||||
|
||||
t->driver = cortexm_driver_str;
|
||||
switch (identity) {
|
||||
case 0x11: /* M3/M4 */
|
||||
t->core = "M3/M4";
|
||||
break;
|
||||
case 0x21: /* M0 */
|
||||
t->core = "M0";
|
||||
break;
|
||||
case 0x31: /* M0+ */
|
||||
t->core = "M0+";
|
||||
break;
|
||||
case 0x01: /* M7 */
|
||||
t->core = "M7";
|
||||
break;
|
||||
}
|
||||
|
||||
t->attach = cortexm_attach;
|
||||
t->detach = cortexm_detach;
|
||||
|
|
|
@ -425,6 +425,11 @@ const char *target_driver_name(target *t)
|
|||
return t->driver;
|
||||
}
|
||||
|
||||
const char *target_core_name(target *t)
|
||||
{
|
||||
return t->core;
|
||||
}
|
||||
|
||||
uint32_t target_mem_read32(target *t, uint32_t addr)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
|
|
@ -115,6 +115,7 @@ struct target_s {
|
|||
|
||||
/* Other stuff */
|
||||
const char *driver;
|
||||
const char *core;
|
||||
struct target_command_s *commands;
|
||||
|
||||
struct target_s *next;
|
||||
|
|
Loading…
Reference in New Issue