Problem with application size on xmega128a1

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

Hi,

as my project on a xmega128a1 has grown and also has a lot of debug messages (sent to minicom) I recently ran into a problem:
As soon as my program gets bigger than 65534 Bytes (0xFFFE Bytes) the program execution fails and the debug output gets messed up. There only appear a lot of "ÿ" (=0xFF) in minicom.
The output of avr-size is:

avr-size -C --mcu=atxmega128a1 main.elf
AVR Memory Usage
----------------
Device: atxmega128a1

Program:   65536 bytes (47.1% Full)
(.text + .data + .bootloader)

Data:       5033 bytes (61.4% Full)
(.data + .bss + .noinit)

I've first checked the XMega A1 data sheet on page 11: There it says the 128A1 has an application section from 0x0000-0xEFFF and an application table section from 0xF000-0xFFFF. However these addresses are words, not bytes.

So after that I've checked the memory window in AVR Studio. The program memory shows program data up to word address 0x7FFF. The rest is empty (0xFF, "ÿ").

Perhaps I'm missing something obvious here, but I'm stuck for some hours now. Any suggestions? :?

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

You have a 128K processor - you are only around the 64K mark - you are only half full. It should work.

Do you have a lot of PROGMEM data? Are you doing anything "odd" with sections in code flash? Have you heard of morepgmspace.h?

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

clawson wrote:
You have a 128K processor - you are only around the 64K mark - you are only half full. It should work.
Indeed ;) And that is what gave me headaches.

clawson wrote:
Do you have a lot of PROGMEM data?
Yes, all my debug output is stored in PROGMEM. I'm using the printf_P function with this macro:

#define printf_F(fmt, ...) printf_P(PSTR(fmt), ##__VA_ARGS__)

But also the first thing I've changed was to use printf instead of printf_P in this macro (to switch my debug output back to printf). No luck.

clawson wrote:
Are you doing anything "odd" with sections in code flash?
No, I did not do anything with sections.

clawson wrote:
Have you heard of morepgmspace.h?
Not yet :)

But I've just found the problem: Switching from avr-gcc 4.4.3 back to 4.3.4 solves the problem for me. I can activate all debug output which results in a 74650 bytes binary and it still works fine. Seems to be a GCC bug then.

Thanks anyway 8)

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

Quote:

Seems to be a GCC bug then.

Where did you get your GCC - please don't tell us that it was "AS5 beta 2"!!

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

I've compiled it from source with the Linux build script available here in the forum: http://www.avrfreaks.net/index.p...

I just forgot to switch back to the old one :D

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

Quote:

I've compiled it from source

Sounds like there's a strong chance that some important patch has not been applied.

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

The build script should fail if applying a patch fails and I don't see anything wrong in the build log.