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

    Hope you had a pleasant Christmass.

    After programming in my nRF52840 DK board the ble_app_uart modified example you suggested, let me make a couple of comments.

    1/ Using the Segger Embedded Studio IDE I couldn't find the file "ble_m.c" in order to type the "adv_start();" sentence you told me. Instead, I've noticed that there is an "advertising_init();" sentence in the "main.c" file, and even an "advertising_start();" sentence few lines later on the script. If I try to edit this file instead of the"ble_m.c" one, the SES IDE says it doesn't recognize the "adv_start();" sentence but suggest typing "advertising_start() instead;". Then, if I write "advertising_start()" right after "advertising_init()", LED1 goes permanently on, but device_name is not being advertised. If instead I write nothing, and since in the referred modified example you told me, there is already an "advertising_start();" sentence a bit further on in the original script, what I get is LED1 intermittently blinking but again, no device_name being advertised.

    2/ To make things harder, with this example I can't open a PuTTY session with the nRF52840 DK board to see what's going on by using CLI commands.

    3/ If instead of the modified example I use the standard SDK_v15.2.0  ble_app_interactive you find in the ble_central and peripheral>experimental folder, then I can find the ble_m.c file you mention, LED3 goes permanently on, and everything goes fine as you said but then obviously, PHY is not coded and Tx_Power is not +8dBm (as it would have happened if I would have used the modified example) 

    As a conclusion, It seems to me that the modified example shall be further edited in order to accept the "adv_start();" sentence. I'm I right? Could you help on that?

    In the hope you will be still willing to provide some guidance to me,  then I fill we are near to achieve the initially intended goal. 

    Waiting on your comments,

    Thanks in advance.

  • Hi Vidar.

    Using the modified SDK you sent to me (see above link) and changing the original S140 with the S140 v6.1.1 you suggested, I get this error while compiling:

    Since it seems that the "nrf_error.h" file path is missing, where in the modified SDK folder could I find this header file?

    Thanks

    Juan

  • Hi Juan,

    The modified SDK uses s140 v.6.1.1 already. If you have started with a new SDK copy you can replace the entire "s140" folder with the one from nRF5_SDK_15.2.0_mod (\nRF5_SDK_15.2.0_mod\components\softdevice\s140). nrf_error.h is located in s140/headers.

  • Hi Vidar,

    Now I have the ble_app_uart example compiled and running on my PCA10056. As expected and according to the main.c source code, Tx_power is set to +8 dBm,  the modulation is CODED_PHY, the Device _Name is set to "Nordic_uart", the LED 1 is blinking and I also  can read the text "UART Start!" printed on the PuTty terminal emulator running on the computer but unfortunately, the device_name is not being advertised, so I can't connect the module from my nRF52840 USB Dongle to complete the ble_app_uart example test.

    If I review the main.c code, I can see an advertising_init(); and also an advertising_start(); statement, but no advertising going on. I tried introducing an adv_start(); just after advertising_init(); since you told me to do so in the past (while discussing about the central & peripheral cli example. See above comments) but the compiler does not accept it.

    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.

    Being anyway the advertising matter my main concern, what am I missing?

    Any suggestion will be appreciated.

    Thanks

Reply
  • Hi Vidar,

    Now I have the ble_app_uart example compiled and running on my PCA10056. As expected and according to the main.c source code, Tx_power is set to +8 dBm,  the modulation is CODED_PHY, the Device _Name is set to "Nordic_uart", the LED 1 is blinking and I also  can read the text "UART Start!" printed on the PuTty terminal emulator running on the computer but unfortunately, the device_name is not being advertised, so I can't connect the module from my nRF52840 USB Dongle to complete the ble_app_uart example test.

    If I review the main.c code, I can see an advertising_init(); and also an advertising_start(); statement, but no advertising going on. I tried introducing an adv_start(); just after advertising_init(); since you told me to do so in the past (while discussing about the central & peripheral cli example. See above comments) but the compiler does not accept it.

    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.

    Being anyway the advertising matter my main concern, what am I missing?

    Any suggestion will be appreciated.

    Thanks

Children
Related