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

cpu/nrf52: set RIOTBOOT_LEN to 8k #11518

Merged
merged 1 commit into from
May 14, 2019

Conversation

fjmolinas
Copy link
Contributor

Contribution description

For nrf52 flash page is 4k. By default the bootloader is 4k but it needs to be at max(4k, 2xFASHPAGE_SIZE) so slots start at the beginning of a page since for now there is only support for writing full pages with flashpage module.

Testing procedure

In https://github.com/RIOT-OS/RIOT/blob/master/tests/riotboot_flashwrite/Makefile uncomment ethos lines. Then flash firmware on an nrf52 board:

$ BOARD=nrf52840dk make riotboot/flash

Setup ethos

sudo ./dist/tools/ethos/start_network.sh /dev/ttyACM0 riot0 2001:db8::/64

Confirm it booted from slot 0 (it should print "Current slot=0"), then
recompile in order to get an image for the second slot with a newer version
number:

$ BOARD=nrf52840dk make riotboot

Then send via CoAP, for example, with libcoap's coap_client:

$ coap-client -m post coap://[fe80::2%riot0]/flashwrite \
   -f bin/nrf52840dk/tests_riotboot_flashwrite-slot1.riot.bin -b 64

Then reboot the node manually. With this PR it will reboot from slot 1, without this pr it will reboot from slot 0.

Issues/PRs references

#9342

@fjmolinas fjmolinas added the Area: OTA Area: Over-the-air updates label May 13, 2019
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

Minor wording nitpick. Feel free to ignore or directly squash! ACK otherwise.

cpu/nrf52/Makefile.include Outdated Show resolved Hide resolved
@fjmolinas fjmolinas force-pushed the pr_nrf52dk_bootloader_length branch from 7f59f75 to de5d2ff Compare May 13, 2019 15:58
@fjmolinas
Copy link
Contributor Author

@kaspar030 thanks for the review, just have to wait for murdock to be green.

@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR labels May 13, 2019
 - nrf52 flash page is 4k, the bootloader needs to be x2 so slots
  start at the beginning of a page.
@fjmolinas fjmolinas force-pushed the pr_nrf52dk_bootloader_length branch from de5d2ff to de33143 Compare May 13, 2019 19:47
@kaspar030 kaspar030 merged commit d85d966 into RIOT-OS:master May 14, 2019
@fjmolinas fjmolinas deleted the pr_nrf52dk_bootloader_length branch August 7, 2019 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: OTA Area: Over-the-air updates CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants