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

  • Hi Juan,

    Did you use the ble_app_uart_c example from my modified SDK on the dongle? You will need a scanner that is set up to scan for CODED_PHY advertisement packets. Otherwise, it won't be able to scan any packets from this peripheral. 

    p143 said:
    Apart from this, if I change APP_ADV_DURATION from "18000" to "0",   (as I need permanent advertising), nothing seems to change except that LED 1 stops blinking.

    In addition to setting APP_ADV_DURATION to '0' you need to change the adv. flag from BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE to BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE in advertising init.  

  • Hi Vidar.

    APP_ADV_DURATION is now set to '0' and working fine. 

    One more thing. If I want to revert your modified ble_app_uart peripheral example to PHY_1MBPS modulation (which I imagine is the one you can scan with a standard dongle), would you please tell me which code statements should I edit? I tried on my own editing 'init.config.ble_adv_primary_phy' and 'init.config.ble_adv_secondary_phy' main.c initialization statements, but obviously with not very much success. 

    Thanks

    Juan

  • Hi Juan,

    You can use the advertising_init() function from the original ble_app_uart example in SDK 15.2.0 if you want to revert back to 1M. 

  • Thanks, Vidar.

    By the way. Do you know of any smartphone BT v5.0 PHY_CODED compatible, apart from (I read it somewhere) the ONEPLUS 6?

    Thanks

    Juan

  • Hi Vidar.

    Everything is working flawlessly now. Regarding your modified ble_app_uart example and its PHY_CODED modulation, what is the BLE data rate actually set in this case. 125 or 500 kbps? 

    Thanks.

Reply Children
No Data
Related