Getting Hardfault when creating a local variable and not getting Hardfault when making the same variable Global
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 2:35 AM
Hi,
Im using threadx, in that i have defined a task in which i initialize my external flash memory regions
i have a 116 byte structure which contains memory information
when i use this structure locally i get a never execute hardfault error where as when i move that variable to global i dont get hardfault
please note that the stack size of task is 6200 bytes
Attaching screenshots
- Labels:
-
STM32L4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 2:50 AM
@Hjain.1 wrote:please note that the stack size of task is 6200 bytes
So have you tried increasing that - by at least 116 bytes ... ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 2:51 AM
as you can see my stack is barely full only 2kb is used and yes i did try increasing it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-03 4:25 AM
What specifically is the nature of the Hard Fault, see registers, stack and instructions.
If not a stack overflow, perhaps corruption or modifying out of bounds.
Failure at return?
Use for a DMA or IT routine and losing scope?
Up vote any posts that you find helpful, it shows what's working..
