From 1f079147c081a507d1486c3804f59a1b6df87070 Mon Sep 17 00:00:00 2001 From: SirSydom Date: Sat, 26 Feb 2022 22:40:17 +0100 Subject: [PATCH] solves #183 (#185) get the unique id directly from flash instead using the async. SDK call. --- src/rp2040_arduino_platform.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rp2040_arduino_platform.cpp b/src/rp2040_arduino_platform.cpp index e901502..2dcb9f2 100644 --- a/src/rp2040_arduino_platform.cpp +++ b/src/rp2040_arduino_platform.cpp @@ -77,7 +77,14 @@ void RP2040ArduinoPlatform::setupUart() uint32_t RP2040ArduinoPlatform::uniqueSerialNumber() { pico_unique_board_id_t id; // 64Bit unique serial number from the QSPI flash - pico_get_unique_board_id(&id); + + noInterrupts(); + rp2040.idleOtherCore(); + + flash_get_unique_id(id.id); //pico_get_unique_board_id(&id); + + rp2040.resumeOtherCore(); + interrupts(); // use lower 4 byte and convert to unit32_t uint32_t uid = ((uint32_t)(id.id[4]) << 24) | ((uint32_t)(id.id[5]) << 16) | ((uint32_t)(id.id[6]) << 8) | (uint32_t)(id.id[7]);