Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

stack, srt0.S and *.ld files in WinARM

2006-03-02 by Grzegorz Reszka

Hello,
  I`m newbie in ARM uC and I wanted to write in WinARM a simple  (transition of LED) programme on LPC2138. But during linking (when I  use RUN_MODE=ROM_RUN, that means LPC2138-ROM.ld file) it returns  following error:
  
  Linking: LED.elf
  arm-elf-gcc -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2  -DROM_RUN  -Os -Wall -Wcast-align -Wcast-qual -Wimplicit   -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow  -Wunused -Wa,-adhlns=crt0.lst   -MD -MP -MF .dep/LED.elf.d  crt0.o    LED.o      --output  LED.elf -nostartfiles -Wl,-Map=LED.map,--cref -lc  -lm -lc  -lgcc  -lstdc++ -TLPC2138-ROM.ld
  c:\winarm\bin\..\lib\gcc\arm-elf\4.0.2\..\..\..\..\arm-elf\bin\ld.exe:  address 0x600 of LED.elf section .stack is not within region RAM
  make.exe: *** [LED.elf] Error 1
  
  > Process Exit Code: 2
  > Time Taken: 00:02
  
  
  I don`t understand why it wants to use the 0x600 size stack whilst the  size of this stack is declared in LPC2138-ROM.ld file as 0x400:
  STACK_SIZE = 0x400;
  
  And when I change in Makefile RUN_MODE to RAM_RUN (LPC2138-RAM.ld file) I receive following message:
  
  Linking: LED.elf
  arm-elf-gcc -mthumb -mcpu=arm7tdmi-s -mthumb-interwork -I. -gdwarf-2  -DRAM_RUN  -Os -Wall -Wcast-align -Wcast-qual -Wimplicit   -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow  -Wunused -Wa,-adhlns=crt0.lst   -MD -MP -MF .dep/LED.elf.d  crt0.o    LED.o      --output  LED.elf -nostartfiles -Wl,-Map=LED.map,--cref -lc  -lm -lc  -lgcc  -lstdc++ -TLPC2138-RAM.ld
  crt0.o: In function `abort':D:\ARMprogramy\LED/crt0.S:215: undefined reference to `__bss_start'
  :D:\ARMprogramy\LED/crt0.S:215: undefined reference to `__bss_end__'
  :D:\ARMprogramy\LED/crt0.S:215: undefined reference to `__ctors_start__'
  :D:\ARMprogramy\LED/crt0.S:215: undefined reference to `__ctors_end__'
  make: *** [LED.elf] Error 1
  
  And also I don`t understand it - in line 215 of crt0.S is only this:
      b      .                          // loop until reset
  and it returns error about undefined refrence to: `__bss_start` , `__bss_end__' , etc.
  
  What should I do in this case? What should I change in my files which I attached to this message?
  
  More over: Could somebody explain me for what str0.S, RAM.ld and ROM.ld  files are needed exactly in ARM projects? Which parts of these files  are important?  When should I use RAM.ld and when ROM.ld files? By  the way could somebody give me those files which will be suitable for  LPC2138 uC?
  
  Thanks for every advice and response.
  
  Regards
  GR
  
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.