This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bootloader in same Flash as application?

Is it possible to have a separate bootloader and application in the same flash? The problem I see is hooking the interrupts from the low memory (the bootloader's to go into 0x0000)into the application which uses them.

Do I have to compile these applications into
one application, to get the interrupts
hooked in? I'd rather these programs
not be dependent on each other.

Parents
  • Hi there!

    You probably have bad luck. When you write to an external FLASH, there will be some sort of write cycle that takes maybe 1 ms per memory page. While that the data bits are used to indicate the status. So, the normal progam, being run from the same chip, would be corrupted while that write cycle.

    You can store the boot loader in another memory chip, maybe an EEPROM and when you go to boot loade mode, you could switch that EEPROM to be in the code segment and the FLASH to be in the X-DATA Segment. Then write the pages to be modified to X-DATA, check the write cycle status, write the next page, etc. and at the end of the loading process, you switch the FLASH back to the CODE segment.

    That is how I have done that kind of projects with external code memory. I think, there might be some derivates, that might support boot loading the internal program memory, too.

Reply
  • Hi there!

    You probably have bad luck. When you write to an external FLASH, there will be some sort of write cycle that takes maybe 1 ms per memory page. While that the data bits are used to indicate the status. So, the normal progam, being run from the same chip, would be corrupted while that write cycle.

    You can store the boot loader in another memory chip, maybe an EEPROM and when you go to boot loade mode, you could switch that EEPROM to be in the code segment and the FLASH to be in the X-DATA Segment. Then write the pages to be modified to X-DATA, check the write cycle status, write the next page, etc. and at the end of the loading process, you switch the FLASH back to the CODE segment.

    That is how I have done that kind of projects with external code memory. I think, there might be some derivates, that might support boot loading the internal program memory, too.

Children