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.

MSP430G2102 Flash usage error in C programming with CCS v6

Other Parts Discussed in Thread: MSP430G2102, MSP430G2402

I'm trying to write code for communicate with rfm69hc rf module over spi and I've written some pin i/o functions I've programmed it with another mcus but they have more than 1 kb flash size.

When I insert rf initialization function to main linker gives error.

"../lnk_msp430g2102.cmd", line 95: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".text" size 0x4e8 . Available memory ranges:

FLASH size: 0x3e0 unused: 0x3a8 max hole: 0x3a8

error #10010: errors encountered during linking; "termo-ti.out" not built

How can I calculate my program size? Shoud I write with assambler the whole project?

  • In the <configuration name>\<project name>.map file you can see what space, for what and where, you are using. Try, if applicable, to reduce mixed library use for 8/16/32/64-bit operations.

    In CCS run the Optimizer Assistant.

    If you finally needs a few bytes more and have one or more Info segments left you can add them to .text.
  • Thanks. I'm going to try to write just main function and bit manipulations but I'm in doubt that the memory will enough for it too. Thanks again.
  • I've changed the microcontroller with msp430g2402 and it has 8kb flash memory (4k maybe 2k enough too but ti is giving samples just for g2402). But I've another problem now. These devices have got only one spi and just working 3-wire interface but there is no information about registers anywhere. In product page there is just one user manual and it's for 430x2xx devices. So UM has no field about USI registers and their contents. Where can I find this information? Because I've write two function one of initialization and the other send byte. But I can't get the correct value from slave device. My code;

    /*********** spi.c ***********/

    static volatile uint8_t firstSend = 0;

    void spiInit()
    {
    USICTL0 |= USISWRST;
    USICTL1 = USICKPH;
    USICKCTL = USISEL_2 | USIDIV_0;
    USICTL0 |= (USIPE7 | USIPE6 | USIPE5 | USIMST | USIOE);
    USISR = 0x0000;
    USICTL0 &= ~USISWRST;
    }

    uint8_t sendByte(uint8_t byte)
    {
    USISRL = byte;
    //if (firstSend = 0) // There is an errata on the product page it's saying first usage of spi is sent n + 1 bit at page 6...
    //{
    // USICNT = 7;
    // firstSend++;
    //}
    //else
    USICNT = 8;
    return USISRL;
    }


    I think I'm sending data over spi but can't receive any data. Getting always zero. Thanks...
  • Can you look at the new problem

**Attention** This is a public forum