This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Faster Modem Programming with J-Link and pynrfjprog

Hey All,

I am working on optimizing a manufacturing script for a product that uses the nRF9160, this script is written in python and uses the pynrfjprog library to interface with a jlink connected to the 9160 over SWD. The production station that this script runs on is the bottle neck in our production line, and we only have a limited number of fixtures that can perform this function.

After conducting an analysis of how long each step in the programming / m-test process took, it looks like modem firmware update is the standout by an order of magnitude. This step takes approximately 35 seconds to complete, where as each other step takes between 5 -10 seconds. There are a total of 10 steps, and I have parallelized the modem firmware step as much as I can, but everything else has to happen sequentially.

I have determined that the only way I can speed up this any further is to speed up the modem firmware update process itself. I have this function running in a separate thread from the main script to program modem firmware.

from pynrfjprog import HighLevel


def program_modem(jlink_snr: int, modem_fw_path: str):
    """Programs modem with specified firmware using provided J-Link snr.

    Args:
        jlink_snr (int): Serial number of the J-Link that will program the modem. (Located on the bottom of the J-Link)
        modem_fw_path (str): Absolute path to the modem firmware zip file.
    """
    with HighLevel.API() as api:
        with HighLevel.IPCDFUProbe(
            api, jlink_snr, HighLevel.CoProcessor.CP_MODEM, clock_speed=14000
        ) as probe:
            probe.program(
                modem_fw_path,
                HighLevel.ProgramOptions(verify=HighLevel.VerifyAction.VERIFY_HASH),
            )
The documentation for the DLLs claims that if the given clock speed is above the maximum allowable for the device, then it will default to the maximum. This has proven untrue, and instead spits out a DLL error (RC = -102) it seems that 14000 is the highest multiple of 1000 allowable.
A request I would have is to update the documentation to match behavior or visa versa.
But a question would be to ask if anyone has found a faster way to program the modems. Be it calling the DLL's directly, or some other method I haven't thought of.
Setup:
Computer is BeeLink U55 Running Linux Mint Cinnamon
J-Link is Base Compact
Thanks for the help!
Parents
  • Hello Jordan,

    jbax92 said:
    Sounds, good. Thought I would ask just in case.

    Of course :-)

    jbax92 said:
    I know the 9160 ships with modem firmware. Which modem firmware version does it ship with? Is it possible to place an order with a different modem firmware version on it?

    The B1A hardware comes with a preprogrammed Production Test Image, while previous revisions are flashed with the modem firmware image they have been tested with.

    Since you need to update the modem firmware to the version you would like to certify your devices with anyway, we do not offer delivery with a specific modem firmware version. But third parties might, upon request.

    Regards,

    Markus

Reply
  • Hello Jordan,

    jbax92 said:
    Sounds, good. Thought I would ask just in case.

    Of course :-)

    jbax92 said:
    I know the 9160 ships with modem firmware. Which modem firmware version does it ship with? Is it possible to place an order with a different modem firmware version on it?

    The B1A hardware comes with a preprogrammed Production Test Image, while previous revisions are flashed with the modem firmware image they have been tested with.

    Since you need to update the modem firmware to the version you would like to certify your devices with anyway, we do not offer delivery with a specific modem firmware version. But third parties might, upon request.

    Regards,

    Markus

Children
No Data
Related