cancel
Showing results for 
Search instead for 
Did you mean: 

malloc hard fault with code offset

Barbie
Associate II
Posted on April 11, 2013 at 13:35

I have a problem with malloc when I move my FW to offset code location.

In the past I use malloc with no problem where my APP sit on 0x08000000, but now it make a hard fault in the middle of the malloc asm where my code start on 0x08010000.

I fail on the first time so it is not a lack of place.

1. What could be the reason  for hard fault during malloc?

2. Is the location of the code can influence this exception?

Bar.
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Barbie
Associate II
Posted on April 11, 2013 at 14:25

I do some more tests.

1. When I put the same code start on 0x08000000 it doesn't happend.

2. When I move it to location 0x08010000 I get the hard fualt with theis message:

Thu Apr 11, 2013 15:04:51: The stack pointer for stack 'CSTACK' (currently 0x20009630) is outside the stack range (0x200020F8 to 0x200024F8) .

I try to increase the stack and the heap but no help. So why the location of the code influance the stack or I forget to offset some parameters?

Regards

Bar.