Skip to content

Commit 058891a

Browse files
authored
Merge pull request #1210 from en-sc/en-sc/from_upstream
Merge up to 26f2df8 from upstream
2 parents dd69b78 + 182092a commit 058891a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+679
-422
lines changed

config_subdir.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ AC_DEFUN([AX_CONFIG_SUBDIR_OPTION],
77
AC_CONFIG_SUBDIRS([$1])
88
99
m4_ifblank([$2], [rm -f $srcdir/$1/configure.gnu],
10-
[echo -e '#!/bin/sh\nexec "`dirname "'\$'0"`/configure" '"$2"' "'\$'@"' > "$srcdir/$1/configure.gnu"
10+
[printf '#!/bin/sh\nexec "`dirname "'\$'0"`/configure" '"$2"' "'\$'@"\n' > "$srcdir/$1/configure.gnu"
1111
])
1212
])

configure.ac

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,11 @@ AC_ARG_ADAPTERS([
291291
LIBFTDI_USB1_ADAPTERS,
292292
LIBGPIOD_ADAPTERS,
293293
SERIAL_PORT_ADAPTERS,
294+
DUMMY_ADAPTER,
294295
PCIE_ADAPTERS,
295296
LIBJAYLINK_ADAPTERS
296297
],[auto])
297298

298-
AC_ARG_ADAPTERS([DUMMY_ADAPTER],[no])
299-
300299
AC_ARG_ENABLE([parport],
301300
AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
302301
[build_parport=$enableval], [build_parport=no])
@@ -417,8 +416,8 @@ AS_CASE(["${host_cpu}"],
417416

418417
can_build_buspirate=yes
419418

420-
AS_CASE([$host],
421-
[*-cygwin*], [
419+
AS_CASE([$host_os],
420+
[cygwin*], [
422421
is_win32=yes
423422
parport_use_ppdev=no
424423
@@ -438,7 +437,7 @@ AS_CASE([$host],
438437
])
439438
])
440439
],
441-
[*-mingw* | *-msys*], [
440+
[mingw* | msys*], [
442441
is_mingw=yes
443442
is_win32=yes
444443
parport_use_ppdev=no
@@ -457,7 +456,7 @@ AS_CASE([$host],
457456
458457
AC_SUBST([HOST_CPPFLAGS], ["-D__USE_MINGW_ANSI_STDIO -DFD_SETSIZE=128"])
459458
],
460-
[*darwin*], [
459+
[darwin*], [
461460
is_darwin=yes
462461
463462
AS_IF([test "x$parport_use_giveio" = "xyes"], [
@@ -515,7 +514,7 @@ AS_IF([test "x$build_dmem" = "xyes"], [
515514
AC_DEFINE([BUILD_DMEM], [0], [0 if you don't want to debug via Direct Mem.])
516515
])
517516

518-
AS_IF([test "x$ADAPTER_VAR([dummy])" = "xyes"], [
517+
AS_IF([test "x$ADAPTER_VAR([dummy])" != "xno"], [
519518
build_bitbang=yes
520519
])
521520

contrib/list_example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <assert.h>
1313
#include <helper/list.h>
1414

15-
static LIST_HEAD(threads);
15+
static OOCD_LIST_HEAD(threads);
1616

1717
struct thread {
1818
int id;

doc/manual/style.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,21 @@ if (!buf) {
225225
}
226226
@endcode
227227

228+
@section stylelogging Logging
229+
230+
Logging is intended to provide human-readable information to users.
231+
Do not confuse logging with the output of commands.
232+
The latter is intended for the result of a command and should be able to be processed by Tcl scripts.
233+
234+
- Use one of the following functions to generate log messages, never use `printf()` or similar functions.
235+
- Use `LOG_ERROR()` to provide information in case an operation failed in an unrecoverable way. For example, if necessary memory cannot be allocated.
236+
- Use `LOG_WARNING()` to inform the user of about an unexpected behavior that can be handled and the intended operation is still be performed. For example, in case a command is deprecated but is nevertheless executed.
237+
- Use `LOG_INFO()` to provide insightful or necessary information to the user. For example, features or capabilities of a discovered target.
238+
- Use `LOG_DEBUG()` to provide information for troubleshooting. For example, detailed information which makes it easier to debug a specific operation. Try to avoid flooding the log with frequently generated messages. For example, do not use LOG_DEBUG() in operations used for polling the target. Use LOG_DEBUG_IO() for such frequent messages.
239+
- Use `LOG_DEBUG_IO()` to provide I/O related information for troubleshooting. For example, details about the communication between OpenOCD and a debug adapter.
240+
- If the log message is related to a target, use the corresponding `LOG_TARGET_xxx()` functions.
241+
- Do not use a period or exclamation mark at the end of a message.
242+
228243
*/
229244
/** @page styledoxygen Doxygen Style Guide
230245

doc/openocd.texi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8030,7 +8030,7 @@ The @var{num} parameter is a value shown by @command{flash banks}.
80308030
@end deffn
80318031

80328032
@deffn {Flash Driver} {stm32l4x}
8033-
All members of the STM32 G0, G4, L4, L4+, L5, U5, WB and WL
8033+
All members of the STM32 C0, G0, G4, L4, L4+, L5, U0, U5, WB and WL
80348034
microcontroller families from STMicroelectronics include internal flash
80358035
and use ARM Cortex-M0+, M4 and M33 cores.
80368036
The driver automatically recognizes a number of these chips using

src/flash/nor/sfdp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int spi_sfdp(struct flash_bank *bank, struct flash_device *dev,
103103
uint16_t id = (((pheaders[k].ptr) >> 16) & 0xFF00) | (pheaders[k].revision & 0xFF);
104104
uint32_t ptr = pheaders[k].ptr & 0xFFFFFF;
105105

106-
LOG_DEBUG("pheader %d len=0x%02" PRIx8 " id=0x%04" PRIx16
106+
LOG_DEBUG("pheader %d len=0x%02x id=0x%04" PRIx16
107107
" ptr=0x%06" PRIx32, k, words, id, ptr);
108108

109109
/* retrieve parameter table */

src/flash/nor/stm32l4x.c

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@
120120
* http://www.st.com/resource/en/reference_manual/dm00346336.pdf
121121
*/
122122

123+
/* STM32U0xxx series for reference.
124+
*
125+
* RM0503 (STM32U0xx)
126+
* https://www.st.com/resource/en/reference_manual/rm0503-stm32u0-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
127+
*/
128+
123129
/* STM32U5xxx series for reference.
124130
*
125131
* RM0456 (STM32U5xx)
@@ -278,7 +284,7 @@ struct stm32l4_wrp {
278284
};
279285

280286
/* human readable list of families this drivers supports (sorted alphabetically) */
281-
static const char *device_families = "STM32C0/G0/G4/L4/L4+/L5/U5/WB/WL";
287+
static const char *device_families = "STM32C0/G0/G4/L4/L4+/L5/U0/U5/WB/WL";
282288

283289
static const struct stm32l4_rev stm32l47_l48xx_revs[] = {
284290
{ 0x1000, "1" }, { 0x1001, "2" }, { 0x1003, "3" }, { 0x1007, "4" }
@@ -297,6 +303,10 @@ static const struct stm32l4_rev stm32c03xx_revs[] = {
297303
{ 0x1000, "A" }, { 0x1001, "Z" },
298304
};
299305

306+
static const struct stm32l4_rev stm32c071xx_revs[] = {
307+
{ 0x1001, "Z" },
308+
};
309+
300310
static const struct stm32l4_rev stm32g05_g06xx_revs[] = {
301311
{ 0x1000, "A" },
302312
};
@@ -325,6 +335,10 @@ static const struct stm32l4_rev stm32g0b_g0cxx_revs[] = {
325335
{ 0x1000, "A" },
326336
};
327337

338+
static const struct stm32l4_rev stm32u0xx_revs[] = {
339+
{ 0x1000, "A" },
340+
};
341+
328342
static const struct stm32l4_rev stm32g43_g44xx_revs[] = {
329343
{ 0x1000, "A" }, { 0x2000, "B" }, { 0x2001, "Z" },
330344
};
@@ -432,6 +446,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
432446
.otp_base = 0x1FFF7000,
433447
.otp_size = 1024,
434448
},
449+
{
450+
.id = DEVID_STM32C071XX,
451+
.revs = stm32c071xx_revs,
452+
.num_revs = ARRAY_SIZE(stm32c071xx_revs),
453+
.device_str = "STM32C071xx",
454+
.max_flash_size_kb = 128,
455+
.flags = F_NONE,
456+
.flash_regs_base = 0x40022000,
457+
.fsize_addr = 0x1FFF75A0,
458+
.otp_base = 0x1FFF7000,
459+
.otp_size = 1024,
460+
},
435461
{
436462
.id = DEVID_STM32U53_U54XX,
437463
.revs = stm32u53_u54xx_revs,
@@ -600,6 +626,30 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
600626
.otp_base = 0x1FFF7000,
601627
.otp_size = 1024,
602628
},
629+
{
630+
.id = DEVID_STM32U031XX,
631+
.revs = stm32u0xx_revs,
632+
.num_revs = ARRAY_SIZE(stm32u0xx_revs),
633+
.device_str = "STM32U031xx",
634+
.max_flash_size_kb = 64,
635+
.flags = F_NONE,
636+
.flash_regs_base = 0x40022000,
637+
.fsize_addr = 0x1FFF3EA0,
638+
.otp_base = 0x1FFF6800,
639+
.otp_size = 1024,
640+
},
641+
{
642+
.id = DEVID_STM32U073_U083XX,
643+
.revs = stm32u0xx_revs,
644+
.num_revs = ARRAY_SIZE(stm32u0xx_revs),
645+
.device_str = "STM32U073/U083xx",
646+
.max_flash_size_kb = 256,
647+
.flags = F_NONE,
648+
.flash_regs_base = 0x40022000,
649+
.fsize_addr = 0x1FFF6EA0,
650+
.otp_base = 0x1FFF6800,
651+
.otp_size = 1024,
652+
},
603653
{
604654
.id = DEVID_STM32U59_U5AXX,
605655
.revs = stm32u59_u5axx_revs,
@@ -1955,8 +2005,11 @@ static int stm32l4_probe(struct flash_bank *bank)
19552005
case DEVID_STM32L43_L44XX:
19562006
case DEVID_STM32C01XX:
19572007
case DEVID_STM32C03XX:
2008+
case DEVID_STM32C071XX:
19582009
case DEVID_STM32G05_G06XX:
19592010
case DEVID_STM32G07_G08XX:
2011+
case DEVID_STM32U031XX:
2012+
case DEVID_STM32U073_U083XX:
19602013
case DEVID_STM32L45_L46XX:
19612014
case DEVID_STM32L41_L42XX:
19622015
case DEVID_STM32G03_G04XX:

src/flash/nor/stm32l4x.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#define DEVID_STM32C03XX 0x453
9292
#define DEVID_STM32U53_U54XX 0x455
9393
#define DEVID_STM32G05_G06XX 0x456
94+
#define DEVID_STM32U031XX 0x459
9495
#define DEVID_STM32G07_G08XX 0x460
9596
#define DEVID_STM32L49_L4AXX 0x461
9697
#define DEVID_STM32L45_L46XX 0x462
@@ -105,7 +106,9 @@
105106
#define DEVID_STM32G49_G4AXX 0x479
106107
#define DEVID_STM32U59_U5AXX 0x481
107108
#define DEVID_STM32U57_U58XX 0x482
109+
#define DEVID_STM32U073_U083XX 0x489
108110
#define DEVID_STM32WBA5X 0x492
111+
#define DEVID_STM32C071XX 0x493
109112
#define DEVID_STM32WB1XX 0x494
110113
#define DEVID_STM32WB5XX 0x495
111114
#define DEVID_STM32WB3XX 0x496

src/helper/list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct list_head {
4646

4747
#define LIST_HEAD_INIT(name) { &(name), &(name) }
4848

49-
#define LIST_HEAD(name) \
49+
#define OOCD_LIST_HEAD(name) \
5050
struct list_head name = LIST_HEAD_INIT(name)
5151

5252
static inline void

src/helper/log.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ extern int debug_level;
152152
#define LOG_TARGET_INFO(target, fmt_str, ...) \
153153
LOG_INFO("[%s] " fmt_str, target_name(target), ##__VA_ARGS__)
154154

155+
#define LOG_TARGET_USER(target, fmt_str, ...) \
156+
LOG_USER("[%s] " fmt_str, target_name(target), ##__VA_ARGS__)
157+
155158
#define LOG_TARGET_WARNING(target, fmt_str, ...) \
156159
LOG_WARNING("[%s] " fmt_str, target_name(target), ##__VA_ARGS__)
157160

0 commit comments

Comments
 (0)