Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion libraries/USBDevice/inc/usbd_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@
/* Exported constants --------------------------------------------------------*/
#define DEVICE_ID1 (UID_BASE)
#define DEVICE_ID2 (UID_BASE + 0x4U)
#define DEVICE_ID3 (UID_BASE + 0x8U)
/*
* On STM32L0 and STM32L1 the three unique-ID words are NOT contiguous:
* the reference manuals place bits 95:64 at offset 0x14, not 0x08
* (RM0376/RM0377/RM0367/RM0451 "Unique device ID registers (96 bits)",
* and RM0038 for STM32L1). UID_BASE + 0x8U is a reserved location there.
* ST's own HAL_GetUIDw2() already uses 0x14U for these two families.
*/
#if defined(STM32L0xx) || defined(STM32L1xx)
#define DEVICE_ID3 (UID_BASE + 0x14U)
#else
#define DEVICE_ID3 (UID_BASE + 0x8U)
#endif

/*
* USB Billboard Class USER string desc Defines Template
Expand Down
Loading