Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

program modem firmware: reset always #17

Open
amarkevich opened this issue Dec 15, 2020 · 1 comment
Open

program modem firmware: reset always #17

amarkevich opened this issue Dec 15, 2020 · 1 comment

Comments

@amarkevich
Copy link
Contributor

pynrfjprog 10.12.0

I want to perform device provisioning in multiple steps. During Probe.program pass HighLevel.ResetAction.RESET_NONE but its ignored in case program modem firmware:

with HighLevel.API() as api:
    snr = api.get_connected_probes()[0]
    print("snr: " + str(snr))

    # To update LTE modem connected to J-Link probe at snr <snr>:
    with HighLevel.IPCDFUProbe(api, snr, HighLevel.CoProcessor.CP_MODEM) as probe:
        probe.program(modem_fw,
            HighLevel.ProgramOptions(
                verify = HighLevel.VerifyAction.VERIFY_HASH,
                reset = HighLevel.ResetAction.RESET_NONE
            )
        )
    # -> !!! RESET !!! <-
    # To program J-Link probe at snr <snr>:
    with HighLevel.DebugProbe(api, snr) as probe:
        probe.program(board_fw,
            HighLevel.ProgramOptions(
                verify = HighLevel.VerifyAction.VERIFY_READ,
                reset = HighLevel.ResetAction.RESET_NONE,
                erase_action = HighLevel.EraseAction.ERASE_SECTOR
            )
        )

@simtind
Copy link
Contributor

simtind commented Sep 10, 2021

Hi,

The documentation for NRFJPROG_program in the Highlevel dll header states:

@details Programs the provided .hex file onto the device connected to the provided debug_probe handle. By using the program_options parameter, the 
 *          verification, pre-programming erase and post-programming reset can be configured. See the description of program_options_t for details.

The reset and verify inputs control the post-program reset and verify actions. They do not control the proogramming algorithm behavior itself.

For modem programming, it is required to reset the device during the modem programming cycle to get it into the bootloader mode.

In general, the program command does not guarantee that a reset does not occur if RESET_NONE is passed, only that we will not perform a reset at the end of the programming cycle. For example, SPU protection, MPU protection, or other runtime memory protection mechanisms will cause the program method to issue a system reset to reset the device to a proogrammable state.

We will update the documentation for the program methods to mention this in the next minor version of nrfjprog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants