Skip to content

COMPONENT_BlueNRG_MS creation : ST Bluetooth Low Energy module #12456

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

Merged
merged 4 commits into from
Apr 29, 2020

Conversation

jeromecoutant
Copy link
Collaborator

@jeromecoutant jeromecoutant commented Feb 18, 2020

Summary of changes

BlueNRG chip is embedded in the IOT L475 and DISCO-L562 boards

Proposition is to migrate the specific repo to a mbed-os component

@donatieng @bulislaw
@ARMmbed/team-st-mcd
@MarceloSalazar

Impact of changes

Set https://github.com/ARMmbed/cordio-ble-x-nucleo-idb0xa1
as deprecated

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

target platform_name test suite test case passed failed result elapsed_time (sec)
DISCO_L475VG_IOT01A-ARMC6 DISCO_L475VG_IOT01A features-feature_ble-targets-target_cordio-tests-cordio_hci-driver Test cordio stack reset sequence 1 0 OK 0.21
DISCO_L475VG_IOT01A-ARMC6 DISCO_L475VG_IOT01A features-feature_ble-targets-target_cordio-tests-cordio_hci-transport Test multiple reset commands 1 0 OK 0.17
DISCO_L562QE-ARMC6 DISCO_L562QE features-feature_ble-targets-target_cordio-tests-cordio_hci-driver Test cordio stack reset sequence 1 0 OK 0.2
DISCO_L562QE-ARMC6 DISCO_L562QE features-feature_ble-targets-target_cordio-tests-cordio_hci-transport Test multiple reset commands 1 0 OK 0.16
[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@mergify mergify bot added the needs: work label Feb 18, 2020
@jeromecoutant
Copy link
Collaborator Author

@ARMmbed/team-st-ble

@ciarmcom ciarmcom requested a review from a team February 18, 2020 10:00
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@ladislas
Copy link
Contributor

@jeromecoutant I really love this PR! It gives mbed os users a real life example for using an external BLE module with a bigger MCU.

A few remarks/questions:

DISCO-L562QE cannot be found on the ST website with this name. ST references this board as STM32L562E-DK --> The mbed documentation page gives us the ST name, but I think it would be nice to have a link in the readme or at least a reference to the ST name.

Both boards are using SPBTLE-RF but its status is NRND (not recommended for new designs). So if it's useful for prototyping, users whose goal is to make a real product will need to use a different module.

ST references two modules that could be used, both part of the longevity program (which is super cool for users betting on those modules!):

How compatible with the SPBTLE-RF HCI Driver would those two modules be?

BlueNRG-M0 seems to be a replacement of SPBTLE-RF as they both have the BlueNRG-MS network processor.

We are building a smart robotic education tool for children with special needs and pre-selected those two modules to use but are not experts in HCI Driver development. This PR seems like a good starting point but we need help choosing the right module. BLE 5.0 with higher data rate would be really useful for us, but if it means longer and more complicated development times, we would happily stick to 4.2.

@jeromecoutant
Copy link
Collaborator Author

DISCO-L562QE cannot be found on the ST website with this name. ST references this board as STM32L562E-DK

I changed https://os.mbed.com/platforms/ST-Discovery-L562QE/ page

Both boards are using SPBTLE-RF but its status is NRND (not recommended for new designs). So if it's useful for prototyping, users whose goal is to make a real product will need to use a different module.

Agree :-(

How compatible with the SPBTLE-RF HCI Driver would those two modules be?

@avilei please comment

@avilei
Copy link

avilei commented Feb 20, 2020

BlueNRG-M0 seems to be a replacement of SPBTLE-RF as they both have the BlueNRG-MS network processor.

That's correct. You can replace SPBTLE-RF with the BlueNRG-M0 module without any issues. They're pin-to-pin compatible and you can reuse the same software that you have today without any changes.
The main difference between the two modules is the RF-design (which means that the firmware configuration stored in the flash of the module is slightly different). From an Mbed OS stand point, the two modules are identical.

That's based on a different chip, so it is not compatible with the current version of Mbed drivers.
There are plans to include Mbed support in the future, but for the time being, as you have already been using SPBTLE-RF, I would suggest to stick to the BlueNRG-M0 module.

0xc0170
0xc0170 previously approved these changes Feb 27, 2020
@mergify mergify bot added needs: CI and removed needs: review labels Feb 27, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2020

CI started

@mergify mergify bot added needs: work and removed needs: CI labels Feb 27, 2020
@mbed-ci
Copy link

mbed-ci commented Feb 27, 2020

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@jeromecoutant
Copy link
Collaborator Author

Hi
Issue seems to be in BLE example, which needs to be updated without ble-x-nucleo-idb0xa1 lib import...
How can we proceed ?
Make a pull request in BLE example first ?
Thx

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 2, 2020

@jeromecoutant in this case yes, please fix the examples

@ladislas
Copy link
Contributor

ladislas commented Mar 2, 2020

@avilei Thanks a lot for the detailed answer! We'll got for the BlueNRG-M0 as our base solution for BLE.

[BlueNRG-M2] That's based on a different chip, so it is not compatible with the current version of Mbed drivers.

You mean if we wanted to run mbed on the BlueNRG-M2?

In our case, we don't want to run mbed on the BlueNRG-M2, mbed runs on our custom board based on the STM32F769 and we just need a BLE module to connect to iOS.

I have a hard time understanding how concretely we could port the HCI driver for BlueNRG-M2 and how hard it would be. And if it is possible at all. The porting instructions are detailed but hard to follow, as I don't have much experience there :(

Another solution we are thinking about is to program the BlueNRG-M2 with ST's tools (setup services and characteristics we need), use mbed on the STM32F769 and create a simple communication protocol between the two using UART to received the data send through BLE.

@ladislas
Copy link
Contributor

ladislas commented Mar 2, 2020

@jeromecoutant the PR description talks about

https://github.com/ARMmbed/ble-x-nucleo-idb0xa1

Should it not be the Cordio one?

https://github.com/ARMmbed/cordio-ble-x-nucleo-idb0xa1

Or both?

@jeromecoutant
Copy link
Collaborator Author

Should it not be the Cordio one?
Or both?

My mistake...
I understand that ble-x-nucleo-idb0xa1 is deprecated by cordio-ble-x-nucleo-idb0xa1,
which is deprecated by this PR

@pan-

@jeromecoutant
Copy link
Collaborator Author

@jeromecoutant in this case yes, please fix the examples

See ARMmbed/mbed-os-example-ble#284

@ladislas
Copy link
Contributor

@jeromecoutant @avilei -- I was going through the PR again last night and I had some thoughts about the naming and the README.md in regard of custom board designs.

I know that SPBTLE-RF is the module used by the shields, but it is listed on the ST website as not recommended for new designs. In addition to that, it is not even mentioned in the ARMmbed/cordio-ble-x-nucleo-idb0xa1 repository.

The README.md also mentions the BlueNRG-MS which adds to the complexity

Per @avilei , the BlueNRG-M0 is the go-to replacement for new designs:

You can replace SPBTLE-RF with the BlueNRG-M0 module without any issues. They're pin-to-pin compatible and you can reuse the same software that you have today without any changes.
The main difference between the two modules is the RF-design (which means that the firmware configuration stored in the flash of the module is slightly different). From an Mbed OS stand point, the two modules are identical.

With all this information, I'm wondering how we could make it easier for future users to know what they can or cannot actually use. I myself spent countless hours reading through specs and manuals to make sure I was not mistaken before choosing a BLE module.

Maybe a simple table like this could help:

Name Type Bluetooth compliance Status Used in shields & boards? Link
SPBTLE-RF Module v4.1 ⚠️ Not recommended for new designs Yes: X-NUCLEO-IDB05A1, DISCO-L475VG-IOT01A, DISCO-L562QE link
BlueNRG-M0 Module v4.2 ✅ Active (included in ST's Longevity Program) No link
BlueNRG-MS Processor v4.2 ✅Active (included in ST's Longevity Program) No link

Finally regarding the naming of the path in components and the HCI driver, I would suggest the following by referencing the BLE processor instead of the module name:

- components/BLE/COMPONENT_SPBTLE_RF/BlueNrgHCIDriver.x
+ components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.x
// or
+ components/BLE/COMPONENT_BLUENRG_MS/BlueNrgMsHCIDriver.x

This way we refer to the BLE processor which is the same for SPBTLE-RF and BlueNRG-M0 and allows us to use them interchangeably.

This would mean renaming "components_add" and "extra_labels_add" with:

- "SPBTLE_RF"
+ "BLUENRG_MS"
// and
- "CORDIO_BLUENRG"
+ "CORDIO_BLUENRG_MS"

And if/when we add support for the BlueNRG-M2 module we'll be able to add:

+ components/BLE/COMPONENT_BLUENRG_2/BlueNrg2HCIDriver.x

What do you think?

@avilei
Copy link

avilei commented Mar 11, 2020

@ladislas Please note that we're about to distribute a replacement board for X-NUCLEO-IDB05A1, called X-NUCLEO-IDB05A2, which will be based on the newer modules for BlueNRG-MS.
The new board is expected in April. As soon as it will be published, we'll update the corresponding links in the table that you have prepared.
Thanks.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 22, 2020

CI restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 22, 2020

I had to abort a job, will restart later today. We need 5.15 issues to be addressed today.

@mbed-ci
Copy link

mbed-ci commented Apr 22, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 23, 2020

CI restarted

@mergify mergify bot added needs: work and removed needs: CI labels Apr 23, 2020
@mbed-ci
Copy link

mbed-ci commented Apr 23, 2020

Test run: FAILED

Summary: 2 of 3 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@jeromecoutant
Copy link
Collaborator Author

[Error] @0,0: L6200E: Symbol ble_cordio_get_hci_driver() multiply defined (by BUILD/DISCO_L475VG_IOT01A/ARM/shields/TARGET_CORDIO_BLUENRG/BlueNrgHCIDriver.o and BUILD/DISCO_L475VG_IOT01A/ARM/mbed-os/components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.o).

What is this shields directory ?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 23, 2020

@ARMmbed/mbed-os-test Please review ^^

Isn't this expected - ble examples uses own config - adds BLE to a target and with this PR there are multiple defined symbols - a reason why this PR was dependent on mbed-os-example-ble#284 ?

jeromecoutant added a commit to jeromecoutant/mbed-os-example-ble that referenced this pull request Apr 29, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2020

I'll start CI later today. The example was updated. This should pass the build now

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 29, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 5
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2020

This needs to get in to unblock master (example was already updated)

@0xc0170 0xc0170 merged commit 3c89556 into ARMmbed:master Apr 29, 2020
@mergify mergify bot removed the ready for merge label Apr 29, 2020
@jeromecoutant jeromecoutant deleted the PR_COMPONENT_BLUENRG branch June 9, 2020 08:32
paul-szczepanek-arm pushed a commit to ARMmbed/mbed-os-example-ble that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants