title: STM32 - RTOS - Max Stack Size
body: <p>I'm using STM32F103R8T6 with RTOS with 2 threads</p>
  
  <pre><code>osThreadDef(ManagerTask, ManagerThread, osPriorityNormal, 0, 128);
    ManagerTaskHandle = osThreadCreate(osThread(ManagerTask), NULL);
    osThreadDef(RFIDTask, RFIDThread, osPriorityNormal, 0, 256);
    RFIDTaskHandle = osThreadCreate(osThread(RFIDTask), NULL);
  </code></pre>
  
  <p>when i try to give the any thread a stack size of >512, neither of the tasks run, but when using 128 and 256 as the above example everything is fine.</p>
  
  <p>So how to i know the max total stack size that i can allocate for my threads ?</p>
  
  <p>in my RTOS Config</p>
  
  <pre><code>#define configMINIMAL_STACK_SIZE                 ((uint16_t)128)
  #define configTOTAL_HEAP_SIZE                    ((size_t)3072)
  </code></pre>