Issue with atprogram.exe

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi forum,

 

I have a LabView application which should program an Atmel ATSAM4S4A. To do this, I use the StudioCommandPrompt executable and run the atprogram command.

When I run this directly (using command prompt), it works fine and I'm able to program my uC. However, as my atprogram command requires parameters, I can't run it directly from LabView and I need to run first a batch file, which will call and run StudioCommandPrompt.

 

My problem occures when I start the StudioCommandPrompt and run the atprogram command with

start "" "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\StudioCommandPrompt.exe" atprogram -t atmelice -i SWD -d atsam4s4a program -c -f "C:\_JRE_Test\Rooter2_0.3.1.hex" --verify

a new CMD window is opened and a warning message is showed: "CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Window directory."

Then, nothing more happens. atprogram is not run.

 

I already made a lot of researches, but I didn't found any answer to this issue.

 

Thank you in advance for your help and support!

 

Regards,

 

 

Gub

This topic has a solution.
Last Edited: Tue. Mar 26, 2019 - 06:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just run atprogram directly.. it's in the \atbackend folder

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gub156 wrote:
To do this, I use the StudioCommandPrompt executable and run the atprogram command.
An alternate way is direct to cmd.exe

            reader = RunProgram_atprogram("cmd.exe", "atprogram -t atmelice -i ISP -d atmega328pb chiperase", textBox1.Text);

in Form1.cs in zip in

AN2466 - Using Atmel-ICE for AVR® Programming In Mass Production

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gub156 wrote:
should program an Atmel ATSAM4S4A

Wrong forum; that isn't an AVR8.  Reported.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Mar 21, 2019 - 11:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all!

 

Thanks for your answers. Unfortunately, as I wrote, I can't run directly StudioCommandPrompt as LabView can't run a command with arguments. That's why I need to create first a batch file.

I found a solution regarding the UNC path warning message (here the link... could be helpfull), but once the new window is opened (the StudioCommandPrompt window), nothing happens. It should actually run the atprogram command.

 

Does anyone have already encoutering this issue?

 

Thank you once again for your answers.

 

 

Regards,

 

Gub

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Again, why are you involving  StudioCommandPrompt  at all?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Meolsen,

 

Now I got it! You're right, I can use directly atprogram... I just based my work on the application note from Atmel (AN2466 - Using Atmel-ICE for AVR® Programming In Mass Production) which describe to use StudioCommandPrompt.

Anyway, I'm still stuck :-(

Now, when I run atprogram with the same parameters, I get the error message "[ERROR] Unrecognized or ambiguous command: 'atprogram', did you mean 'program'?", but if I run atprogram.exe manually (not from my batch), the parameters are correct. So I don't know why runing atprogram.exe from the batch produces this error.

Any idea?

 

Here is my script:

@echo on

set appPath="C:\Program Files (x86)\Atmel\Studio\7.0\atbackend\"
set appName="atprogram.exe"
set fwLocation=%~dp0
set fwName=Rooter2_0.3.1.hex
set param=atprogram -t atmelice -i SWD -d atsam4s4a program -c -f %fwLocation%%fwName% --verify


cd %appPath%
start "" %appName% %param%
timeout /t -1

 

Thank you in advance... again!

 

Regards,

 

 

Gub

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have atprogram both in appName and as the first param...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep! And it works well when I run this manually... There's only an issue when I run it through a batch file... If I remove the "atprogram", then the error message is the same. The 'atprogram' string will be replaced by the next command (i.g -t).

 

Any idea?

 

Regards,

 

 

Gub

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well,  [ERROR] Unrecognized or ambiguous command: 'atprogram', did you mean 'program'?"  comes from atprogram, which means that you called 'atprogram atprogram'.

 

Also, no need to CD, just call it directly ...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you think I should just run the start command without any CD command first, right?

Like this:

start "" "C:\Program Files (x86)\Atmel\Studio\7.0\atbackend\atprogram.exe" atprogram -t atmelice -i SWD -d atsam4s4a program -c -f Rooter2_0.3.1.hex --verify

If yes, it still doesn't work. I get the same error message... I don't get it...

 

Thank you again!

 

Regards,

 

 

Gub

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
%appPath%\%param%

 

Or, fix your param to be 

set param=-t atmelice -i SWD -d atsam4s4a program -c -f %fwLocation%%fwName% --verify

 

Again, you're calling atprogram.exe with atprogram as the first argument... 

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Meolsen,

 

Thanks for your help! Finally, it works! I don't know what I did wrong the first time when I removed the atprogram parameter, but anyway, now it's good! I can now move forward with my project!

 

Thanks a lot!

 

Regards,

 

Gub