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.
Thanks
Solved! Go to Solution.
Hi Ralu,
The USB MSD Bootloader does work on JM128 (ColdFire V1), ColdFire V2, and Kinetis.
Here is information on it and several others as reference material others might like:
AN4367 : Ethernet Bootloader for MCU (pdf)| AN4367SW | |
AN4370 : USB DFU Bootloader for MCUs (pdf)| AN4370SW | |
AN4368 : USB Mass Storage Device Host Bootloader (pdf)| AN4368SW | |
AN4379 : Freescale USB Mass Storage Device Bootloader (pdf)| AN4379SW | |
https://community.freescale.com/thread/102108
Also documents for MQX:
Hope this helps.
Best Regards,
David
Hi Ralu,
The USB MSD Bootloader does work on JM128 (ColdFire V1), ColdFire V2, and Kinetis.
Here is information on it and several others as reference material others might like:
AN4367 : Ethernet Bootloader for MCU (pdf)| AN4367SW | |
AN4370 : USB DFU Bootloader for MCUs (pdf)| AN4370SW | |
AN4368 : USB Mass Storage Device Host Bootloader (pdf)| AN4368SW | |
AN4379 : Freescale USB Mass Storage Device Bootloader (pdf)| AN4379SW | |
https://community.freescale.com/thread/102108
Also documents for MQX:
Hope this helps.
Best Regards,
David