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.

Updating Exception Vector on transition from boot to application platform

Hello,

In my current project I need to implement a transition from bootloader to application platform which is a data loadable software. When transition I need to update exception vector located at 0x0000 address.

The exception vector table in the boot loader looks something like this below:

resetEntry

        b   c_int00

undefEntry

        b   UndefinedException_Handler

svcEntry

        b   SVC

prefetchEntry

        b   PrefetchException_Handler

dataEntry

        b   dataAbortHandler

reservedEntry

        b   reservedEntry

        ldr pc,[pc,#-0x1b0]       ; IRQ

 ldr pc,[pc,#-0x1b0]       ; FIQ

I am trying to update on transition to application platform as below:

my new vector table of platform:

.global resetEntry

resetEntry:
b resetEntry
;undefEntry
b Handler_UndefinedException
;svcEntry
b soft_int
;prefetchEntry
b Handler_PrefetchException
;dataEntry
b dataAbortHandler
;reservedEntry
b Handler_ReservedEntryException
ldr pc,[pc,#-0x1b0] ; IRQ
ldr pc,[pc,#-0x1b0] ; FIQ

New setup function to update the vector table.

__resetEntry:
.word resetEntry

.def _Vector_Setup

; Save return location
cpy r12, r13
push {r11-r12,r14,pc}
sub r11, r12, #0x4

ldr r0, __resetEntry                    ; Get the start vector address
mcr p15, #0, r0, c12, c0, #0 ;    Copy it to the vector base register

When I try this i get undefined exception, is there something wrong in my code or is not possible to update exception vector using above instructio.

I am working on TMS570LC43x  micro controller cortex R5 core.

Thanks,

Nagaraj Hegde

  • Nagaraj,

    I think you're looking at the VMSA section of the ARM Architecture Ref. Manual - v7AR ...
    The Cortex R5 doesn't support VMSA, it has only PMSA support. So the register doesn't exist.

    There really isn't an equivalent on Cortex R5. What you are trying to do is however handled by
    our own bootloader examples (see http://www.ti.com/lsds/ti/microcontrollers_16-bit_32-bit/c2000_performance/safety/tms570/tech_docs.page?rootFamilyId=4&familyId=1870&docTitle=bootloader&docCategoryId=1) and you can study how it's done.

    It's not too bad because most of the exceptions and certainly the time critical ones are IRQs and these can be remapped anywhere through the VIM. For the other exceptions you have to keep some code at the low vector address that manages a jump to the area of flash that has your final code.
  • Thanks Antony for the reply.

    I agree about using VIM to install IRQ's. However my problem is switching between different tasks in application software.

    I am using SVC to handle switching tasks using software Interrupt. Can you suggest me how do I remap SVC after transition from boot to platform application software.
  • Nagaraj,

    Hi it is not possible to move the SVC vector. The TI bootloader examples install a branch to a secondary address, outside of the boot sector, for all of the exceptions aside from IRQ.