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

Bootloader programming in Mesh_SDK

We are using nRF52840 with the
nrf5_SDK_for_Mesh_v1.0.0
in combination with
s140_5.0.0-3.alpha

I'm working with the nRF52840-Preview-DK board.

Task: program a bootloader for our product

I tried to integrate the serial bootloder and followed the Quick Start Guide for the Mesh SDK.
That is the link: infocenter.nordicsemi.com/.../md_doc_getting_started_dfu_quick_start.htm

The first problem appeared in step 4:
When entering this command in the command line interface:
python device_page_generator.py -d nrf52840_xxAA -sd "s140_5.0.0-3.alpha"
I got this result:
Wrote device page for nrf52840_xxAA with the s140_5.0.0-3.alpha SoftDevice to bin/device_page_nrf52832_xxAA_s132_5.0.0.hex
==> the name of the hex-file contains the default names from the json file

Steps 6 to 9 didn't show up a problem.

After step 9 I veryfied the the result with nRFgo Studio and there whre 3 parts as expected:
- Bootloader
- Application
- Softdevice

I was aware of the fact that my application just contained the DFU part, but not the serial part
=> so there it was no surprise when the output of step 10 was:
Failed to upgrade target. Error is: Serial port could not be opened on 17. Reason: .... and so on ...

Nevertheless I did step 11 checking the bootloader.
This result was a surprise:
    bootloader_verify.py 683338486 17
Output:
    Device family:                  NRF51
    Reading UICR..                  ERROR: The --family option given with the command (or the default from
    ERROR: nrfjprog.ini) does not match the device connected.
    Error calling nrfjprog with arguments -s 683338486 --memrd 0x10001014 --n 4 --w 32 --family NRF51.
    
Question 1:
Where is this information (NRF51) taken from? That is the wrong family as I'm using NRF52.
I expect this is taken from the bootloader file
nrfjprog --program mesh_bootloader_serial_gccarmemb_nrf52840_xxAA.hex

My next step: try to use the serial example in the Mesk_SDK.
As this example is using Softdevice s130 I tried to adapt it to Softdevice s140
=> I failed badly as many files within this Softdevice changed a lot.

Question 2:
- Is it possible to adapt the example in nrf5_SDK_for_Mesh_v1.0.1_src\examples\serial from s130 to s140?

Question 3:
- is there any other way to flash bootloader, softdevice and application other than using the command line tool following the steps in Quick Start Guide

Parents
  • Hi,

    Thanks for reporting this!

    First, I highly recommend to switch over to nRF5 SDK for Mesh v2.0.1, both because that one has a qualified Mesh stack (v1.x is not), it has more functionality, and for the nRF52840 it uses a non-alpha SoftDevice. One major problem with the s140 v5.x alpha releases is that it is incapable of doing bootloader DFU.

    For the name of the generated hex file in step 4, I see from the python code that the default name for --output-file is bin/device_page_nrf52832_xxAA_s132_5.0.0.hex regardless of the provided --device and --softdevice parameters. The hex file itself should be good, though, it is only the name that is wrong. I see that this has already been patched in the development branch and so it is fixed for the next release.

    The error that you see in step 11 is that bootloader_verify fails to detect the NRF52840 family. In bootloader_verify.py you will find a function named "get_device_family". Add a line "        '683': 'NRF52840'," so that it reads:

    def get_device_family(serial_number):
        family = {
            '480': 'NRF51',
            '680': 'NRF51',
            '681': 'NRF51',
            '682': 'NRF52',
            '683': 'NRF52840',
        }
        if not serial_number[:3] in family:
            return 'NRF51' # fallback to 51.
        else:
            return family[serial_number[:3]]

    Regards,
    Terje

  • Dear Terje

    thank you for the quick answer.

    I did the modifications and got this output:

    Device family:                  NRF52840
    Reading UICR..                  ERROR: Argument provided has a wrong value. Memory access not aligned, value
    ERROR: outside of range or similar.
    Error calling nrfjprog with arguments -s 683338486 --memrd 0x10001014 --n 4 --w 32 --family NRF52840.

    Nevertheless we will first change SDK and Softdevice to the versions you recommend before trying again.

    But please: could you give me an answer to question 3 above?

    Thanks

  • Hi,

    If you are referring to all the steps using the nrfjprog command line tool, then I am afraid there is few other options. We do have an old GUI tool named nRFGo Studio that can do programming, you could have a look at using that one instead. Be warned however that it is not necessarily updated for the latest SotDevice and SoCs, so it may report things such as "unknown SoftDevice" where in fact the correct SoftDevice is downloaded to the board. Your mileage may vary.

    Regads,
    Terje

Reply
  • Hi,

    If you are referring to all the steps using the nrfjprog command line tool, then I am afraid there is few other options. We do have an old GUI tool named nRFGo Studio that can do programming, you could have a look at using that one instead. Be warned however that it is not necessarily updated for the latest SotDevice and SoCs, so it may report things such as "unknown SoftDevice" where in fact the correct SoftDevice is downloaded to the board. Your mileage may vary.

    Regads,
    Terje

Children
No Data
Related