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.

关于MSP430F2274, 程序中所定义的数组过大的解决方法。

Other Parts Discussed in Thread: MSP430F2274

我定义了一个5KByte的字符型数组unsigned char pic4[ ], 编译之后显示如图下所示。

我就增大了Stack/heap 的数值 如下图所示。

但还是不够, 有什么别的方法可以解决这个问题呢。

BTW, MSP430F2274是32K+256B Flash Memory /  1KB RAM

  • 楼主,你好,

         1K的RAM里面肯定是放不下5K的数组的.这个数组中的值在运行中需要改写吗?可以尝试方到flash里面。

  • Whisper CHEN,

    是的,5KB数据是放不在1KB RAM中的,建议将其发在Flash中。方法如下:

    How to allocate variable in specified address in CCS and IAR

    1. For CCS

    MEMORY

    {

    FLASH_DATA              : origin = 0xF000, length = 0x0FE0

    }

    SECTIONS

    {

       HISTORY_DATA : {} >FLASH_DATA

    }

    #pragma DATA_SECTION(g_history_data, "HISTORY_DATA")

    UInt16 g_history_data[HISTORY_LENGTH];

    2. For IAR

    __no_init UInt16 g_history_data[HISTORY_LENGTH] @ 0xF000;

    此地址自己变。