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:

    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
        if not query_func("File found at %s. Do you want to overwrite the file?" % key_file):
      File "c:\users\jtorr\appdata\local\programs\python\python37-32\lib\site-packages\nordicsemi\dfu\util.py", line 69, in query_func
        choice = raw_input().lower()
    NameError: name 'raw_input' is not defined

    ..... 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

  • 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:

    +++ 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();
     }

    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.

Reply Children
No Data
Related