Finding configTOTAL_HEAP_SIZE Maximum Value

spflanze wrote on Tuesday, March 15, 2016:

I commented out code in void StartThreadUART_Rx() so that this was all that was left in effect:

void StartThreadUART_Rx(void const * argument)
{ for(;;){}
}

The instructions that caused the Bus Fault were not produced, and the thread ran normally.

I then brought back only the call to xQueueReceive() such that the code in effect was:

void StartThreadUART_Rx(void const * argument)
{ uint8_t rxchar;
    BaseType_t xQueueReceiveResult;
    for(;;)
    { xQueueReceiveResult = xQueueReceive( QueueUART_RxHandle, (void *)&rxchar, 10000 ), portMAX_DELAY );
    }
}

The assembly code that caused the Bus Fault returned.

Next I tried:

void StartThreadUART_Rx(void const * argument)
{ size_t len 
   for(;;)
   { len = strlen("test");
   }
}

The assembly code that caused the Bus Fault was not present. This ran normally.

Next I tried:

void StartThreadUART_Rx(void const * argument)
{ HAL_StatusTypeDef HAL_UART_DMAResumeStat; 
   for(;;)
   { HAL_UART_DMAResumeStat = HAL_UART_DMAResume( &huart2 );
   }
}

The Bus Fault causing assembly code returned.

There are certain function calls the cause the Bus Fault assembly code to be created.