Good morning!
We have recently made the switch from an STLink flasher that was VERY unstable to a Flasher ARM and so far our initial testing leaves us very satisfied, thank you for a solid product.
Now, here is the steps we took since receiving the Flasher ARM :
-Program via JFlash. Worked.
-Program via JLinkExe, in console. Worked.
-Program via JLinkExe with a batch file and argument -commanderscript. Worked.
-Program via JLinkExe with argument -commanderscript launched by C# code. Not Working.
I am about certain the code i wrote to launch and handle the process, not open a console window, redirect its output, etc. is working as i have tested it with other executables (notably STLink CLI).
But I will accept you doubting this and so i went ahead and tried with the bare minimum code i could use to start the process, and it still does not program.
I am using the exact same arguments and jlink script as the batch file scenario which works.
Its hard to identify possible causes of the problem since every exitcode has been 1. Even when trying to introduce different errors such as unplugging the Flasher or unplugging the target.
For this issue refer to this post : JLinkExe return code 1 when executing script
The script.jlink file is the same used for both this and the batch file , it contains only an "r" to shut the target board down for now.
The batch file that works :
Here is the test method with code as simple as possible to start the process :
ok i give up trying to keep this sample formatted right, previewing the post keeps messing it up, im sorry...
i left it visible in the screenshot of the batch file output.
I added a screenshot of the batch file console output, the test method only flashes the screen but does not shut down the target board.
I will try switching the procress to cmd.exe with a /K argument to keep window open today and report back but here is the output i get when running my other method which redirects the JLinkExe output :
I have seen similar posts where you suggest using JFlash in production instead of JLinkExe, we do have a license that came with the Flasher ARM but my problem with using JFlash in command line is that the GUI still opens according to documentation, and i would like to keep the end user on a single GUI , my custom production software's GUI. For similar reasons, we are not using the StandAlone mode because the firmware programming is a step incorporated in a series of steps taken to test every board produced and my custom software needs to handle when and where that firmware programming step is executed. If it was up to me i would get the SDK and work from there but i was not able to convince my superiors since the batch file is working fine. :P
Quick suggestion semi off-topic : i saw some pretty heavy jlink script while reading the forums but for somethings as simple as -r -g and -loadfile , i would love to see those commands as viable command line arguments for jlink.exe, completly removing the need for a script file, thus the need to write the firmware file path every time in the script text file!
If there is any information missing let me know ill update asap :)
Thank you!
Phil~
We have recently made the switch from an STLink flasher that was VERY unstable to a Flasher ARM and so far our initial testing leaves us very satisfied, thank you for a solid product.
Now, here is the steps we took since receiving the Flasher ARM :
-Program via JFlash. Worked.
-Program via JLinkExe, in console. Worked.
-Program via JLinkExe with a batch file and argument -commanderscript. Worked.
-Program via JLinkExe with argument -commanderscript launched by C# code. Not Working.
I am about certain the code i wrote to launch and handle the process, not open a console window, redirect its output, etc. is working as i have tested it with other executables (notably STLink CLI).
But I will accept you doubting this and so i went ahead and tried with the bare minimum code i could use to start the process, and it still does not program.
I am using the exact same arguments and jlink script as the batch file scenario which works.
Its hard to identify possible causes of the problem since every exitcode has been 1. Even when trying to introduce different errors such as unplugging the Flasher or unplugging the target.
For this issue refer to this post : JLinkExe return code 1 when executing script
The script.jlink file is the same used for both this and the batch file , it contains only an "r" to shut the target board down for now.
The batch file that works :
Here is the test method with code as simple as possible to start the process :
ok i give up trying to keep this sample formatted right, previewing the post keeps messing it up, im sorry...
i left it visible in the screenshot of the batch file output.
Source Code
- private static readonly string DIRECTORY = Path.Combine(Environment.CurrentDirectory, @"JLink\");private static readonly string JLINKPATH = Path.Combine(DIRECTORY, "Jlink.exe");
- private static int Test(){ using (var process = new Process {EnableRaisingEvents = true}) { process.StartInfo = new ProcessStartInfo(JLINKPATH) { Arguments = "-device stm32f030cc -if swd -speed 50000 -commanderscript script.jlink" }; process.Start(); process.WaitForExit(); return process.ExitCode; }}
I added a screenshot of the batch file console output, the test method only flashes the screen but does not shut down the target board.
I will try switching the procress to cmd.exe with a /K argument to keep window open today and report back but here is the output i get when running my other method which redirects the JLinkExe output :
[DEBUG]Launching Jlink.exe
SEGGER J-Link Commander V5.12j (Compiled Jul 18 2016 18:52:07)
DLL version V5.12j, compiled Jul 18 2016 18:51:28
[DEBUG]Process ended, exit code : 1
I have seen similar posts where you suggest using JFlash in production instead of JLinkExe, we do have a license that came with the Flasher ARM but my problem with using JFlash in command line is that the GUI still opens according to documentation, and i would like to keep the end user on a single GUI , my custom production software's GUI. For similar reasons, we are not using the StandAlone mode because the firmware programming is a step incorporated in a series of steps taken to test every board produced and my custom software needs to handle when and where that firmware programming step is executed. If it was up to me i would get the SDK and work from there but i was not able to convince my superiors since the batch file is working fine. :P
Quick suggestion semi off-topic : i saw some pretty heavy jlink script while reading the forums but for somethings as simple as -r -g and -loadfile , i would love to see those commands as viable command line arguments for jlink.exe, completly removing the need for a script file, thus the need to write the firmware file path every time in the script text file!
If there is any information missing let me know ill update asap :)
Thank you!
Phil~
The post was edited 1 time, last by Philippe.Lahaie ().