R32C R5F64219 Reset Vector Rewrite

Hi all!

I have a strange problem with the device mentioned above. We have a bootloader in the last sector of the flash, from 0xFFFF8000 to 0xFFFFFFFF. The problem is, the bootloader has to be changed due to constructional changes. Everything goes well, including the erase of this last sector, until writing to the address of the reset vector (the API can only write 8 bytes, so it is not just the last 4, but the last 8 bytes). The flash api, which can be found on renesas.com, successfully erases the last sector, including the reset vector, but we're unable to write the reset vector, although all the previous addresses (up to 0xFFFFFFF8) can be written. The datasheets do not mention anything about restrictions of writing the reset vector, or the last flash sector. Could you help me please in this problem?

Thanks in advance:

Thomas