EmbDev.net

Forum: ARM programming with GCC/GNU tools lpc2368 stops running if the code grows


Author: Filipe (Guest)
Posted on:

Rate this post
0 useful
not useful
Anyone experienced a problem when the code are growing?
In my project i have some libraries included to use LCD and i'm trying 
to comunnicate with the SD card.
I'm using the LCD to debug and see where the code is getting error.
When i add LCD_write funcion to see the message in some part of the 
program the program stop to run, compile but not run anyomre in lpc2368. 
Seems to be a compiler problem.
Anyone knows how can i fix that?
I can send the code for analise.
I'm using yagarto with eclipse.

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Filipe wrote:
> Anyone experienced a problem when the code are growing?
> In my project i have some libraries included to use LCD and i'm trying
> to comunnicate with the SD card.
> I'm using the LCD to debug and see where the code is getting error.
> When i add LCD_write funcion to see the message in some part of the
> program the program stop to run, compile but not run anyomre in lpc2368.
> Seems to be a compiler problem.
> Anyone knows how can i fix that?
> I can send the code for analise.
> I'm using yagarto with eclipse.

I don't think it's a compiler-problem.

- Check if the program is transfered completly into the controller's 
memory (depends on the used tool, try with flashmagic/LPC bootloader 
first). If you are using OpenOCD, check if the needed pages are erased 
before flashing. OpenOCD also offers a verify command (or use gbd's 
compare-sections freature).

- Check the stack-settings: If the stack-size is configureable (stack 
starts somewhere in RAM but not at the top) inclease the execution stack 
size (size value is usually used in the instruction of the stack-inits 
sequence). Also check the stack-settings used in IRQ-Mode.

- If you are using dynamic memory (malloc et al). Check for 
heap-stack-collisions. Try to test without dynamic memory first

- Check the interrupt-setup and ISRs. Try to test without activating any 
interrupts if possible.

- Create a minimal example to reproduce the issue. I see that the 
"minimal" might be still large if you only see the problem when the code 
growth. But please try to minimize as much as possible.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.