From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jonathan Riches" To: , Subject: OCD - wiggler baud rate problem Date: Wed, 29 Aug 2001 09:20:00 -0000 Message-id: <005901c130a3$799dc5f0$ea0018ac@proteus> X-SW-Source: 2001-08/msg00219.html Thanks Juro for the info. It appears that in GDB 5.0 (ocd.c) that all ocd writes / reads are as bytes, this would account for the problem I also had in writing an init file, where the SYPCR was only getting 1 byte written, then it was set for good. I have found the download speed using wiggler has risen from 10,000 bits/sec to 25,000, Regards Jonathan Riches Juro wrote > ####################################################################### Hi Jonathan There's a bug in OCD.C, I reported it to macraigor: the file load was SIGNIFICANTLY slower. Using Raven I achieved the equivalent of about 9600 baud rate. So I started comparing the old code with the new one and found a serious bug: in the file OCD.C you try to determine if to read/write words, halfwords or bytes. Your code: ======================================================= if ( ((memaddr & 4) == 4) || ((len & 4) == 4) ) buf[5] = 4; /* Word align and word length */ else if ( ((memaddr & 2) == 2) || ((len & 2) == 2) ) buf[5] = 2; /* TWO BYTE WRITE */ else buf[5] = 1; /* default to byte write */ ===================================================== is clearly wrong. You probably meant something like: ===================================================== if ( ((memaddr & 3) == 0) && ((len & 3) == 0) ) buf[5] = 4; /* Word align and word length */ else if ( ((memaddr & 1) == 0) && ((len & 1) == 0) ) buf[5] = 2; /* TWO BYTE WRITE */ else buf[5] = 1; /* default to byte write */ ===================================================== The same code occurs in two different places. Indeed, after replacing the code we were back up to the speed #####################################################################