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.

Compiler/MSP430-GCC-OPENSOURCE: MSP430-GCC can't use memset for more than 4k arrays

Part Number: MSP430-GCC-OPENSOURCE
Other Parts Discussed in Thread: MSP430F5529,

Tool/software: TI C/C++ Compiler

Hi ,I'm using msp430f5529 with MSP430-GCC-OPENSOURCE on linux,when I try to memset a buf[4096] to 0,like this

#define BUFSIZE 2048
uint8_t buf[BUFSIZE];
int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

  memset(buf,0x00,sizeof(uint8_t)  * BUFSIZE);

the program will stuck before main function.when I debug I found the compiler will automatic memset before main,and if the BUFSIZE is too large(2048 is fine ,but 4096 can't work).

Why?