EmbeddedRelated.com
Forums
Memfault Beyond the Launch

PROBLEM with MSP430F2121 and BSL

Started by Unknown October 8, 2007
Hi, I'm new here. I'm italian and so my english is not very
good...pardon!

I have need to program MSP430F2121 (28 pin, 4KB, UART) using BSL
(Bootstrap Loader) controlled by PC. By Visual Basic 6, I'm be able to
driver RS232 (TX, RX, RTS, and DTR) and I'm be able to communicate to
MSP430F2121.

I make thing step-by-step, reading before sall0089d and slaa0096d.

First Step:
I send to MSP SYNC (0x80) command, and I receive ACK (0x90). It's all
right!

Second Step:
After SYNC command, I send MASS ERASE command:
HDR: 0x80
CMD: 0x18
L1: 0x04
L2. 0x04
AL: 0x00
AH: 0xFF
LL: 0x06
LH: 0xA5
CKL: 0x7D
CKH: 0xB9
The parameters AH, AH, LL, LH are suggested by TI (see the example of
Visual C++ application for Win32)
MSP430 answers me by ACK, 0x90 and in effect all memory is empty, all
0xFF
But there's a mistery: if I send RX PASSWORD, MSP430 answers me NAK,
0xA0 after the fourth byte and voltage level goes low by MSP430:
WHY???

Thirth Step:
After SYNC Command, I send RX PASSOWRD, in other words, I send to
MSP430 the password, that is 32 times 0xFF after MASS ERASE.
Now MSP430 answers me ACK, 0x90. It's all right!
But some times, MSP430 answers me NAK, 0xA0 after the fourth byte and
voltage level goes low by MSP430: WHY???
In MSP430F2121, as other new chips, when password is wrong, MSP430
erase all flash memory, filled with 0xFF. When MSP430 answers me by
ACK, I verify, reading the flash memory, that RX PASSWORD command is
processed right.

Fourth Step:
After SYNC command and after RX PASSWORD, I try to write 2 bytes
(always even data, because MSP430 is a 16 bit MCU!!) in flash memory,
but MSP430 answers me NAK, 0xA0, ALWAYS!!!
The string that I sent is:
HDR: 0x80
CMD: 0x12
L1: 0x06
L2. 0x06
AL: 0x00
AH: 0xF8
LL: 0x02
LH: 0x00
D1: 0x12
D2: 0x34
CKL: 0x69
CKH: 0x27
Seeing in details:
L1=L2 and indicate that the bytes are 6 (AL, AH, LL, LH, D1, D2)
AL, AH indicate the start address memory using little-endian notation:
0xF800
LL, LH indicate the number of pure data bytes: only 2, D1 and D2
D1 and D2 indicate the data that I want to write into flash memory
CKL, CKH indicate the cheacksum calculated by:
CKL=HDR xor L1 xor AL xor LL xor D1 xor 0xFF
CKH=CMD xor L2 xor AH xor LH xor D2 xor 0xFF
Why I add "xor 0xFF"? Because I must inverted the subtotal xor
calculation: CKL=INVERTE (HDR xor L1 xor AL xor LL xor D1). It's the
same!
But I receive from MSP430, NAK: WHY????

Could someone help me, please?
Federico

On Oct 8, 5:16 am, federico...@fdpinternational.com wrote:

> I have need to program MSP430F2121 (28 pin, 4KB, UART) using BSL > (Bootstrap Loader) controlled by PC.
I thought the F2xxx series doesn't even have a bootloader when it comes from the factory? You could probably use gdbproxy to program them. Eric
On 2007-10-08, Eric <englere_geo@yahoo.com> wrote:
> On Oct 8, 5:16 am, federico...@fdpinternational.com wrote: > >> I have need to program MSP430F2121 (28 pin, 4KB, UART) using BSL >> (Bootstrap Loader) controlled by PC.
The bootstrap loader is describe in TI app report slaa089d.pdf There's a BSL download program called mspg430-bsl that you can get here: http://mspgcc.cvs.sourceforge.net/mspgcc/python/
> I thought the F2xxx series doesn't even have a bootloader when it > comes from the factory?
According to the datasheet it does.
> You could probably use gdbproxy to program them.
If all you want to do is program flash, using msp430-jtag is easier than using gdbproxy. But, either method requires a closed-source library if you use a USB-JTAG interface. IIRC, msp430-jtag can program flash via parallel-port JTAG interface w/o the closed source library, but there are some parts for which the parallel port JTAG widget won't work because of timing issues. msp430-jtag is avaialable from the same location as msp430-bsl above. -- Grant Edwards grante Yow! All this time I've at been VIEWING a RUSSIAN visi.com MIDGET SODOMIZE a HOUSECAT!
On 8 Ott, 20:18, Grant Edwards <gra...@visi.com> wrote:
> On 2007-10-08, Eric <englere_...@yahoo.com> wrote: > > > On Oct 8, 5:16 am, federico...@fdpinternational.com wrote: > > >> I have need to program MSP430F2121 (28 pin, 4KB, UART) usingBSL > >> (Bootstrap Loader) controlled by PC. > > The bootstrap loader is describe in TI app report slaa089d.pdf > > There's aBSLdownload program called mspg430-bslthat you can > get here: > > http://mspgcc.cvs.sourceforge.net/mspgcc/python/ > > > I thought the F2xxx series doesn't even have a bootloader when it > > comes from the factory? > > According to the datasheet it does. > > > You could probably use gdbproxy to program them. > > If all you want to do is program flash, using msp430-jtag is > easier than using gdbproxy. But, either method requires a > closed-source library if you use a USB-JTAG interface. IIRC, > msp430-jtag can program flash via parallel-port JTAG interface > w/o the closed source library, but there are some parts for > which the parallel port JTAG widget won't work because of > timing issues. > > msp430-jtag is avaialable from the same location as msp430-bsl > above. > > -- > Grant Edwards grante Yow! All this time I've > at been VIEWING a RUSSIAN > visi.com MIDGET SODOMIZE a HOUSECAT!
I can't use standard and commercial program, as these witten. I must use a custom Win32 application written by Visual Basic 6, because the hardware must test the target circuit with MSP430F2121, must program MSP430 and the verify the correct functioning. Ok? But I dont' be able to write any bytes on the flash memory. In first, I try to write byte 0x12 in 0xF800 and byte 0x34 in 0xF801 of flash memory. So the entire string that I send by RS232 is follow: 0x80, 0x12, 0x06, 0x06, 0x00, 0xF8, 0x02, 0x00, 0x12, 0x34, 0x69, 0x27. In other words, each bytes sent has the follow means: HDR: 0x80 (sync) CMD: 0x12 (rx data command) L1: 0x06 (number of all bytes sent) L2. 0x06 (number of all bytes sent) AL: 0x00 (low byte of start flash memory address) AH: 0xF8 (hi byte of start flash memory address) LL: 0x02 (number of data bytes only, <250) LH: 0x00 (always 0) D1: 0x12 (first data) D2: 0x34 (second data) CKL: 0x69 (low check sum) CKH: 0x27 (low check sum) Could anyone help me, please? Federico
On 2007-10-09, federico.rd@fdpinternational.com <federico.rd@fdpinternational.com> wrote:

> I can't use standard and commercial program, as these witten. > I must use a custom Win32 application written by Visual Basic > 6, because the hardware must test the target circuit with > MSP430F2121, must program MSP430 and the verify the correct > functioning. Ok?
Visual Basic could run the msp430-bsl program. Our test stations are run using VB 6 applications and they have no problem calling external programs to perform certain operations. If you absolutely insist on on re-inventing the wheel, you're free to do so.
> But I dont' be able to write any bytes on the flash memory. > > In first, I try to write byte 0x12 in 0xF800 and byte 0x34 in > 0xF801 of flash memory.
> So the entire string that I send by RS232 is follow: 0x80, 0x12, 0x06, > 0x06, 0x00, 0xF8, 0x02, 0x00, 0x12, 0x34, 0x69, 0x27. > In other words, each bytes sent has the follow means: > HDR: 0x80 (sync) > CMD: 0x12 (rx data command) > L1: 0x06 (number of all bytes sent) > L2. 0x06 (number of all bytes sent) > AL: 0x00 (low byte of start flash memory address) > AH: 0xF8 (hi byte of start flash memory address) > LL: 0x02 (number of data bytes only, <250) > LH: 0x00 (always 0) > D1: 0x12 (first data) > D2: 0x34 (second data) > CKL: 0x69 (low check sum) > CKH: 0x27 (low check sum) > > Could anyone help me, please?
I tried. I pointed you to a working BSL download program. How does what you send compare with what is sent by a working BSL download progam? -- Grant Edwards grante Yow! Why is it that when at you DIE, you can't take visi.com your HOME ENTERTAINMENT CENTER with you??

Memfault Beyond the Launch