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.
Hi to everybody,
there are a plenty of informations on how to implement a custom bootloader for msp430 microcontroller, maybe too much for me...
I understand that:
1) bootloader interrupt vector must stay on 0xFF80-0xFFFF. Bootloader code start at 0x5C00.
2) application interrupt vector have to be relocate to a different address, lets say 0xFF00-0xFF7F. Application interrupt vector table can move to ram at startup by the bootloader or by the application. Application code start ad 0xA100.
Now, besides interrupt part, I simplified bootloader and application without using any ISRs.
So my bootloader start at the reset address 0xFFFE, turn on a led, wait 1 second and then jump to the application that turn off that led and turn on another led. The problem is that I'm not able to jump to the application code.
Have I to jump to application reset vector address 0xFF7E? Or have I to jump to main 0xA100? I think the first one.
The instruction that I use to jump is ((void(*)())0xFF7E)();
Bootloader is implemented using CCS 6.0
On application side where I use gcc I implement a custom linker file memory.x where
MEMORY {
sfr : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010, size 16 */
peripheral_8bit : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100, size 240 */
peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200, size 256 */
bsl : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x1800, size 2K as 4 512-byte segments */
infomem : ORIGIN = 0x1800, LENGTH = 0x0200 /* END=0x1a00, size 512 as 4 128-byte segments */
infod : ORIGIN = 0x1800, LENGTH = 0x0080 /* END=0x1880, size 128 */
infoc : ORIGIN = 0x1880, LENGTH = 0x0080 /* END=0x1900, size 128 */
infob : ORIGIN = 0x1900, LENGTH = 0x0080 /* END=0x1980, size 128 */
infoa : ORIGIN = 0x1980, LENGTH = 0x0080 /* END=0x1a00, size 128 */
ram (wx) : ORIGIN = 0x1c00, LENGTH = 0x3f80 /* END=0x5b80, size 16K-128byte */
rom (rx) : ORIGIN = 0xa100, LENGTH = 0x4e80 /* END=0xff80, size 24192 */
//rom (rx) : ORIGIN = 0x5c00, LENGTH = 0xff80 /* END=0xff80, size 41856 */
//vectors : ORIGIN = 0xff80, LENGTH = 0x0080 /* END=0x10000, size 128 as 64 2-byte segments */
far_rom : ORIGIN = 0x00010000, LENGTH = 0x00015c00 /* END=0x00025c00, size 87K */
/* Remaining banks are absent */
ram2 (wx) : ORIGIN = 0x0000, LENGTH = 0x0000
ram_mirror (wx) : ORIGIN = 0x0000, LENGTH = 0x0000
usbram (wx) : ORIGIN = 0x0000, LENGTH = 0x0000
/* Interrupt Proxy table from _App_Proxy_Vector_Start */
vectors : ORIGIN = 0xFF00, LENGTH = 0x0080
}
I think that there is something missing when I call application reset vector, some code that I have to implement on application side in order to jump correctly to main but I don't know what I have to do.
Thanks in advance if someone can help me
Regards
Your boot-loader need to jump to the entry point of your application. This entry point is the actual address of the reset vector for your compiled application. Assuming your boot-loader maintains the address mapping of the original application, the best way (in my opinion) to locate the entry point is to output your application as a TI-TXT file and scroll all the way down to the 0xFFFE address. All you need to do is make sure that your boot-loader jumps to that address.
Hi Jace,
I already implemented my custom bootloader and it seems to work (flash erase, backup data from external spi flash, read and write to/from internal msp430 flash). I have a problem on my application that is written for msp430-gcc. I posted before my custom memory.x where a redefined vectors from 0xFF80 to 0xFF00 in order not to overwrite bootloader's interrupt vector. Normally application reset vector start at 0xFFFE so with my redefinion of vectors I expect to jump to 0xFF7E in order to start my application but this doesn't work. I'm not able to realize what I'm missing.
Regards
**Attention** This is a public forum