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,
I want to program an MSP430F2101 from a MSP430F5528 via the BSL using TEST/RESET. It would seem this should be quite possible using the on-chip UART in the 5528. I've been reading "MSP430 programming via Bootstrap Loader" Before I start writing code like mad has someone else already put together a set of functions to be compiled into MSP430 code that will implement this?
Thanks.
Mike
Hi Mike,
I am working on JTAG rather than BSL, but this link may help:
http://www.ti.com/lit/zip/slau319
--- Alex ---
Alex,
Thanks for your response.
The document I refer to in my original post is slau319a although I did not have the whole package so that is good.
However, the code contained in there I believe is all designed to invoke BSL from the PC which I don't need to do. I need to run BSL on one MSP430 from *another* MSP430. I may be able to use some of it and I can always start from scratch using the info on slau319a.
Anyway, again if anyone knows of or has already written a set of BSL routines designed to run on an MSP430 I'd appreciate it.
Mike
I wonder if anyone has set up a community wiki for such projects?
I have given up on my JTAG... It just isn't responding correctly. I have managed to access the BSL though.
4 things to watch out for:
1) The BSL is "FLASH" based not "ROM" based
2)UART initialization:
init_uart(BAUD_9600,
DATA_BITS_8,
STOP_BITS_1,
PARITY_EVEN);
The constants speak for themselves.
3) CRC (still not sure how this code conforms to the manuals, but it works)
//Taken from TI BSL scripter
#define flash_crc_init() 0xFFFF
static short flash_crc(unsigned short oldcrc, unsigned char data){
unsigned short x;
x = ((oldcrc >> 8) ^data) & 0xff;
x ^= x >> 4;
return (oldcrc << 8) ^ (x << 12) ^ (x << 5) ^ x;
}
To generate a CRC
crc = flash_crc_init();
crc = flash_crc(crc, data[1]);
crc = flash_crc(crc, data[2]);
......
crc = flash_crc(crc, data[n]);
Send the low byte of the CRC before the high byte
4) 200 ms delay between sending bytes on UART *not sure how tight this constant is yet
I have achieved making a MSP430 programmer (use F149)which support BSL、 SBW and JTAG.
As i know ,it works well on F1xx\F 2xx\F4xx\F5418\F5438\F5418A\F5438A,so maybe i can give some ideas.
Could I please direct you to my JTAG post?
http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/p/98931/346279.aspx#346279
Thanks
Hi Michael,
Look for the BSL Replicator within the Deprecated folder of the zip you mentioned (slau319a.zip). There is a file called bsl_replicator.c which will do what you need. It is not written for a 5xxx, but it is in the ball park at least.
Note that there is a bug in function [int bslDownloadCode(unsigned int* pCodeArray, unsigned char patchFlag)] of bsl_replicator.c.
BlockSize should be refreshed at the end of the while loop based on the number of bytes remaining after writing the data, but it does not. Since the read/write/compare function calls in bslDownloadCode all use BlockSize, you can end up writing more bytes than you actually have if the number of bytes in the "section" does not align to TX_BLK_SIZE. This will cause write errors if your next section tries to write those bytes again that were erroneously written in the previous call.
Speaking of TX_BLK_SIZE, they make it 16 bytes, which is ridiculously small. You can increase this to 250 for a big change in throughput.
I guess I cannot complain that much that there are bugs. It is in the deprecated folder after all!
Thanks
darkwzrd
**Attention** This is a public forum