Data Memory Usage with External SRAM

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

I recently inherited an older project and am trying to get it up and running again.  It is an ATxmega128A1  that has the external SRAM chip.  When I go to compile it says:

 

                error:         Program Memory Usage     :    124874 bytes   89.7 % Full
                Data Memory Usage         :    48588 bytes   593.1 % Full    (Memory Overflow)
                EEPROM Memory Usage     :    1765 bytes   86.2 % Full

 The project is old and is using an older ebi_driver.c Rev 479 from 2007-03-05.  However, if I modify the line from ATxmega128A1.atdf:

 

<memory-segment start="0x4000" size="0xBFFF" type="ram" rw="RW" exec="0" name="EXTERNAL_SRAM external="true"/>

And remove the 'external="true"' portion the program will build and run properly.

 

    Task "RunOutputFileVerifyTask"
                Program Memory Usage     :    124874 bytes   89.7 % Full
                Data Memory Usage         :    48588 bytes   84.7 % Full
                EEPROM Memory Usage     :    1765 bytes   86.2 % Full

 

I have the 'external ram check for memory overflow' option checked in my compiler settings.

 

Do I need to modify the 'SRAM segment' under memory settings?  Currently it is blank.

 

 

This topic has a solution.
Last Edited: Wed. Aug 7, 2019 - 03:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Everything seems to be working properly after I edit the atdf file.

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

From the current atdf :

<?xml version="1.0" encoding="UTF-8"?><avr-tools-device-file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:NumHelper="NumHelper" xmlns:xalan="http://xml.apache.org/xalan" xsi:noNamespaceSchemaLocation="../../schema/avr_tools_device_file.xsd" schema-version="0.3"><variants>
    <variant ordercode="ATXMEGA128A1-AU" package="TQFP100" speedmax="32000000" tempmax="0" tempmin="0" vccmax="3.6" vccmin="1.6"/>
    <variant ordercode="ATXMEGA128A1-CU" package="CBGA100" speedmax="32000000" tempmax="0" tempmin="0" vccmax="3.6" vccmin="1.6"/>
  </variants><devices>
    <device name="ATxmega128A1" architecture="AVR8_XMEGA" family="AVR XMEGA">
      <address-spaces>
      ...
        <address-space name="data" id="data" start="0x0000" size="0x1000000" endianness="little">
          <memory-segment start="0x0000" size="0x1000" type="io" rw="RW" exec="0" name="IO"/>
          <memory-segment start="0x1000" size="0x0800" type="eeprom" rw="RW" exec="0" name="MAPPED_EEPROM"/>
          <memory-segment start="0x2000" size="0x2000" type="ram" rw="RW" exec="0" name="INTERNAL_SRAM"/>
          <memory-segment start="0x4000" size="0xBFFF" type="ram" rw="RW" exec="0" name="EXTERNAL_SRAM" external="true"/>
        </address-space>
        ...

via

Atmel Packs

[XMEGAA]

...

1.1.68 (2017-02-16) Generate enums for status/configuration registers according to AVR-1000.

...

1.0.39 Fix issues with legacy headers for non-U devices. Add external SRAM to list of address spaces.

...

 

Attachment(s): 

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

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

If I use the current atdf file, I can not get my code to properly compile

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

bbtb wrote:
I can not get my code to properly compile
What errors?

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

                error:         Program Memory Usage     :    124874 bytes   89.7 % Full
                Data Memory Usage         :    48588 bytes   593.1 % Full    (Memory Overflow)
                EEPROM Memory Usage     :    1765 bytes   86.2 % Full

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

incorrect (v1 pack instead of current v2 pack)

 

From the current atdf :

<?xml version="1.0" encoding="UTF-8"?><avr-tools-device-file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:NumHelper="NumHelper" xmlns:xalan="http://xml.apache.org/xalan" xsi:noNamespaceSchemaLocation="../../schema/avr_tools_device_file.xsd" schema-version="0.3"><variants>
    <variant ordercode="ATXMEGA128A1-AU" package="TQFP100" speedmax="32000000" tempmax="0" tempmin="0" vccmax="3.6" vccmin="1.6"/>
    <variant ordercode="ATXMEGA128A1-CU" package="CBGA100" speedmax="32000000" tempmax="0" tempmin="0" vccmax="3.6" vccmin="1.6"/>
  </variants><devices>
    <device name="ATxmega128A1" architecture="AVR8_XMEGA" family="AVR XMEGA">
      <address-spaces>
        <address-space name="prog" id="prog" start="0x0000" size="0x22000" endianness="little">
          <memory-segment start="0x0000" size="0x20000" type="flash" rw="RW" exec="1" name="APP_SECTION" pagesize="512"/>
          <memory-segment start="0x1E000" size="0x2000" type="flash" rw="RW" exec="1" name="APPTABLE_SECTION" pagesize="512"/>
          <memory-segment start="0x20000" size="0x2000" type="flash" rw="RW" exec="1" name="BOOT_SECTION" pagesize="512"/>
        </address-space>
        <address-space name="data" id="data" start="0x0000" size="0x1000000" endianness="little">
          <memory-segment start="0x0000" size="0x001000" type="io" rw="RW" exec="0" name="IO"/>
          <memory-segment start="0x1000" size="0x000800" type="eeprom" rw="RW" exec="0" name="MAPPED_EEPROM"/>
          <memory-segment start="0x2000" size="0x002000" type="ram" rw="RW" exec="0" name="INTERNAL_SRAM"/>
          <memory-segment start="0x4000" size="0xFFBFFF" type="ram" rw="RW" exec="0" name="EXTERNAL_SRAM" external="true"/>
        </address-space>

XMEGA has 24b data addressing; defective atdf has 16b.

via

Microchip Packs Repository

[XMEGAA]

...

2.0.3 (2019-01-24)

Fixed upper bound of external memory for EBI devices. Succeeds Atmel.XMEGAA_DFP 1.1.68.

with Thanks! to strontiumdog

https://www.avrfreaks.net/forum/attiny412-avr-gcc-porta-undeclared-first-use-function#comment-2742971

 

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

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

That looks like it might be a fix.  I can't seem to get the new pack installed.  If I download and install it with the pack manager and then uninstall the older version 1.1.68, I can not compile.  I get an error:

 

Firmware.cproj : error  : Error in adding components to project, Component Atmel:Device:Startup is Missing

 

I do not think atmel studio can see the new device pack.  If I manually extract it to 'C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\XMEGAA_DFP\2.0.6\' it is still broken.

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

It looks like when I import the pack to AS7 it saves it in 'C:\Program Files (x86)\Atmel\Studio\7.0\packs\microchip\XMEGAA_DFP\2.0.6\' and is not recognized by my project.