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

Update nrf9160 modem firmware from Linux command line

I want to be able to update both application firmware and modem firmware via
the terminal. I know the nrfjprog and have no problem downloading application firmware.

Is it true that Nordic have no simple cli tool to update the modem firmware?

I know about nrfConnect and also the python package pynrfjprog... and FOTA.
But nrfConnect cannot be automatized by simple bash scripting.
And pynrfjprog is not a complete solution (like nrfjprog)... it is a python package where you have to program a lot yourself.
I know it might be a 30-35 lines for simple handling, but why do everyone need to do this, when it could be a standard feature of nrfjprog?

For pynrfjprog I have looked here: devzone.nordicsemi.com/.../214914

And FOTA is not practical in a production endvironment.

So is it at all possible with nrfjprog or a similar commandline tool to program modem firmware in a single command?

For example something like this:

nrfjprog --program <hexfile> -f NRF91

For reference I have been searching quite a lot around the community... but haven't been able to find answer.
Only something like these which really aren't what I need:

devzone.nordicsemi.com/.../ncs-tutorial---temporary
infocenter.nordicsemi.com/index.jsp
devzone.nordicsemi.com/.../unable-to-update-firmware-on-nrf9160
devzone.nordicsemi.com/.../command-line-method-for-nrf9160-1-updating-modem-firmware-and-2-application-firmware
devzone.nordicsemi.com/.../i-have-a-hard-time-when-trying-to-update-nrf9160-dk-modem
devzone.nordicsemi.com/.../how-to-apply-nrf9160-sip-modem-firmware-with-j-link-probe
devzone.nordicsemi.com/.../214914
devzone.nordicsemi.com/.../getting-started-with-nrf9160-dk

Parents
  • Hello, 

    Yes, I could not agree more with you. We are aware that this is a serious drawback, and we are working to fix this. At the moment the best solution is using pynrfjprog until we get this fixed.

    from pynrfjprog import HighLevel
    api = HighLevel.API()
    api.open()
    snr = api.get_connected_probes()
    for s in snr:
        probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
        probe.program("mfw_nrf9160_1.2.0.zip")
        probe.verify("mfw_nrf9160_1.2.0.zip")
        probe.close()
        print("Done")
     
    api.close()

    I am sorry for the inconvenience this is causing. 

    Kind regards,
    Øyvind

Reply
  • Hello, 

    Yes, I could not agree more with you. We are aware that this is a serious drawback, and we are working to fix this. At the moment the best solution is using pynrfjprog until we get this fixed.

    from pynrfjprog import HighLevel
    api = HighLevel.API()
    api.open()
    snr = api.get_connected_probes()
    for s in snr:
        probe = HighLevel.IPCDFUProbe(api, s, HighLevel.CoProcessor.CP_MODEM)
        probe.program("mfw_nrf9160_1.2.0.zip")
        probe.verify("mfw_nrf9160_1.2.0.zip")
        probe.close()
        print("Done")
     
    api.close()

    I am sorry for the inconvenience this is causing. 

    Kind regards,
    Øyvind

Children
  • Hi Øyvind

    First of all I'm impressed with your response speed - thank you for that!

    Second I'm glad I'm not the only one missing something here. In a production environment where I have to put production-ready software in my nrf devices it has to be efficient and streamlined... and I cannot do this with gui tools.

    Producing 50-100 pcs of equipment and the operator has to click nrf connect 50-100 times is just adding to the overall cost.

    Do you know what the schedule is of the next-gen tool?

    From previous incidents it looks like you have had standalone cli tools (nrf9160_mdm_dfu) to do firmware update of the modem software... but for some reason has canceled those. Do you know why?

    BR,

    Carsten

  • I started to write this answer yesterday, but it was not sent. 

    cvt1982 said:
    First of all I'm impressed with your response speed - thank you for that!

     Well, quick answers are not always good as it looks like I might have not gotten or given all the details. 

    Reading over one more time, I have to correct myself. I do agree that we should have a better/easier solution in e.g. nRF Connect for Desktop, which allows for programming several nRF9160 with both modem and application.

    However, the pynrfjprog is a wrapper for nrfjprog and lets you program the amount of devices you want, and is perfect for production environment. There are examples of how it is done in the github repo (look at the .py files). 

    The script I provided is something that you can run one simple command and then program the modem to all connected nRF9160 devices. The old nrf9160_mdm_dfu is deprecated, but was a script similar to this python script to program one device.

    Kind regards,
    Øyvind


  • Hi Øyvind

    Okay I admit that pynrfjprog seems to be able to do the trick.

    I have 2 questions:

    1. You say that prnrfjprog is just a wrapper for nrfjprog. So can you show me how to program the modem firmware directly from nrfjprog?
    2.  I have followed your guide on nRF Connect SDK (more specifically the Installing the nRF Connect SDK manually because I like to be in full control on my Linux setup) and I cannot find anything mentioned on the pynrfjprog. In the guide nrfjprog is highlighted as the tool to use (which "west" has to use during "west flash" commands).

     Maybe it is just me who are blind, but for some reason the pynrfjprog is a hidden project when looking at your default documentation (on nRF Connect SDK, user guides etc.). The first time I saw it was on a post here in the forums.

    Maybe it should be included more actively (with reference to the examples on the github repo) to help users like me?

    BR,

    Carsten

  • Hi Carsten!

    cvt1982 said:
    You say that prnrfjprog is just a wrapper for nrfjprog. So can you show me how to program the modem firmware directly from nrfjprog?

    Yes, the pynrfjprog is a wrapper for nrfjprog, but also introduces more features than nrfjprog. E.g. the ability to program modem fw, which nrfjprog alone does not have. And this is something that is missing from nrfjprog IMHO. This is also reported to our nrfjprog team.

    cvt1982 said:
    I have followed your guide on nRF Connect SDK (more specifically the Installing the nRF Connect SDK manually because I like to be in full control on my Linux setup) and I cannot find anything mentioned on the pynrfjprog. In the guide nrfjprog is highlighted as the tool to use (which "west" has to use during "west flash" commands).

     As you mention in your initial post, the pynrfjprog may introduce more programming for a simple project where you simply want to compile and test your code. In a production environment it will allow the developer to program several devices with a production ready modem and application firmware.

    Both west and cmake/ninja uses nrfjprog to program the device, but only one device at the time. Once compiled the user can swap "west flash" or "ninja flash" with a python command that uses pynrfjprog to program both modem and application. 

    cvt1982 said:
     Maybe it is just me who are blind, but for some reason the pynrfjprog is a hidden project when looking at your default documentation (on nRF Connect SDK, user guides etc.). The first time I saw it was on a post here in the forums.

     Yeah, I agree that it's not mentioned that much in use with nRF9160, but it is available under nRF Tools and via github. There should be more mentioning of this tool especially with regards to information on usage in production for nRF9160.

    Let me know if anything is unclear, or you need any more information and I will dig up some more for you Slight smile

    Kind regards,
    Øyvind

  • Thank you for the answers, this certainly clear out my questions.

Related