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

Customizing a bootloader

If all you need is changing  PHY, Tx power and Device Name in a standard nRF52840, do you need building a new bootloader from the scratch or the is a way to edit the standard firmware,  build a new edited file and finally re-program this file in a standard nRF52840? Thanks

Parents
  • Hi Vidar. Following the Getting started with Nordic's Secure DFU bootloader, a step by step guide, in the A1 step, Generate your own private key. Type this command line:  nrfutil.exe keys generate private.key, all I get is:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    C:\Users\jtorr>nrfutil.exe keys generate private.key
    File found at private.key. Do you want to overwrite the file? [y/N]
    Traceback (most recent call last):
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
    File "C:\Users\jtorr\AppData\Local\Programs\Python\Python37-32\Scripts\nrfutil.exe\__main__.py", line 9, in <module>
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
    File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\nordicsemi\__main__.py", line 364, in generate
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    ..... but I don't see any private key string to continue, in order to obtain the public key.

    Any comments?

    Thanks in advance.

  • Hi Vidar.

    I need customizing the TXPOWER parameter through BLE in several nRF52840 modules I am testing, in such a way next time they boot up, they will do with their output power set to pos8dBm and not to pos6dBm as is the case now. Would you please help me with a step by step guide?

    I barely understand how to build and program a secure DFU using nRFtools, but I don't know how to build the source file to initiate the process.

    And also, where in within all the blocks the firmware is made up is this parameter defined? In the Bootloader block, in the SoftDevice, in the App_Data, in the Application itself or somewhere else that I am not yet aware? The modules I am testing are from uBlox. Will I need special source files other than if I set this parameter in the module of a nRF52840 DK board?

    Thanks so much

  • Hi Vidar. Would you please tell me the command I should edit in the BLE Interactive CLI example to set advertising on at boot-up (the factory default is off)?

    Shure I can issue an advertise_on command through the PuTTY console, but the SoC resets to off as soon as the module is being switch-off. Thanks so much.

  • Hi, could you explain what you want to archive in more detail? Is for testing, or do you plan to use this example as a starting point for your own application? The BLE interactive  example is built around the command line interface so you can easily test different ble features, but not meant to be used in a final application. 

  • Hi Vidar. We are trying to make a prototype, able to advertise a customized local name, with a coded PHY modulation and maximum transmitted power in order to build the proof of concept (PoC) for a new product. If the result is positive, we will start a finance round to bring this product to the market and in this case, a team of developers would build a new firmware from the scratch. 

  • Hi, I suggest you try the example I posted here: https://devzone.nordicsemi.com/f/nordic-q-a/40476/unable-to-convert-to-long-range-after-looking-at-umpteen-examples--/157300#157300. It's based on ble_app_uart, but modified to use +8dBm output power and coded phy.  Change the DEVICE_NAME define in main.c to set a custom device name. 

  • Thanks, Vidar. Based on your previous comments, I think I already know how to do that. The only thing we still don't know is how to set the firmware to allow the module advertising its local name by default, and not by issuing a CLI command through a COM port. Thanks

Reply
  • Thanks, Vidar. Based on your previous comments, I think I already know how to do that. The only thing we still don't know is how to set the firmware to allow the module advertising its local name by default, and not by issuing a CLI command through a COM port. Thanks

Children
  • Yes, but it's not as straight forward to make these changes in the CLI example. That's why I suggested to use the ble_app_uart example instead.  

  • We will review the suggested example, but tell me if I am wrong. In the end, setting the advertising service on by firmware should be just a matter of finding where, in which c source file I mean, is the c command or definition (I am not familiarized developing terminology) responsible for triggering this mode. I reckon It shouldn't be so difficult for somebody familiarized with the nRF52840 firmware. Would it?

    (Post Data. The link https://www.nordicsemi.com/eng/nordic/Products/nRF52840-DK/S140-SD-v6/60625 you provide gives a 404 error )

    Regards.

  • You are not wrong, just add adv_start() here:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    +++ b/examples/ble_central_and_peripheral/experimental/ble_app_interactive/ble_m.c
    @@ -1872,6 +1872,7 @@ void ble_m_init(void)
    bas_init();
    conn_params_init();
    advertising_init();
    + adv_start();
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    p143 said:
    (Post Data. The link https://www.nordicsemi.com/eng/nordic/Products/nRF52840-DK/S140-SD-v6/60625 you provide gives a 404 error )

    This is a link to our old website, it should have been redirected. Use this one instead: https://www.nordicsemi.com/Software-and-Tools/Software/S140/Download#infotabs

  • Hi Vidar.

    Are you sure we are not missing a starting parenthesis ({) in the script you sent me?

    and also, where should I copy this script, at the end of the ble_m.c file script or not matter where in within?

    Thanks for your help.

  • Hi,

    It's a "diff" to show the change I made. Just add the "adv_start();" line after advertising_init(); in ble_m.c at line number ~1872 and it should work.