alif/usbd: Implement proper USB serial number.

Using SE services to get the SoC unique id.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2024-02-02 17:51:03 +11:00
parent 2f85a19d7d
commit 31d18c5885

View file

@ -30,10 +30,11 @@
#include "shared/tinyusb/mp_usbd.h"
#include "tusb.h"
#include "se_services.h"
void mp_usbd_port_get_serial_number(char *serial_buf) {
// TODO
uint8_t id[8] = "ABCDEFGH";
uint8_t id[5];
se_services_get_unique_id(id);
MP_STATIC_ASSERT(sizeof(id) * 2 <= MICROPY_HW_USB_DESC_STR_MAX);
mp_usbd_hex_str(serial_buf, id, sizeof(id));
}