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

bootloader for nrf51822 QFACA1part on a custom board

Hi All,

We are trying find a way to upgrade nrf51822 in the field post initial release. I read the following posts (devzone.nordicsemi.com/.../) (developer.nordicsemi.com/.../a00069.html)

If I to I am trying to understand the following please bare me for asking very basic questions

  1. Do we must need to have a bootloader?

  2. Is there any existing bootloader that I can use as it is on nrf51822 QFACA1 part? or I must customize something? if yes, what all needs to be done? I don't think we can accommodate dual bank architecture. If that is the case, what I need to worry about?

  3. How do I program bootloader for the first time ? (Most likely a programmer, but I would still like to have an answer to confirm)

  4. Do I need to flash bootloader at specific address?

  5. How do I park device to bootloader mode for future firmware upgrade? I don't have any button on my PCB (how does other people do it for their devices) .

  6. When upgrading softdevice does it also erase the bootloader? or it can be prevented? May be I was informed that to upgrade softdevice you must erase entire flash, which doesn't sound right to me.

  7. How do you upgrade softdevice only? or softdevice + application or application only?

I know I asked so many questions but I would like to understand all this in a same thread.

Parents
  • Hi Harry,

    1. Yes, you need a bootloader if you want to do DFU. It's possible to make an application that can also handle the bootloader task but it will make the process more complicated and less safe.

    2. The bootloader is available in the SDK. Please let me know which SDK you based your application on and the softdevice version on the chip.

    3. Yes, you use normal programmer and flash the bootloader as a normal application.

    4. Yes, but the programmer will handle that for you. Please have a look here for more information about the bootloader.

    5. You can add the DFU service into your application, and can switch to bootloader mode by a command from the central device. Look here.

    6. If the old bootloader is compatible with the new softdevice, you don't need to update the bootloader. Updating the softdevice will erase the application part only.

    7. To update just softdevice, you can specify that you want to update softdevice or simply let the DFU master (app) on the phone take care of it, base on the information you provided in the .zip image. The application can be updated after that. Or you can combine them together and let the DFU master takes case of it.

    You can find more information in this FAQ.

Reply
  • Hi Harry,

    1. Yes, you need a bootloader if you want to do DFU. It's possible to make an application that can also handle the bootloader task but it will make the process more complicated and less safe.

    2. The bootloader is available in the SDK. Please let me know which SDK you based your application on and the softdevice version on the chip.

    3. Yes, you use normal programmer and flash the bootloader as a normal application.

    4. Yes, but the programmer will handle that for you. Please have a look here for more information about the bootloader.

    5. You can add the DFU service into your application, and can switch to bootloader mode by a command from the central device. Look here.

    6. If the old bootloader is compatible with the new softdevice, you don't need to update the bootloader. Updating the softdevice will erase the application part only.

    7. To update just softdevice, you can specify that you want to update softdevice or simply let the DFU master (app) on the phone take care of it, base on the information you provided in the .zip image. The application can be updated after that. Or you can combine them together and let the DFU master takes case of it.

    You can find more information in this FAQ.

Children
  • Hi Bui, Thanks for all the answers.I truly appreciate it. The softdevice version is 8.0.3, this is the softdevice.hex file, which has not changed since 8.0.0, but the package we reference is 8.0.3. Also, there will not be an app on the phone (DFU master application) to upgrade the nRF51822 SW. This is seen as a major security flaw. Instead, nRF51822 software will be sent OTA to the LPC1124 processor's external flash which will use SPI interface to program nRF51822. Now, the question is how do I park nRF51822 to bootloader mode? In crux, the architecture has two different ARM processors (LPC1124 and nRF51822) which can communicate over SPI or over swd. I would appreciate your comments.

  • Hi Harry,

    How do you send the NRF51 image to the LCP1124 OTA ? You will use BLE or something else ?

    To update the image from LCP1123 to NRF51 you can use SPI, we have an SPI bootloader here. But you have to write your own SPI DFU master.

    To send the nRF51 from application mode to bootloader mode, please follow what we do in the example ble_app_hrs with dfu. It should be very similar, please have a look at function bootloader_start() in dfu_app_handlers.c

  • Hi Bui, Thank you very much for the reply. We use a tool (similar to JTAG) to send composite image to LPC1124 but not BLE. It is not done OTA. In that case, do I need to have SPI DFU master?

    Also, I have the following question based on the release notes of the SPI bootloader. "The example host application can currently only program an application (not a bootloader or SoftDevice), and expects the application binary to be programmed into address 0x18000 of the flash."

    1. If we want the ability to program application + softdevice what changes we will have to make?

    2. Also, can we control the application address and softdevice address in flash? I remember softdevice is flashed at location 0x00000000 (MBR) + at offset 0x1000. Also, upgrading softdevices erases application completely. Is there a way to avoid this? I hope it doesn't erase bootloader as well.

    3. Do we also have to worry about interrupts once bootloader is flashed? since the same interrupt will be defined differently by softdevice? if that is the case how do we mange it?

  • Hi Harry,

    1. It's a bug with the readme text. We will update it. Softdevice and bootloader update is supported. You can check the source code of the host example. If you press button 2 it will update softdevice.

    2. I don't think it's a good idea to change softdevice address. Since the location of the softdevice configuration page is hard coded. For the address of the application, it's based on the size of the current softdevice. Note that the 0x18000 address is the address of the image on the host device, has nothing to do with the location of the application when flashed.

    3. The interrupt vector table will be forwarded to the bootloader if there is existing a bootloader. Then the bootloader will forward that to the softdevice when it's finished. You can have a look at question B here.

  • Hi Bui, Thank you very much. I just started working on this. Now, I am overwhelmed with the information in the bootloader project.

    I need to create a standalone project using keil tools for nrf51822. I believe that I will have to

    1. Download the following directories to my local machine. link text and link text

    2. Add all files from above directory to a blank project and compile and then download followed by send a file using a SPI master from LPC1124 (My architecture has 2 micros 1 is LPC1124 and the other is nRF51822)

    3. I don't have the buttons and LEDs as defined in the bootloader project above which I plan to comment out.

    Is it the right way to do it? I have never worked on this before please bear me if I asked for too much.

Related