Skip to main content
Visitor II
September 27, 2023
Question

STM32L451CET6 ThreadX: Hard Fault when Creating Tasks over 27KB

  • September 27, 2023
  • 2 replies
  • 1158 views

Using STM32L451CET6 and threadx I created multiple task and was running into hard fault on debugging found that from my 70KB byte pool when i created a task more than 27Kb it was running into hard fault again the usable memory is 160Kb out of which a partition exists between sram 1 and sram 2 which is of 128kb sram1 and rest sram2 Can anyone suggest why this is happening

Tried changing stack size of tasks, whenever they are under 27/28Kb they work perfectly. but when it is exceeding that limit,it runs into hardfault

    This topic has been closed for replies.

    2 replies

    Super User
    September 27, 2023

    Your task STACKS are over 27K bytes (or words)?  How many tasks do you have?  Disclaimer: I have only a little experience with AzureRTOS.  There should be some error function when its memory allocator runs out of memory.  If so, is that getting called?

    ST Employee
    October 26, 2023

    Hi @Hjain.1 ,

    Hope your are doing well.

    do you still have the problem?, if it is the case would you please share a project  reproducing the issue? 

    regards
    haithem.