Keil™, An ARM® Company

Technical Support

GCC: PROBLEMS WHEN CODE START IS 0X20 - 0X7FFF


Information in this article applies to:

  • GNU C Compiler for ARM Version 3.22

QUESTION

When I specify a starting address between 0x0020 and 0x8000, downloading code fails. How can I solve this problem?

ANSWER

This problem is caused by a GNU Linker error. Fortunately, there is a work-around. When code (.text) start in Project - Options - Linker is between 0x0020 and 0x7FFF, set the code origin in the Linker Script to 0. The linker will then produce a correct ELF file. For example, when the text start is specified as follows:

Project - Options - Linker - Text Start: 0x1000

The correct linker script should be:

MEMORY
  {
    CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x0001E000
    DATA (rw) : ORIGIN = 0x40000000, LENGTH = 0x00004000
  }

Also, you may need to add the option -N under Options for Target - Linker - Misc Controls.

Last Reviewed: Monday, July 10, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure