• 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 » Writing to NOR flash (external memory) using DMA
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
  • Forums

    Writing to NOR flash (external memory) using DMA

    This question has suggested answer(s)
    AV54983
    Posted by AV54983
    on Sep 06 2010 08:00 AM
    Intellectual300 points

    I am using Texas Instrument's USB stick for the TMS320C5515 processor and interfaced to this on the PCB is the NOR Spansion flash. The number on the flash is:
    S29AL032D70TF104
    002FF413K.

    Question: Is it possible to perform data buffer writes to the NOR flash (external memory) using Direct Memory Access (DMA) ? I am using the DMA 3 controller since only this can access external memory.

    When I execute the Chip Support Library (CSL) code and integrate the NOR_write code for writing data from internal memory to using DMA, I get the following system message:

    C55xx: Trouble Reading Memory Block at 0x400000 on Page 1 of Length 0x30: Error 0x80000002/-1143 Fatal Error during: Memory,  The memory at 0x00800000 continually indicated it was 'not ready' All memory operations currently in progress were aborted in order to regain control of the processor. This is considered a catastrophic event, but the debugger should  still be able to access memory and CPU registers. System state has been altered.  It is strongly advised that the processor should be reset before resuming execution, 

    Though I am trying the write to the external memory it gives me this Trouble Reading Memory message.

    (In this above mentioned USB stick, the NOR flash is external memory CS2 space. )

    Thus any insights and help regarding NOR flash writing using DMA will help.

    Thanks,

    AV.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • PedroGelabert
      Posted by PedroGelabert
      on Sep 07 2010 09:37 AM
      Intellectual1970 points

      Before using DMA, make sure that the EMIF is programmed properly. This is accomplished through the use of the following registers:

      Asynchronous Wait Cycle Configuration Register 1

      Asynchronous Wait Cycle Configuration Register 2

      Asynchronous CS2 Configuration Register 1

      Asynchronous CS2 Configuration Register 2

      These registers configure the EMIF's setup, strobe, hold, wait, and turn around time of each external access in terms of CPU clock cycles. It also sets the data bus width for the corresponding chip select. Once these are configured to match the timings of your NOR, the DMA should be able to read and write to NOR.

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AV54983
      Posted by AV54983
      on Sep 10 2010 06:09 AM
      Intellectual300 points

      Pedro,

      I am configuring the registers you mentioned as follows:

          /* Config EMIF - ASYNC-Wait Config Registers */
          EMIF_AWCCR1      = 0x00FF;  // to set the MEWC field to maximum 0xFF;
          EMIF_AWCCR2      = 0x00E4;  // bits 8 to 15 still remain non-zero

          EMIF_ACS2CR1    |= 0x000D;  // Asynchronous data bus 16-bit width and
                                                               // and Minimum turn-around time set to max 3.    


          EMIF_ACS2CR2    |= 0x4000;  // bit 14 is tried to be set to '1' in order to enable the Extended wait cycles

                                                               // however bit 14 does not become '1' after this instr.

      I do not know what other bits to set. I am referring to "SPRUGU6–March 2010 External Memory Interface (EMIF)"  document.

       

      When I execute the code, only every eighth  word is correctly written to external  NOR flash as is illustrated below:

      Please note that for the present I only want to get the writing to NOR flash via DAM to be done perfectly.

      Also the buffer that I am using to send the external memory is:

      00A0   0005  00A0 0007  00A0 0009 00A0 000B 00A0 000D 00A0 000F 00A0 0011  00A0 0013 00A0 0015 00A0 0017 ....

      The NOR flash is then reset to all FFFFs as:

      FFFF  FFFF  FFFF  FFFF  FFFF  FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF ...

      And the data that is transferred to the external NOR using DMA is :

      FFFF  0005  FFFF  FFFF FFFF FFFF FFFF FFFF FFFF 000D  FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0015 FFFF FFFF

      Thus only every eighth word is transferred.

      Note that the buffer has 00A0 every alternate word since the NOR flash needs this to be able to write the next word.

      Thus please give me further hints and clues what to do since I need to be able to write to NOR flash using DMA.

      Thanks in advance.

      - AV

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pratap Reddy M V
      Posted by Pratap Reddy M V
      on Sep 10 2010 08:36 AM
      Expert1245 points

      Hi,

      Are you able to write to the NOR flash with out using DMA?. Are you sure that your flash needs only 00A0 for writing a word?. Most of the Spansion NOR flash chips require a specific command sequence(0xAA, 0x55, 0xA0) for programming a word. Please verify the NOR read and write operations with out using DMA to make sure that your EMIF and other configurations are fine. Then making the write operation work with DMA becomes easy. Check if your NOR flash supports command to write multiple words, this command is more suitable for DMA operation.

      Pratap. 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AV54983
      Posted by AV54983
      on Sep 10 2010 12:35 PM
      Intellectual300 points

      Yes I am able to read and write to NOR flash without DMA.

      I am also able to read from NOR flash with DMA.

      Writing to NOR flash with DMA is the issue. Pratap, Have you ever been able to do it ?

      There is a Unlock Bypass Mode wherein after you unlock the NOR flash then it is only required to send 00A0 before every word to be written.

      Regds,

      - AV.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Sep 13 2010 17:38 PM
      Genius12695 points

      Hi,

       

      As answered to your email, DMA to NOR can not be done that simple. When DMA starts, it keeps writing to NOR and it's checking the writing finished.

      Can you tell me why you want to use DMA write to NOR?

      Regards,

      Hyun 

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

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

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AV54983
      Posted by AV54983
      on Sep 14 2010 00:22 AM
      Suggested Answer
      Intellectual300 points

      Hi Hyun et al,

      It is nice to get your prompt reply.

      I want to be able to write to NOR flash using DMA to be able to record voice samples while the DSP is doing some processing.

      Now based on your reply I am trying to use the SD card to achieve my goal. Hope to interact and correspond with you for the same.

      Thanks and Regards,

      - AV.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Sep 14 2010 11:51 AM
      Suggested Answer
      Genius12695 points

      Hi,

      I'll do my best to resolve your issues.

      Regards,

      Hyun

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

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

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AV54983
      Posted by AV54983
      on Sep 23 2010 00:35 AM
      Intellectual300 points

      Pedro,

      As mentioned by you, part of programming the EMIF porperly is to configure the Asynchronous CS2 Configuration Register 2.

      Now this is an I/O register at location 0x001011. The MSB of this register cannot be edited by programming nor by View -> Memory and physically

       changing the value. If writing to the NOR flash using DMA is to be done then this has to be looked at and resolved.

      I am using the USB ezDSP stick 5515. Code composer studio Version: 4.1.3.00038 and Code Generation Tool 4.3.5.


      Thanks and regards,

      AV.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pratap Reddy M V
      Posted by Pratap Reddy M V
      on Sep 23 2010 02:17 AM
      Expert1245 points

      Hi,

      Please check the configuration of "EMIF System Control Register (ESCR) [1C33h]" in your program.

      You need to set this register to word access to allow the CPU to access 16 bits of the EMIF registers.

      Pratap.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • AV54983
      Posted by AV54983
      on Sep 25 2010 03:27 AM
      Intellectual300 points

      Pratap,

      Thanks for your solution.

      However the bigger problem does remain, that is, still I am not able to write data to the external NOR flash using DMA.

      Only every eight word is getting stored.

      Regds,

      AV

      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