diff --git a/drivers/hwinfo/hwinfo_stm32.c b/drivers/hwinfo/hwinfo_stm32.c index e20f060934..75029d7495 100644 --- a/drivers/hwinfo/hwinfo_stm32.c +++ b/drivers/hwinfo/hwinfo_stm32.c @@ -44,6 +44,26 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length) return length; } +#if defined(CONFIG_SOC_SERIES_STM32WBAX) || \ + defined(CONFIG_SOC_SERIES_STM32WBX) || \ + defined(CONFIG_SOC_SERIES_STM32WLX) +struct stm32_eui64 { + uint32_t id[2]; +}; + +int z_impl_hwinfo_get_device_eui64(uint8_t *buffer) +{ + struct stm32_eui64 dev_eui64; + + dev_eui64.id[0] = sys_cpu_to_be32(READ_REG(*((uint32_t *)UID64_BASE + 1U))); + dev_eui64.id[1] = sys_cpu_to_be32(READ_REG(*((uint32_t *)UID64_BASE))); + + memcpy(buffer, dev_eui64.id, sizeof(dev_eui64)); + + return 0; +} +#endif + int z_impl_hwinfo_get_reset_cause(uint32_t *cause) { uint32_t flags = 0;