Skip to content

Commit f043f68

Browse files
committed
Use proper Arduino MAC Adress
1 parent 9e2094f commit f043f68

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Projects/Multi/Applications/LoRa/AT_Slave/src/mlm32l0xx_hw.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,22 @@ uint32_t HW_GetRandomSeed(void)
350350

351351
void HW_GetUniqueId(uint8_t *id)
352352
{
353+
// First 3 bytes are Arduino OUI A8-61-0A
354+
// Other 5 bytes are derived by STM32 internal ID registers
355+
353356
uint32_t id1 = *((uint32_t *)ID1);
354357
uint32_t id2 = *((uint32_t *)ID2);
355358
uint32_t id3 = *((uint32_t *)ID3);
356359
uint32_t id13 = id1 + id3;
357360

358361
id[7] = id13 >> 24;
359362
id[6] = id13 >> 16;
360-
id[5] = id13 >> 8;
361-
id[4] = id13;
362-
id[3] = id2 >> 24;
363-
id[2] = id2 >> 16;
364-
id[1] = id2 >> 8;
365-
id[0] = id2;
363+
id[5] = id3 & 0xFF;
364+
id[4] = id2 & 0xFF;
365+
id[3] = id1 & 0xFF;
366+
id[2] = 0x0A;
367+
id[1] = 0x61;
368+
id[0] = 0xA8;
366369
}
367370

368371
uint8_t HW_GetBatteryLevel(void)

0 commit comments

Comments
 (0)