diff options
| author | Ha Thach <[email protected]> | 2026-08-13 09:15:52 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-13 09:15:52 +0700 |
| commit | dc3927fd293126d6f2b835153155ba7830f5707f (patch) | |
| tree | f25da76dc993f4ad5a4b388a83691c345d31457b | |
| parent | 32530d8f4b6cd6d6f7a7df7e6358856c7ebc4f5e (diff) | |
| parent | 853cbff468cde5821447ecc92063acf11d3e696e (diff) | |
Merge pull request #3818 from hathach/claude/lpc55-board-uid
hw/bsp/lpc55: implement board_get_unique_id from flash PFR UUID
| -rw-r--r-- | hw/bsp/lpc55/family.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/bsp/lpc55/family.c b/hw/bsp/lpc55/family.c index e021caf35..11bf86827 100644 --- a/hw/bsp/lpc55/family.c +++ b/hw/bsp/lpc55/family.c @@ -170,6 +170,14 @@ uint32_t board_button_read(void) { return BUTTON_STATE_ACTIVE == GPIO_PinRead(GPIO, BUTTON_PORT, BUTTON_PIN); } +size_t board_get_unique_id(uint8_t id[], size_t max_len) { + // 128-bit UUID in the flash PFR region at 0x0009FC70 (UM11126 rev 2.1 section 48.8) + const uint8_t* uuid = (const uint8_t*) 0x0009FC70; + size_t const len = tu_min32(max_len, 16); + memcpy(id, uuid, len); + return len; +} + int board_uart_read(uint8_t* buf, int len) { (void) buf; (void) len; |
