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

Custom uart bootloader doesn't jump to application

Hi!

This is what I'm using:

-SoftDevice S113 v7.0.1

-SDK v17.0.0.0

-SES v4.52c

-nRF52840

I've created a custom buttonless uart bootloader based on the "secure_bootloader_uart" for the nRF52480 without any of the security and encryption functions because I just don't need them for my application.

I've debbuged the bootloader and it seems that is working, but I cannot make it to jump to my application once the application is received and flashed.

The flash mapping is:

MBR --> 0x0000 0000 to 0x0000 1000

SoftDevice  --> 0x0000 1000 to 0x0001 C000

Application --> 0x0001 C000 to 0x0008 9000

Bootloader --> 0x000F 8000 to 0x000F E000

Bootloader settings --> 0x000F F000 to 0x0010 0000   (Custom bootloader info)

When the bootloader checks that all code placed in flash, SoftDevide and Application, are valid, then it calls the function "nrf_bootloader_app_start()"

After calling this function it should jump to SoftDevice and then to my application, but the system reboots and executes again the bootloader and it tries to jump again in an endless loop.

I've tested my application with the orignal "secure_bootloader_uart" and it works, so afaik the application is ok. I've also checked that flash addresses on where the application and SoftDevice are placed are the same that the ones used by my Bootloader.

Is there anyone who can help me? Thank you

 

Regards,

David

  • Hi Hung,

    sorry for my late response.

    I've been checking the PC in both applications: my BL and the original secure BL. As you might expectected is that both PC are not equal. My BL PC jumps to a wrong address although the address set to the function is correct. Why? I don't know

    I debugged the original BL step by step and I did the same with my BL. Both BL applies the same jump destination address, but the original BL jumps correctly and mine no. The only difference between both projects is the optimization level. 

    My application is too small, so I don't need to apply any optimization to fit it in the bootloader area, meanwhile the original BL needs to apply a Level 1 optimization in order to fit. I decided to apply the same optimization level into my BL application and guess what happened.... it worked Scream

    I don't know why, but for my it's not normal.

    Do you have any explanation for that behaviour?

    Regards,

    David

  • Hi David, 
    I had a quick test here with the open USB bootloader (debug version) for PCA10059 with optimization level set to 0. I don't see any issue with it jumping to the application. Could you try to test on your side ? Which IDE did you use for compiling? 

    What I can suggest is to try simplify the bootloader to very simple one, just have the code to jump to application and nothing else. So when you test it you flash MBR, App, BL (so no DFU feature) just to check the difference between your code and the stock bootloader .

Related