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

Flashing custom nRF52 (Bootloader, SoftDevice, Application)

Good morning,

Is it always required to use Segger J-Link in order to flash Bootloader, Softdevice and Application to a new device?

Could you summarize the different possibilities we have to flash any of these parts?

Furthermore, and regarding the nRF52840: is it possible to use the USB port to flash the device?

Best regards.

Parents
  • you need J-Link to flash bootloader. The Softdevice and the application can be flashed OTA

  • As mentioned, you need to program the chip with a bootloader first in order to enable FW update over USB,etc. Different options for programming the chips in production are summarized in this guide: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.gs/dita/gs/prod_test_prog.html?cp=1_0_6  

  • Good morning Vidar. Could you send me the right link in what regards programming chips in production? Is not working now.

    I have developed my custom board based on nRF52840 and up to now, I have no Segger J-Link to flash the bootloader. Our first converstation was some months ago and maybe there are news in what regards how my device can be flashed, so:

    - Do I always need the Segger J-Link to flash bootloader? Are there any other options? Will the ARM Flasher by Segger also work?

    - Can the bootloader be flashed using the USB port?

    - And in what regards SoftDevice, and Application: once I have the bootloader flashed, can they be flashed via BLE the first time (with DFU, of course)?

    - Which method do you recommend to flash Bootloader, SoftDevice, Application for mass production?

    Best regards,

    Dani.

  • Hi Dani, here's an updated link to the documentation I was referring to earlier: Production programming and testing

    Dani said:
    Do I always need the Segger J-Link to flash bootloader? Are there any other options?

     The ICs are shipped blank from our factory, but some third-party modules may come pre-programmed with a bootlaoder. 

    Dani said:
    Can the bootloader be flashed using the USB port?

     Unfortunately, no. The USB can only be enabled and controlled by FW running on the chip.

    Dani said:
    And in what regards SoftDevice, and Application: once I have the bootloader flashed, can they be flashed via BLE the first time (with DFU, of course)?

     You could just flash the MBR and bootloader and program the Softdevice and application afterward. But wouldn't it be better to flash everything at once? It will certainly be faster.  

    Dani said:
    Which method do you recommend to flash Bootloader, SoftDevice, Application for mass production?

    I would say to program everything through the debug interface in one step if possible and not DFU. But it depends. Maybe you want the final FW to be uploaded after the product is enclosed, etc. 

    Best regards,

    Vidar

  • Thank you so much for your answer.

    It will perfect to flash everything at once the first time, but later on, I will need the device to be updated via BLE (just the application).

    Will the Segger ARM Flasher also work to flash everything?

    Best regards,

    Dani

Reply Children
  • You can flash everything at once regardless of what programmer you use, but you may want to merge the hex files first to speed up the process a bit. See Merging files with mergehex

  • Good morning,

    I have suceeded in programming both softdevice and application with J-Flash tool by Segger and ARM flasher. It is perfectly working-

    Now, I want to also include bootloader in order to have BLE-DFU implemented. I have created private_key following steps detailed in DFU_Step_by_step. I have merged bootloader, softdevice and application with J-Flash tool but device is not working. I suppose that it is a problem related with addresses. Is there any explanation showing which addresses to consider for all of this three parts in what regards the nRF52840 device?

    Furthermore, is it required to create the zip file using this?:

    nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52832_xxaa.hex --sd-req 0x98 --key-file private.key app_dfu_package.zip

    I suppose this is only required when carrying out a BLE-DFU operation, right? 

    Apart of this: in my application I have some preserved data: I have set FDS_VIRTUAL_PAGES to 5 and preserved data is working without Bootloader. Do I have to consider something new with this preserved data when including bootloader? Is re-adressing carried out automatically?

    All the best,

    Dani

  • Hi again,

    I have already found this: I had to create the bootloader setting.

    Now, the application starts working but, when it has to start advertising, it seems to be hung!!!! do you know which can be the reason?

    So,

    - How can I debug my application when bootloader is present?

    - What about preserved data? Have I to consider extra settings when bootloader is present?

    Best regards,

    Dani.

  • Hi Dani,

    Yes, the settings page is needed to tell the bootloader that you have a valid application, it will fall back to DFU mode otherwise. As for debugging the app, you can do that after you've loaded the settings page. Just make sure to disable boot validation option in the settings page to allow the bootloader to boot the app even if it has been modified. 

    Dani said:
    What about preserved data? Have I to consider extra settings when bootloader is present

     FDS automatically detects the presence of the bootloader and places the data below the bootloader instead of placing it at the end of flash, see Memory layout. Also, the NRF_DFU_APP_DATA_AREA_SIZE flag inside the bootloader must correspond to the number of FDS pages allocated by the app to ensure app data is preserved data through DFU. The default is usually 3 pages. 

    Best regards,

    Vidar

  • Hi Vidar,

    Thank you again for your answers.

    Which settings page are you referring to in your last answer?

    Should the 'NRF_DFU_APP_DATA_AREA_SIZE ' parameter also be modified in the 'nrf_dfu_types.h' file when including this file (DFU service) into the application?

    I'm working with Keil...

    Best regards,

    Dani.

Related