Building "Production" ELF Files, EEPROM Problem

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

I am using Studio 6.2 (standard toolchain) to build "production" ELF Files.

Reference: http://www.atmel.com/webdoc/atme...

 

I have four sections in EEPROM that I am trying to embed in the .ELF File.

 

My settings/code:

 

 

The first three are being correctly programmed, but the eeprDataParams are not (see attached .txt = .eep file).  None of these "variables" are referenced anywhere else in the code.

 

Am I doing something wrong with the fourth EEPROM section?

Attachment(s): 

This topic has a solution.

Science is not consensus. Science is numbers.

Last Edited: Wed. Jul 15, 2015 - 02:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not combine all four sets of data into one struct then just put it in EEMEM (ie ".eeprom") then you wouldn't need any of this magic/jiggery-pokery.

 

BTW do you really mean 0xB00 ? That's a long way away from the rest of the data.

 

Oh and when the proj.eep is created do you have -j for all four named sections? My guess is that eehwParams is missing there.

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

Cliff - thanks for the reply.

 

For legacy reasons, I was trying to get it at those particular addresses -- hence the multiple sections.  If necessary, I can combine them, but I'd rather not.

 

I do mean 0xb00 -- again, for legacy reasons.

 

I'm not sure for your third point -- could you give a little more insight (regarding the -j)?  In AVS 4.18, I had my custom makefiles, with every flag manually set, etc.  In Atmel Studio 6.x, I have found it easier to just use the GUI.  Where/how would I add the flag that you are referencing?  I am not manually making the EEP file -- it is being built automatically when I rebuild the project.

 

Edit: looking in auto-generated Makefile, I found this:

 

"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom   -j .serialNumber  -j .modelNumberLen  -j .modelNumber  -j .eehwParams --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --change-section-lma .serialNumber=0x007 --change-section-lma .modelNumberLen=0x010 --change-section-lma .modelNumber=0x011 --change-section-lma .eehwParams=0xb00 --no-change-warnings -O ihex "foo.elf" "foo.eep" || exit 0

Science is not consensus. Science is numbers.

Last Edited: Tue. Jul 14, 2015 - 10:01 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

...Well that's frustrating.  Ended up simply being a missing space.

 

Science is not consensus. Science is numbers.

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

When you use "Other linker flags" doesn't the IDE auto-supply the -Wl, anyway? (I think it should - if they are linker flags then obviously they are -Wl,)

 

I'm guessing that you probably used "Memories" and in that case I think the IDE automatically generates the -j's I had thought might be the problem Clearly:

"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom   -j .serialNumber  -j .modelNumberLen  -j .modelNumber  -j .eehwParams --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --change-section-lma .serialNumber=0x007 --change-section-lma .modelNumberLen=0x010 --change-section-lma .modelNumber=0x011 --change-section-lma .eehwParams=0xb00 --no-change-warnings -O ihex "foo.elf" "foo.eep" || exit 0

is correct - so my guess was a bit of a pink kipper. (I see it even sets the LMA to 0xB00 correctly too).

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

I had to look up kipper -- didn't realize it was another name for herring...

 

I did use "Memories"

 

I believe the missing space was the result of a copy/paste error when I changed the name of the variable (accidentally deleted the space after the command).

Science is not consensus. Science is numbers.

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

I had to look up kipper 

What a sheltered life you 'mericans live! Have you never enjoyed the ultimate pleasure of an Arbroath Smokie then? I'm also a major fan of Craster Kippers that some would argue are the best in the world. (it's where you arrive with www.kipper.co.uk !). Nothing like smoked fish for breakfast.

 

Next you colonials will be telling me you don't enjoy the pleasure of kedgeree for breakfast either? I have my own kedgeree recipe - I like to believe it's the best in the world - not everyone likes 10,000+ scovilles for breakfast though!

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

I am very fond of Manx kippers. I buy them by the box. Royal Mail delivers within 24 hours. (Possibly because you do not want them too long in a mail van)