STK500.exe

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

Hello,

when using stk500.exe in xp, it is possible to redirect the output to a text file by "stk500.exe -dUSB >c:\text.txt".

When executing this in Windows7, text.txt is 0Byte.
Redirecting the output of other programs e.g. "dir >c:\txt.txt" works fine.

Can anybody confirm this / know a solution ?

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

Shirley that command would just produce an error.

XP tends to put stderr and stdout all off to the same place.
I do not have Windows7. I suspect that

stk500.exe -cUSB -dATmega88 1>c:\text.txt    // work fine
stk500.exe -dUSB 2>c:\errors.txt    // might just do stderr

Try it and see for yourself.

David.

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

"stk500.exe -cUSB -dATmega88 1>c:\text.txt"

gives the same result (text.txt is 0Byte)

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

Quote:

XP tends to put stderr and stdout all off to the same place.

No it doesn't '1' is stdout, '2' is stderr (as with all similar command line shells). If you want both stdout and stderr both routed to the same place then:

stk500.exe -dUSB > c:\text.txt 2>&1

which says pipe stream 2 (stderr) to the same place as stream 1 (stdout).

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

"stk500.exe -dUSB > c:\text.txt 2>&1 "

... text.txt is still 0Byte

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

Curious, I don't see what you see (and I don't need to worry about stderr):

E:\Program Files\Atmel\AVR Tools\STK500>stk500 -dUSB
STK500 command line programmer, v 2.4 Atmel Corp (C) 2004-2011.

Scanning ports:
COM1 ... Port busy or STK500 not connected
COM2 ... Port busy or STK500 not connected
COM3 ... Port busy or STK500 not connected
COM4 ... Port busy or STK500 not connected
COM5 ... Port busy or STK500 not connected
COM6 ... Port busy or STK500 not connected
COM7 ... Port busy or STK500 not connected
COM8 ... Port busy or STK500 not connected
COM9 ... Port busy or STK500 not connected
Could not connect to STK500 v2 on COM9

E:\Program Files\Atmel\AVR Tools\STK500>stk500 -dUSB > foo.txt

E:\Program Files\Atmel\AVR Tools\STK500>type foo.txt
STK500 command line programmer, v 2.4 Atmel Corp (C) 2004-2011.

Scanning ports:
COM1 ... Port busy or STK500 not connected
COM2 ... Port busy or STK500 not connected
COM3 ... Port busy or STK500 not connected
COM4 ... Port busy or STK500 not connected
COM5 ... Port busy or STK500 not connected
COM6 ... Port busy or STK500 not connected
COM7 ... Port busy or STK500 not connected
COM8 ... Port busy or STK500 not connected
COM9 ... Port busy or STK500 not connected
Could not connect to STK500 v2 on COM9

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

@Clawson:
do you use 32Bit or 64Bit Windows ?

(I use 64Bit Windows7)

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

I use what (IMAO) is the best version of Windows M$ managed to produce. That is Windows XP-SP3.

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

... sadly i have to use Win7 at work :(
And it seems stk500.exe doesnt support windows7 correctly - at least regarding redirecting the output.

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

I get the same as clawson do with 64 bit win7.

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

Try right clicking stk500.exe and run it in compatibility mode for winXPSP3. I run both xp and win7/32 and sometimes I have to run stuff in winz/32 in compatibility mode in order for things to work. If you get a warning, just click OK or IGNORE.

Good Luck

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Hello Jim,

i already tried to run in compatibility mode for XPSP3... still the same :(

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

I just tried Cliff's screenshot on a win7/32 and got ACCESS DENIED. My WINXPSP3 works just peachy. My only thought is that Win7 is doing something with security as it does not like the command prompt to begin with

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Take a step back. Does this work:

E:\>echo hello world > foo.txt

E:\>type foo.txt > bar.txt

E:\>type bar.txt
hello world

E:\>

IOW can you simply pipe stdout to a file anyway?

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

... this also works here:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

D:\>echo hello world > foo.txt

D:\>type foo.txt > bar.txt

D:\>type bar.txt
hello world

D:\>

but:
D:\>stk500.exe > foo.txt

D:\>type foo.txt

D:\>
... empty foo

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

I get:

E:\Program Files\Atmel\AVR Tools\STK500>STK500 > foo.txt

E:\Program Files\Atmel\AVR Tools\STK500>type foo.txt
STK500 command line programmer, v 2.4 Atmel Corp (C) 2004-2011.

Use -h for help.

Is your stk500.exe also V2.4 ?

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

... yes stk500.exe is also V2.4:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.


C:\Program Files (x86)\Atmel\AVR Tools\STK500>STK500
STK500 command line programmer, v 2.4 Atmel Corp (C) 2004-2011.

Use -h for help.

C:\Program Files (x86)\Atmel\AVR Tools\STK500>STK500 >d:\foo.txt

C:\Program Files (x86)\Atmel\AVR Tools\STK500>type d:\foo.txt

C:\Program Files (x86)\Atmel\AVR Tools\STK500>
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try just creating the foo.txt in the same drive/directory as stk500.exe - that is:

STK500 > foo.txt 

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

Depending on your toolchain paths the redirect can select a different shell, at least within a makefile when both bash and windows shells are available.