possible bug in creating a memory segment

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

Hello,

The context is as follow:
By default, AVR puts code in the .text area and assigns this to flash.
Variables are put in .data and assigned to RAM. Eprom (given with the compiler directive) is allocated to .eeprom

EECV is a area (section) I've defined on my own. When linking, I allocate this to 0x810000 and put the default .eeprom section to 0x810028.

Those values are indicated in the project via Memory settings. EECV is indicated as EEPROM

The issue is with the HEX file. EECV is not removed from flash file, so the loader refuse to load the EECV section of the HEX file which is then out of range.

Solution: add -R .EECV in the ## Intel Hex file production flags section of make file

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

Thanks for this info!

I have the same problem, i need to remove a custom section from the flash hex file because studio complains it's too big to load.

I use the studio 6 makefile via gui so far. Unfortunatly i can't find the right input field where i could make the entry mentioned above. Maybe someone can point me to the right direction?
Or will i have to use a custom makefile to achive this?

Thanks for help.
Holger

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

The -R needs to be added to the avr-objcopy but I'm not sure how you'd achieve that through the IDE so may need to go in via the back door.

Not sure why they don't use -j rather than -R which would avoid ths?

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

Hi clawson,

many thanks. I was able to use the makefile generated by studio6 and then added the -R parameter and it finally worked.

If this is the only way to handle this i would qualify this as a studio bug and enter it into the bugtracker, if no one objects.

I also think that the studio should be able to detect if a custom section is outside the flash and remove it automatically.

Holger

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

holgerd wrote:
Hi clawson,

many thanks. I was able to use the makefile generated by studio6 and then added the -R parameter and it finally worked.

If this is the only way to handle this i would qualify this as a studio bug and enter it into the bugtracker, if no one objects.

Holger

For me the bug has been solved in AVRStudio5.1.
I don't have to change the make file any more. I have not tried the V6.0

Pierre

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

Quote:

I have not tried the V6.0

Not very wise. 5.1 is riddled with bugs. 6.0 is pretty stable.

@Holgerd, I would report this as a bug. I'm pretty sure that AS4 did add -R's when you used named sections so it looks like AS6 has lost this functionality.

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

I was about to post what i did just for someone to double-check before i report this as a bug. And just while doing this i discovered that i'm a bit too dumb for the AS6 :(
I did enter my section into the Linker memory section "Flash segment" instead of the much better "EEPROM segment...:roll:

Problem solved, many thanks for your comments!