RAM sections appear in Intel Hex File

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I wonder if someone can help me out. I have got an ATXMEGA128A1 with external SRAM (0x4000-0xFFFF). I tried to port the project from WINAVR to AS6.1. The program runs and nearly everything is fine, but why do these EXTRAM sections appear in the Intel Hex File (filled with 00)?

Here is my linker call:
avr-gcc.exe -o MyAs6Port.elf main.o aaa.o bbb.o ccc.o -Wl,-s -Wl,-Map="MyAs6Port.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mrelax -Wl,-section-start=.extram1=0x804000 -Wl,-section-start=.extram2=0x80432d -Wl,-section-start=.buffextram=0x80b000 -mmcu=atxmega128a1

Excerpt from my intel hex file:
:0200000400807A
:1040000000000000000000000000000000000000B0

Why does it fill the RAM address 0x804000 with zeros?

Here is the variable array which is located at 0x80400:

static uint8_t temp_buf[BUFSIZE_MUX_TX] __attribute__ ((section (".extram1")));
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ce wrote:
but why do these EXTRAM sections appear in the Intel Hex File (filled with 00)?
Most likely because of your objcopy command which creates the Hex file.
(presumably using -R options and forgot to add .extram1 to them)

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good hint. Thanks a lot. The problem is that the AS6.1 generates an Intel Hex File automatically if I put a hook on ".hex (Generate hex file) in the project setting (common). In this case it calls automatically avr-objcopy.exe, but I cannot configure its parameters.

I removed this hook and placed a Post Build Event to generate the hex file instead.

Thanks again!