Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/24/11 16:40
Read: times


 
#181305 - the golden rule
Responding to: ???'s previous message
Please reconsider your plan to put the re-programming code at the Bank 2 location. You should make sure that the boot loader function uses a design such that if there is a power loss during the time that update is in progress that it is easy to re-start the process over again. With the scheme that you describe you will run into a big issue if you have the flash block with the Reset and Interrupt vectors erased and then there is an upset.
if ANY interruption of the update process (power fail, pulled plug, ...) can leave the chip unbootable the bootloader design is faulty.

a few hints (means, not necessarily the only means)
to start the boot erase the top flash page and reset the controller.
if erase failure the controller will just stay in app mode, if reset failure, a reset will start the bootloader
when the update is complete write a zero to the designated byte in this page to indicate app mode.

page 0 of the memory shall be part of the bootloader (unchanging code) and all vectors shall in boot mode jump to the bootloaders ISRs, in appmode to a fixed location table (typically page one) in the app. at this place the app code will jump to the ISR.

the above is doable in C but both clearer and simpler in asm.

Erik


List of 14 messages in thread
TopicAuthorDate
Odd use of code banking            01/01/70 00:00      
   I don't know about Keil's...            01/01/70 00:00      
   Seperate Program?            01/01/70 00:00      
      separate program            01/01/70 00:00      
         Often special lock bits for boot regions            01/01/70 00:00      
         linker magic            01/01/70 00:00      
            RTFM            01/01/70 00:00      
               You are not good to go            01/01/70 00:00      
                  updater and libraries            01/01/70 00:00      
         which is why            01/01/70 00:00      
   Please Reconsider            01/01/70 00:00      
      the golden rule            01/01/70 00:00      
      re: Reconsider            01/01/70 00:00      
         If needed...            01/01/70 00:00      

Back to Subject List