AnsweredAssumed Answered

MQX bootloader help / interrupt vectors

Question asked by Luka Rahne on Jan 9, 2012
Latest reply on Jan 9, 2012 by David E Seymour

I need bootloder that does not fail. That mean that if you turn off power during update it does not crash. Devices I am working on must be able to upgrade image over some bus (does not matter which) one. 

I have done bootloader before whit such feature and this is how it worked.


Memory map (linked file - pseudo code):


%vectors pointing on jump list: (n vectors)jv1jv2jv3...jvnbootloader code working whitout interrupts (approx 4k)------------------- % this address is fixedjv1: .jmp vector1jv2: .jmp vector2...jv3: .jmp vector nall reamining code


Bootloader is working in way that it figures out if it has valid image in memory device (external flash in my case) and copies that image at address space after  end of bootloader where is

line jv1: .jmp vector1.


It is responsibility of main  program that enables writing code from bus (eth for instance) to  appropriate address in memory.


We can see that this approach does not consume much of flash and can be done ressistant on power faliures.

Now I need something similar in MQX, but i have problems understanding how are vectors mapped.

My cpu is 51JM


Only table i can find is in vectors.c but all vectors there are mapped on DEFAULT_VECTOR which is _int_kernel_isr.

Does MQX maps all interrupts tough this _int_kernel_isr ? 


Woul be enough if i put only jmp  _int_kernel_isr on fixed place out of kernel space and vectors pointing on SP (stack pointer) and PC (program counter), so that they can be changed later if needed.