X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstlink-common.h;h=b357c7a52a533438aa68f61b2a4d2ab1a049295d;hb=bd3472751be353b9e220bfa2fa59bacb4d6b5b57;hp=7c3c0cbe32694169c59eb4cacf85876cd4642591;hpb=f85a173c465bb875359df223cfac81cdd16db5c7;p=fw%2Fstlink diff --git a/src/stlink-common.h b/src/stlink-common.h index 7c3c0cb..b357c7a 100644 --- a/src/stlink-common.h +++ b/src/stlink-common.h @@ -71,6 +71,9 @@ extern "C" { #define STLINK_SWD_ENTER 0x30 #define STLINK_SWD_READCOREID 0x32 // TBD +// cortex m3 technical reference manual +#define CM3_REG_CPUID 0xE000ED00 + typedef struct { uint32_t r[16]; uint32_t xpsr; @@ -81,6 +84,13 @@ extern "C" { } reg; typedef uint32_t stm32_addr_t; + + typedef struct _cortex_m3_cpuid_ { + uint16_t implementer_id; + uint16_t variant; + uint16_t part; + uint8_t revision; + } cortex_m3_cpuid_t; typedef struct stlink_version_ { uint32_t stlink_v; @@ -197,6 +207,7 @@ extern "C" { // PUBLIC uint16_t stlink_chip_id(stlink_t *sl); + void stlink_cpu_id(stlink_t *sl, cortex_m3_cpuid_t *cpuid); // privates, publics, the rest.... // TODO sort what is private, and what is not