10-09-2018 06:27 AM
Hi everyone,
I have created a VI for programming an Atmel processor and it somehow works, but I don't know why. I have installed Atmel Studio which comes with a command prompt utility. The utility itself opens another command line program which is called atprogram.exe which can be called together with commands and arguments which I need for the System Exec.vi. An example command is: atprogram -t samice -i JTAG -d ATSAM4S8C chiperase and if I run this command I get an error WindowsError: [Error 6] The handle is invalid together with some python errors at line x.
I managed to get rid of this error by simply connecting the commands and arguments to the standard input input of the system exec.vi too (lucky guess). Does anyone know why this only works when the commands and arguments are connected to both inputs of the system exec.vi?
I have placed the VI in the attachment, I could not find a similar solution so maybe it can be helpful to somebody.
10-09-2018 10:20 AM
The standard input is the input that should be used. What input would you expect?
10-15-2018 01:51 AM
Thanks for your reply. I indeed expected the standard input to be the input that should be used. However, I did not expect that it only works when I send the arguments -t samice -i JTAG -d ATSAM4S8C chiperase to both inputs. I have used this System Exec.vi before but never had to use the arguments for both inputs in order to work properly.
03-15-2019 04:17 AM
I've had exactly the same issue with the Atmel ICE programmer. Mine now works thanks to your suggestion.
Did you find a way of getting the return data to appear in the atprogram window to show progress as it does when you run it directly from a cmd window?
03-15-2019 04:53 AM
I am glad that the suggestion works for you. The VI as attached in the initial message is the one I used in a production environment. I just wanted to know if programming went well or not. I haven't done anything with the actual progress.
03-15-2019 11:35 AM
@paulcopes wrote:
I've had exactly the same issue with the Atmel ICE programmer. Mine now works thanks to your suggestion.
Did you find a way of getting the return data to appear in the atprogram window to show progress as it does when you run it directly from a cmd window?
AVRDude shows progress on the command window as it is programming the Atmel.
BTW: AvrDude is what the Arduino IDE uses
05-22-2019 08:56 AM - edited 05-22-2019 09:02 AM
Thanks for the tip for solution. This has bothered me for a while and until i saw your post i used a real hack to get it working. Since command parameters has nothing to do with standard input i just tried with a single character and it worked. Now i has a space connected to the standard input.
Command parameters shall be on the command line as instructions for the program when it starts. Input to the program when it is running is through standard input, normally from the keyboard when running interactive. atprogram.exe does normally not expect anything from the standard input when it is running.