Skip to content

Commit 2b54a11

Browse files
Merge branch 'develop' into st-trace
2 parents fdeb172 + b47f083 commit 2b54a11

File tree

17 files changed

+891
-550
lines changed

17 files changed

+891
-550
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ if (STLINK_HAVE_SYS_MMAN_H)
6060
add_definitions(-DSTLINK_HAVE_SYS_MMAN_H)
6161
endif()
6262

63+
CHECK_INCLUDE_FILE(sys/time.h STLINK_HAVE_SYS_TIME_H)
64+
if (STLINK_HAVE_SYS_TIME_H)
65+
add_definitions(-DSTLINK_HAVE_SYS_TIME_H)
66+
endif()
67+
6368
CHECK_INCLUDE_FILE(unistd.h STLINK_HAVE_UNISTD_H)
6469
if (STLINK_HAVE_UNISTD_H)
6570
add_definitions(-DSTLINK_HAVE_UNISTD_H)
@@ -104,6 +109,7 @@ set(STLINK_HEADERS
104109
src/stlink-lib/md5.h
105110
src/stlink-lib/sg.h
106111
src/stlink-lib/usb.h
112+
src/stlink-lib/helper.h
107113
)
108114

109115
set(STLINK_SOURCE
@@ -114,6 +120,7 @@ set(STLINK_SOURCE
114120
src/stlink-lib/md5.c
115121
src/stlink-lib/sg.c
116122
src/stlink-lib/usb.c
123+
src/stlink-lib/helper.c
117124
)
118125

119126
if (WIN32)
@@ -132,6 +139,11 @@ if (WIN32)
132139
set(STLINK_SOURCE "${STLINK_SOURCE};src/win32/mmap.c")
133140
set(STLINK_HEADERS "${STLINK_HEADERS};src/win32/mmap.h")
134141
endif()
142+
143+
if (NOT STLINK_HAVE_SYS_TIME_H)
144+
set(STLINK_SOURCE "${STLINK_SOURCE};src/win32/sys_time.c")
145+
set(STLINK_HEADERS "${STLINK_HEADERS};src/win32/sys_time.h")
146+
endif()
135147
endif ()
136148

137149
## Include test execution for test-targets for target Debug

doc/dev/developer.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Return: -1 for error. 0 for success.
300300
int stlink_current_mode(stlink_t *sl);
301301
int stlink_force_debug(stlink_t *sl);
302302
int stlink_target_voltage(stlink_t *sl);
303-
int stlink_set_swdclk(stlink_t *sl, uint16_t divisor);
303+
int stlink_set_swdclk(stlink_t *sl, int freq_khz);
304304

305305
int stlink_erase_flash_mass(stlink_t* sl);
306306
int stlink_write_flash(stlink_t* sl, stm32_addr_t address, uint8_t* data, uint32_t length, uint8_t eraseonly);

inc/backend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
int (*trace_enable) (stlink_t * sl, uint32_t frequency);
3333
int (*trace_disable) (stlink_t * sl);
3434
int (*trace_read) (stlink_t * sl, uint8_t* buf, size_t size);
35-
3635
} stlink_backend_t;
3736

3837
#endif // STLINK_BACKEND_H_

inc/stlink.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ void stlink_close(stlink_t *sl);
251251
int stlink_core_id(stlink_t *sl);
252252
int stlink_reset(stlink_t *sl);
253253
int stlink_jtag_reset(stlink_t *sl, int value);
254+
int stlink_soft_reset(stlink_t *sl, int halt_on_reset);
254255
int stlink_run(stlink_t *sl);
255256
int stlink_status(stlink_t *sl);
256257
int stlink_version(stlink_t *sl);
@@ -273,7 +274,6 @@ int stlink_set_swdclk(stlink_t *sl, uint16_t divisor);
273274
int stlink_trace_enable(stlink_t* sl, uint32_t frequency);
274275
int stlink_trace_disable(stlink_t* sl);
275276
int stlink_trace_read(stlink_t* sl, uint8_t* buf, size_t size);
276-
277277
int stlink_erase_flash_mass(stlink_t* sl);
278278
int stlink_write_flash(stlink_t* sl, stm32_addr_t address, uint8_t* data, uint32_t length, uint8_t eraseonly);
279279
int stlink_parse_ihex(const char* path, uint8_t erased_pattern, uint8_t * * mem, size_t * size, uint32_t * begin);
@@ -315,6 +315,9 @@ int stlink_write_option_control_register1_32(stlink_t *sl, uint32_t option_contr
315315
int stlink_write_option_bytes(stlink_t *sl, stm32_addr_t addr, uint8_t* base, uint32_t len);
316316
int stlink_fwrite_option_bytes(stlink_t *sl, const char* path, stm32_addr_t addr);
317317

318+
int stlink_flashloader_start(stlink_t *sl, flash_loader_t *fl);
319+
int stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t addr, uint8_t* base, uint32_t len);
320+
int stlink_flashloader_stop(stlink_t *sl);
318321

319322
#include <sg.h>
320323
#include <usb.h>

inc/stm32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
/* Cortex core ids */
1111
#define STM32VL_CORE_ID 0x1ba01477
1212
#define STM32F7_CORE_ID 0x5ba02477
13+
#define STM32H7_CORE_ID 0x6ba02477 // STM32H7 JTAG ID Code (RM0433 pg3065)
1314

1415
/* Constant STM32 memory map figures */
1516
#define STM32_FLASH_BASE ((uint32_t)0x08000000)
17+
#define STM32_F1_FLASH_BANK2_BASE ((uint32_t)0x08080000)
18+
#define STM32_H7_FLASH_BANK2_BASE ((uint32_t)0x08100000)
1619
#define STM32_SRAM_BASE ((uint32_t)0x20000000)
1720
#define STM32_G0_OPTION_BYTES_BASE ((uint32_t)0x1FFF7800)
1821
#define STM32_G4_OPTION_BYTES_BASE ((uint32_t)0x1FFFF800)

0 commit comments

Comments
 (0)