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

Boot Loader and Int Vector table reloacation

Im trying to determine the best way to deal with the Interrupt
vector tables in a system where the main code will be downloaded
into ram and a bootloader will be in the ROM.

I need to move the vector table up into RAM without moving the
base address of the bootloader ROM code.

Thanks
Mark

Parents Reply Children
  • Is there a real code example of this method? I am fairly new to this processor and a bit confused as to how to plug this all in.

  • Is there a real code example of this method? I am fairly new to this processor and a bit confused as to how to plug this all in.
    If, indeed you are fairly new, why do you deal with issues as complex as this. Get some wear on your '51 shoes, then come back to this issue. The way to get practice on the '51 is to use it as it is intended before "going excotic".

    Erik

  • Fortunately I don't have much of a choice in this matter. It's what the project requires and I happen to be the resources for it at the moment. It's good to know that it's not simple though.

  • I did a similar thing when I had to update my firmware over usb.
    In my case one interwupt was used in the update code and regular firmware and the
    code hat to respond as fast as possible.

    in ASM I used the following:
    (note the RET instead of RETI)

    extrn DATA   (USB_VECT)
    extrn DATA   (V24_VECT)
    CSEG at 00003h
      PUSH    USB_VECT+1
      PUSH    USB_VECT+0
      RET
    CSEG at 00023
      PUSH    V24_VECT+1
      PUSH    V24_VECT+0
      RET
    end
    
    and in c
    #pragma NOIV
    void V24Irq(void) interrupt SIO_VECTOR
    {
      ...
    }
    void USBIrq(void) interrupt IE0_VECTOR
    {
      ...
    }
    

    and at init Time:
    UINT16 usb_vect _at_ 0x20;
    UINT16 sio_vect _at_ 0x22;
    void initirq(void)
    {
      usb_vect = (UINT8 code *) &UsbIrq;
      sio_vect = (UINT8 code *) &V24Irq;
      EA=1;
    }
    
    Hope this helps
    Thomas