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

How to get Bluetooth Bootloader up and running??

Hi,

I am having BIG problems getting the Bluetooth Dual Bank Bootloader sample to work!

I am using Keil 5.18 and using SDK version 9.0.0 and also tried 10.0.0. I have S310 working together with a application using both ANT+ and BT. No problems what soever...

But now I want to add a bootloader functionality so that I can update the firmware remotely if I need to.

I use the following recipee:

  • First I clear the CPU using nRFStudio
  • Then I install Softdevice S310 v3.0.0 in the device (116KB)
  • I use the sample BLE_DFU_DUALBANK_S310 (not sure this is the exact name :))
  • From either V9 or V10 SDK
  • Build the project (which takes 3 compile iterations optimizing for size)
  • I have then tried installing the bootloader 2 ways.
  • One way is just clicking upload in Keil which uses jrfprog
  • Second way is using nRFStudio and install the bootloader here by using the .hex file

I reset the board and then use "NRF Toolbox" on my Android Phone to try and search for the device. But it never comes up.

Actually I think it crashes becuase I cant even lit a LED....

I am pretty stuck here. I cant seem to be able to single step the bootloader for some reason. This way I could possible identify what is going wrong...

Please help

  • Hi Again, Now I have some progress - but the bootloader is not running yet... Here goes: As you suggested - I did get HardFaults - so that was the reasone why I ended up there when debugging. I compared memory setup between my application and my bootloader and could see that the bootloader was using 0x2700 - 0x8000 and application was using 0x2200 - 0x8000. Strangely when giving my bootloader more memory (0x2200 - 0x8000) i did not get the HardFault any more. So now I get through the startupcode and my LED gets LIT! Whoohoo! The next problem is when the bootloader calls pstorage_init also in the initialization process. This fails. Why is the bootloader using pstorage and for what? So I have to debug some more later on

  • Strange, you should get an error at link time if there were not enough RAM allocated, is it possible that the set RAM size you had did not correspond with the address range? Also, the RAM allocation in the bootloader doesn't need to be aligned with the application's. Bootloader and application are always started via the reset handler.

    That said, the bootloader needs a no init section (IRAM2) that used to share bonding information between application and bootloader.

    Do you have 32K or 16K of RAM on the chip you're using?

    I'd suggest to open a clean bootlaoder project to ensure you have the default values. With a 16K RAM variant you need to change the linker settings from:

    image description

    to:

    image description

  • Hi Vidar,

    Actually you were spot on... The issues I was facing was because our prototype boards now only have 16Ks of ram.

    So I ended up installing Keil 5.18 and SDK10 clean, then created a new Bootloader project dualbank S310.

    Edited the memory configuration, build the bootloader and uploaded S310 and the bootloader

    And guess what?! Now the bootloader jumped into action and is now working just fine!

    (I tried configuring my old project just before without success)

    So now I have a working hex file with a bootloader :)

    So thank you very much for you help / support - very much appriciated!

    BR Flemming

Related