Debygger stacks

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Debygger stacks

958件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sojiro on Tue Jul 06 06:42:26 MST 2010
I can build my code but i cannot run it
It stacks within HardFault_Handler( )

The VECTPC register shows "0x0 (0) g_plnVectors in section .text"
But what is this?

I appreciate any support
Thanks

Original Attachment has been moved to: 1100517_main.c.txt.zip

0 件の賞賛
返信
4 返答(返信)

918件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jul 08 03:24:01 MST 2010
A Debug build is typically bigger than a Release build as no optimisation is carried out on it. A debug build also typically uses more stack space.

You can sometimes reduce the size of a Debug build by checking that the linker option --gc-sections is enabled. Some example projects do not have this enabled, and depending upon which version of LPCXpresso IDE you are using, your own projects may also not have this enabled. But if you are using the latest LPCXpresso IDE (3.4) you should be able to enable it without encountering the debug issues that some users saw in earlier releases.  This may well reduce your RAM requirements by removing data that is not being used (as well as reducing flash requirements by removing unused code).

To enable --gc-sections, go to

Project Properties->C/C++ Build->Settings->MCU  Linker->Miscellaneous and add the option into the "Other options (-Xlinker [option])" box.

You can find more info on --gc-sections in the forum post:
http://knowledgebase.nxp.com/showpost.php?p=1721&postcount=15

Anyway, I suspect that your problem boils down to your data consuming almost all of your RAM, leaving none for the stack and heap. The above information may help you to avoid the problem with your Debug build, but as I said previously I would really need to see your map file and the linker scripts to comment further.

Regards,
CodeRedSupport
0 件の賞賛
返信

918件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sojiro on Thu Jul 08 03:03:25 MST 2010
I think i figured it out
First of all i made a mistake i wanted to write 8[B]K[/B]B of course and indeed my target is LPC1343

I just read this
"Note that Debug builds will be larger than Release builds"
Which CodeRedSupport wrote in another thread
So I can build successfully but because i am at 8KB limit when i try to debug it needs more RAM but there is no more RAM and it stacks

CodeRedSupport what do you think of it

PS
As i said i reduced the array and it works
0 件の賞賛
返信

918件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Jul 07 03:05:30 MST 2010
What part are you using? 8MB of RAM certainly sounds rather a lot!! For example an LPC1343 has 8KB of RAM.

Your 80x80 character array will consume 6KB of this - which does not leave very much space for other data, the stack and, potentially, the heap. I suggest looking at the .map file generated by the linker to see how much of your memory you are using.

If you need further help with this, I suggest posting your map file together with the linker script file(s) being used.

Regards,
CodeRedSupport
0 件の賞賛
返信

918件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sojiro on Wed Jul 07 01:48:13 MST 2010
i use an array
char array[80][80]
If i reduce it it works ok
But i use less than 8MB that RAM has
dunno what happens
still trying to figure out
0 件の賞賛
返信