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.

MSP432E401Y: FaultISR on Malloc()

Part Number: MSP432E401Y
Other Parts Discussed in Thread: TEST2

I am debugging an issue I am having with the http library. in HTTPClient_setHeader(), the method calls a malloc(), but blocks on that malloc and returns to the faultISR. I put 2 malloc's before I call this _setHeader() function, and it had the same fault on the second malloc. I am only calling malloc(1). What could be the problem here? Code is below, and the second malloc returns to the faultISR()

    char dateTime[20];
    char date[10];
    char* test = malloc(1);
    char* test2 = malloc(1);
    time_t t = time(NULL);
    struct tm tm = *gmtime(&t);

  • Hello Ryan,

    Are you sure about "char* test2 = malloc(1)" gives the Fault? Make sure that optimization is switched off to ensure that it is not the first one itself. Secondly when allocating a memory address to a pointer

    Also shouldn't it be

    char *test = malloc(1)

**Attention** This is a public forum