does anyone know how to read programmatically the device specific properties from the Arduino MKR WiFi 1010 chip or board?
For example, following properties of the device:
any identification number, that can uniquely identify the physical device, integer or GUID or string or any other, how to read that from the code?
SerialNumber of the MRK WiFi 1010 device
ModelNumber of the MRK WiFi 1010 device
I have tried to check the documentation and examples, however I couldn't find anything at all. Please, help.
I dont have a MKR WiFi 1010, but the following works for all the boards I have, so I think it should apply.
In the IDE click on "Tools", and then "Get Board Info".
A box should then pop up with the board name, its VID, PID and Serial Number.
The following screenshots are from IDE 2.2.0, but other versions work similarly.
@JohnLincoln thanks for the example. I need exaclty that, however read from the code, programmatically. Any idea how that can be done in code?
Juraj
September 3, 2023, 12:50pm
4
the SN is build this way
uint8_t Serial_::getShortName(char* name) {
// from section 9.3.3 of the datasheet
#define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C)
#define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040)
#define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x0080A044)
#define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x0080A048)
utox8(SERIAL_NUMBER_WORD_0, &name[0]);
utox8(SERIAL_NUMBER_WORD_1, &name[8]);
utox8(SERIAL_NUMBER_WORD_2, &name[16]);
utox8(SERIAL_NUMBER_WORD_3, &name[24]);
return 32;
}
@Juraj are you trying to help? that's something very bizzare. What do you mean the Serial Number is built? I was thinking that it is stored in the board constant memory?
Juraj
September 3, 2023, 6:24pm
6
what the IDE shows a SN is composed by that function.
that code reads the register of the MCU where the serial number is stored.
system
Closed
March 1, 2024, 6:24pm
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.