arduino/ArduinoCore-mbed

GIGA R1: getUniqueSerialNumber always returns zero

megacct opened this issue · 2 comments

however HAL_GetUIDw0, HAL_GetUIDw1 and HAL_GetUIDw2 do return the expected register values

pennam commented

Hi @megacct
If you print the content of your name array you should see that is filled. However it is filled in a special way due to the way the IDE prints the serial number when you select Tools->Get Board Info.

Each ASCII char of the serial number is followed by a 0x00 so you can't feed directly a Serial.Println(name) with this buffer. For example this is what i get from my board:

30 00 30 00 34 00 36 00 30 00 30 00 34 00 38 00 33 00 34 00 33 00 32 00 35 00 31 00 31 00 35 00 33 00 38 00 33 00 34 00 33 00 36 00 33 00 35 00

Hi @pennam
Thanks for that. My first byte is zero so explains everything. Cheers