Hello,
I’m working on porting some boot-loader code from the QE32 microcontroller to the QE64 microcontroller. It looks like the FLASH memory map is a little more complex (with some paging needed). I’m struggling a bit with the “Project.prm” file and the actual code to copy over to FLASH. Can you help me how to write to the FLASH in a boot-loader scenario using the “doonstack.asm” file? I’m wondering if I’m going down the right path by setting the PAGE (0 – 3) and the writing to address 0x8000 – 0xBFFF? I’ve copied in a code snippet below from my boot-loader. Is there a specific example for the QE64 chip?
// only pages one and two
for(index=1; index<3; index++)
{
PPAGE_XA_14 = index;
//erase old program here
ProgramAddress = 0x8000;
while(ProgramAddress < 0xBFFF)
{
//reset watchdog for each erase cycle
__RESET_WATCHDOG();
FlashErase((unsigned char*)ProgramAddress);
ProgramAddress += 512;
}
}
// only pages one and two
for(index=1; index<3; index++)
{
PPAGE_XA_14 = index;
ProgramAddress = 0x8000;
while(ProgramAddress < 0xBFFF)
{
//reset watchdog for each erase cycle
__RESET_WATCHDOG();
FlashProg((unsigned char*)ProgramAddress, value);
ProgramAddress++;
}
value++;
}
Thanks
Madhu