Skip to content

Commit 250ab10

Browse files
DavidEGraysontom-van
authored andcommitted
flash/stm32l4x: add STM32C071xx support
I successfully programmed a NUCLEO-C071RB with these changes. Change-Id: Ib57a77fa18f8a0e8c882e2250d6111c588d76887 Signed-off-by: David (Pololu) <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8525 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
1 parent 5233312 commit 250ab10

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

doc/openocd.texi

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

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

src/flash/nor/stm32l4x.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ static const struct stm32l4_rev stm32c03xx_revs[] = {
303303
{ 0x1000, "A" }, { 0x1001, "Z" },
304304
};
305305

306+
static const struct stm32l4_rev stm32c071xx_revs[] = {
307+
{ 0x1001, "Z" },
308+
};
309+
306310
static const struct stm32l4_rev stm32g05_g06xx_revs[] = {
307311
{ 0x1000, "A" },
308312
};
@@ -442,6 +446,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
442446
.otp_base = 0x1FFF7000,
443447
.otp_size = 1024,
444448
},
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+
},
445461
{
446462
.id = DEVID_STM32U53_U54XX,
447463
.revs = stm32u53_u54xx_revs,
@@ -1989,6 +2005,7 @@ static int stm32l4_probe(struct flash_bank *bank)
19892005
case DEVID_STM32L43_L44XX:
19902006
case DEVID_STM32C01XX:
19912007
case DEVID_STM32C03XX:
2008+
case DEVID_STM32C071XX:
19922009
case DEVID_STM32G05_G06XX:
19932010
case DEVID_STM32G07_G08XX:
19942011
case DEVID_STM32U031XX:

src/flash/nor/stm32l4x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
#define DEVID_STM32U57_U58XX 0x482
109109
#define DEVID_STM32U073_U083XX 0x489
110110
#define DEVID_STM32WBA5X 0x492
111+
#define DEVID_STM32C071XX 0x493
111112
#define DEVID_STM32WB1XX 0x494
112113
#define DEVID_STM32WB5XX 0x495
113114
#define DEVID_STM32WB3XX 0x496

tcl/board/st_nucleo_c0.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
3+
source [find interface/stlink.cfg]
4+
5+
transport select dapdirect_swd
6+
7+
source [find target/stm32c0x.cfg]
8+
9+
reset_config srst_only

0 commit comments

Comments
 (0)