Added Bootloader Section, Now Global Vars Broken

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

Hi All,

Using ATmega128 with WinAVR and AVRStudio.

I created a section in the bootloader area of flash (0xFE00) with a subroutine that is used to modify some program memory space.

Problem is, now when I load the ELF file the .init code apparently can't copy global variable initial values from flash into RAM. The ELPM instruction always puts 0xFF into R0 rather than the actual value in flash. Using the HEX file seems to work better but still may have issues. Still looking into that.

My archive search yielded little, so I am wondering if anyone has encountered/solved this issue.

Thanks,
Jim

C: i = "told you so";

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

Ah I had this very same problem and reported it as an error to Atmel. They then fixed it in Service Pack 3. Does your AVR Studio say "build 490"? If not it's time to upgrade.

The problem appeared to be Studio's inability to handle a .ELF that contained more than just the usual .text and .data initialisation sections.

Cliff

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

Super! In fact I am not using 490. I'll give it a whirl, thanks Cliff.

Jim

C: i = "told you so";

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

I tried Build 490 and it works, problem eliminated....

C: i = "told you so";