1
- /*
1
+ /*
2
2
* File: stlink-common.h
3
3
* Bulk import from stlink-hw.h
4
- *
4
+ *
5
5
* This should contain all the common top level stlink interfaces, regardless
6
6
* of how the backend does the work....
7
7
*/
@@ -24,6 +24,7 @@ extern "C" {
24
24
#define USB_ST_VID 0x0483
25
25
#define USB_STLINK_PID 0x3744
26
26
#define USB_STLINK_32L_PID 0x3748
27
+ #define USB_STLINK_NUCLEO_PID 0x374b
27
28
28
29
// STLINK_DEBUG_RESETSYS, etc:
29
30
#define STLINK_OK 0x80
@@ -67,7 +68,7 @@ extern "C" {
67
68
#define STLINK_DEBUG_WRITEDEBUGREG 0x0f
68
69
#define STLINK_DEBUG_ENTER_SWD 0xa3
69
70
#define STLINK_DEBUG_ENTER_JTAG 0x00
70
-
71
+
71
72
// TODO - possible poor names...
72
73
#define STLINK_SWD_ENTER 0x30
73
74
#define STLINK_SWD_READCOREID 0x32 // TBD
@@ -144,8 +145,8 @@ extern "C" {
144
145
uint32_t sram_size ;
145
146
uint32_t bootrom_base , bootrom_size ;
146
147
} chip_params_t ;
147
-
148
-
148
+
149
+
149
150
// These maps are from a combination of the Programming Manuals, and
150
151
// also the Reference manuals. (flash size reg is normally in ref man)
151
152
static const chip_params_t devices [] = {
@@ -324,7 +325,7 @@ static const chip_params_t devices[] = {
324
325
},
325
326
};
326
327
327
-
328
+
328
329
typedef struct {
329
330
uint32_t r [16 ];
330
331
uint32_t s [32 ];
@@ -341,7 +342,7 @@ static const chip_params_t devices[] = {
341
342
} reg ;
342
343
343
344
typedef uint32_t stm32_addr_t ;
344
-
345
+
345
346
typedef struct _cortex_m3_cpuid_ {
346
347
uint16_t implementer_id ;
347
348
uint16_t variant ;
@@ -431,7 +432,7 @@ static const chip_params_t devices[] = {
431
432
#define STM32L_SRAM_SIZE (16 * 1024)
432
433
stm32_addr_t sram_base ;
433
434
size_t sram_size ;
434
-
435
+
435
436
// bootloader
436
437
stm32_addr_t sys_base ;
437
438
size_t sys_size ;
@@ -476,7 +477,7 @@ static const chip_params_t devices[] = {
476
477
int stlink_fwrite_flash (stlink_t * sl , const char * path , stm32_addr_t addr );
477
478
int stlink_fwrite_sram (stlink_t * sl , const char * path , stm32_addr_t addr );
478
479
int stlink_verify_write_flash (stlink_t * sl , stm32_addr_t address , uint8_t * data , uint32_t length );
479
-
480
+
480
481
// PUBLIC
481
482
uint32_t stlink_chip_id (stlink_t * sl );
482
483
void stlink_cpu_id (stlink_t * sl , cortex_m3_cpuid_t * cpuid );
@@ -502,7 +503,7 @@ static const chip_params_t devices[] = {
502
503
503
504
504
505
#include "stlink-sg.h"
505
- #include "stlink-usb.h"
506
+ #include "stlink-usb.h"
506
507
507
508
508
509
0 commit comments