cancel
Showing results for 
Search instead for 
Did you mean: 

a reset in IAP, sp or ram or ...??

arge
Associate III
Posted on April 14, 2014 at 10:56

Hello everybody , I have a firmware which runs whose offset adress is 0x9000 and on stm32f105RC (256 KB Flash, 64K Ram). It is a iap sw that runs on stm32f205 I am trying it to run on stm32f105.

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x9000);

When it runs it without offset there is no problem it works fine on stm32f105.

NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0);

 

But with 0x9000 offset some resets (maybe hardfault I can't debug iap) in my uart function. In the my uart function there is several functions calls eachother with same pointer parameter. Resets on part of sw changes when I change or close some other functionalities. 

1) How can I solve if it is a stack overflow?

2) Why does offseted sw give proglem when zero offset sw works fine?

#iap-reset-stm32f105 #iap-hardfault
6 REPLIES 6
Posted on April 14, 2014 at 15:30

Why can't you debug the IAP code? Why can't you implement a Hard Fault Handler that provides you with some diagnostic information?

If the behaviour alters based on which vector table you point to, then you need to review what interrupts/faults your code may be generating, and determining if you are correctly servicing them all. How do the service routines differ between the two tables? The vector tables contain absolute addresses in memory, do these point to the correct routines? Was the code linked properly at the target address?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
arge
Associate III
Posted on April 14, 2014 at 16:25

arge
Associate III
Posted on April 14, 2014 at 16:36

I have to debug iap sw but it jumps the fw sw offset=0x9000. I am tried debug in iap but after it jumped fw i can't see any code to put breakpoint or smthng. But i can see all registers while running but not hardfault. maybe I should comment nvic_system_reset() to see the station.

-Linker is correct like nvic offset

-Correct me if I am wrong Ram is 63K, and last 1K is SP what if I think Ram is full and I want to allocate more space, Can I reduce SP space less than 1K?
chen
Associate II
Posted on April 14, 2014 at 18:19

Hi

''I am tried debug in iap but after it jumped fw i can't see any code to put breakpoint or smthng. But i can see all registers while running but not hardfault. maybe I should comment nvic_system_reset() to see the station.''

Once you jump to the application - you need to debug the application.

It sounds like the hardfault is caused by the application NOT the IAP

arge
Associate III
Posted on April 15, 2014 at 10:33

to be migrated, sourceId: 40745:697285D7-A9CA-445D-B16C-F23BF0E3B1A3

Posted on April 15, 2014 at 18:02

It's more indicative that the compiler/linker is generating bad code.

You want to examine the output code, and the service routines in the vector table, and see where it's going.

You should be able to define the app as a free-standing block of code, with it's own vector table and base address. Examine the .MAP and .LD files to be sure you know where it's putting everything.

Have a proper Hard Fault routine, and have it and other code output diagnostic information via a USART or SWV channel.

Doubt it's the stack, a stack placed at the top of memory is going to have plenty of space to descend, even if that is through your heap and statics.

How much are you using the stack, what kind of local/auto variable footprint does it have, and can't you just fill the stack space with a marker and monitor actual depth/utilization?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..