TProcess to slow?

BlitzMax Forums/MaxGUI Module/TProcess to slow?

MacSven(Posted 2007) [#1]
I have written a nice GUI for avrdude. Now i have a problem. If i use the TProcess to start avrdude in terminal the STDOUTPUT shows me not all.

AVR device initialized and ready to accept instructions
Device signature = 0x1e9502
"efuse" memory type not defined for part "ATMEGA32"
AVR device initialized and ready to accept instructions
Device signature = 0x1e9502
reading lfuse memory:
writing output file "<stdout>"
->HEX VALUE MISSING
AVR device initialized and ready to accept instructions
Device signature = 0x1e9502
reading hfuse memory:
writing output file "<stdout>"
0xd9
done.
AVR device initialized and ready to accept instructions
Device signature = 0x1e9502
"ffuse" memory type not defined for part "ATMEGA32"
done.

Has anyone the same problem?


jsp(Posted 2007) [#2]
Don't know the avrdude, but do you read out both TPipeStream from TProcess (error and pipe)?
May post some code...


MacSven(Posted 2007) [#3]
Yes i do. Here is the Codesample:

If ButtonState(erase)= True Then
SetButtonState(erase,False)
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e")
While Process.Status()
If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then
linepipe = Process.pipe.ReadLine().Trim()
lineerro = Process.err.ReadLine().Trim()
If linepipe <> "" Then
AddTextAreaText(textarea , linepipe+Chr$(13))
EndIf
If lineerro <> "" Then
AddTextAreaText(textarea , lineerro+Chr$(13))
EndIf
EndIf
Wend
EndIf


If ButtonState(fusebit)=True Then
SetButtonState(fusebit,False)

' read efuse

fmode1="-Uefuse:r:"
filename$="-"
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h")
While Process.Status()
PollSystem()
If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then
linepipe = Process.pipe.ReadLine().Trim()
lineerro = Process.err.ReadLine().Trim()
If linepipe <> "" Then
Print linepipe
AddTextAreaText(textarea , linepipe+Chr$(13))
EndIf
If lineerro <> "" Then
Print lineerro
AddTextAreaText(textarea , lineerro+Chr$(13))
EndIf
EndIf
Wend

' read lfuse

fmode1="-Ulfuse:r:"
filename$="-"
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h")
While Process.Status()
PollSystem()
If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then
linepipe = Process.pipe.ReadLine().Trim()
lineerro = Process.err.ReadLine().Trim()
If linepipe <> "" Then
Print linepipe
AddTextAreaText(textarea , linepipe+Chr$(13))
EndIf
If lineerro <> "" Then
Print lineerro
AddTextAreaText(textarea , lineerro+Chr$(13))
EndIf
EndIf
Wend

' read hfuse

fmode1="-Uhfuse:r:"
filename$="-"
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h")
While Process.Status()
PollSystem()
If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then
linepipe = Process.pipe.ReadLine().Trim()
lineerro = Process.err.ReadLine().Trim()
If linepipe <> "" Then
Print linepipe
AddTextAreaText(textarea , linepipe+Chr$(13))
EndIf
If lineerro <> "" Then
Print lineerro
AddTextAreaText(textarea , lineerro+Chr$(13))
EndIf
EndIf
Wend

' read ffuse

fmode1="-Uffuse:r:"
filename$="-"
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" "+fmode1+filename$+":h")
While Process.Status()
PollSystem()
If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then
linepipe = Process.pipe.ReadLine().Trim()
lineerro = Process.err.ReadLine().Trim()
If linepipe <> "" Then
AddTextAreaText(textarea , linepipe+Chr$(13))
Print linepipe
EndIf
If lineerro <> "" Then
AddTextAreaText(textarea , lineerro+Chr$(13))
Print lineerro
EndIf
EndIf
Wend
EndIf

Any idea?


jsp(Posted 2007) [#4]
You don't set the console output flag, that could be the problem.
Instead of:
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e")

try:
Process:TProcess = CreateProcess(AppDir$+"/MacAVR.app/contents/MacOS/avrdude -q -C"+avrconfig+" -c"+prog$[id]+" -p"+parta$[chip]+" -e", 1 )


LAB[au](Posted 2007) [#5]
Cool AVR freaks live on these forums!


MacSven(Posted 2007) [#6]
Cool, that was the problem, thanx.

Yes @ LAB, i am making Hardware with AVR Comntroller and i am working
on a GUI for avrdude. I have avrdude adapted for use with Blitzmax.