Hi,
I am using MSP430F5437 and I am seeing some varying results. I have created code to download firmware upgrades, and this works fine on 3 our of the 4 boards that I have. The processor is running at 18MHz and the baud rate is 115200.
*************************************************************
Clock settings:
UCSCTL1 |= DISMOD;
UCSCTL0 = 0x0000;
UCSCTL3 = 0x0020;
__bis_SR_register(SCG0);
UCSCTL1 = DCORSEL_7; // Select suitable range
UCSCTL2 = 548 + FLLD_1; // Set DCO Multiplier
UCSCTL4 = SELA__REFOCLK | SELS__DCOCLKDIV | SELM__DCOCLKDIV ;
***************************************************
UART settings:
UCA1BR0 = 9;
UCA1BR1 = 0;
UCA1MCTL = 0xC1;
***************************************************
Let me explain what I have done.
With the current code I have setup a test case were data is streamed to the device. All devices can receive hundreds of megabytes without giving me any failures. If I start copying this data from my incoming buffer to flash that is when I get into trouble.
My flashing routine globally disables interrupts and uses polling on the UART Rx flag to check for incoming bytes (UCA1IFG & UCRXIFG). One test that I did was to replace flashing with delays to simulate the timing, and this test again showed no problems with receiving data.
I have tried the 3 methods for flashing data. Byte, long word and even block write (128 bytes).
Byte writes are too slow, and even a 4K buffer (About 60K of code) overflows.
Long word writes are fine on 3 out of 4 boards.
Block writes does not seems to work at full speed (Inserting breaks between chars and it does work). Documentation is a little unclear here, as it seems no access to flash can be done while a block write is in progress.
******************************************************
Summarize:
My current code writes to flash 4 bytes at a time, while receiving data on the UART. 3 devices out of 4 that I are testing have no problems, while a 4th has any of these bits set: UCFE, UCOE, UCRXERR or UCBRK. If flashing is disabled, all boards can receive an endless amount of data without issues, it seems.
Any advice would be much appreciated.
Thanks,
Jorgen