-1

task_create

tasks

rtos_config

debug

I am new at RTOS , created two tasks on stm32cubeide but i counter HardFault_Handler exception on debug . why could it be ? I have the need for your help . all of the file --> link thanks....

Asaemon
  • 1
  • 2
  • 3
    Please post code instead of images. And show where is the exception, or at least detail it a bit more. – Matthieu Jul 08 '21 at 20:59
  • 1
    I’m pretty sure that the (minimal) task stack size is too small mainly because printf is called, which is known to be quite stack hungry. Increase it (e.g. using > 500) and retry. And more important enable FreeRTOS stack overflow checking and configASSERT for development. – HS2 Jul 09 '21 at 07:49
  • https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html enjoy your Friday night ;) – Sorenp Jul 09 '21 at 18:49

1 Answers1

0

Normally this happened in RTOS because some task need more memory. Increase stack Size by editing your task.

enter image description here

If you add a lot of task or use more memory maybe you can overflow default total memory heap allocated in FreeRTOS. You can increase that in the Config Parameter tab. Remember, more memory allocated by FreeRTOS less free RAM memory.

enter image description here