New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: bluetooth: HCI: add Ambiq Apollo3 BLE support #72609
base: main
Are you sure you want to change the base?
driver: bluetooth: HCI: add Ambiq Apollo3 BLE support #72609
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
c2813e3
to
c5e53af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as the Ambiq stuff goes, this looks good.
I will let the other BLE people discuss that section.
It's likely that the HCI API rewrite will only get merged after the next release, so in that sense any new drivers (using the old API) should be able to be merged before that. For now, I also have |
Some Ambiq Apollox Blue SOC (e.g. Apollo3 Blue) uses internal designed BLEIF module which is different from the general IOM module for SPI transceiver. The called HAL API will also be independent. This driver is implemented for the BLEIF module usage scenarios. Signed-off-by: Aaron Ye <aye@ambiq.com>
This commits add the BLEIF instance which is compatible with "ambiq,spi-bleif" on Ambiq apollo3p_evb and apollo3_evb. Also creates the default pinctrl for the defined instance. Signed-off-by: Aaron Ye <aye@ambiq.com>
This commit add the SPI-based HCI support for the Ambiq Apollo3 Blue SOC (e.g. Apollo3 Blue Plus, Apollo3 Blue) support. Also correct the dependency of necessary peripheral. Signed-off-by: Aaron Ye <aye@ambiq.com>
The BLE controller of some Ambiq Apollox Blue SOC may have issue to report the expected supported features bitmask successfully, thought the features are actually supportive. Need to correct them before going to the host stack. Signed-off-by: Aaron Ye <aye@ambiq.com>
…ario The controller may be unavailable to receive packets because it is busy on processing something or have packets to send to host. Need to free the SPI bus and wait some moment to try again. Signed-off-by: Aaron Ye <aye@ambiq.com>
This commit defines the bt-hci subnode under the bleif node on Ambiq Apollo3 Blue and Apollo3 Blue Plus SOC. Also add the default configurations for Bluetooth feature on Ambiq apollo3_evb and apollo3p_evb. Signed-off-by: Aaron Ye <aye@ambiq.com>
c5e53af
to
bea7e06
Compare
@jhedberg Would you mind taking a look at this PR when you are available? Thank you. |
@aaronyegx approved from my side, but I'll likely need some guidance on how to best convert this to the new HCI API (especially the DTS parts of it). |
It is likely we need to have a new "zephyr,bt-hci-spi" binding. And the bt-hci dts node may need to adapt for Apollo4 Blue from:
to:
In the driver, I think we also need a hci_spi_config struct like:
but not sure if we must include all global variables to one new hci_spi_data structure. Anyway, I will test the changes once you finish the upgrading on the supported Apollo3/4 EVB. |
@RichardSWheatley Please help take another look, thanks. |
This PR implements the SPI based HCI driver for Ambiq Apollo3 Blue/Apollo3 Plus Blue. Apollo3 Blue/Apollo3 Plus Blue BLE integrates one core for running BLE controller only. The MCU can work as BLE host and talk to the integrated BLE controller via SPI based BLEIF module. The SPI BLEIF pins are not exposed from MCU and the new implemented SPI BLEIF driver is added for HCI.
Test passed on the following samples:
-samples/bluetooth/peripheral
-samples/bluetooth/peripheral_hr
-samples/bluetooth/peripheral_ht
-samples/bluetooth/peripheral_esp
-samples/bluetooth/peripheral_dis
-samples/bluetooth/peripheral_gatt_write
-samples/bluetooth/peripheral_sc_only
-samples/bluetooth/central
-samples/bluetooth/central_hr
-samples/bluetooth/central_ht
-samples/bluetooth/central_gatt_write
-samples/bluetooth/broadcaster
-samples/bluetooth/broadcaster_multiple
-samples/bluetooth/beacon
-samples/bluetooth/observer
-samples/bluetooth/scan_adv
-samples/bluetooth/mtu_update
-samples/bluetooth/eddystone
-samples/bluetooth/ibeacon
-samples/bluetooth/hci_uart
-tests/bluetooth/init