I am attempting to create a bootloader, for a K70, using the ideas in AN4368. My problem is with the flash driver supplied. In particular the routine 'Flash_ByteProgram". It is returning a 'Flash access error'. In flash_FTFL.h the flash write command is defined as 0x06 using '#define FlashCmd_ProgramLongWord 0x06'. However looking at the K70 reference manual there is no 0x06 command. See section 22.214.171.124. There is a 'Program Phrase' command that writes eight bytes. Is the flash driver supplied with AN4368 incorrect? Is a corrected one available?
I have attached both flash_FTFL.c and flash_FTFL.h that were supplied with AN4368.