• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » Big array consequences?
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Big array consequences?

    Big array consequences?

    This question is answered
    Robert Smith
    Posted by Robert Smith
    on Jul 31 2012 06:43 AM
    Intellectual620 points

    I develop application for the C5505 based custom board. I've defined big array of 65536 words (128 KBytes).

    #pragma DATA_SECTION( ".upgrade")

    Uint16 arrFirmwareImage[65536 ] ;

    I also defined memory section .upgrade via linker cmd file. I compiled and build application without any problems.

    However the application crashes whenever I try to write to arrFirmwareImage past array member 32768 i.e. to the second 64KB.

    Can anyone comment or provide any tip what are possible problems or consequences of defining of such big array?

    Thanks

    C5505
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Archaeologist
      Posted by Archaeologist
      on Jul 31 2012 08:26 AM
      Mastermind41565 points

      What memory model are you using?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Robert Smith
      Posted by Robert Smith
      on Jul 31 2012 08:28 AM
      Intellectual620 points

      I use large memory model.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Archaeologist
      Posted by Archaeologist
      on Jul 31 2012 09:00 AM
      Verified Answer
      Verified by Robert Smith
      Mastermind41565 points

      The short answer is that you should use huge memory model.

      The long answer is that using objects of size 32k to 64k is problematic in large memory model due to the size of ptrdiff_t, which is intimately tied into pointer arithmetic and array addressing.  If you're careful, you can probably use objects of up to 64k as long as you write the code in a particular way, but I don't have any documentation on how to do that, or what constructs to avoid.  This is a gray area for C5500, and I don't think there is anyone working on clarifying it.  If the performance of huge memory model is acceptable, you should use it.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brad Griffis
      Posted by Brad Griffis
      on Jul 31 2012 09:11 AM
      Guru57425 points

      FYI, for Laijin 2.x devices like 5502, 5503/6/7/9/ 5510 the only workaround is to cast the data to uint32_t, do the pointer arithmetic, and then cast back.  I have customers using this (inelegant) workaround in production:

      http://processors.wiki.ti.com/index.php/55x_FAQ#Why_can_I_not_correctly_move_data_that_spans_a_64K-word_boundary.3F

      I'm in complete agreement that for devices like 5505/5515 the MUCH better method is to simply make sure you're using huge memory model.

      ---------------------------------------------------------------------------------------------------------

      Please click the Verify Answer button on this post if it answers your question.
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Robert Smith
      Posted by Robert Smith
      on Jul 31 2012 09:39 AM
      Intellectual620 points

      Is there any performance consequences of using the huge memory model?

      Thanks

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Archaeologist
      Posted by Archaeologist
      on Jul 31 2012 09:44 AM
      Mastermind41565 points

      Huge model is only slightly less efficient than large model.  You're not likely to see a big difference unless you do a lot of manipulation of ptrdiff_t types.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use