TI MSP430 BootStrap Loader (BSL) -- Entry from software in C?


Does anyone have experience with the bootstrap loader (BSL) feature of MSP430 processors made by TI?

I'm having trouble entering the BSL from software written in C. According to application note SLAA089D page 16, the following sequence of instructions will enter the BSL:

mov #00h,&CCTL0 bic.b #02h, &P1SEL bic.b #04h, &P2SEL, bic.b #32h, &IE1 mov.b #00h, &BCSCTL2 mov #00h, SR br &0C00h

I am trying to enter from C, but the device doesn't seem to enter the BSL. In particular, the line P1.1 (BSL TX) stays Hi-Z. My code looks like this, and as far as I can tell, its equivalent.

void EnterBootStrapLoader(void) { voidFcn BSL = (voidFcn) 0x0c00;

// Cautionary action -- make all pins Hi-Z P1DIR = 0; P1SEL = 0; P2DIR = 0; P2SEL = 0; P3DIR = 0; P3SEL = 0; P4DIR = 0; P4SEL = 0; P5DIR = 0; P5SEL = 0; P6DIR = 0; P6SEL = 0;

// Cautionary Action -- Turn off all the interrupts that my app was using // Turn off TimerB, UART, ADC TBCTL=0; ME1 &= ~(UTXE0 | URXE0); IE1 &= ~(UTXIE0 | URXIE0); ADC12CTL0 = 0; ADC12IE = 0;

// from TI Application Note SLAA089D CCTL0 = 0; P1SEL &= ~(0x02); P2SEL &= ~(0x04); IE1 &= ~(0x32); BCSCTL2 = 0; __bic_SR_register(0xff);

// never returns BSL(); }

Additionally, when I try to use a debugger (rowley crossstudio), it looks like the program counter is bouncing around all over the place, from low addresses ( < 0x0100 ), to around (0x1500), to my software's initialization routine.

Any hints?

Thanks, Nick Johnson

Reply to
Loading thread data ...


Learn how to make your c compiler generate an assembly language listing and examine it.

Verify that there is no important difference between the branch instruction used in the assembly version and the function call mechanism used in the c version. (Often there is)

Single step through the actual branch/call. Compare what happens when you do this from your C program vs. the assembly program. Particularly, look at the the registers when you arrive at the branch target.

Reply to

Ok, I figured it out. My error was I was branching to address

0x0C00, but address 0x0C00 is actually a vector. Just in case it may help someone in the future, here is code that I have tested, and which works on the MSP 430 F 149.

How to enter the ti msp 430 bootstrap loader (bsl) from C:


typedef void (*voidFcn)(void);

void EnterBootStrapLoader(void) { // 0x0c00 is the vector; the address of the bsl is located there voidFcn *bslVector = (voidFcn*) 0x0c00; // find address of bsl voidFcn BSL = *bslVector;

// from TI Application Note SLAA089D, adapted to C CCTL0 = 0; P1SEL &= ~(0x02); P2SEL &= ~(0x04); IE1 &= ~(0x32); BCSCTL2 = 0; __bic_SR_register(0xff);

// never returns BSL(); }

Reply to

Nick, thanks for posting your code, I've modified it for the MSP430 F2274 that I'm using but I can't seem to get the MSP430 BSL Communication Program from app note SLAU319A to talk to the BSL. In fact, the BSL is not responding to the sync character (80h) at all when I send it at 9600 baud


Question, do I need to assert the RST and TEST lines to the processor when I've started the BSL from software? I don't think I need to, but using a watchpoint with my JTAG debugger I never see the BSL read from UCA0RXBUF, so I suspect something is wrong.

Do you have any suggestion?


--------------------------------------- Posted through

formatting link

Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.