Hi all:
With your help i was able to run custom bootloader from SARAM memory H0. I'm working with the standard bootloader removing unnecessary parts from it so that it would look like the example from the spraaq3 document.
I have the following problem: when the AutobaudLock is executing the
while(SCIARegs.SCIFFCT.bit.ABD != 1) {}
is running for awhile then causes DSP to reset. Should I run this example from the flash not just from the SARAM under simulator?
The function is listed below. I have added the SCIARegs.SCIFFCT.bit.ABDCLR = 1; line as per erratum.
Thanks,
Yvon.
inline void SCIA_AutobaudLock()
{
ui16 byteData;
// Must prime baud register with >= 1
SCIARegs.SCILBAUD = 1;
// Prepare for autobaud detection
// Set the CDC bit to enable autobaud detection
// and clear the ABD bit
SCIARegs.SCIFFCT.all = 0x2000;
SCIARegs.SCIFFCT.bit.ABDCLR = 1;
// Wait until we correctly read an
// 'A' or 'a' and lock
while(SCIARegs.SCIFFCT.bit.ABD != 1) {}
// After autobaud lock, clear the CDC bit
SCIARegs.SCIFFCT.bit.CDC = 0;
#if K1
// for K1 we have to grab an extra byte out of the
// buffer. This is not required on F2810/12
while( (byteData = SCIARegs.SCIRXBUF.bit.RXDT) != 'A');
SCIARegs.SCITXBUF = byteData;
#endif
#if F2812 | F2810
while(SCIARegs.SCIRXST.bit.RXRDY != 1) { }
byteData = SCIARegs.SCIRXBUF.bit.RXDT;
SCIARegs.SCITXBUF = byteData;
#endif
return;
}