Skip to content

Support to BlueNRG_2 BLE component #13246

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 31 commits into from
Dec 17, 2020
Merged

Support to BlueNRG_2 BLE component #13246

merged 31 commits into from
Dec 17, 2020

Conversation

apalmieriGH
Copy link
Contributor

Summary of changes

Add support to BlueNRG_2 BLE Component

Documentation


Pull request type

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

Test results

[] 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

@pan- @MarceloSalazar @avilei @jeromecoutant @LMESTM

@avilei
Copy link

avilei commented Jul 8, 2020 via email

@ciarmcom
Copy link
Member

ciarmcom commented Jul 8, 2020

@apalmieriGH, thank you for your changes.
@avilei @pan- @jeromecoutant @MarceloSalazar @LMESTM @ARMmbed/mbed-os-pan @ARMmbed/mbed-os-maintainers please review.

|Module Name|Processor Name|Bluetooth compliance|Status|Used in shields & boards|Link|
|-------------|-----------|-----|-|-|-|
|SPBTLE-RF |BlueNRG-MS (network processor) |v4.1 |Not recommended for new designs |X-NUCLEO-IDB05A1, DISCO-L475VG-IOT01A, DISCO-L562QE | https://www.st.com/en/wireless-transceivers-mcus-and-modules/spbtle-rf.html |
|BlueNRG-M0 |BlueNRG-MS (network processor) |v4.2 |Active (included in ST's Longevity Program) |X-NUCLEO-IDB05A2 (coming soon) | https://www.st.com/en/wireless-transceivers-mcus-and-modules/bluenrg-m0.html |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table in COMPONENT_BlueNRG_MS/README.md has to be updated ?

Copy link
Contributor Author

@apalmieriGH apalmieriGH Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to update and align the table in COMPONENT_BlueNRG_MS/README.md as well.


In order to use this library with X-NUCLEO-BNRG2A1, you need to update the firmware of the BLUENRG-M2SP BLE module mounted on that expansion board as described in the following page:

[TODO BlueNRG-2](https://os.mbed.com/components/X-NUCLEO-BNRG2A1/)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link doesn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a bookmark for now.


Bluetooth Low Energy Nucleo Expansion Board:

https://os.mbed.com/components/X-NUCLEO-BNRG2A1/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link doesn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bookmark for now.

virtual void initialize()
{
// Setup the spi for 8 bit data, low clock polarity,
// 2-edge phase, with an 1MHz clock rate (rate to be checked)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid comment like "to be checked" :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree :-)

Copy link
Contributor

@0xc0170 0xc0170 Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None "to be done" in the code 💯

uint16_t spiWrite(uint8_t type, const uint8_t *data, uint16_t data_length)
{
static const uint8_t header_master[] = { 0x0a, 0x00, 0x00, 0x00, 0x00 };
uint8_t header_slave[5];// = { 0xaa, 0x00, 0x00, 0x00, 0x00 };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment to remove ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Comment on lines 53 to 80
|Settings|Pin 1|Pin 2|Pin 3|
|--------|-----|-----|-----|
|**D3** |Open |Short|Short|
|**D13** |Short|Short|Open |

In case you change the default configuration, then you also have to configure this library to use pin **D13** to drive the SPI clock.
To this aim you need to update your local mbed_app.json file with:

```
"target_overrides": {
"XXXX": {
"bluenrg_2.SPI_SCK": "D13"
},
```

If you use pin **D13** for the SPI clock, please be aware that on some STM32 Nucleo boards you may **not** drive the LED,
otherwise you will get a conflict: the LED on STM32 Nucleo boards is connected to pin **D13**.

Referring to the current list of tested platforms (see [X-NUCLEO-BNRG2A1](https://os.mbed.com/components/X-NUCLEO-BNRG2A1/) page),
the patch is required for
- [ST-Nucleo-F103RB](https://developer.mbed.org/platforms/ST-Nucleo-F103RB/)
- [ST-Nucleo-F411RE](https://developer.mbed.org/platforms/ST-Nucleo-F411RE/)
- [ST-Nucleo-F446RE](https://developer.mbed.org/platforms/ST-Nucleo-F446RE/)
- [FRDM-K64F](https://developer.mbed.org/platforms/FRDM-K64F/)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this part valid ? tested ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested, yet. But the behavior should be the same as for X-NUCLEO-IDB05A1 (BlueNRG_MS component). Anyway, I'll update/rephrase the readme accordingly.

0xc0170
0xc0170 previously requested changes Jul 9, 2020
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there is no BlueNrg2HCIDriver.h , but all is in BlueNrg2HCIDriver.cpp ?

#include "hci_mbed_os_adaptation.h"

// rtos
#include "Thread.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use prefixes like on line 22, rtos/header.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The structure of the folder is the same as components/BLE/COMPONENT_BlueNRG_MS

@mergify mergify bot dismissed 0xc0170’s stale review July 9, 2020 14:33

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 10, 2020

Please remove merge commit 572b384 and rebase instead. We will start CI asap

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 16, 2020

@apalmieriGH I am reviewing, and noticed there are merge commits still. Would you be able to rebase? Or if not , I can fetch the branch and try to clean the history (it should be linear to show only changes related to this branch).

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for the rebase to clean up the history

@mergify mergify bot dismissed 0xc0170’s stale review July 17, 2020 10:30

Pull request has been modified.

@apalmieriGH
Copy link
Contributor Author

@0xc0170 tried to rebase. Could it work now?

0xc0170
0xc0170 previously approved these changes Jul 27, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 27, 2020

@ARMmbed/mbed-os-pan Please review

@mergify mergify bot dismissed 0xc0170’s stale review July 31, 2020 12:47

Pull request has been modified.

apalmieriGH and others added 11 commits December 14, 2020 15:28
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
also correctly set unused addres to 0s as required by spec
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
Signed-off-by: Andrea PALMIERI <[email protected]>
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 16, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 16, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 17, 2020

I'll squash merge this, there are lot of readme updates, one commit looks better for this update.

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.