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.

  • Why not use an ISP chip such as the Philips P89C51Rx2 or P89C66x with FlashMagic from http://www.esacademy.com. Atmel has the ISP T89C51Rx2. This eliminates the problem.

    Erik

  • 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.

  • Thanks for your replies, I'll have to talk with my hardware engineer about how he wants to do it.

  • The following knowledgebase article addresses a number of these issues:

    http://www.keil.com/support/docs/337.htm

    Jon

  • Hi,

    You need check the existing of application in bootloder, if applcation exists, the address of interrupt entry should be add the first address of application. For example:
    bootloder starts from 0000H and application starts from 4000h,one interrupt entry at 0023h.

    ORG 0000H ; BOOTLODER
    ORG 0023 ; INTERRUPT ENTRY IN BOOT.
    JB APP_EXIST,4023H
    LJMP BOOT_INT_SERVICE

    ORG 4000H ; APPLICATION STARTS
    ORG 4023 ; INTERRUPT IN APP.
    LJMP APP_INT_SERVICE