The Smart Ready software will make use of one of three possible MAC addresses. These are 1] the address burned in the radio chipset by the third party manufacturer, 2] the address stored in the Smart Ready software's own bootloader (referred to as the factory address, being configured during production and taken from the range of addresses assigned to Bluegiga or Silicon Labs), and 3] the temporary/user address stored in the PSKey 44 (0x2c) which can be written and activated during runtime with the BGAPI/BGScript command dumo_cmd_system_set_bt_address.
When some address exists in the PSKey at boot, this will be used by the stack. If the PSKey is erased during runtime, the current temporary address is kept active, but only until the next reboot. If the PSKey does not exists at boot, then the factory address will be in use. This is the normal condition in most cases.
You can check at any time the current MAC address in use by launching the command dumo_cmd_system_get_bt_address.
The only case when the radio chipset’s address is in use is when the PSKey does not exist and at the same time the factory address is the invalid ff:ff:ff:ff:ff:ff.
Provided that the factory address is correctly configured in production, notice that the bgupdate.exe (and the update functionality in BGTool) will take care of reading it from the current bootloader and injecting it back when the generic new firmware image will be written.
A generic .bin firmware image created with the bgbuild.exe contains the bootloader and has the address set to ff:ff:ff:ff:ff:ff.
Also the dfu.exe obtained from the SDK is designed to preserve the factory address.
However, the factory address will go lost (that is, will be replaced with the all Fs address in the firmware image) when re-flashing over the SWD interface or when implementing your own ST-based DFU functionality.
In these cases, if you wish your module to keep on using the original factory address, that is, you do not want your module to start using the radio chipset’s address, then you will have two options:
1] read the current address beforehand with the dumo_cmd_system_get_bt_address, and use the dumo_cmd_system_set_bt_address to set it back as the user address (notice here that in general there is no way to preserve any PSKey across a re-flash), or
2] arrange for your re-flash routine to read the current address stored in the current bootloader and then inject it into the bootloader that you are going to write to the Flash memory: the factory MAC address is stored in the very last 8 bytes of the bootloader (and no CRC is applied to those bytes).
Can you clarify the bootloader byte location where the MAC address is stored? The statement "the factory MAC address is stored in the very last 8 bytes of the bootloader" is ambiguous. What is this address range?
For clarification please have a look at the pdf file which can be found under the following temporary link: