LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming Atmel with atprogram in LabVIEW

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.

Message 1 of 7
(5,779 Views)

The standard input is the input that should be used. What input would you expect?

0 Kudos
Message 2 of 7
(5,755 Views)

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.

0 Kudos
Message 3 of 7
(5,735 Views)

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?

0 Kudos
Message 4 of 7
(5,562 Views)

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.

0 Kudos
Message 5 of 7
(5,556 Views)

@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 

========================
=== Engineer Ambiguously ===
========================
Message 6 of 7
(5,544 Views)

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.

0 Kudos
Message 7 of 7
(5,393 Views)