A bug in AtmelStudio V6.1?

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

I have updated AtmelStudio V6.1 (build 2562).

However if I put a big structure (around 5M bytes) in bss_sdram, it will report a "Memory Overflow" error after compiling:
text data bss dec hex filename
114586 5899692 2129880 8144158 7c451e CommLink_v11.elf
Done executing task "RunCompilerTask".
Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files\Atmel\Atmel Studio 6.1\Extensions\Application\AvrGCC.dll".
Task "RunOutputFileVerifyTask"
CommLink_v11(0,0): Program Memory Usage : 6014278 bytes 1147.1 % Full (Memory Overflow)
Done executing task "RunOutputFileVerifyTask" -- FAILED.
Done building target "CoreBuild" in project "CommLink_v11.cproj" -- FAILED.
Done building project "CommLink_v11.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

This project has no problem if it is compiled by AtmelStudio V6.0.

Now I want to know if it is a critical error or just a warning?

Thanks.

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

Hmh, that sounds strange. Maybe avr-size disagrees with the placement :P

I assume you have checked the map etc, and verified that the data is indeed in the correct location? Also, it would help to get the full compile log (with diagnostic logging on, tools->options->MSBuild)...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

So I tried to update to the 6.1 version and got same kind of problem.

Finished building: .././usart.c
Building target: MicroCont-2013.elf
Invoking: AVR/GNU Linker : 3.4.2
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-gcc.exe" -o MicroCont-2013.elf Asmi.o diskio.o ff.o glcd.o hardware.o hexbin.o I2c.o inithw.o interrupts.o MicroCont.o OWfuncs.o tiimari.o usart.o -Wl,-Map="MicroCont-2013.map" -Wl,-u,vfprintf -Wl,--start-group -Wl,-lprintf_flt -Wl,-lscanf_min -Wl,-lm -Wl,--end-group -Wl,--gc-sections -Wl,-section-start=.data=0x801100 -Wl,-section-start=__heap_end=0x80ffff -mmcu=atmega128
Finished building target: MicroCont-2013.elf
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "MicroCont-2013.elf" "MicroCont-2013.hex"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "MicroCont-2013.elf" "MicroCont-2013.eep" || exit 0
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "MicroCont-2013.elf" > "MicroCont-2013.lss"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "MicroCont-2013.elf" "MicroCont-2013.srec"
"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin\avr-size.exe" "MicroCont-2013.elf"
text data bss dec hex filename
27718 1112 2985 31815 7c47 MicroCont-2013.elf
Done executing task "RunCompilerTask".
Task "RunOutputFileVerifyTask"
MicroCont-2013(0,0): Program Memory Usage : 28830 bytes 22,0 % Full
Data Memory Usage : 4097 bytes 100,0 % Full (Memory Overflow)
Done executing task "RunOutputFileVerifyTask" -- FAILED.
Done building target "CoreRebuild" in project "MicroCont-2013.cproj" -- FAILED.
Done building project "MicroCont-2013.cproj" -- FAILED.

Build FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

these sources builds on 6.0.1996 without any complains. I tried to copy toolchain settins from previous version, but seems that this never version dont understand that there could be an external memory on Atmega128. :cry:

So, what am i doing wrong?

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

Quote:

So, what am i doing wrong?

Well the error there seems pretty clear:

Data Memory Usage : 4097 bytes 100,0 % Full (Memory Overflow) 

The mega128 only has 4096 bytes of SRAM and you've used noe more.

Have a look at the map file (or use avr-nm) and find out what's eating all the RAM.

(what's more this is compile time allocation - you really need to be down at about 80% to allow for run time allocation/stack etc).

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

I have an external 64k memory connected to Atmega128 and with the 6.0 version the same source builds like this

text data bss dec hex filename
37076 1222 2993 41291 a14b MicroCont.elf
Done executing task "RunCompilerTask".
Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files (x86)\Atmel\Atmel Studio 6.0\Vs\Compiler.Task.dll".
Task "RunOutputFileVerifyTask"
Program Memory Usage : 38298 bytes 29,2 % Full
Data Memory Usage : 4215 bytes 6,5 % Full
Done executing task "RunOutputFileVerifyTask".
Done building target "CoreRebuild" in project "MicroCont.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "ReBuild" in file "C:\Program Files (x86)\Atmel\Atmel Studio 6.0\Vs\Avr.common.targets" from project "F:\AVR-Projects2012\AVR-Studio\MicroCont\MicroCont.cproj" (entry point):
Done building target "ReBuild" in project "MicroCont.cproj".
Done building project "MicroCont.cproj".

Build succeeded.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

I understand that the code wont fit in 4k of RAM. Thats why there is that external memory.

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

Yes but the utility that checks the .data usage in 6.1 does not know this.

There have been prior threads showing how to disable that utility - search them out!

EDIT something like this:

https://www.avrfreaks.net/index.p...

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

Note that the target file may not work between Studio releases...

I've poked mailtosarathy about that...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Ok. Thank You for your help.

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

Just to note that as far as I can see. What was edited in that Compiler.targets file (in the ..\vs\ directory) was that the lines:

(one under each of "CoreBuild" and "CoreRebuild") have simply been removed.

EDIT: after making a back up I just edited my copy of that file in AS6.1 then restarted Studio and rebuilt a project. It no longer invokes "OutputFileVerifyTask" any more - so the additional size checking stuff is not run.

I guess the ultimate solution here is for that size checking stuff to be some how configurable to be told either "RAM is bigger than you think" or "don't cause a fatal end to the build just because things look too big"

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

Quote:

I guess the ultimate solution here is for that size checking stuff to be some how configurable to be told either "RAM is bigger than you think" or "don't cause a fatal end to the build just because things look too big"

In my view it is a bit silly to fail the compilation if the size errors. However, mailtosarathy is the goto guy on the target system... He'll hopefully pop by when they wake up over in India :P

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

I suppose a .text=too big is always bound to be fatal and perhaps the .data=too big should only be considered allowable for AVR that have EXTMEM?

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

Sorry, looks like the initial implementation was to include Internal + external RAM memory for size calculation but there was a bug reported to use only Internal RAM So it has been updated. (For example in one case the external memory was not present but overflow was not detected because of internal+external RAM calculation)

I will revisit the issue, For now you can disable the size reporting https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=956469&highlight=#956469
Use the following simple command in the BuildEvents->post build to display the size

$(ToolchainDir)\avr-size.exe -C --mcu atmega128 "$(OutputDirectory)\$(OutputFileName)$(OutputFileExtension)"

:D

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

It makes a heck of a lot more sense to allow the user to set the amount of external memory (if any) they have attached in the project options.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

I have similar problem, i have external memory of 32K , But still i get the error.

But the same project compiles in one of the other PC with Studio 7 and it doesn't works with other,

 

Below is the Compilation output FYR,

 

------ Build started: Project: Inidigenous Mobile AFT, Configuration: Debug AVR ------
Build started.
Project "Inidigenous Mobile AFT.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\Divya­_1\Documents\Atmel Studio\7.0\Div-DevelopmentBranch\Inidigenous Mobile AFT\Inidigenous Mobile AFT.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
        make: Nothing to be done for 'all'.
    Done executing task "RunCompilerTask".
    Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunOutputFileVerifyTask"
Inidigenous Mobile AFT(0,0): error:         Program Memory Usage     :    211560 bytes   80.7 % Full
                Data Memory Usage         :    15351 bytes   187.4 % Full    (Memory Overflow)
    Done executing task "RunOutputFileVerifyTask" -- FAILED.
Done building target "CoreBuild" in project "Inidigenous Mobile AFT.cproj" -- FAILED.
Done building project "Inidigenous Mobile AFT.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

Rakshith

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

It's a 6YO thread! AS6 has been dead and buried for many years.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly