JFlash Command Line Error

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • JFlash Command Line Error

    I am running the following batch script. The first JFlash run succeeds, but the second one fails with error code 1. For the second run the GUI will show up properly but fails to auto program the device stating "ERROR: Failed to unsecure chip". I can then go and manually unsecure, erase, and program the chip. I can replicate the error if I try to auto program without first connecting to the target, however if I close and reopen JFlash I can auto program the device without first connecting. I am using a JLink Ultra+ with an efm32wg990F256 using SWD to program.

    Source Code

    1. @ECHO OFF
    2. "C:\Program Files (x86)\SEGGER\JLink_V502h\JFlash.exe" -openprjreset.jflash -connect -auto -startapp -exit
    3. timeout /t 5
    4. "C:\Program Files (x86)\SEGGER\JLink_V502h\JFlash.exe" -openprjreset.jflash -connect -auto -startapp


    I've found that I can work around the issue by not using auto program.

    Source Code

    1. @ECHO OFF
    2. "C:\Program Files (x86)\SEGGER\JLink_V502h\JFlash.exe" -openprjreset.jflash -connect -erasesectors -programverify -startapp -exit
    3. timeout /t 5
    4. "C:\Program Files (x86)\SEGGER\JLink_V502h\JFlash.exe" -openprjreset.jflash -connect -erasesectors -programverify -startapp -exit