Hi everyone..
I made ep9301 Custom board similar ts7200 edb9301 little different..
I made My own Bootloader(boot and zmodem) it's simple works
I met Strange Problem in Downloading My Own Bootloader
Download tool is cirrus download in "cirrus-arm-linux-2.0.2" package
compiling download tool has no problem,
But during downloading own bootloader, CheckSum Error and SizeError
has appeared.
i checked download.c(PC CLIENT) and /src/main.c(CUSTOM BOARD)
PC CLIENT CODE is
------------------------------------------------------------------
long lFileSize;
SendChar((char)(lFileSize & 0xFF));
printf("SendDATA %02x\r\n",(char)(lFileSize & 0xFF));
SendChar((char)((lFileSize >> 8) & 0xFF));
printf("SendDATA %02x\r\n",(char)((lFileSize >> 8) & 0xFF));
SendChar((char)((lFileSize >> 16) & 0xFF));
printf("SendDATA %02x\r\n",(char)((lFileSize >> 16) & 0xFF));
SendChar((char)((lFileSize >> 24) & 0xFF));
printf("SendDATA %02x\r\n",(char)((lFileSize >> 24) & 0xFF));
i printed "lFileSize" for each SendChar Fuction.
it works. good data...
Custom board code is...
--------------------------------------------------------------
long iFileSize;
unsigned char *pBuffer;
char data0;
char data1;
char data2;
char data3;
pBuffer = (volatile unsigned char *)&iFileSize;
pBuffer[0] = data0 = Serial_GetChar();
pBuffer[1] = data1 = Serial_GetChar();
pBuffer[2] = data2 = Serial_GetChar();
pBuffer[3] = data3 = Serial_GetChar();
We know if PC CLIENT send "0x11,0x22,0x33,0x44" sequencely..
Custom Board will Check
pBuffer[0]= 0x11,pBuffer[1]= 0x22,pBuffer[2]= 0x33,pBuffer[3]= 0x44
But, I'm so confused this result..
pBuffer[0]= 0x22,pBuffer[1]= 0x11,pBuffer[2]= 0x44,pBuffer[3]= 0x33
it seems like 16 bit big endian data...
if i have compiled big endian option, board didn't works.
because, I checked binary data of download tool,
i thought, Serial function has Bug...
So, i changed code like this..
-----------------------------------------------------
pBuffer[0] = data0 = 0x11;
pBuffer[1] = data1 = 0x22;
pBuffer[2] = data2 = 0x33;
pBuffer[3] = data3 = 0x44;
if( pBuffer[0] == 0x11)
Serial_SendChar(0);
if( pBuffer[1] == 0x22)
Serial_SendChar(1);
if( pBuffer[2] == 0x33)
Serial_SendChar(2);
if( pBuffer[3] == 0x44)
Serial_SendChar(3);
if( data0 == 0x11)
Serial_SendChar(4);
if( data1 == 0x22)
Serial_SendChar(5);
if( data2 == 0x33)
Serial_SendChar(6);
if( data3 == 0x44)
Serial_SendChar(7);
4,5,6,7 has received... 1,2,3,4 is no...
result is...
pBuffer[0]=0x22, pBuffer[1]=0x11, pBuffer[2]=0x44, pBuffer[3]=0x33,
data0 =0x11, data1 =0x22, data2 =0x33, data3 =0x44
code used array value has bug.. seems like 16 bit big endian
and casting code(long & -> unsigned char *) has bug.. it's same
problem...
why happens.. hardware problem?, cross compiler problem?, compile
option?.. do not casting 8bit pointer in bytes,strings,16bit,32bit?
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|