Skip to content

Instantly share code, notes, and snippets.

@veghead
Created July 9, 2024 02:00
Show Gist options
  • Save veghead/d88db143c2fd4065a1ede5df223f81b6 to your computer and use it in GitHub Desktop.
Save veghead/d88db143c2fd4065a1ede5df223f81b6 to your computer and use it in GitHub Desktop.
NRF52 Boot Sequnce

Upon system reset, the execution branches to the MBR Reset Handler as specified in the System Vector Table.

The sequence is MBR -> bootloader -> application. The MBR is provided by the softdevice. The MBR uses a configuration page, the address of which is MBRPARAMADDR which is MBR_PARAM_ADDR (defined in nrf_mbr.h), or if this is 0xFFFFFFFF, UICR.NRFFW[1]

Bootloader address is BOOTLOADERADDR which is MBR_BOOTLOADER_ADDR (defined in nrf_mbr.h). If this is 0xFFFFFFFF, UICR.NRFFW[0] is used instead.

APP_CODE_BASE hardcoded in softdevice

The bootloader build creates two blocks of hex. The bootloader itself and UICR.NRFFW[0] which contains the address of MBR_BOOTLOADER_ADDR (from hexinfo.py):

- { first: 0x00028000, last: 0x0002DBB3, length: 0x00005BB4 }
- { first: 0x10001014, last: 0x1000101B, length: 0x00000008 }
- file: 'mqaoa_SD_BL_13_3_a3a7fda.hex'
  data:
  - { first: 0x00000000, last: 0x00000AFF, length: 0x00000B00 }
  - { first: 0x00001000, last: 0x00018E4B, length: 0x00017E4C }
  - { first: 0x00019000, last: 0x0001F59F, length: 0x000065A0 }
  - { first: 0x00028000, last: 0x0002DBB3, length: 0x00005BB4 }
  - { first: 0x0002E000, last: 0x0002E327, length: 0x00000328 }
  - { first: 0x0002F000, last: 0x0002F327, length: 0x00000328 }
  - { first: 0x10001014, last: 0x1000101B, length: 0x00000008 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment