Skip to main content
KMew
Senior III
January 4, 2023
Solved

NUCLEO-IDB05A2: MAC Address Question

  • January 4, 2023
  • 1 reply
  • 1644 views

Hello,

I recently purchased STM's BLE nucleo expansion board, which works without issue.

I am reviewing the software to develop my understanding and had a question regarding the MAC address.

They are typically a unique address to the specific chip that is used and that every manufactured piece had a different MAC address. However, for the sample code (SensorDemoBLE), I never had to put in the IDB05A2's BLE MAC address. It knew, which means that every IDB05A2 must have the same MAC address.

Judging by this, is this assumption about the MAC address being unique wrong? In other words, if I ordered another Bluetooth BlueNRG-M0A chip, would it also have the same MAC address as the sample code?

    This topic has been closed for replies.
    Best answer by Sebastien DENOUAL

    Hi @KMew​ ,

    BlueNRG-M0A module embeds a BlueNRG-MS chipset and so this chipset documentation is also valid in this case.

    About MAC address, I would advise to check PM0237 : BlueNRG-MS stacks programming guidelines section 3.1.1. It describes the different type of BLE MAC address and how to use them.

    To make it short, this BlueNRG-MS ( and so the associated BleuNRG-M0x module) don't have a preassigned MAC address. As you mentioned, each device is having a unique id .. but this is not a preassigned MAC address.

    So, you are right : BLE MAC address should be handle at application level.

    There is different type of MAC address : PUBLIC, PRIVATE or RANDOM. Except is you have specific requirements, usually selecting a random mac address is preferred solution.

    In this case, at very first boot, device will generate (and store) a random MAC address that will remain valid for the whole life of product.

    Hope it helps,

    Regards,

    Sebastien.

    1 reply

    Sebastien DENOUAL
    ST Employee
    January 5, 2023

    Hi @KMew​ ,

    BlueNRG-M0A module embeds a BlueNRG-MS chipset and so this chipset documentation is also valid in this case.

    About MAC address, I would advise to check PM0237 : BlueNRG-MS stacks programming guidelines section 3.1.1. It describes the different type of BLE MAC address and how to use them.

    To make it short, this BlueNRG-MS ( and so the associated BleuNRG-M0x module) don't have a preassigned MAC address. As you mentioned, each device is having a unique id .. but this is not a preassigned MAC address.

    So, you are right : BLE MAC address should be handle at application level.

    There is different type of MAC address : PUBLIC, PRIVATE or RANDOM. Except is you have specific requirements, usually selecting a random mac address is preferred solution.

    In this case, at very first boot, device will generate (and store) a random MAC address that will remain valid for the whole life of product.

    Hope it helps,

    Regards,

    Sebastien.

    KMew
    KMewAuthor
    Senior III
    January 5, 2023

    Hello Sebastien,

    Thank you for your reply!

    So what you're saying is that I can reassign the MAC address if I wished? For example, there is a pre-defined MAC address in the code. I can change that address and it will reassign the MAC address and operate as intended still?

    Sebastien DENOUAL
    ST Employee
    January 5, 2023

    Hello @KMew​ ,

    Yes.. this is it. Anyway, this implies you manage your own set of mac address at production level ( PUBLIC or PRIVATE : you must avoid 2 product with same MAC address)

    As mentioned in my initial post : depending of your specific needs, you may simply use static random address. In this case, no need to manage BLE MAC address. This will be handled by BLE stack.

    BLE stack will generates a random address at very first boot (and store into NVM memory). This address will be use for whole product life - No need to manage it at application level.

    Regards,

    Sebastien.