This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FICR Register - MAC address - MSB incorrect

Hi. I my embedded code I read default MAC address internally and mine is read as 73:7F:..... but in reality is supposed to be F3:7F.....

I have read few tickets where people have asked about same issue when using custom MAC address and you have mentioned about Bluetooth SIG requirements on Most significant bits.

Please can you confirm that all I need to do in my case where I am using default MAC address of device is that in code I always make the Most Significant bit of my mac address as 1? The same logic of MSb=1 across all my devices will fix the issue in reading MAC address correct?

Thanks   

  • Hi,

     

    Out of the total 48 bits of the BT ADDR, the two upper bits indicates the address type.

    If these bits are '11', it indicates that you're using a random static address type. This is the reason all devices have '11' as the upper bits hard-coded by default.

     

    Please can you confirm that all I need to do in my case where I am using default MAC address of device is that in code I always make the Most Significant bit of my mac address as 1? The same logic of MSb=1 across all my devices will fix the issue in reading MAC address correct?

     If you want to apply it as a random static address type, then you should set the two upper bits to '11'.

     

    Kind regards,

    Håkon

  • Hi Hakon.

    Thanks. I am reading the default hard coded random static address for one device I used the MSB (Most significant nibble actually) was 7 which is 0x0111. However, from what you said above MSB should be 0x11xx if I'm just reading from device address stored on chip. Please advise if something wrong here? 

    My code is very simple ->

    ************************************

    macaddress[0] = NRF_FICR->DEVICEADDR[0];
    macaddress[1] = NRF_FICR->DEVICEADDR[1];

    NRF_LOG_INFO(" Device Addr : 0x%08X%08X\r\n.", macaddress[1], macaddress[0]);

    ************************************

    Using above I get a MAC address which reads 73:7F:.... on FICR of nRF52840 which I haven't touched and when I use an android phone then using Bluetooth protocol MAC addr is being read as F3:7F:..... by the Lightblue app.

  • Joel said:
    However, from what you said above MSB should be 0x11xx if I'm just reading from device address stored on chip. Please advise if something wrong here?

    My apologies, I should have stated MSBit instead of MSB. It is the upper two bits that are set to '0b11'.

    In your case, 73:7f:etc:, would become (0x73 | 0xc0) = 0xF3.

     

    Kind regards,

    Håkon

Related