Hi Jing Pan,
I was testing it. Modifying the startup_mke18f16.c from your example code and setting our BCA configuration values:
__attribute__ ((used,section(".BootloaderConfig"))) const struct {
unsigned int d1;
unsigned int d2;
unsigned int d3;
unsigned int d4;
unsigned char d5;
unsigned char d6;
unsigned short d7;
unsigned short d8;
unsigned short d9;
unsigned long d10;
unsigned char d11;
unsigned char d12;
unsigned char d13;
unsigned char d14;
unsigned int d15;
unsigned int d16;
unsigned char d17;
unsigned char d18;
unsigned short d19;
unsigned short d20;
unsigned short d21;
unsigned int d22;
} BCA_DATA = { 0x6766636b,0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF, 0xE8, 0xFF, 0x000A,
0xFFFF, 0xFFFF, 0xFFFFFFFF,0xFF,0xFF,0xFF, 0xFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF, 0xFF, 0xFFFF,
0x0123, 0x0321,0xFFFFFFFF};
We guess that there is a possible issue on the enabledPeripherals field. When we set that field to 0xFF (default value) the timeout meets with set value, but when we set only the CANbus peripheral (0xE8) the timeout adds 208ms extra to the set value.
We don't know what is happening, maybe the initialisation of peripheral adds this delay... but 200ms seems too much.
It is possible to avoid that extra timeout value?
Thanks! 