Skip to content

Commit 0e4ee2b

Browse files
committed
stm32f072xx_hic: explicitly disable bootloader
1 parent 7d06005 commit 0e4ee2b

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

source/hic_hal/stm32/stm32f072xx/daplink_addr.h

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,59 +24,51 @@
2424

2525
#define DAPLINK_ROM_START 0x08000000
2626
#if defined(INTERFACE_STM32F072XB)
27-
#define DAPLINK_ROM_SIZE 0x00020000 // 128 Kb
27+
#define DAPLINK_ROM_SIZE 0x00020000 // 128 KB
2828
#elif defined(INTERFACE_STM32F072X8)
29-
#define DAPLINK_ROM_SIZE 0x00010000 // 64 Kb
29+
#define DAPLINK_ROM_SIZE 0x00010000 // 64 KB
3030
#endif
3131

3232
#define DAPLINK_RAM_START 0x20000000
33-
#define DAPLINK_RAM_SIZE 0x00004000 // 16 Kb
33+
#define DAPLINK_RAM_SIZE 0x00004000 // 16 KB
3434

3535
/* ROM sizes */
36-
/* stm32f072 can use STDFU */
36+
/* stm32f072xx does not support DAPLink bootloader: use STDFU or SWD */
3737
#define DAPLINK_ROM_BL_SIZE 0x00000000
38-
#define DAPLINK_ROM_CONFIG_ADMIN_SIZE 0x00000000
39-
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00000800
4038

41-
#define DAPLINK_ROM_IF_SIZE (DAPLINK_ROM_SIZE - \
42-
DAPLINK_ROM_BL_SIZE - \
43-
DAPLINK_ROM_CONFIG_ADMIN_SIZE - \
44-
DAPLINK_ROM_CONFIG_USER_SIZE)
39+
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00000800
40+
#define DAPLINK_ROM_IF_SIZE (DAPLINK_ROM_SIZE - DAPLINK_ROM_CONFIG_USER_SIZE)
4541

4642
#define DAPLINK_ROM_BL_START DAPLINK_ROM_START
47-
#define DAPLINK_ROM_CONFIG_ADMIN_START (DAPLINK_ROM_BL_START + DAPLINK_ROM_BL_SIZE)
48-
#define DAPLINK_ROM_IF_START (DAPLINK_ROM_CONFIG_ADMIN_START + DAPLINK_ROM_CONFIG_ADMIN_SIZE)
43+
#define DAPLINK_ROM_IF_START DAPLINK_ROM_START
4944
#define DAPLINK_ROM_CONFIG_USER_START (DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE)
5045

5146
/* RAM sizes */
47+
#define DAPLINK_RAM_SHARED_SIZE 0x00000100
48+
#define DAPLINK_RAM_APP_SIZE (DAPLINK_RAM_SIZE - DAPLINK_RAM_SHARED_SIZE)
49+
5250
#define DAPLINK_RAM_APP_START DAPLINK_RAM_START
5351
#define DAPLINK_RAM_SHARED_START (DAPLINK_RAM_APP_START + DAPLINK_RAM_APP_SIZE)
5452

55-
#define DAPLINK_RAM_APP_SIZE (DAPLINK_RAM_SIZE - DAPLINK_RAM_SHARED_SIZE)
56-
#define DAPLINK_RAM_SHARED_SIZE 0x00000100
57-
5853
/* Flash Programming Info */
5954
#define DAPLINK_SECTOR_SIZE 0x800
60-
#define DAPLINK_MIN_WRITE_SIZE 2
55+
#define DAPLINK_MIN_WRITE_SIZE 4
6156

6257
/* Current build */
63-
#if defined(DAPLINK_BL)
58+
#if defined(DAPLINK_IF)
6459

65-
#define DAPLINK_ROM_APP_START DAPLINK_ROM_BL_START
66-
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_BL_SIZE
67-
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_IF_START
68-
#define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_IF_SIZE
60+
#define DAPLINK_ROM_APP_START DAPLINK_ROM_IF_START
61+
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_IF_SIZE
62+
#define DAPLINK_ROM_UPDATE_START 0
63+
#define DAPLINK_ROM_UPDATE_SIZE 0
6964

70-
#elif defined(DAPLINK_IF)
65+
#elif defined(DAPLINK_BL)
7166

72-
#define DAPLINK_ROM_APP_START DAPLINK_ROM_IF_START
73-
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_IF_SIZE
74-
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_BL_START
75-
#define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_BL_SIZE
67+
#error "stm32f072xx does not support DAPLink bootloader"
7668

7769
#else
7870

79-
#error "Build must be either bootloader or interface"
71+
#error "Build must be interface"
8072

8173
#endif
8274

0 commit comments

Comments
 (0)