Occasional download glitch

Questions and discussion about the ZBasic IDE.
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Occasional download glitch

Post by pjc30943 »

About one percent of the time it appears that a newly compiled program has downloaded (1280n), but in reality it has not. Then I erroneously assume I'm running a revised program. Occasionally I notice that it's the same one, for example when a debug statement is outputted after downloading, and the newly compiled version has that commented out.

Anyone else experience this?
Paul
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

I have never seen this before. When a program downloads, it shows you the progress of the download. I assume you see this progress indicator but yet it still seems that the program did not download?

One way you know if a program has been "freshly downloaded" is to the use the FirstTime() function.
Mike Perks
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

Does download have a read-back/verify option?
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

There is a verify operation. That is why I don't understand this problem for asked for more information.
Mike Perks
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

If I recall right, there were crashes a while back with the progress bar, so that has been disabled. If that issue has been resolved, I can re-enable it and see if it yields any insights.
Either way, I definitely see this occurring. I just had a new program "downloaded" three times in a row, but the old program executed instead. The fourth time the correct, new program executed.
A bit disturbing since it's hard to know how many times I assumed a new program wasn't working, and made changes accordingly, when in fact it was never even loaded:D


EDIT:
I re-enabled the progress bar. I believe the IDE does not always reach the download process when hitting F5; in these cases, no download is attempted, and the old program executes instead. I'm not sure why the device resets though--making it seem as though downloading occurred...
Paul
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

> ... new program "downloaded" [] but the old program executed ...

Now that you mention it, I've seen this, too; yesterday, in fact. I can't duplicate it now.

To test an instruction's behavior, I wrote a minimal project (myproj3.pjt), something like:

Code: Select all

Sub Main()
	console.writeline(cstr(-90.0 mod 360.0))                                                                                     
End Sub
My application was running at the time, so the debug pane was actively showing data fly by at 115200. I changed the console speed to 19200 and pressed F5 several times - and I think it appeared to compile (native mode) and download - but my application continued to run (lots of Nuls and garbage since I'd changed speed).

I have seen this phenomenon.
Tom
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

I have since removed the F7 button from my keyboard, to ensure that I'm hitting F5 (compile + *download*) and not just deceiving myself and others:D I still see this phenomena and have basically eliminated any human error. Maybe the compiler compiles an older version before it saves on hitting F5, or something with similar results...

I'll use FirstTime(), but this is still a bit disconcerting, as I don't want to rely on one function to verify that I'm running new code while debugging complex applications (i.e., what it FirstTime() has a bug, etc).
Paul
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

I might have re-encountered the odd compile-and-download-but-still-execute-old-code phenomenon.

I SavedAs a .bas file, which automatically changed the IDE window name for that file but did not change the files in the project properties. Consequently, subsequent compiles didn't use the newly-named (and solely-displayed) changed code, instead using the previous-name file (which is not displayed).

Should a SaveAs change the project properties file list?
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

GTBecker wrote:Should a SaveAs change the project properties file list?
That's an interesting scenario. I would think that the project properties file should not be updated unconditionally.

There are several possible desired outcomes when using Save As:
  • do not change the project files list
  • replace the original file in the project files list with the new file
  • add the new file to the project list
It may be best to add radio buttons to the Save As dialog to reflect these choices or, alternately, display a separate dialog with the choices after the Save As is completed.
- Don Kinzer
twesthoff
Posts: 247
Joined: 17 March 2006, 6:45 AM
Location: Fredericksburg, VA

Occasional download glitch

Post by twesthoff »

FYI, The main reason I use SaveAs is to make a second copy of a program.  This is usually during development, when I want to try something new and if it doesn't work out, then go back to the earlier version.  I find I always have to go edit the project files list to get the desired result. I just want to save a snapshot in time to come back to later.  So having a way to do this in one step would be nice.
There are a lot of possibilities as to how best to accomplish this, especially with include files etc.


On 1/14/2010 4:30 PM, IDE wrote:
GTBecker wrote: Should a SaveAs change the project properties file list? That's an interesting scenario. I would think that the project properties file should not be updated unconditionally.

There are several possible desired outcomes when using Save As:
  • do not change the project files list
  • replace the original file in the project files list with the new file
  • add the new file to the project list
It may be best to add radio buttons to the Save As dialog to reflect these choices or, alternately, display a separate dialog with the choices after the Save As is completed.



- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

I captured this glitch on video. The following occurred:

(1) code changed, then saved.
(2) F5 was pressed.
(3) code (from somewhere) downloaded and verified. No compilation process is seen on the video, although it may have compiled the first time before I started filming.
(4) The program downloaded correctly, since it was verified and the new program download fuse was set.
(5) code executed. This code is old code that was unchanged.

Steps 2-5 were run a few more times on the video, with the old code downloaded each time.

I then made another change, and pressed F5 again. This time the new code compiled, downloaded correctly, and executed.
Paul
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

Maybe it's cosmic rays like the Toyota glitch...

-Don
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

Don_Kirby wrote:Maybe it's cosmic rays like the Toyota glitch...

-Don
I can't tell if you're serious or not:)
Paul
Don_Kirby
Posts: 341
Joined: 15 October 2006, 3:48 AM
Location: Long Island, New York

Post by Don_Kirby »

No, not serious. The Toyota glitch hypothesis doesn't apply in this case, being that it's repeatable.

-Don
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

On a related note (which might be normal, though) sometimes the IDE tries to download a program that couldn't have compiled, since there were compilation errors.

For example, there was a "missing (" error, and yet the focus quickly changed from the Output window to the Debug window as the IDE was trying to download a program. The micro was powered off though, and i got the "Device failed to respond...' message. Back in the Output windows I noticed the error.

I wonder what would have been downloaded if the device was powered on.
Paul
Post Reply