Skip to content
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

[NRF5] Bootloader for NRF52_DK @s132 and NRF51_DK @s130 #3376

Merged
merged 2 commits into from
Dec 23, 2016

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Dec 6, 2016

  • either single and dual banks bootloaders for nRF51 and nRF52 (complied to *.hex) @s13x 2.0.0
  • new NRF51_DK_BOOT, NRF52_DK_BOOT, NRF51_DK_OTA, NRF52_DK_OTA targets for SoftDevice 13x
  • add support for choice bootloader from a list of a few.

Reserve BLE dfu service for nrf5x (previously was for nrf51)

Legacy bootloader's targets (@s110) NRF51_DK_OTA and NRF51_DK_BOOT are renamed to NRF51_DK_LEGACY_OTA and NRF51_DK_LEGACY_BOOT

For support choosing of a bootloader for a target (for now dual bank or single bank solution) the value target.bootloader_select_index was added to target descriptions.
This could be override in a child target or in a application configuration file in order to make a another choice.

+ either single and dual banks bootloaders for nRF51 and nRF52 (complided to *.hex)
+ new NRF51_DK_BOOT, NRF52_DK_BOOT, NRF51_DK_OTA, NRF52_DK_OTA for SoftDevice 13x
+ add support for choice bootloader from a list of a few.

Reserve BLE dfu service for nrf5x (previously was for nrf51)
@nvlsianpu
Copy link
Contributor Author

@pan- @anangl: Need your opinions.

@nvlsianpu
Copy link
Contributor Author

For curious: code with modification of used nrf5 bootloader https://github.com/nvlsianpu/nrf5_bootloader based on nRF5 sdk 11.

Be aware of https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fbledfu_bootloader_introduction.html Probably you will need to creating a zip with image and init packet.

SysTick->CTRL = 0;
#endif
// disable all interrupts
core_util_critical_section_enter();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Overall, I'm happy with this PR (I need to test it) but I believe that it would be very helpful to link to Nordic documentation (here) and explain on the mbed Nordic page how to switch from single bank to dual bank.

I also wonder if it is possible to add size constraint in the linker script file when dual bank is used or at least explain step by step what has to be done.

It would also be nice to explain to users how to generate a new bootloader (outside this PR).

@@ -2387,11 +2387,12 @@
"MERGE_SOFT_DEVICE": true,
"EXPECTED_SOFTDEVICES_WITH_OFFSETS": [
{
"boot": "",
"boot": ["s130_nrf51_2.0.0_sb_bootloader.hex", "s130_nrf51_2.0.0_sb_bootloader.hex"],
Copy link
Member

Choose a reason for hiding this comment

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

Why the single bank binary is referenced twice ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug

"EXPECTED_SOFTDEVICES_WITH_OFFSETS": [
{
"boot": "",
"boot": ["s132_nrf52_2.0.0_db_bootloader.hex", "s132_nrf52_2.0.0_sb_bootloader.hex"],
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo in the dual bank bootloader name: s132_nrf52_2.0.0_db_bootloadre.hex instead of s132_nrf52_2.0.0_db_bootloader.hex

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug

@nvlsianpu
Copy link
Contributor Author

I believe that it would be very helpful to link to Nordic documentation (here) and explain on the mbed Nordic page how to switch from single bank to dual bank.

It would also be nice to explain to users how to generate a new bootloader (outside this PR).

I agree. I will update/create FOTA target web immediately after we done this PR

I also wonder if it is possible to add size constraint in the linker script file when dual bank is used or at least explain step by step what has to be done.

for now I planned to emphasize this in documentation - although I think it's very good idea. But due the time constrains I must wait for a spare time.

…n 9instead of two single bank bootloaders)

fix: typo in dual bank bootloader intel-hex file name
fix: remove redundant interupts disabling on bootloader startup call
@bridadan
Copy link
Contributor

bridadan commented Dec 8, 2016

Maintainers: when running tests, please run a nightly on this since the softdevice will affect all of the tests.

@adbridge
Copy link
Contributor

@nvlsianpu Do you believe this is ready now? All actions done?

@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1258

All builds and test passed!

@nvlsianpu
Copy link
Contributor Author

It's ready to be merged. As changed are approved I'm going to update DK documentation.

@nvlsianpu
Copy link
Contributor Author

FYI:
Documentation for this features aimed to github is here https://github.com/nvlsianpu/mbed/blob/nrf5_doc/targets/TARGET_NORDIC/ReadMe.md. It's only waiting for nordic's tech writer for a vertification.

@sg-
Copy link
Contributor

sg- commented Dec 15, 2016

This will require an alignment with online tools deployment. @theotherjimmy @screamerbg need to sync about when it will be possible.

@pan- Did you test this?

@adbridge
Copy link
Contributor

adbridge commented Dec 19, 2016

@pan- bump

@pan-
Copy link
Member

pan- commented Dec 22, 2016

@sg- I've tested this, the content of the PR works but it is not that simple to get it working.
The old DFU service in BLE API is not perfectly aligned with the latest Nordic DFU flow and require a bit of work.

I would prefer to have this PR integrated in a feature branch rather than in master so the missing items needed to have a good DFU feature like a refresh of the update services and a good documentation will be completed before the integration into master.

@sg-
Copy link
Contributor

sg- commented Dec 22, 2016

Thanks for the feedback @pan-

@nvlsianpu Can you change this PR to be against https://github.com/ARMmbed/mbed-os/tree/feature-nrf5_dfu_s13x_v2

@nvlsianpu nvlsianpu changed the base branch from master to feature-nrf5_dfu_s13x_v2 December 22, 2016 15:07
@0xc0170 0xc0170 merged commit 15d1944 into ARMmbed:feature-nrf5_dfu_s13x_v2 Dec 23, 2016
@janjongboom
Copy link
Contributor

@pan- @sg- Why has this never made it into master? I've been using the _OTA target and it works fine.

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.

8 participants