Closed ghost closed 3 years ago
Correct for Arduino - the change address command is now actually executed. Also enhanced how to setup a per-device unique MAC address. See file for details: .../features/FEATURE_BLE/targets/TARGET_Ambiq_Micro/hal/apollo3/hci_drv_apollo3.c
closing
@kirk-sfe
I can see you updated the ambiq-apollo3-arduino
branch. Is that branch the base of the Arduino core V2.x.x for the Apollo3 boards?
Is this fix also relevant for the pure Mbed OS way, or does the Mbed OS V6.8 (released today) already handle all this?
Hi - The fix was tested on our Arduino core and constructed to flush the "change address" message in the command queue - it's stuck because of how ArduinoBLE works (mbed assumes events/command messages are being sent, which flushes the command queue - arduino ble isn't doing this as far as I can see when debugging - the flush call isn't ever called).
I need to test this in a pure mbed implementation - it will work, but I'm not sure if there are side-effects with the command queue. I'm going to try and do this this week.
If you want to give it a try, add this line: hciCmdRecvCmpl(1);
Right after the call to: HciVendorSpecificCmd()
Around line 675, In the file: mbed-os/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/hal/apollo3/hci_drv_apollo3.c
AND
-K
@idea--list FYI - Took a look at a straight mbed-os solution. The current code for a custom address will work, just add: -D AM_CUSTOM_BDADDR to your compile line to enable it. i.e: mbed compile -t GCC_ARM -m SFE_ARTEMIS_DK -D AM_CUSTOM_BDADDR
The original fix is really just needed for ArduinoBLE
@kirk-sfe Thanks for the info!
Apollo 3 Devices can have the same BLE mac address - causing devices to collide when advertising. This makes it impossible to use a set of apollo3 devices in a local area, since a large percentage of the devices will have the same address.
Note - it's not the same address for all devices, but a small number of addresses spread across devices. I've seen two addresses being used for a set of 6 boards.
The issue is in hci_drv_apollo3.c, AM_CUSTOM_BDADDR section of the code.
Run BLE examples that advertise.
Target(s) affected by this defect ?
Toolchain(s) (name and version) displaying this defect ?
What version of Mbed-os are you using (tag or sha) ?
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
How is this defect reproduced ?