Hi,
Thanks for the information.
Yes, the BLDC app uses OSVECTORS for its vector table (vector.c) for some reason.
But the erase process of the bootloader includes the last sector which holds the memory protection bytes, interrupt vector table and startup vectors. And then it restores both the Flash protection bytes, so the flash is not secured (FSEC == 11 is a secure state), and the start-up vector of the bootloader. The rest of the sector is erased so it allows to program the vector table of the BLDC application.
I would only remove the start-up vector from the BLDC vector.c file,
// ,{ 0x00 ,
// #ifdef IRQ_OFF_1F8_FCN /*0 0xFFFE00 + 1F8*/
// IRQ_OFF_1F8_FCN,
// #else
// dummy,
// #endif
// },{ 0x00 ,
// STARTUP_FCN
// }
and modify OSVECTORS:
OSVECTORS = READ_ONLY 0xFFFE10 TO 0xFFFFF7;
Regards,
Daniel