USB-Serial dongles & the Empeg: FIXED!

Posted by: mlord

USB-Serial dongles & the Empeg: FIXED! - 13/03/2006 02:11

A longstanding problem with programming the Empeg flash (kernels, logos, etc..) over serial, is that it has always been very fussy about the PC serial port. In particular, USB-serial adapters rarely worked.

No more.

I've finally gone through the download.c code with a fine-toothed comb, and found/fixed the problem. Linux users can take immediate advantage by downloading and using the new code.

Now.. If only tfabris could update LogoEdit based on this new/fixed code, and if JEmplode were similarly updated, the problem could be put completely to rest.

The updated POSIX (Linux et al..) code is here. The actual fix was to change the flushrx (aka readflush) code to do a non-zero delay. But I also cleaned up the indentation etc.. so that I could understand the rest of the code.

It works for me, using several different USB/bluetooth serial adapters.

Cheers
Posted by: tfabris

Re: USB-Serial dongles & the Empeg: FIXED! - 13/03/2006 02:20

Looking at my source code from Logoedit, I already changed flushrx in my version, thusly:

Code:
static void flushrx()
{
// Tony Fabris 2002-10-22
// Attempt to fix long-standing bug in flash timings. This particular
// change (delay 1 second instead of 0 seconds on each flushrx) was
// suggested by Jan Harkes. I avoided it at first because I thought
// it would slow things down too much. But now it seems to be just
// what the doctor ordered. Thanks, Jan.
while(readbyte(1)>=0);
}



Is there more to it than that?
Posted by: mlord

Re: USB-Serial dongles & the Empeg: FIXED! - 13/03/2006 02:39

That was most of it, though I only used 0.10 secs delay in that routine (noticeably quicker), but no big deal any way one does it).

There were a couple of other places where I added writeflush() before any reads, dunno if those helped or not.

If it's working well over USB-serial dongles, then you know you've got it right.

Cheers