• 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) » C6000 Single Core DSP » C67x Single Core DSP Forum » C672X Main Loop Halts Inside SDRAM Functions
Share
C6000 Single Core DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS

Forums

C672X Main Loop Halts Inside SDRAM Functions

This question is not answered
Chris Keung
Posted by Chris Keung
on Apr 16 2012 05:12 AM
Prodigy10 points

Hi,

 

I encountered main loop halting inside SDRAM functions when ISR is leaving less than certain time interval for main loop execution.

 

The Setup:
    TMS320C6727 DSP with SDRAM
    Program built with CCS v3.3
        Main loop (code section at internal RAM) with event-driven function calls (code section at SDRAM)
        ISR at constant frequency 16kHz

Test Conditions:
    The ISR processing is increased so that ~4us interval is left for main loop processing
        Before event happens, the main loop is still running
        (The unexpected behavior) When event happens, the main loop halts forever
        Interrupt Return Pointer (IRP) does not change at all. It indicates that the main loop halts in SDRAM function (by looking up the value in map file)
        (Tried several times) I stepped out of the SDRAM function back to internal RAM function using emulator and let it free-run. But main loop halts again in another SDRAM function
    The ISR processing is then reduced so that more than ~4us interval is left for main loop processing
        Main loop processing then resumes

Questions:
    When leaving less than certain time interval for main loop processing, why running the main loop internal-RAM function is ok but running the main loop SDRAM function causes the main loop to halt forever? (is it related to instruction fetch behavior?)
    How to setup the device to ensure the main loop will not halt forever under frequent and short main loop execution interval like above?

 

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Sam Kuzbary
    Posted by Sam Kuzbary
    on Apr 16 2012 13:42 PM
    Expert2655 points

    Greetings,

    Considering the C6727 architecture, if the Program Cache is disabled, then an application residing in external SDRAM will run a lot slower than in IRAM, and for that you need to ascertain that your Program Cache is enabled, then your SDRAM resident code will improve in performance.

    Next put some small Interrupt Threshold on the module that contain your main loop as well as any TI library linked in and used in your main loop.

    All this assume your SDRAM EMIF setup is correct and match your choice device.

    Good Luck,

    Sam

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • KK Szeto
    Posted by KK Szeto
    on Apr 23 2012 02:47 AM
    Prodigy20 points

    Hi,

    I tested that enabling instruction cache works (not tried further changing interrupt threshold value). Thank you very much.

    Can you further explain how instruction cache helps the program halt situation? Also why program halts without instruction cache enabled?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sam Kuzbary
    Posted by Sam Kuzbary
    on Apr 23 2012 12:20 PM
    Expert2655 points

    Greetings,

    Enabling the Program Cache aided your runtime to speed up enough your ISR and rectified the background loop process starvation on CPU cycle.

    Good Luck,

    Sam

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • KK Szeto
    Posted by KK Szeto
    on Apr 23 2012 20:19 PM
    Prodigy20 points

    Hi,

    I still cannot get how it works. So why background loop halts in SDRAM instruction if instruction cache is not enabled? (is it because if interrupt arrives at the middle of instruction execution, CPU will discard the instruction execution and serve the ISR? How to modify the behavior so that interrupts will not cause the CPU to discard the current instruction execution, assuming no disable interrupt?)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sam Kuzbary
    Posted by Sam Kuzbary
    on Apr 24 2012 07:54 AM
    Expert2655 points

    Greetings,

    Your use of "CPU Halt" when the error condition occur is too little details.  Aside from the error being remedied by enabling the Program Cache, go ahead and dis-able it, reproduce the error condition, then examine the following during the error

    1. Call Stack.

    2. Interrupt Enable.

    3. Local variables involved in your main background loop.

    4. May be data arrays used.

    5. SDRAM interface.

    6. Then when you are at such condition, attempt to singlw step the CPU and see what instructions are being fetched and from where.

    Doing the above may aid in explaining what happened when the ISR made the background freeze.

    Typically in such a run-time where ISRs are used in foreground and library functions are used in background, you will need to build with certain interrupt threshold to make the run-time work properly.  Having the Cache disabled surfaced the race condition that exhibit itself in no more ISR and the CPU is frozen.

    Good Luck,

    Sam

    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