• 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 » Microcontrollers » Hercules™ Safety Microcontrollers » Hercules™ Safety Microcontrollers Forum » F021 EEPROM Writng problem
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

F021 EEPROM Writng problem

F021 EEPROM Writng problem

This question is not answered
Seongjin Jeong
Posted by Seongjin Jeong
on Jul 09 2012 19:14 PM
Prodigy185 points

Hi.

I'm using RM48L952ZWT.

I'm tring to write the sector 7. but, I failed.

It works good in RM48HDK board. but, My Rm48L952 board is not.

I post my source code. Could you check it?

I'm using CCS5.2.

#include "F021_FMC_LE.h"

    Fapi_StatusType oReturnCheck = Fapi_Status_Success;
    uint32 u32StartAddress = 0xF0200000U;
    uint8 au8MainDataBuffer[16] = {0x78, 0x17, 0x19, 0x2E, 0x0A, 0xB9, 0x11, 0x70, 0x5F, 0xC1, 0x9C, 0xFD, 0x54, 0x51, 0xED, 0x86};
    //uint32 u32Index;

     /*
                            Add device specific initialization here, including, but not limited to:
                            pll initialization, setting up RWAIT/EWAIT value, etc.

                            Assumes, unless otherwise noted, device has 144bit wide Flash Banks.
    */

    oReturnCheck = Fapi_writeEwaitValue(0x00040000);

    oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,80);  /* Example code is assuming operating frequency of 160 MHz */

    //oReturnCheck =  Fapi_doMarginRead((uint32 *)u32StartAddress, (uint32 *)ReplyBuffer, 16, Fapi_NormalRead);

    oReturnCheck = Fapi_doMarginReadByByte((uint8 *)u32StartAddress, (uint8 *)ReplyBuffer, 16, Fapi_NormalRead);

    if (ReplyBuffer[0] == 0xFF)
    {
        if((oReturnCheck == Fapi_Status_Success) && (Fapi_checkFsmForReady() != Fapi_Status_FsmBusy))
        {
      oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);


      if(oReturnCheck == Fapi_Status_Success)
      {
       oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32StartAddress,au8MainDataBuffer,16,0,0,Fapi_AutoEccGeneration);
      }

      /* Wait for FSM to finish */
      while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

        /* Check the FSM Status to see if there were no errors */
      if (Fapi_getFsmStatus() != 0)
      {
         /* Put Error handling code here */
      }
        }
    }

    oReturnCheck = Fapi_doMarginReadByByte((uint8 *)u32StartAddress, (uint8 *)ReplyBuffer, 16, Fapi_NormalRead);

 

Thank you.

Komeco/R&D dept

Seongjin Jeong

F021
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • John Hall
    Posted by John Hall
    on Jul 12 2012 16:36 PM
    Expert5235 points

    Hi Seongjin,

    There is an issue using Fapi_writeEwaitValue() before Fapi_initializeAPI() is called as Fapi_GlobalInit.m_poFlashControlRegisters pointer to the Flash memory controller has not been set.  Also, Fapi_initializeAPI() will store the current ewait value and if EWAIT is setup after this function, Fapi_setActiveFlashBank() will fail for Fapi_Error_InvalidHclkValue.  Additionally, the parameter passed to Fapi_writeEwaitValue() should only be the value you want to set EWAIT to, so you would pass 0x4 instead of the value your code shows.

    I would replace Fapi_writeEwaitValue() to the following:

        REGISTER(0xfff87288) = 0x00000005; /* enable writes to EWAIT register */
        REGISTER(0xfff872B8) = 0x00040002; /* EWAIT=4 */
        REGISTER(0xfff87288) = 0x00000002; /* disable writes to EWAIT register */

    John Hall

    Safety MCU Software Team

    If my reply answers your question please click on the green button "Verify Answer"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Jul 20 2012 09:30 AM
    Expert8985 points

    Seongji,

    Could you tell us the status on this thread? If your question has been answered, could you please mark it has "Verified Answer" so we can close this thread.

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    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