Diese Sektion erlaubt es ihnen alle Beiträge dieses Mitglieds zu sehen. Beachten sie, dass sie nur solche Beiträge sehen können, zu denen sie auch Zugriffsrechte haben.
Frage an Colibri!
Wäre es möglich deinem Tool beizubringen das boop an die Betty zu schicken?
BOOL CmdPrgFlash(DWORD DstAddress, int WordLen, BYTE *SrcBuffer)
{
int i;
int k;
BOOL Error;
DWORD dwPrgAddress;
WORD wPrgData;
int Retries;
DWORD Address;
int FlashNr;
DWORD FlashBase;
DWORD wData;
if(DstAddress < FLASH_1_ADDRESS)
{
return false;//Error
}
FlashNr = (DstAddress < FLASH_2_ADDRESS) ? 1 : 2;
FlashBase = (FlashNr == 1) ? FLASH_1_ADDRESS : FLASH_2_ADDRESS;
for(i=0; i<WordLen; i++)
{
dwPrgAddress = DstAddress + (i * 2);
wPrgData = GetWord(&SrcBuffer[i * 2], true);//LSB first
Retries = 3;
do
{
Error = false;
Address = 0x555 << 1;
Address |= FlashBase;
wData = 0xAA;
((WORD*)Address)[0] = wData;
Address = 0x2AA << 1;
Address |= FlashBase;
wData = 0x55;
((WORD*)Address)[0] = wData;
Address = 0x555 << 1;
Address |= FlashBase;
wData = 0xA0;
((WORD*)Address)[0] = wData;
Address = dwPrgAddress;
Address |= FlashBase;
wData = wPrgData;
((WORD*)Address)[0] = wData;
BOOL DataOk;
DataOk = false;
for(k=0; (k<1000) & !DataOk ; k++)
{
if( (((WORD*)Address)[0] & 0x80) == (wData & 0x80) )
{
DataOk = true;
}
}
if(!DataOk)
{
Error = true;
}
Address = 0 << 1;
Address |= FlashBase;
wData = 0xF0;//Reset
((WORD*)Address)[0] = wData;
}while(Error & (Retries-- > 0));
}
return true;//OK
}
CS0:8003E25C CMP R0, #0x21 ; '!'
CS0:80000C1C MOV R0, R0,LSL R3 -> 24000*8 = 192000
//Flash1 auf 16 bit einstellen (ist vom ISP-BootLoader noch auf 32 bit eingestellt)
BCFG0 = 0x1000FBEF;