Hi All,
I'm new to the bootloader and freescale MCU. What i would like to do is to add the serial bootloader to my firmware, but my problem is how would i segment the memory on my firmware so it works with the bootloader code and won't create any overlap etc...
Firmware .prm file
NAMES END SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x015F; ROM = READ_ONLY 0xF000 TO 0xFFAD; ROM1 = READ_ONLY 0xFFC0 TO 0xFFCF; /* INTVECTS = READ_ONLY 0xFFD0 TO 0xFFFF; Reserved for Interrupt Vectors */ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */ DEFAULT_RAM /* non-zero page variables */ INTO RAM; _PRESTART, /* startup code */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ DEFAULT_ROM, COPY /* copy down information: how to initialize variables */ INTO ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */ _DATA_ZEROPAGE, /* zero page variables */ MY_ZEROPAGE INTO Z_RAM;ENDSTACKSIZE 0x30VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */
Serial Bootloader .prm file
ENTRIES MY_NVOPT MY_NVPROTENDNAMESENDSECTIONS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0060 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x015F; ROM = READ_ONLY 0xFE00 TO 0xFFAD; NVPROTROM = READ_ONLY 0xFFBD TO 0xFFBD; NVOPTROM = READ_ONLY 0xFFBF TO 0xFFBF;ENDPLACEMENT /* here all predefined and user segments are placed into the SECTIONS defined above. */ NVPROT_ROM INTO NVPROTROM; NVOPT_ROM INTO NVOPTROM; DEFAULT_ROM INTO ROM; DEFAULT_RAM INTO RAM; _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM;ENDVECTOR 0 main INIT main
Thanks,
I changed the firmware ROM to
ROM = READ_ONLY 0xF000 TO 0xFDFF;
I received the following messages
"
received 0xf8 <off-Key>
Wrong calibrate response <0xf8, must be 0xfc>. Target is not calibrated.
"
I think this probably due to mis-matched speed.
Problem solved after computer reset itself. The communication is all good and firmware works as expected.