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

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

Children
No data