This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Boot Loader and App Question

I am planning to implement a bootloader in the main Memory which can write the application code in the Flash. I have reserved a location for app code.

 

Question I have is,  how to update the interrupt table when I change the application code? Do I need to generate two different files for ISRs and app code?

Whats the best mechanism so that I do this efficiently?

How do I change the interrupt vector table?

 

-Harsh

  • Just to clarify, the Interrupt Vectors I am trying to change should point to some function in App Code.

  • Hi,

      The short answer to your question is that you can not safely erase the interrupt vector table at all.  The reason being, there's always a chance the device could reset right after the erase, and become unresponsive.

    My quick summary of how I'd handle it.

    Make your Application code have a reserved word at it start.  This will contain a CRC, or even just a known value.  The application code would also contain its own internal interrupt table.  The MSP430's  interrupt vector table would point into your bootloader.  When an interrupt happens, the interrupt is first caught by the bootloader which checks the CRC/value in the app code to make sure there is correct code there.  If it is, it passes the interrupt along to the application.  If not, it ignores the interrupt, and waits for programming instructions.

    Updates would be done as follows:

    1) Application code segments are erased (these can obviously not overlap with the MSP430 ISRs)

    2) Application code is programmed

    3) Lastly, the CRC/known value is written, indicating the Application was correctly programmed (verified by Boot Loader)

    The "Flash Monitor" App Report (slaa341) provides more examples and details along these lines, but I would also impliment my suggestions above for additional reliability.

  • Lane Westlund said:

    When an interrupt happens, the interrupt is first caught by the bootloader which checks the CRC/value in the app code to make sure there is correct code there.  If it is, it passes the interrupt along to the application.  If not, it ignores the interrupt, and waits for programming instructions.

    Lane,

    How would I jump to function in the Application Code? For this I would also have to make sure my function resides in a particular location of flash memory?

    How would I create a linker file for the application code ?

    Thanks

    Harsh

  • >How would I create a linker file for the application code ?

    The specifics of creating a linker file are specific to your IDE, and described in the User's Guide.

    As a general Rule, I would create two projects.  One for the bootloader, with the interrupts in the normal location.

    For the application, I modify the linker file in the following way:

    • Move the ISR table to a defined location of your choice, which the Bootloader will use
    • Be sure no code goes in the segment where the MSP430 ISR table is

**Attention** This is a public forum