... | @@ -23,6 +23,28 @@ Note that assigning node IDs is only supported if you submit your target images |
... | @@ -23,6 +23,28 @@ Note that assigning node IDs is only supported if you submit your target images |
|
|
|
|
|
<br />
|
|
<br />
|
|
|
|
|
|
|
|
## How to assign node IDs with hex files
|
|
|
|
|
|
|
|
If you upload the target binary in Intel hex format, the node ID cannot be assigned by the testbed. Instead, you need to rely on unique identifiers in the information registers of the microcontroller and map those to useful node IDs.
|
|
|
|
An example for the target platform nRF5:
|
|
|
|
```
|
|
|
|
uint16_t flocklab_node_id(void)
|
|
|
|
{
|
|
|
|
uint32_t dev_addr[] = { 0x9866f68a, 0xfe694776, 0x4e14e2f8, 0x8045ddde, 0xea673b1f, 0x546931a7, 0x4db62047, 0x38057982, /* observers 1 - 8 */
|
|
|
|
0x322c95bb, 0x05840339, 0x6251e878, 0xe29d4310, 0x3dbb14a0, 0, 0, 0xa9bf0f2b, /* observers 9 - 16 */
|
|
|
|
0, 0, 0x73d0188a, 0xae33933c, 0x183d13fe, 0xd3e8a7ab, 0x0b59d912, 0x054fead2, /* observers 17 - 24 */
|
|
|
|
0, 0x7f15a6a9, 0x069fcd53, 0, 0xa271b29d, 0, 0xb86f91c3, 0 }; /* observers 25 - 32 */
|
|
|
|
uint32_t i;
|
|
|
|
for (i = 0; i < sizeof(dev_addr) / sizeof(uint32_t); i++) {
|
|
|
|
if (dev_addr[i] == NRF_FICR->DEVICEADDR[0]) {
|
|
|
|
return i + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
## How to embed target image files into the XML config file
|
|
## How to embed target image files into the XML config file
|
|
|
|
|
... | | ... | |