License
To start Mira OS, a valid license is needed on the device.
Each license is unique to the device, and can not be copied from one device to another.
Signing a device¶
Use the mira_license.py
tool.
To sign a nrf52832 device, use:
./mira_license.py -d /dev/ttyXXXXX -t license -P nrfjprog -s NNNNN -a 0x0007f000 -l 0x00001000
To sign a nrf52840 device, use:
./mira_license.py -d /dev/ttyXXXXX -t license -P nrfjprog -s NNNNN -a 0x000ff000 -l 0x00001000
To sign a mkw41z device, use:
./mira_license.py -d /dev/ttyXXXXX -t license -P nxp_mkw41z -s NNNNN -a 0x0007f800 -l 0x00000800
Where /dev/ttyXXXXX
is the device name for the license dongle UART interface.
NNNNN is the serial number of the programmer, which can be retrieved using
nrfjprog --ids
Changing the license storage¶
The address (-a
) and length (-l
) of the certificate block can be changed for
a given build, to match the CERTIFICATE space in the .ld script, when using a
custom ld script. For more information, see:
./mira_license.py -h
Functions¶
mira_license_is_validating¶
mira_bool_t mira_license_is_validating( void);
Check if the license is currently being validated.
To wait until the license is checked, use:
PROCESS_WAIT_WHILE(mira_license_is_validating()); mira_bool_t is_valid = mira_license_is_valid();
If the license is not valid after, the device will restart within a few seconds.
Return
MIRA_TRUE if license is still validating, MIRA_FALSE if done validating
mira_license_is_valid¶
mira_bool_t mira_license_is_valid( void);
Return if the license is valid.
During validation, the return value is undefined.
To wait until the license is checked, use:
PROCESS_WAIT_WHILE(mira_license_is_validating()); mira_bool_t is_valid = mira_license_is_valid();
Return
MIRA_TRUE if license is valid, MIRA_FALSE if license is not valid.