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

Can't run secure bootloader example on nRF51822

I have nRF51822 AA with SDK 12.3.0 and SEGGER SES 3.10f.

I was able to run and experiment with ble_app_beacon example, fixing known SES troubles, mainly with memory sections in flash_placement.xml (those are described in devzone).

But I was unable to run dfu/bootloader_secure example.

First there was build problems, and I managed to fix them in flash_placement.xml, but I'm not sure if it was a right thing. There were:

  • `UNPLACED_SECTIONS' error for .bootloaderSettings
  • undefined reference to `__stop_dfu_trans' (as well as start)
  • undefined reference to `__isr_vector'

The first to were more or less referenced on forums here. So I did:
<ProgramSection alignment="4" load="Yes" name=".bootloaderSettings" start="$(BOOTLOADER_SETTINGS_START:0x0003FC00)" size="$(BOOTLOADER_SETTINGS_SIZE:0x400)" />
and
<ProgramSection alignment="4" load="No" keep="Yes" name=".dfu_trans_run" address_symbol="__start_dfu_trans" end_symbol="__stop_dfu_trans" />

But __isr_vector produced not so much results, and I ended with 
<ProgramSection alignment="0x100" load="No" name=".vectors_ram" address_symbol="__isr_vector" start="$(RAM_START:$(SRAM_START:))" />
of wich I'm most doubtful.

Now it builds, but it does not work. Debug shows one jump at 0x6B0 location and then all goes to unmapped memory. I could say that then I was not sure where to place bootloader and softdevice in memory, there were Debug runs that led to main{} and Hardfaulted after some initialization. But I'm unable to reproduce it.

Here is the project itself, which I just copied from example and placed alongside with it: yadi.sk/.../45x4TLDw6Wxk_g
I use pca10028\arm5_no_packs as the basis.

Parents
  • So, does someone have an idea what to check here? Or maybe what settings should be for __isr_vector?
    Or maybe correct SEGGER project file?

  • Hi,

    I have ported the bootloader example (pca10028_debug version) to SES, see attachment below. Some additional notes:

    1. I've only tested with SES version 3.50 and 4.12, suggest that you upgrade to a more recent version.

    2. You need to apply some minor changes to the SDK  ( use the "_vectors" linker symbol instead __isr_vector), see diff file in the project folder.

    3.  Keep the original folder structure since the project relies on relative paths. To avoid overwriting existing project files you can make a new bootloader folder so that the path to your project looks like this: "\nRF5_SDK_12.3.0_d7731ad\examples\dfu\bootloader_secure_ses\pca10028_debug\ses\secure_dfu_secure_dfu_ble_s130_pca10028_debug.emProject"

    4. Is not thoroughly tested. 

    bootloader_secure_ses.zip

Reply
  • Hi,

    I have ported the bootloader example (pca10028_debug version) to SES, see attachment below. Some additional notes:

    1. I've only tested with SES version 3.50 and 4.12, suggest that you upgrade to a more recent version.

    2. You need to apply some minor changes to the SDK  ( use the "_vectors" linker symbol instead __isr_vector), see diff file in the project folder.

    3.  Keep the original folder structure since the project relies on relative paths. To avoid overwriting existing project files you can make a new bootloader folder so that the path to your project looks like this: "\nRF5_SDK_12.3.0_d7731ad\examples\dfu\bootloader_secure_ses\pca10028_debug\ses\secure_dfu_secure_dfu_ble_s130_pca10028_debug.emProject"

    4. Is not thoroughly tested. 

    bootloader_secure_ses.zip

Children
Related