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

Flashing nRF52840 module

Hi everyone,

First of all sorry for the big post but I have to clear many questions inside my head.

I just finished and received my prototype board that incorporates Raytac's MDBT50Q-P1MV2 module. This module is pre-approved by Nordic and is based on nRF52840 SOC.

As a new embedded developer I have a few questions regarding the programming of the module. For the last few months I was playing around with nRF52840 DK using the SDK16 and s140 soft device and I have written my own BLE application that works fine.

Now I want to flash the third party module. What I have understood so far is that there are actually two methods to flash the SOC, either using DFU bootloader or using an external programmer like a J-Link. Is this right?

What I've written is that in order to update the softdevice or the application or the bootloader directly from USB you have to implement the so called secure DFU bootloader

Also it is required to implement the secure DFU bootloader if you want to update the application Over The Air (OTA) right?

I am not intended to use the USB for programming at the moment (maybe in the future if I have to update the application OTA), and for that reason I purchased the J-Link EDU mini.

Due to the fact, that the last few months I was working with nRF52840 DK that incorporates MCU interface running SEGGER J-Link OB firmware, I am not familiar using external programmers (like the J-Link EDU mini).

The module I have received is equiped with a bootloader? In general when Nordic ships nRF SOCs are equiped with the Bootloader?

The J-Link EDU mini I purchased is equiped with the J-Link software or I have to install it manually?

In order to update the application through the J-Link I can use either Segger or nRF Desktop -> Programmer (adding the hex file)? Also I have read in some posts of using the nRFGo Studio (but I have not any experience with this)

In order to upload a ble_peripheral example I have to program the soft device first or it is not required? So far, I have purchased five nRF52840 DK and I've never needed to program the softdevice and all the examples running normally.

In general what is the procedure before starting updating any third party module? Should I erase the module and then programming the bootloader? Where do I find the bootloader?

Thanks in advance

Nick

Parents
  • Nick,

    That is a long post :)

    I have tired to answer each question below, I haven't used the RayTac modules before some my answers will be more generic.

    Now I want to flash the third party module. What I have understood so far is that there are actually two methods to flash the SOC, either using DFU bootloader or using an external programmer like a J-Link. Is this right?

    Yes, that is right.

    What I've written is that in order to update the softdevice or the application or the bootloader directly from USB you have to implement the so called secure DFU bootloader

    Also it is required to implement the secure DFU bootloader if you want to update the application Over The Air (OTA) right?

    Yes that is correct.  The last time I checked Nordic didn't have an example DFU bootloader the implemented both OTA and serial.

    The module I have received is equiped with a bootloader? In general when Nordic ships nRF SOCs are equiped with the Bootloader?

    The J-Link EDU mini I purchased is equiped with the J-Link software or I have to install it manually?

    Each module is different.  Some module manufacturers include code on the module to help get you up and running some do not.  The should be some details in the documentation for the module.

    No, Nordic doesn't ship their modules with firmware on them unless you have very large volumes.  You normally need a Segger J-Link or J-Flash to program the chip.  Did you add connections to the SWCLK and SWDIO pins of the module on your prototype board?  This is where you connect the debugger.

    You should install https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Toolscommand line tools so you can program the device.

    In order to update the application through the J-Link I can use either Segger or nRF Desktop -> Programmer (adding the hex file)? Also I have read in some posts of using the nRFGo Studio (but I have not any experience with this)

    nRFGo Studio is very old an shouldn't be used any more.  You can use nRF Desktop as you pointed out or nrfjprog which is part of the command line tools linked above.

    In order to upload a ble_peripheral example I have to program the soft device first or it is not required? So far, I have purchased five nRF52840 DK and I've never needed to program the softdevice and all the examples running normally.

    Yes if you want to use any of the Bluetooth LE examples you need to program the softdevice first.  The reason you haven't needed to do it is Segger Embedded Studio does it for you when you debug your application.  If you have been testing just the peripheral examples then the soft device isn't needed.

    In general what is the procedure before starting updating any third party module? Should I erase the module and then programming the bootloader? Where do I find the bootloader?

    Again when using third party modules the vendor should provide some guidance as to what they module comes with if anything.  I normally erase the module and put on my own application.

    You need to compile the bootloader you self since you custom board is likely using different pins than the Nordic DK. 

    I hope this helps.

    Cheers,
    Darren

  • Hi Darren and thank you for your answer

    Did you add connections to the SWCLK and SWDIO pins of the module on your prototype board?  This is where you connect the debugger.

    Yes I have added those debugging lines and I finally managed to flash my evaluation board with three different ways using:

    1. Segger IDE

    2. nRF Connect for Desktop -> Programmer (upload hex file)

    3. nrfjprog (hex file)

    However, what it is not clear for me is that, I didn't required to upload the softdevice seperately. Looking e.g. the hex file of the blinky project in ble_peripheral examples, I can see the title of each hex file includes the softdevice. What is happening here? The generated hex files of Nordic's examples includes the softdevice? I mean maybe the linker merges application's hex file with softdevice's hex file?

Reply
  • Hi Darren and thank you for your answer

    Did you add connections to the SWCLK and SWDIO pins of the module on your prototype board?  This is where you connect the debugger.

    Yes I have added those debugging lines and I finally managed to flash my evaluation board with three different ways using:

    1. Segger IDE

    2. nRF Connect for Desktop -> Programmer (upload hex file)

    3. nrfjprog (hex file)

    However, what it is not clear for me is that, I didn't required to upload the softdevice seperately. Looking e.g. the hex file of the blinky project in ble_peripheral examples, I can see the title of each hex file includes the softdevice. What is happening here? The generated hex files of Nordic's examples includes the softdevice? I mean maybe the linker merges application's hex file with softdevice's hex file?

Children
  • Nick,

    Sorry for the delay I was on vacation.  

    However, what it is not clear for me is that, I didn't required to upload the softdevice seperately.

    I believe that Nordic is trying to reduce complexity for developers who are getting started with Nordic devices and the SoftDevice.  All of the BLE examples have the SoftDevice included and the SES projects have the SoftDevice loaded for you.  You can find this if you review the .emProject file.

    I have created scripts which merge the SoftDevice, bootloader and application hex files into a single hex file for production.

    Cheers,

    Darren

Related