Skip to content

NRF52 SDK15 update #9019

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 40 commits into from
Feb 1, 2019
Merged

NRF52 SDK15 update #9019

merged 40 commits into from
Feb 1, 2019

Conversation

TacoGrandeTX
Copy link
Contributor

Description

Add support for Nordic nRF5x SDK15.0

Pull request type

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

@cmonr cmonr changed the title feature-nrf52-sdk15 NRF52 SDK15 update Dec 8, 2018
@cmonr cmonr requested a review from a team December 9, 2018 01:09
@pan-
Copy link
Member

pan- commented Dec 9, 2018

@cmonr We can look at BLE changes included in this PR but I think you should require a review from the Hal team as most changes are in the HAL.

@cmonr
Copy link
Contributor

cmonr commented Dec 10, 2018

@JanneKiiskila Would you and your team like to review this as well?
This isn't coming into master yet, but figured I'vd give y'all the change to start looking at what's here now.

@@ -0,0 +1,53 @@
/* mbed Microcontroller Library
* Copyright (c) 2015 ARM Limited
Copy link
Contributor

Choose a reason for hiding this comment

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

add SPDX identifier and fix the year (new files 2018), also the company name

 * Copyright (c) 2018, Arm Limited and affiliates.
 * SPDX-License-Identifier: Apache-2.0

Copy link
Contributor Author

@TacoGrandeTX TacoGrandeTX Dec 19, 2018

Choose a reason for hiding this comment

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

@0xc0170 Is the following commit appropriate: bc4aed0 ? I've excluded any old files we didn't touch such as itm_api.c. Would you want the company name and SPDX added for those files (and not touch the date)? I'll then follow this model for any other Arm source files located under the TARGET_NORDIC tree.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please follow for any, would be good 👍

Thanks

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.

What testing did you perform? As a minimum I would imagine all the tests on all base nrf boards + BLE testing should be performed locally.

@@ -9,17 +9,6 @@
#define MBED_APP_SIZE 0x80000
#endif

/* If softdevice is present, set aside space for it */
Copy link
Member

Choose a reason for hiding this comment

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

What has changed that we don't need to block space for softdevice anymore?

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 new memory stats collection (specifically #8607) broke Nordic SD builds as it defines MBED_RAM_START so the scatterfile needed to change. We now define MBED_RAM_START and MBED_RAM_SIZE in the library json file when building with the SD:

https://github.com/TacoGrandeTX/mbed-os/blob/chile/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json#L37-L39

This works out good because if one changes the BLE config the RAM requirements might also change and then they only need to touch one file.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have only done on NRF52_DK and NRF52840_DK for now, I think that means we should add NRF51_DK to the verification, thank you for comments on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@desmond-blue SDK15 doesn't include support for the NRF51 so there is no need to verify on the NRF51_DK.

@0Grit
Copy link

0Grit commented Dec 18, 2018

Any chance of TWIM and SPIM support?

pan-
pan- previously requested changes Dec 19, 2018
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

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

So, I wanted to try and test ble but I faced several issues with that PR:

  • Serial reception doesn't work with this PR in our test application; looks like the RX interrupt is not triggered.
  • The following files should enable the BLE feature (reference here):
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_OTA/mbed_lib.json
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_FULL/mbed_lib.json   targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_OTA/mbed_lib.json

@cmonr cmonr mentioned this pull request Dec 27, 2018
3 tasks
@elm3
Copy link

elm3 commented Jan 9, 2019 via email

@pan-
Copy link
Member

pan- commented Jan 11, 2019

Here is a small snippet that reproduces the issue:

#include <stdio.h>

int main(void)
{
    while (true) {
        int c = getc(stdin);
        putc(c, stdout);
    }
    return 0;
}

@donatieng Maybe it would be useful to have a test as simple as this one to check that UART works.

My own test case was a bit mot complex and involved IRQ and custom RawSerial; you can access it here: https://gist.github.com/pan-/9c836b51116aa8e9c3c262dca60c17b5 .

@0xc0170 0xc0170 dismissed their stale review January 14, 2019 13:35

Will need rereview

@naveenkaje
Copy link
Contributor

Addressed the serial issue with https://github.com/TacoGrandeTX/mbed-os/pull/6

@TacoGrandeTX
Copy link
Contributor Author

Performed required rebase after test infrastructure broke resulting in a test failure for commit a770d03.

Greentea results are all pass for nRF52_DK and nRF52840_DK with the the exception of mbed_hal-trng. This test also fails for my host system on master... the test performs a physical reset that doesn't play well with my laptop (results in a timeout). Test results are attached for builds with the Arm compiler.

greentea_log-arm_compiler.zip

@cmonr
Copy link
Contributor

cmonr commented Jan 23, 2019

@TacoGrandeTX Looking at the feature branch itself, since if this PR doesn't modify/update .travis.yml, it and any PRs opened against the feature branch will be hit with the same issues that Mbed OS faced last week.

Fortunately since the feature-branch doesn't have any unique commits, rebasing it was not difficult.

This will need another rebase (sorry), but after that, it should be back to normal, testing-wise.

TacoGrandeTX and others added 8 commits January 23, 2019 10:08
- top level files ported from TARGET_NORDIC/TARGET_NRF5x/

Also addressed:
- fixed linking issue for gcc
- added support for nRF52-DK builds, but reverted to using nRF52840 sdk_config.h (must be updated)
- introduced "RTC" to targets.json (might need to be removed eventually)
Also addressed:
- removed dependency on legacy config (excluded apply_old_config.h)
- removed legacy pwm and saadc headers
- Arm Compiler 5 linking issue (a band-aid for now... needs to
  be properly addressed for peripheral sharing)
- added missing header in SoftDevice file
- Missed some NRFX defines that needed to changed
- Set PWM base clock to 125kHz (needs to be reverted back to 1 MHz)
- Updated sdk_config.h for nRF52_DK builds
- Brought in updates from PR7779 (fix for nRF52 PWM issues)
Ralph F and others added 16 commits January 23, 2019 10:12
- Add MBR, NONE and OTA SoftDevice build options for S132 and S140
- Add S112 SoftDevice (single build option)
- Some folder restructuring in TARGET_SOFTDEVICE_COMMON was required
This reverts commit 3d2fa53.

This was a breaking change for the "MBR" and "NONE" builds.
After testing it was also determined that copying the vector
table a second time wasn't required for the "FULL" build.
* Update TARGET_NRF5x/README.md to improve "Changing SoftDevice" section
  and added section on NRF52840 CryptoCell310 Support
* Update the file list in TARGET_SDK_15_0/TARGET_SOFTDEVICE_COMMON/README.md
* Add missing CR-LF to Nordic-provided SDK file
* Rename a header file in the TARGET_SOFTDEVICE_S112 tree
 - Brought in new nrfx APIs
 - Brought in PPI additions
 - Removed dead code for RTC
    - Adjust memory for SoftDevice
    - Enable PRIO=5 for interrupt priority check
    - Change NRF_SD_BLE_API_VERSION to 6
    - Add handle and buffer for advertising and scanning
    - Remove guard for phy update
    - Change scatter files and mbed_lib.json for PR #8607
 - Update (c) year and company name
 - Add SPDX-License-Identifier
 - Impacted files:
    - Files touched for SDK15 port
    - Files added in 2018
Move the check from preprocessor to the if condition
@TacoGrandeTX
Copy link
Contributor Author

@cmonr OK - thanks for that. New rebase has been performed and testing looks good as before (attaching greentea reports). The serial issue has been resolved so now @pan- can continue his review.

gt_log-arm_compiler.zip.zip

@cmonr cmonr dismissed pan-’s stale review January 30, 2019 22:06

Please re-review. Initial comments addressed.

@cmonr
Copy link
Contributor

cmonr commented Jan 30, 2019

@TacoGrandeTX Fyi: #9358

@elm3 elm3 merged commit d179c9d into ARMmbed:feature-nrf52-sdk15 Feb 1, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 2, 2019

@elm3 Please if PR needs merging talk to @ARMmbed/mbed-os-maintainers , this should not have been merged.

@TacoGrandeTX
Copy link
Contributor Author

@ARMmbed/mbed-os-maintainers Yes we are waiting for this to be merged. What is the gating item?

@TacoGrandeTX
Copy link
Contributor Author

@cmonr I'm not expecting any impact to the SDK update from #9358. On the driver side the SDK update is largely a change in driver structure (not much has changed in functionality or implementation). Likewise the new SoftDevice won't be impacted either.

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.

10 participants