samd: ability to printout entire serial number
This commit is contained in:
parent
5c835bc0f6
commit
94238fd95b
@ -44,6 +44,7 @@ struct command_s {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static bool cmd_version(void);
|
static bool cmd_version(void);
|
||||||
|
static bool cmd_serial(void);
|
||||||
static bool cmd_help(target *t);
|
static bool cmd_help(target *t);
|
||||||
|
|
||||||
static bool cmd_jtag_scan(target *t, int argc, char **argv);
|
static bool cmd_jtag_scan(target *t, int argc, char **argv);
|
||||||
@ -71,6 +72,9 @@ static bool cmd_enter_bootldr(target *t, int argc, const char **argv);
|
|||||||
|
|
||||||
const struct command_s cmd_list[] = {
|
const struct command_s cmd_list[] = {
|
||||||
{"version", (cmd_handler)cmd_version, "Display firmware version info"},
|
{"version", (cmd_handler)cmd_version, "Display firmware version info"},
|
||||||
|
#ifdef PLATFORM_HAS_PRINTSERIAL
|
||||||
|
{"serial", (cmd_handler)cmd_serial, "Display firmware serial number"},
|
||||||
|
#endif
|
||||||
{"help", (cmd_handler)cmd_help, "Display help for monitor commands"},
|
{"help", (cmd_handler)cmd_help, "Display help for monitor commands"},
|
||||||
{"jtag_scan", (cmd_handler)cmd_jtag_scan, "Scan JTAG chain for devices" },
|
{"jtag_scan", (cmd_handler)cmd_jtag_scan, "Scan JTAG chain for devices" },
|
||||||
{"swdp_scan", (cmd_handler)cmd_swdp_scan, "Scan SW-DP for devices" },
|
{"swdp_scan", (cmd_handler)cmd_swdp_scan, "Scan SW-DP for devices" },
|
||||||
@ -354,3 +358,11 @@ static bool cmd_enter_bootldr(target *t, int argc, const char **argv)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PLATFORM_HAS_PRINTSERIAL
|
||||||
|
bool cmd_serial(void)
|
||||||
|
{
|
||||||
|
print_serial();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "gdb_if.h"
|
#include "gdb_if.h"
|
||||||
#include "cdcacm.h"
|
#include "cdcacm.h"
|
||||||
#include "usbuart.h"
|
#include "usbuart.h"
|
||||||
|
#include "gdb_packet.h"
|
||||||
|
|
||||||
#include <libopencm3/sam/d/nvic.h>
|
#include <libopencm3/sam/d/nvic.h>
|
||||||
#include <libopencm3/sam/d/port.h>
|
#include <libopencm3/sam/d/port.h>
|
||||||
@ -280,6 +281,14 @@ char *serialno_read(char *s)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_serial(void)
|
||||||
|
{
|
||||||
|
gdb_outf("0x%08X%08X%08X%08X\n", *(volatile uint32_t *)0x0080A048,
|
||||||
|
*(volatile uint32_t *)0x0080A044,
|
||||||
|
*(volatile uint32_t *)0x0080A040,
|
||||||
|
*(volatile uint32_t *)0x0080A00C);
|
||||||
|
}
|
||||||
|
|
||||||
void platform_request_boot(void)
|
void platform_request_boot(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#define PLATFORM_HAS_UART_WHEN_SWDP
|
#define PLATFORM_HAS_UART_WHEN_SWDP
|
||||||
#define PLATFORM_HAS_POWER_SWITCH
|
#define PLATFORM_HAS_POWER_SWITCH
|
||||||
#define PLATFORM_HAS_BOOTLOADER
|
#define PLATFORM_HAS_BOOTLOADER
|
||||||
|
#define PLATFORM_HAS_PRINTSERIAL
|
||||||
|
|
||||||
#define BOARD_IDENT "Black Magic Probe (SAMD), (Firmware " FIRMWARE_VERSION ")"
|
#define BOARD_IDENT "Black Magic Probe (SAMD), (Firmware " FIRMWARE_VERSION ")"
|
||||||
#define BOARD_IDENT_DFU "Black Magic (Upgrade) for Launchpad, (Firmware " FIRMWARE_VERSION ")"
|
#define BOARD_IDENT_DFU "Black Magic (Upgrade) for Launchpad, (Firmware " FIRMWARE_VERSION ")"
|
||||||
@ -219,4 +220,5 @@ static inline int platform_hwversion(void)
|
|||||||
|
|
||||||
void uart_pop(void);
|
void uart_pop(void);
|
||||||
int usbuart_convert_tdio(uint32_t arg);
|
int usbuart_convert_tdio(uint32_t arg);
|
||||||
|
void print_serial(void);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user