When writing to the internal flash using the I2C ISP protocol I can write, read, erase PAGES, BLOCKS and SECTORS with no issues as long as I stay away from the 512 bytes starting at 0x0.
When I BLOCK write #0 I do not get an error ack which is an error in itself.
However when I PAGE write #0 I get this error: ERR_USER_CODE_CHECKSUM which is probably also not the correct error message since I have the correct checksum writing everywhere else.
I then used a SEGGER JFlash tool to burn the chip via SWD and read out the flash via I2C.
I then discovered that the word at 0x28 was not identical to the file. The Segger tool had modified this when burning. If I do the same thing and modify my image I'm able to burn it via I2C as well.
I'm burning 0xdffd604a at offset 0x28.
So there is obviously some sort of qualification being performed when writing the the start of the flash.
However I'm unable to find proper documentation on the requirements and what this magic number is.
From looking at image documentation this corresponds to the vector 11 in the image and should contain a valid pointer to an enhanced boot block structure, is this the clue?