Skip to content

Default to Cordio BLE stack for NRF52* targets #10709

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 5 commits into from
Jun 9, 2019

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented May 29, 2019

Description

The BLE stack from SoftDevice is not actively maintained and
has issues (e.g. BLE fails to initialise) when used with Nordic SDK v15.

Note: To verify this PR properly, remove/do not set target-specific labels in mbed_app.json.

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@donatieng @pan- @paul-szczepanek-arm

Release Notes

Starting with mbed-os 5.13 and the introduction of Nordic SDK V15, Nordic SoftDevice Bluetooth stack is not supported.
Bluetooth remains supported with the help of ARM’s Cordio stack.

Copy link
Member

@paul-szczepanek-arm paul-szczepanek-arm left a comment

Choose a reason for hiding this comment

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

cool, in which case remove the mbed json overrides

@ciarmcom ciarmcom requested review from donatieng, pan-, paul-szczepanek-arm and a team May 29, 2019 17:00
@ciarmcom
Copy link
Member

@LDong-Arm, thank you for your changes.
@donatieng @pan- @paul-szczepanek-arm @ARMmbed/mbed-os-maintainers please review.

@pan-
Copy link
Member

pan- commented May 30, 2019

Somehow the BLE feature is not defined for NRF52830 and NRF52840 in targets.json; can you look at that @LDong-Arm ?

@LDong-Arm
Copy link
Contributor Author

Somehow the BLE feature is not defined for NRF52830 and NRF52840 in targets.json; can you look at that @LDong-Arm ?

I thought BLE feature was disabled by default to keep build size down, and only enabled by mbed_app.json as needed? Or should it be enable whenever available?

@LDong-Arm
Copy link
Contributor Author

Somehow the BLE feature is not defined for NRF52830 and NRF52840 in targets.json; can you look at that @LDong-Arm ?

I thought BLE feature was disabled by default to keep build size down, and only enabled by mbed_app.json as needed? Or should it be enable whenever available?

It turns out that SOFTDEVICE_S140's SDK enables BLE, but the CORDIO stack is outside of the SDK so we need to enable BLE in targets.json as discussed with @pan-.

There will be no need to enable BLE again in mbed_app.json of individual applications.

@LDong-Arm
Copy link
Contributor Author

cool, in which case remove the mbed json overrides

Or shall we keep the overrides for compatibility with older mbed-os?

Copy link
Contributor

@donatieng donatieng left a comment

Choose a reason for hiding this comment

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

Looks good - @ARMmbed/mbed-os-maintainers could this please target RC2?

@donatieng
Copy link
Contributor

cool, in which case remove the mbed json overrides

Or shall we keep the overrides for compatibility with older mbed-os?

Please keep them in the examples repo for now until this is on master :)

Copy link
Member

@bulislaw bulislaw left a comment

Choose a reason for hiding this comment

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

🎉 Approved for RC2. Should that be documented somewhere? @pan- please add section to release notes in the PR body.

@mbed-ci
Copy link

mbed-ci commented Jun 4, 2019

Test run: FAILED

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

Failed test jobs:

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

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 4, 2019

Build failures related, one of the tests fails to compile:

        [Error] main.cpp@35,31: use of undeclared identifier '__NRF_NVIC_APP_IRQS_0'
        [Error] main.cpp@35,81: use of undeclared identifier '__NRF_NVIC_APP_IRQS_1'

Please review

Note, rc2 should be finalized today

@LDong-Arm
Copy link
Contributor Author

Build failures related, one of the tests fails to compile:
[Error] main.cpp@35,31: use of undeclared identifier '__NRF_NVIC_APP_IRQS_0'
[Error] main.cpp@35,81: use of undeclared identifier '__NRF_NVIC_APP_IRQS_1'

Please review
Note, rc2 should be finalized today

Thanks for catching that. I've updated the critical section test which failed to build, thanks to help from @pan-

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 5, 2019

Exporters should be OK, but test failed with related errors:

nrf52 ble tests, for ARM:

[1559730685.03][CONN][INF] found KV pair in stream: {{__testcase_name;Test multiple reset commands}}, queued...
[1559730685.03][CONN][INF] found KV pair in stream: {{__testcase_start;Test reset command}}, queued...
[1559730685.13][CONN][RXD] ++ MbedOS Error Info ++
[1559730685.13][CONN][RXD] Error Status: 0x80010133 Code: 307 Module: 1
[1559730685.23][CONN][RXD] Error Message: Mutex: 0x200078AC, Not allowed in ISR context

same test fails also for GCC/IAR but has test assert rather. Anyway, same test (features-feature_ble-targets-target_cordio-tests-cordio_hci-transport) 3 compilers , nrf52 target

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 5, 2019

Moved to rc3, rc2 generated

@LDong-Arm
Copy link
Contributor Author

Exporters should be OK, but test failed with related errors:
nrf52 ble tests, for ARM:
[1559730685.03][CONN][INF] found KV pair in stream: {{__testcase_name;Test multiple reset commands}}, queued...
[1559730685.03][CONN][INF] found KV pair in stream: {{__testcase_start;Test reset command}}, queued...
[1559730685.13][CONN][RXD] ++ MbedOS Error Info ++
[1559730685.13][CONN][RXD] Error Status: 0x80010133 Code: 307 Module: 1
[1559730685.23][CONN][RXD] Error Message: Mutex: 0x200078AC, Not allowed in ISR context

same test fails also for GCC/IAR but has test assert rather. Anyway, same test (features-feature_ble-targets-target_cordio-tests-cordio_hci-transport) 3 compilers , nrf52 target

I can locally reproduce this issue. Looking into it.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2019

@LDong-Arm Any update, just any timebox for this - we would like to timebox rc3

@paul-szczepanek-arm
Copy link
Member

paul-szczepanek-arm commented Jun 7, 2019

I've got a fix for that one, working on it. Give me an a few hours. Doesn't mean there won't be more

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 merged commit dc77c40 into ARMmbed:master Jun 9, 2019
@CodingGhost
Copy link

Hi, I just read about the cordio stack, but I hthink(hope) I misunderstood something.
will the nordic softdevice and SDK15 still be supported/functional with the latest release?
because as I understood it, the S140 is replaced by cordio, which means that everything that I did in the last years is now useless and deprecated..?

@pan-
Copy link
Member

pan- commented Aug 7, 2019

SDK15 is still supported and functional while soft device is no more in the latest release.
The BLE API is still supported and will continue to be. However it got a different implementation based on the Cordio stack and not the softdevice.

It would be interesting for us to understand what limitation/issues you would hit updating your software to the laster release.

Please note that the nordic SDK and the softdevice have never been part of mbed-os public API. Those are implementation details.

@CodingGhost
Copy link

CodingGhost commented Aug 8, 2019

ok, thats good, but I see one problem for me. I currently use the softdevice for OTA updates with the Nordic DFU service, so if I use cordio instead of the S140, I cannot use my bootloader anymore right?

also, I am using some direct calls to the nordic SD, for example to go into deep sleep powerdown mode, how would I do this then?

@CodingGhost
Copy link

@pan- so what about my problems?

@BracketJohn
Copy link

@pan- I'm also interested in whether DFU will still work with the new Cordio stack, as I'm looking to perform BLE OTA DFUs.

An answer here would be greatly appreciated!

@0Grit
Copy link

0Grit commented Aug 16, 2019

@BracketJohn there are a couple issues regarding your question. Can't remember if they are still open.

@BracketJohn
Copy link

BracketJohn commented Aug 16, 2019

Hi @loverdeg-ep, thanks for the reply! So far, I found #3363, #4587 and #5412, but all of them are closed or inactive it seems. Also, I was not able to find any updated guides/statements on this issue, do you know whether there was an answer somewhere?

Edit: I also found this mbed forum thread from 4 months ago, that said that this feature is high priority and still in planing: https://os.mbed.com/questions/85333/Arm-Mbed-Cordio-and-OTA-DFU/

I've created #11251 to get some clarity on this.

@pan-
Copy link
Member

pan- commented Aug 19, 2019

@donatieng Could you comment on DFU over BLE using the Cordio stack ?

@BracketJohn
Copy link

@donatieng, @pan- I've also created #11251 in order to get a more visible answer on this – I've also listed some of the issues on the topic I found there, maybe that helps/is a good place to answer the question

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.