uint8_t FTFE_CommandExecute() __attribute__((section(".ARM.__at_0x20000000")));
uint8_t FTFE_CommandExecute()
{
FTFE->FSTAT |= ( FTFE_FSTAT_RDCOLERR(1) | FTFE_FSTAT_ACCERR(1) | FTFE_FSTAT_FPVIOL(1) );
FTFE->FSTAT |= FTFE_FSTAT_CCIF(1);
while( (FTFE->FSTAT & FTFE_FSTAT_CCIF_MASK) ){
__asm("NOP");
}
while( !(FTFE->FSTAT & FTFE_FSTAT_CCIF_MASK) ){
__asm("NOP");
}
return FTFE->FSTAT;
}
main()
{
address=0x00010000;
FTFE->FCCOB0 = 0x09;
FTFE->FCCOB1 = (address>>16) & 0x000000FF;
FTFE->FCCOB2 = (address>> & 0x000000FF;
FTFE->FCCOB3 = address & 0x000000FF;
__disable_irq();
FTFE_CommandExecute();
__enable_irq();
}
If you break here and check the FLASH, it will look like the image above.