Commit 1502c663 authored by Bartosz Bilas's avatar Bartosz Bilas Committed by Carles Cufi
Browse files

runners: jlink: exit with error in case of a failure



Add "ExitOnError 1" argument that treats any command-error
as fatal thus in the case of a programming error the "west flash"
command will return the correct error code instead of the default 0. It
fixes the false positive return codes when e.g we call west flash
command without a connected programmer or with the disconnected board.

Signed-off-by: default avatarBartosz Bilas <b.bilas@grinn-global.com>
parent f6e829a6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -251,7 +251,10 @@ class JLinkBinaryRunner(ZephyrBinaryRunner):
                self.run_client(client_cmd)

    def flash(self, **kwargs):
        lines = ['r'] # Reset and halt the target
        lines = [
            'ExitOnError 1',  # Treat any command-error as fatal
            'r',  # Reset and halt the target
        ]

        if self.erase:
            lines.append('erase') # Erase all flash sectors