Ext. RAM appears 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 have got a problem with the use of external RAM. If I debug my code with the JTAG mkII everything (including ext. RAM access) works fine.

But feeding a programmer with the resulting hex file fails. AVR studio says "The contents of teh HEX file does not fit in the selected device".

A analysis of the hex file shows that the external RAM is filled up with 0x00 in it. Why does the RAM appear in the hex file?

Makefile extract (generated by AVRStudio 4.16 SP1):

LDFLAGS += -Wl,-section-start=.extram=0x804000

typical variable declaration:

static uint8_t flash_buf[BUFSIZE_MUX_TX] __attribute__ ((section (".extram")));

Does anyone has an idea what I am doing wrong?

(BTW: I am using an ATXMEGA128A1 with WinAVR-20090313)

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

I think you need to add a -R command line option to avr-objcopy to prevent it from putting the .extram memory section into the .hex file.

My experience was in reserving an area of internal ram on a more lowly processor, so I may be wrong.

Nigel Batten
www.batsocks.co.uk

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

Thanks, this works. I patched the makefile (which was generated by the AVRStudio) like this

HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature -R .extram

(I added '-R .extram')

Now it works. But this is only a patch. Can I configure the AVRStudio to enter this in the makefile?

EDIT: In this case it is maybe better to move this to the "AVR studio 4 forum".