This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STACK OVERFLOW

What stack size to put when using functions like fopen (in read mode) to prevent Hard Line Fault and overflowing the stack??

I tried by putting this

Stack EQU 0x00040000
It didn't work!

Parents
  • Since you didn't even specify a specific processor, memory resources or even an MCU architecture, I will assume you are working with C51 with an 8051 and no external RAM.

    A value of 0x00040000 is going to be a little bit too high.

Reply
  • Since you didn't even specify a specific processor, memory resources or even an MCU architecture, I will assume you are working with C51 with an 8051 and no external RAM.

    A value of 0x00040000 is going to be a little bit too high.

Children
  • Is it overflowing the stack, or are you passing in NULL or broken pointers. Helps to identify what's actually causing the hard fault, rather than fishing for reasons.

    The processor provides methods of identifying the location/cause, if you can move beyond a tight loop doing nothing.

    Does fopen() have any code behind it to do anything, or is it hitting a BKPT/SWI?