Skip to content

Commit 31d18c5

Browse files
committed
alif/usbd: Implement proper USB serial number.
Using SE services to get the SoC unique id. Signed-off-by: Damien George <damien@micropython.org>
1 parent 2f85a19 commit 31d18c5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ports/alif/usbd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@
3030

3131
#include "shared/tinyusb/mp_usbd.h"
3232
#include "tusb.h"
33+
#include "se_services.h"
3334

3435
void mp_usbd_port_get_serial_number(char *serial_buf) {
35-
// TODO
36-
uint8_t id[8] = "ABCDEFGH";
36+
uint8_t id[5];
37+
se_services_get_unique_id(id);
3738
MP_STATIC_ASSERT(sizeof(id) * 2 <= MICROPY_HW_USB_DESC_STR_MAX);
3839
mp_usbd_hex_str(serial_buf, id, sizeof(id));
3940
}

0 commit comments

Comments
 (0)