Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit d05953c

Browse files
committed
at32f43x: Add UID command
stm32_common: Provide as a meson dep to at32f43x
1 parent 680ba47 commit d05953c

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/target/at32f43x.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@
3535
#include "target.h"
3636
#include "target_internal.h"
3737
#include "cortexm.h"
38+
#include "stm32_common.h"
3839

3940
static bool at32f43_cmd_option(target_s *target, int argc, const char **argv);
41+
static bool at32f43_cmd_uid(target_s *target, int argc, const char **argv);
4042

4143
const command_s at32f43_cmd_list[] = {
4244
{"option", at32f43_cmd_option, "Manipulate option bytes"},
45+
{"uid", at32f43_cmd_uid, "Print unique device ID"},
4346
{NULL, NULL, NULL},
4447
};
4548

@@ -126,8 +129,10 @@ static bool at32f43_mass_erase(target_s *target);
126129
#define AT32F423_SERIES_256KB 0x700a3000U
127130
#define AT32F423_SERIES_128KB 0x700a2000U
128131
#define AT32F423_SERIES_64KB 0x70032000U
129-
#define AT32F4x_PROJECT_ID 0x1ffff7f3U
130-
#define AT32F4x_FLASHSIZE 0x1ffff7e0U
132+
133+
#define AT32F4x_UID_BASE 0x1ffff7e8U
134+
#define AT32F4x_PROJECT_ID 0x1ffff7f3U
135+
#define AT32F4x_FLASHSIZE 0x1ffff7e0U
131136

132137
typedef struct at32f43_flash {
133138
target_flash_s target_flash;
@@ -708,3 +713,10 @@ static bool at32f43_cmd_option(target_s *target, int argc, const char **argv)
708713

709714
return true;
710715
}
716+
717+
static bool at32f43_cmd_uid(target_s *target, int argc, const char **argv)
718+
{
719+
(void)argc;
720+
(void)argv;
721+
return stm32_uid(target, AT32F4x_UID_BASE);
722+
}

src/target/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ target_at32f4 = declare_dependency(
319319
sources: files(
320320
'at32f43x.c',
321321
),
322-
dependencies: target_cortexm,
322+
dependencies: [target_cortexm, target_stm_common]
323323
)
324324

325325
target_ti = declare_dependency(

0 commit comments

Comments
 (0)