Forum Discussion
Altera_Forum
Honored Contributor
20 years agoprobably problem is that you erasing the flash also erasing your self.
to make firmware update you need to do one of following things. 1. make bootloader. this program is placed in internal rom or external flash in area that will never erased or reprogrammed on normal condition. set reset pointer to that area. when bootloader starts it will decide what to do: update firmware or execute firmware. advantages: easier to debug, your system will stable even on errors during updating. disadvantages: you need to make two modes - firmware update and normal mode and switch between them. 2. include updating subprogram in your main program, on update, place that portion of code in ram and switch context to there. advantages: very flexible, harder to debug disadvantages: your system will not functional if some errors occurred while updating.