Downloader freeze - Win98

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

Downloader freeze - Win98

Post by pjc30943 »

Brief comment. Most likely my fault, but in the case it's not, I'm mentioning it here.

Downloader works fine for small program. But a larger program (Code: 1335, RAM: 119) always fails to verify, often to download, and locks up the IDE until I ctrl-alt-del it.
I will next try and see if there's some rough threshold where this effect starts. Perhaps it is simply my com buffer overflowing (Win98SE).

Incidentally, I don't see com1 listed under Device Options. Perhaps this is something you could address?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

I wouldn't suspect that it's anything that you're doing. As far as I know it's never been run on Win98SE before (nor Win95 nor Win3.x for that matter). We have tested it on Win2K and XP - those are the platforms that it is specified and documented to work with. The description on the website indicates this as well. There certainly may be a good reason to use '98 but it is getting a bit long in tooth.

You may want to try using ZLoad, the command line utility. It may or may not work better than the IDE in this regard. The code is similar but not the same. The simpler environment in which a command line utility runs may allow it to function properly on Win98.

As for the missing COM1, I'm not sure what to say about that. We use a process called "comm port enumeration" where we look at entries in the registry to see what devices are available. If there is no entry for a particular port, it won't show up in the list. The registry key that we use is HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. It is possible that this method is not reliable on Windows versions prior to Win2K. I don't remember if RegEdit is available on Win98 but if it is you can look to see if COM1 is present.

Please report back any additional information that you can collect.
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

Don:

Some results/tidbits:

(1)
Regedit does exist in Win98SE, and sercomm lists the ports correctly. Yet it doesn't appear in Device Options.

(2)
<Zload> -c1 <name.zxb> does reliably load the program--and wow, it is like an order of magnitude faster (disregarding the missing verification step). In any case, perhaps configuration switch statements, and an execution macro, could allow easier Zload operation via a button push. This would be an alternative to F5. Maybe you already have this, but I couldn't see it.

(3)
Sometimes just pressing F5 causes a program freeze immediately.
Other times downloading freezes within just a few '.'s of start. The number of '.'s are pretty constant, it seems: for 10 consecutive crashes, the number of '.'s are always three, for example. After program changes, the number may be 20 for many consecutive failures.

(4)
Perhaps you might want to correct Pg.83 of the language reference manual. The text states zxb, yet the examples all use hex files (which I think the ZBasic compiler doesn't even output at any stage).



Let me know if there is anything else you'd like me to check...

Oh by the way, I have an old Win 95...no wait Win 3.1...I mean, Commodore computer I'd like to run the IDE on. Are you telling me you don't support that just 'cause you think it "ancient"??! :lol:
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

The fact that ZLoad runs significantly faster suggests that something is amiss in the serial comm interaction with the OS. What it is, exactly, will likely remain a mystery. If you want to work on tracking it down, I'd be happy to provide the source code for the IDE - it's mostly open source anyway. You'd need VC6 to compile it but I have several legitimate copies and could loan you one.

If you want to include the verification pass when using ZLoad, use the -v option, too. There is probably a way to create a menu or keyboard command to invoke zload. The biggest hurdle may be getting the object file name. The SciTE documentation may be helpful in this regard.

Thanks for the tip on the manual change. Originally, the compiler generated .hex files. That was changed early in the Beta cycle but the corresponding change the manual was overlooked.
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

Thanks Don for the reply.

If you send me the sourcecode, I could take a bit of time and look through it. I should have VC6 at work. I think you have my email address, no? (pjc30943@...)

The problem with Zload is that the IDE has to be closed in order for it to work...the IDE takes the ports hostage, preventing Zload downloads. And with no way to change the ports in Device Options, I can't even give it a bogus port on bootup:)
So basically, I have to close the program every time I want to download...I'm not sure how to manually release the port from the ide...maybe that would be a useful option, to not have it automatically open the port on program startup.

But, no worries, I know you don't want to spend time on figuring out old OSs. I sure wouldn't want to.


(1)
By the way, it's not clear what the Properties option in the Language menu does. All it does is create plain text. Maybe it's in the manual but I couldn't find its purpose.

(2)
Page 73, Ref manual,
Section 5.4 Setting Download Options:
"The serial port to use may be changed by using the “Download Options…� entry on the Options menu."

It's a different submenu in the current version.


This is a really nice IDE by the way. Lots of awesome features, like code collapse. The compiler is very smart too.
The RAM usage is significantly more efficient that the BX compilers...one of my BX programs compiled to 160 bytes RAM, versus 200+...probably in large part due to strings...
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

The problem with Zload is that the IDE has to be closed in order for it to work...the IDE takes the ports hostage, preventing Zload downloads. And with no way to change the ports in Device Options, I can't even give it a bogus port on bootup
The port setting is stored in a file named SciTEUser.properties located in the home directory for the current user. On Win2K and XP, this is usually a subdirectory of 'Documents and Settings' named for the particular user. The file may not yet exist if you didn't change any of the defaults. The simplest way to modify that file is to select 'Open User Options File' on the Options menu to load the file (again, it might be empty). Then you can add or modify a line that looks like this:

Code: Select all

debug.comport=2
This example sets the download/monitor port to COM2. You'll have to exit the IDE and restart for this new setting to take effect. If you set it to a non-existent port the IDE will end up with no port open. If you attempt to download via the IDE under these circumstances, a message box will appear indicating that the port couldn't be opened.
t's not clear what the Properties option in the Language menu does


The full SciTE editor has a very long list of supported languages including C, Java, Kix, TeX, php, Perl, VB, etc. I believe that there are nearly 50 in total. Among the languages supported is plain text (Text on the Language menu) and the properties "language" of the SciTE configuration files (Properties on the Language menu). You'll notice that the configuration files have the extension ".properties". For the IDE, I pared the list down to just the few that appear on the menu. If you want more or fewer entries, you can change it by editing the SciTEGlobal.properties file. The simplest way to do this is to select the "Open Global Options File" entry on the Options menu. Around line 479, you'll find a line

Code: Select all

menu.language=
This line and the subsequent non-commented lines define the default language set. Later, at about line 536, you'll find this line:

Code: Select all

menu.language=ZBasic|bas||Text|txt|Shift+F11|Properties|properties||
This redefines the languages that will be shown to just the few that you see. More can be added by copying from the previous list or some can be deleted by editing the line. The IDE will need to be restarted for the change to take effect.
The serial port to use may be changed by using the “Download Options…� entry on the Options menu.
Thanks for finding this. It should read "Device Options...".
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

Thanks for the details. That clarifies things.


Just a note that I've experienced pretty terrible crashes on F5. Screen distorts into a plaid checkerboard, the zbasic env. font setting all corrupted to something strange, etc. Again, this is of course Win98SE...and again, zload always works perfectly.



In any case, per your instructions, I can set the bootup debug port to com2, and use zload from the command line perfectly. But then, the ZX Env. has to be restarted with new settings to use com1 for debugging...I know these are asthetic points, but restarting the ide is time consuming and shouldn't be required, even if it's really fast-loading...I'm sure there is an efficient mechanism in place to do all this.
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

How about the -m option on zload to monitor the com port e.g.

Code: Select all

zload -c2 -v -m test.zxb
Mike
http://home.austin.rr.com/perks/micros/
Last edited by mikep on 04 December 2005, 14:36 PM, edited 1 time in total.
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

mikep wrote:How about the -m option on zload to monitor the com port e.g.

Code: Select all

zload -c2 -v -m test.zxb
Mike

Good call:)
Works fine. Thanks.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

I've experienced pretty terrible crashes on F5 [with Win98]...
Patient: Doctor! It hurts like crazy when I do this.
Doctor: My advice - don't do that. :-)

Seriously, though, you might try adding the following lines to your User Options file:

Code: Select all

command.name.0.*=ZLoad Go
command.mode.0.*=subsystem&#58;console,savebefore&#58;no
command.shortcut.0.*=F5
command.0.*=$&#40;SciteDefaultHome&#41;\..\zload -c1 -v -m $&#40;project.dir&#41;\$&#40;project.name&#41;.zxb
Note that COM1 is the default for ZLoad so the -c1 is not strictly necessary.
Most of the information necessary to formulate this solution can be found in the HTML help information accessed via the menu item Help|ZBasic IDE Help and then following the link "SciTE Help" near the top of the page. A section on that page describes how to add "tools" such as this. The part that is not documented (yet) is the access to the project name components although those are largely self-evident or at least consistent with other aspects of the IDE.

After adding this to your User Options (and restarting the IDE) you'll find a new entry on the Tools menu - ZLoad Go showing an accelerator key F5. This works on my XP system. I haven't tested it yet on Win2K but I expect that is will work. It may or may not work on Win98.

The one hitch in this setup is that once you press F5 (or whatever key you assign) you have a command running that doesn't terminate (due to the -m option). Because of this, you won't be able to compile until you terminate that command. You can do this by using ctrl-break.

For certain types of test runs, you may be able to use the feature of ZLoad that causes it to terminate when it receives a certain character from the device. See the description of the -s option.
- Don Kinzer
pjc30943
Posts: 220
Joined: 01 December 2005, 18:45 PM

Post by pjc30943 »

My doctor always said to keep doing it, that way I get numb to the pain:)

Thanks for the details. Nice option. I shall look at the SciTE in much more detail so that you don't have to keep posting what we could figure out on our own...

I also thought Zload would have com1 as the default, per the docs, but when I don't specify a port, it returns something similar to "cannot find com port".

The only way it works for me is to use the -c1 switch.

I've already been using ctrl-break to recompile (the first time it took me a few minutes to figure out why the heck nothing was working). It never is able to halt the processor, however, although it looks like it tries to.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

The only way it works for me is to use the -c1 switch.
That is peculiar. I just re-tested to confirm that COM1 is the default. It works as stated.

Another way to specify the port to use is to create an environment variable named ZLOAD_PORT and set its value to the number of the comm port, e.g.

Code: Select all

ZLOAD_PORT=2
This, too, is documented in Chapter 7 of the reference manual.

I use this capability nearly every day since my test platform is connected to COM2 and I often download using ZLoad. That way I don't have to type the -c2.

If you're interested, the source code for ZLoad is in the installation directory under ./source/zload. You'll find VC6 project and workspace files there as well.
- Don Kinzer
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

for this editor menu addition
command.0.*=$(SciteDefaultHome)\..\zload -c4 -v -m $(project.dir)\$(project.name).zxb

anyone know the syntax to use when $(project.dir) has a space in the path name? In my case, the project folder is on the Windows XP desktop - thus "documents and settings" is assured to be in the path name.

EDIT: I put quotes around the whole path and file name for the zxb file and it seemed to work. A guess.
Post Reply