Skip to content

Update feature-nrf52-sdk15 for v5.12 #9999

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

Closed
wants to merge 46 commits into from
Closed

Update feature-nrf52-sdk15 for v5.12 #9999

wants to merge 46 commits into from

Conversation

TacoGrandeTX
Copy link
Contributor

Description

Keep feature-nrf52-sdk15 current with master for v5.12 release:

  • Rebase with master
  • Added support for Arm Compiler 6 (AC6)
  • Removed SDK14 files (which were never required)

Do not merge - this is a feature rebase only

Pull request type

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

Reviewers

Release Notes

Successful greentea results attached. There are two failures for nRF52840_DK with AC6 but those tests pass with gcc so appears to be a GT problem with these tests on nRF52840 under AC6. There is one failure on nRF52_DK related to TRNG as that always times out on laptop (as before). @desmond-blue conducted BLE testing using standard BLE examples.

v5.12_tests.zip

TacoGrandeTX and others added 30 commits March 4, 2019 14:22
- 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)
Enable UART interfaces to enable serial debug prints.
Using the nrfx_get_irq_number only works with the handle. Since we
know the IRQ numbers for UART0, RTC2 and EGU0, use them directly.
- Use new NRFX header file
- Fix nRF52832 linker script/ld files (hardcoded addresses for now)
- Temporarily remove DEVICE_TRNG for nRF52832 (which broke the build)
- Improve serial_putc() fix so we don't rely on "extra" functions
- Added legacy nrf_drv_rng.c as there is no merit in fully adopting nrfx_rng.c
- Added nrf_queue library component
- Removed apply_old_config.h (unused for some time now)
- Updated sdk_config.h for queue and RNG support for nRF52832
- Brought back RNG into targets.json for nRF52832
Note: nRF52840 still uses CryptoCell 310 for TRNG
When the SoftDevice (SD) is enabled we need to set the app_offset
to 0x26000 to make room for the SoftDevice.  If we let the build
tools self-manage this, MBED_APP_START is coming out at 0x25000
which is not correct for the Nordic 15.0 SDK.

The app_offset value is translated to MBED_APP_START by the build
infrastructure.  We were hard coding MBED_APP_START in the scatter
and ld files as a temporary measure while testing.  This now sets
it properly if the SD is being brought in.
Ensure that vector table gets initialized properly. The table that we
initialize in startup_nrf52840.S gets wiped out as the section is
declared as noinit. Fix this by implementing the weak function mbed_sdk_init
that inits the vector table.
* Remove NRF_SDH_CLOCK parameters from mbed_lib.json
* Bring in QSPI for nRF52840
* Migrate legacy QSPI driver to SDK v15 (nrfx_qspi.h)
* Remove outdated comment in i2c_api.c
The 15.0 SDK doesn't support the nRF51 so it must continue to use the legacy
NRF drivers.  Thus the original common_rtc.c, gpio_api.c and us_ticker.c are
restored and placed under TARGET_NRF5x/TARGET_NRF51.

Likewise the modified common_rtc.c, gpio_api.c and us_ticker.c are moved to
TARGET_NRF5x/TARGET_NRF52 so they are excluded from nRF51 builds.
nRF5x PinNames.h never utilized PORT_SHIFT so removed for clarity after
user commented on it.
- 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
@0Grit
Copy link

0Grit commented Mar 8, 2019

Any chance a WIP PR or issue can be created with current progress on this effort?
We might be able to assist this effort as we continue work on our NRF52840 based target BSP.

@TacoGrandeTX
Copy link
Contributor Author

@loverdeg-ep Could you elaborate on your question? This PR is just a minor update for the upcoming v5.12 release and it contains no new features. We currently have Nordic SDK v15 support here: https://github.com/ARMmbed/mbed-os/tree/feature-nrf52-sdk15

@0Grit
Copy link

0Grit commented Mar 8, 2019

@TacoGrandeTX

Per your comment here #7674 (comment)
Peripheral support first, USB is on backlog, what about NFC, etc.

I was thinking an issue or work in progress merge request for the feature branch could be used to track the effort.

I understand the reasoning for the current pace on this and believe it would be nice if the community could distribute this effort with you in Nordic's place.

@TacoGrandeTX
Copy link
Contributor Author

@loverdeg-ep OK - understood and I personally like that approach. The plan is to take this to mainline rather soon and then evaluate future work. FYI @dlfryar.

* The following v14.2 files are removed from nrfx/legacy:
  nrf_drv_clock.h
  nrf_drv_common.h
  nrf_drv_gpiote.h
  nrf_drv_spi.h
  nrf_drv_twi.h
  nrf_drv_uarth.h
* Remove unneeded references to "nrfx_glue.h" and "nrf_drv_common.h"
* Remove the definition of PACKED from app_util_platform.h (already defined
  in mbed_toolchain.h)
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 15, 2019

Scheduled one CI run to test this rebase

@mbed-ci
Copy link

mbed-ci commented Mar 15, 2019

Test run: FAILED

Summary: 3 of 9 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-IAR8
  • jenkins-ci/mbed-os-ci_build-ARMC6

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 15, 2019

Failures related, MTB_LAIRD_BL654 failing to build

When removing CryptoCell310 we now need to define:
  NRFX_RNG_ENABLED=1
  RNG_ENABLED=1
  NRF_QUEUE_ENABLED=1
These are brought in via "macros_add".
@TacoGrandeTX
Copy link
Contributor Author

@0xc0170 Builds for MTB_LAIRD_BL654 were failing due to changes in how CryptoCell310 is removed. The required config changes are documented in a new section of https://github.com/TacoGrandeTX/mbed-os/tree/denmark/targets/TARGET_NORDIC/TARGET_NRF5x#nrf52840-cryptocell310-support and targets.json was updated accordingly.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 15, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Mar 15, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 2
Build artifacts

@cmonr
Copy link
Contributor

cmonr commented Mar 16, 2019

@TacoGrandeTX Does this still need work, or can the 'Do Not Merge' label be removed?

@TacoGrandeTX
Copy link
Contributor Author

@cmonr This is all set and it can be force-pushed as we discussed. When back from vacation I will bring in the USBD work from @AGlass0fMilk.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 18, 2019

Rebased

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 18, 2019

dbd38798f0 - (HEAD -> feature-nrf52-sdk15, upstream/feature-nrf52-sdk15) Fix targets.json for MTB_LAIRD_BL654

@cederom
Copy link

cederom commented May 22, 2019

+1 for NRF SDK 15 (current is 15.3), also secure DFU triggered from user code, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants