ATmega128A ext. RAM; AS 6.2 to AS 7 Migration issues

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

Hello Freaks,

 

I use a project with ATmega128A with 32 kB external RAM. In atmel studio the external RAM is defined under Toolchain / Linker / Misc

-Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x807FFF

In atmel studio 6.2 it runs without problems. After migration the project to atmel studio 7 I got the following warning:

Warning: Memory Usage estimation may not be accurate if there are sections other than .text sections in ELF file    (Memory Overflow)

 

Output at Atmel Studio 6.2:

"C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1061\avr8-gnu-toolchain\bin\avr-size.exe" "Main.elf"
   text       data        bss        dec        hex    filename
  72344      16484       3668      92496      16950    Main.elf
Done executing task "RunCompilerTask".
Task "RunOutputFileVerifyTask"
    Program Memory Usage     :    88828 bytes   67,8 % Full
    Data Memory Usage         :    20152 bytes   30,9 % Full
Done executing task "RunOutputFileVerifyTask".

Output at Atmel Studio 7:

"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "Main.elf"
   text       data        bss        dec        hex    filename
  72442      16484       3668      92594      169b2    Main.elf
Done executing task "RunCompilerTask".
Task "RunOutputFileVerifyTask"
Main(0,0): error:         Program Memory Usage     :    88926 bytes   67,8 % Full
            Data Memory Usage         :    20152 bytes   492,0 % Full
Warning: Memory Usage estimation may not be accurate if there are sections other than .text sections in ELF file    (Memory Overflow)
Done executing task "RunOutputFileVerifyTask" -- FAILED.

What can I do?

 

Thanks, Paul

 

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

M_Weber wrote:
What can I do?
Just igrnoe the % display. In both cases the 20152 is accurately stated. It's how this is then converted to % display that is wrong - but that's just eye candy for those who can't do arithmetic in their head.

 

BTW the original 30.9% is surely wrong anyway? It doesn't take a genius to see that if 20152 represents 30.9% then this implies the total is 20152/.309 = 65,216 bytes but you said "32KB external". So how does that add up anyway?

 

ISTR an atmega128 has 4KB of RAM natively. If you add 32KB then you have 36KB in total so 20152 is actually 54.67% of all the available RAM.

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

Hi clawson,

 

The wrong percentage doesn't bother me. The problem is that the whole process ends with an error. This allows other errors/warnings to be easily overlooked.

 

    Done executing task "RunOutputFileVerifyTask" -- FAILED.
Done building target "CoreBuild" in project "Main.cproj" -- FAILED.
Done building project "Main.cproj" -- FAILED.

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

 

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

Oh I see. I seem to remember Morten from Atmel posting here previously with some way to disable the whole memory report thing - if it didn't run it could not throw an error ;-)

 

I've tried search/google but cannot immediately relocate that thread so you may need to wait for the US to wake up and Morten to read this.

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

M_Weber wrote:
What can I do?
wrt Atmel Studio 7, what device pack?

ATmega128A.atdf in 1.4.331 appears correct for "XRAM".

http://packs.download.atmel.com/#collapse-Atmel-ATmega-DFP-pdsc

 

"Dare to be naïve." - Buckminster Fuller

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

@gchapman

After an update to version 1.4.331 the problem persists.

 

 

I have found following Link.

 

Atmel Studio 6.1 has a new RunOutputFileVerifyTask task that fails the build when the binary exceeds memory limit of the target board. This is a very useful check but can be a pain on certain occasions. It is fairly easy to disable though. Edit the Compiler.targets file under [Atmel Studio 6.1 install folder]\vs and comment all elements where RunOutputFileVerifyTask appears, including UsingTask at the beginning.

In the file Compiler.targets I deleted the third line.

 

  <UsingTask TaskName="RunOutputFileVerifyTask" AssemblyFile="$(AVRSTUDIO_EXE_PATH)\Extensions\Application\AvrGCC.dll" />

After compiling I get the following error message:

    Done executing task "RunCompilerTask".
C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets(10,2): error: MSB4036: The "RunOutputFileVerifyTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.
Done building target "CoreBuild" in project "Main.cproj" -- FAILED.
Done building project "Main.cproj" -- FAILED.

The thing is that the tip for version 6.1 and not 7 is.

 

Someone else has an idea?

 

 

 

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

What's the Atmel Studio 7 version?

Atmel Studio 7.0 Release Note

[page 4]

Atmel Studio 7.0.1645

...

– AVRSV-7877: Devices with external SRAM fails to calculate available SRAM.

...

 

"Dare to be naïve." - Buckminster Fuller

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

gchapman wrote:
What's the Atmel Studio 7 version?

 

Atmel Studio 7.0.2389 7.0.2397

Freshly installed a few days ago.

 

Last Edited: Mon. Dec 2, 2019 - 12:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just tried cchanging compiler.tagets on my machine (needs Admin rights). Before a build showed:

------ Build started: Project: test, Configuration: Debug AVR ------
Build started.
Project "test.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 "D:\test\test\test.cproj" (target "Build" depends on it):
	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 8 --output-sync 
		make: Nothing to be done for 'all'.
	Done executing task "RunCompilerTask".
	Task "RunOutputFileVerifyTask"
				Program Memory Usage 	:	552 bytes   0.4 % Full
				Data Memory Usage 		:	0 bytes   0.0 % Full
				Warning: Memory Usage estimation may not be accurate if there are sections other than .text sections in ELF file
	Done executing task "RunOutputFileVerifyTask".
Done building target "CoreBuild" in project "test.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "D:\test\test\test.cproj" (entry point):
Done building target "Build" in project "test.cproj".
Done building project "test.cproj".

After (which included stopping, starting AS7 because MSVS caches .targets as I know to my cost previously!) it showed:

------ Build started: Project: test, Configuration: Debug AVR ------
Build started.
Project "test.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 "D:\test\test\test.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 8 --output-sync 
		make: Nothing to be done for 'all'.
	Done executing task "RunCompilerTask".
Done building target "CoreBuild" in project "test.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "D:\test\test\test.cproj" (entry point):
Done building target "Build" in project "test.cproj".
Done building project "test.cproj".

So the size test/display is, indeed, removed.

 

I took back up copy of Compiler.targets before I started (which I think you MUST do!) but after that about the only thing I changed was:

C:\Program Files (x86)\Atmel\Studio\7.0\Vs>git diff --no-index Compiler.targets.cjl Compiler.targets
diff --git a/Compiler.targets.cjl b/Compiler.targets
index a8e27ec..18fb9a6 100644
--- a/Compiler.targets.cjl
+++ b/Compiler.targets
@@ -8,7 +8,7 @@
        OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" GenerateHexFile="$(GenerateHexFile)" GenerateListFile="$(GenerateListFile)"
        GenerateEepFile="$(GenerateEepFile)" ForceReCompile="$(ForceReCompile)" Language="$(Language)" ToolchainFlavour="$(ToolchainFlavour)" ProjectReferences="@(ProjectReference)"/>

-       <RunOutputFileVerifyTask  Project = "$(MSBuildProjectName)" OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" AvrDevice = "$(avrdevice)" Configuration="$(Configuration)" Language="$(Language)" ToolchainName = "$(ToolchainName)" ToolchainFlavour="$(ToolchainFlavour)" Directory = "$(MSBuildProjectDirectory)" ToolchainSettings = "$(ToolchainSettings)"/>
+       <!--RunOutputFileVerifyTask  Project = "$(MSBuildProjectName)" OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" AvrDevice = "$(avrdevice)" Configuration="$(Configuration)" Language="$(Language)" ToolchainName = "$(ToolchainName)" ToolchainFlavour="$(ToolchainFlavour)" Directory = "$(MSBuildProjectDirectory)" ToolchainSettings = "$(ToolchainSettings)"/-->
   </Target>

   <Target Name="Clean">
@@ -24,7 +24,7 @@
        OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" GenerateHexFile="$(GenerateHexFile)" GenerateListFile="$(GenerateListFile)"
        GenerateEepFile="$(GenerateEepFile)" Language="$(Language)" ToolchainFlavour="$(ToolchainFlavour)" ProjectReferences="@(ProjectReference)"/>

-       <RunOutputFileVerifyTask Project = "$(MSBuildProjectName)" OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" AvrDevice = "$(avrdevice)" Configuration="$(Configuration)" Language="$(Language)" ToolchainName = "$(ToolchainName)" ToolchainFlavour="$(ToolchainFlavour)" Directory = "$(MSBuildProjectDirectory)" />
+       <!--RunOutputFileVerifyTask Project = "$(MSBuildProjectName)" OutputType="$(OutputType)" OutputFileName="$(OutputFileName)"  OutputFileExtension="$(OutputFileExtension)" AvrDevice = "$(avrdevice)" Configuration="$(Configuration)" Language="$(Language)" ToolchainName = "$(ToolchainName)" ToolchainFlavour="$(ToolchainFlavour)" Directory = "$(MSBuildProjectDirectory)" /-->
        </Target>

  <Target Name="Compile">

C:\Program Files (x86)\Atmel\Studio\7.0\Vs>

In other words I just add "!--" to the start of the XML tag for RunOutputVerifyTask and "--" to the end which is the standard way of commenting lines in XML.

 

For reasons best known to Atmel the <RunOutputVerifyTask> entry appears TWICE in that XML file.

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

Hi clawson,

 

I have commented out the task "RunOutputFileVerifyTask" (2 times) in the file compiler.targets and it works (compile with no error). Thanks.

 

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


Under Project Properties / Toolchain / AVR/GNU Common / General there's a checkbox for 'External RAM check'... Does that help you?

:: 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

meolsen wrote:
Under Project Properties / Toolchain / AVR/GNU Common / General there's a checkbox for 'External RAM check'... Does that help you?

 

I had already tried this checkbox. It has no influence on the problem.

 

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

"Dare to be naïve." - Buckminster Fuller