I have a little big problem. Hope you can get me in the right direction. I am developing a firmware for MSP430G2553. My IDE ist CCS 5.2; Compiler Selection is TIv4.1.5; Output format ELF (Coff gives errors, that program will not fit into mem). Nothing selected for optimization levels.
My code is as follows:
uint8_t len;
uint16_t timestamp;
uint16_t now;
LED_YELLOW_ON();
// get datalen
len = uart_rxGetByte();
// get data
timestamp = timer_getMS();
now = timer_getMS();
while(len && ((now - timestamp) < 5000)) // while further bytes outstanding or 1000ms gap
{
if(uart_rxCount())
{
buf[pos++] = uart_rxGetByte();
len--;
timestamp = timer_getMS();
}
now = timer_getMS();
}
if((now - timestamp) >= 1000)
{
continue; // if timeout ... return to while loop
}
What I can see is that variables len and timestamp are both located in Register R9.
Of course my program fails. Until I added this part all worked fine. So I thought I would have a stack overflow. Reduced some buffers and freed 50 Bytes of memory. Map file says, I still have space:
name origin length used unused attr fill
RAM 00000200 00000200 0000017c 00000084 RWIX
Can you halp me get the point please!?!?!?!