aboutsummaryrefslogtreecommitdiff
path: root/stmhal/usbd_desc.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/usbd_desc.c')
-rw-r--r--stmhal/usbd_desc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stmhal/usbd_desc.c b/stmhal/usbd_desc.c
index a3f1a7bc1..32e4fd043 100644
--- a/stmhal/usbd_desc.c
+++ b/stmhal/usbd_desc.c
@@ -33,6 +33,10 @@
#include "usbd_desc.h"
#include "usbd_conf.h"
+// need these headers just for MP_HAL_UNIQUE_ID_ADDRESS
+#include "py/misc.h"
+#include MICROPY_HAL_H
+
// So we don't clash with existing ST boards, we use the unofficial FOSS VID.
// This needs a proper solution.
#define USBD_VID 0xf055
@@ -169,7 +173,7 @@ STATIC uint8_t *USBD_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *leng
//
// See: https://my.st.com/52d187b7 for the algorithim used.
- uint8_t *id = (uint8_t *)0x1fff7a10;
+ uint8_t *id = (uint8_t *)MP_HAL_UNIQUE_ID_ADDRESS;
char serial_buf[16];
snprintf(serial_buf, sizeof(serial_buf),
"%02X%02X%02X%02X%02X%02X",