[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] Re: Programmers errors on linux, help!
From: |
Theodore A. Roth |
Subject: |
Re: [avrdude-dev] Re: Programmers errors on linux, help! |
Date: |
Sun, 25 May 2003 17:24:21 -0700 (PDT) |
On Mon, 26 May 2003, Alex Shepherd wrote:
:)> > Could this perhaps be due to power supply issues?
:)>
:)> I had try it in both configurations - with powering from parallel port,
:)> and from external power supply - effect is the same.
:)>
:)> I can't understand the strange behavior of func usleep() - when I
:)> set SLOW_TOGGLE=1 avrdude hangs on included calls to uslepp(). But this
:)> function works correct in another places in par.c! What's going on ?
:)> I don't know.
:)
:)I am having similar problems in that I am seeing verify errors sometimes
:)(maybe 1-2 in 5) when I run on Win2k. However when I boot Linux on the same
:)hardware, it runs fine. I tried a number of things at the time to see if it
:)changed the behaviour but so far I cannot isolate the problem.
:)
:)On Linux the programming time is about 10-11 seconds and seems to work fine,
:)but on Win2k it is only about 6 seconds and fails periodically, so it does
:)start to smell like a problem with timing.
:)
:)I am also wondering about the usleep function as I think most of my failures
:)are the first 2 bytes on a 64 byte block. I may have had some in other
:)locations, but I am pretty sure they almost always 64 byte aligned.
I wonder if using select() as a replacement for usleep() might be a possible
solution. I seem to recall that select() is a bit more portable than
usleep(). Something like this maybe:
int
usecsleep (int usecs)
{
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = usecs;
return select (0, NULL, NULL, NULL, &tv);
}
This was taken from "Linux Application Development" by Johnson and Troan.
This also assumes that cygwin doesn't already implement usleep() in this
way.
Worth a try.
Ted Roth