This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom firmware updater (dual bank) on nrf51822 + s130 ?

Hello.

How to write custom firmware updater, which:

  1. Takes new firmware from other device on SPI or I2C bus.

  2. Writes it to flash ("bank1" at 0x1B000, or "bank2" at 0x25000), for example, with ble_flash_word_write() (BLE radio is off at that moment).

3) Updates something in flash memory to start from "bank1" or "bank0", so selected firmware starts after reset. ?

Especially interested in (3) - where to change firmware starting address? By default firmware starting address in flash memory is 0x1B000 - how to change this default?

Thanks!

P.S.

Keil reports "Component is incompatible with versions of other selected components" when I select nRF_Libraries->DFU->dfu_bootloader and asks me to use s110 stack, while I'm using s130 2.0.0-7.alpha That's why I decided to write own simple firmware updater rather than use existing DFU, incompatible with s130.

Parents
  • I'd recommend downloading SDK v.11.0.0 alpha as it's already configured for the s130 2.0.0-7.alpha and includes the serial bootlaoder. Note that this example is using UART, but can be modified to use a different transport layer as long as it's reliable.

    The sd_softdevice_vector_table_base_set() call is used to tell the softdevice to where the application is located. That is, where it should forward interrupts. This SV instruction is called from the bootloader before branching to the application.

Reply
  • I'd recommend downloading SDK v.11.0.0 alpha as it's already configured for the s130 2.0.0-7.alpha and includes the serial bootlaoder. Note that this example is using UART, but can be modified to use a different transport layer as long as it's reliable.

    The sd_softdevice_vector_table_base_set() call is used to tell the softdevice to where the application is located. That is, where it should forward interrupts. This SV instruction is called from the bootloader before branching to the application.

Children
Related