• 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 » TMS570LS3137 Flash/EEPROM difficulties
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

TMS570LS3137 Flash/EEPROM difficulties

This question is not answered
Stefan Zuber
Posted by Stefan Zuber
on Apr 20 2012 03:28 AM
Prodigy85 points

Hi,

currently I am trying to access the Flash module of a TMS570LS3137ZWT. Therefore I use the F021 Flash API. Writing Banks 0 and 1 are working properly but I face difficulties when programming and erasing Bank 7. When checking the FSM status after a programming command I receive the PGV error-bit set. The code I use is copied from the F021 Flash API Reference Guide. RWAIT and EWAIT are set to 3 because I am working with a frequency of 160MHz. Any suggestions what might be wrong? What is actually meant when talking about HCLK frequency in the API Reference guide, the frequency the TMS570 is working at (160 MHz) or the frequency of the physical oscillator which generates the system frequency (I am using a 16Mhz quartz crystal)?

My second question is about the EEPROM emulation. I read in one of your documents the the emulation is only done in software via a specific EEPROM driver. Is this the F021 API or is there another library? If so where do I get it from? Does using the Flash Bank 7 for EEPROM emulation require any changes in the configuration of the flash registers compared with using it as 'normal' flash? I don't get this out of your documentation...

Thanks in advance!

Stefan

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 Apr 20 2012 11:34 AM
    Expert5245 points

    Hello Stefan,

    HCLK frequency is the frequency the system is running.  In your case it would be 160MHz..

    How are you setting the EWAIT value?  It is a locked register and you would either need to write to the FSM_WR_ENA register first to unlock the FSM registers for writing and then write the EWAIT value to EEPROM_CONFIG register to bit 19:16 or use the API function Fapi_writeEwaitValue().

    Flash EEPROM Emulation (FEE) driver is built on top of the F021 Flash API.  We are working on a TI FEE driver for this device and it should be available mid 3rd Quarter of this year.  There are no changes needed to the flash registers to support using a FEE driver.

    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.
  • Stefan Zuber
    Posted by Stefan Zuber
    on May 02 2012 02:58 AM
    Prodigy85 points

    Hi John,

    Thanks for your reply. Sorry for my delayed response but I was on vacation.

    To set EWAIT I am using Fapi_writeEwaitValue(). As far as I get it from the debugger this value is set properly. So just to figure out if I got everything correct: flash bank 7 can be used as 'normal' flash the same way as bank 0 and 1. There is no special treatment required to do so except setting the EEPROM_CONFIG register properly and the FAPI also sets up all the other registers correctly when calling its initialization function?!

    Regards,

    Stefan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Hall
    Posted by John Hall
    on May 02 2012 08:37 AM
    Expert5245 points

    Stefan,

    You are correct.  There is no special treatment required for bank 7 except for setting EWAIT.  The API will setup the registers correctly when you call Fapi_setActiveFlashBank() with Fapi_FlashBank7.

    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.
  • Stefan Zuber
    Posted by Stefan Zuber
    on May 03 2012 08:21 AM
    Prodigy85 points

    John,

    thanks for the reply. One other question came up: As stated in the documentation the flash bank width of the TMS570LS3137ZWT is 16 bytes (without ECC) and it is not possible to write over a flash bank width i.e. writing 14 bytes from address 0x4. But is it possible to write to a flash bank width twice, like writing bytes 0 to 5 first and bytes 6 to 15 on a second program command? If I do so I get the INVDAT bit set even tough bytes 6 to 15 are all 0xFFs?!?! Or to say it in other words: is it necessary to have the whole flash bank width erased (set to 0xFFs) when writing a single byte in it?

    Regards,

    Stefan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Hall
    Posted by John Hall
    on May 03 2012 14:14 PM
    Expert5245 points

    Stefan,

    It is possible to make multiple writes within a bank width.

    for bytes 0-5 Fapi_issueProgrammingCommand( (uint32 *) 0,  pDatabuffer, 6, 0,0,Fapi_DataOnly);

    for bytes 6-15 Fapi_issueProgrammingCommand( (uint32 *) 0x6,  pDatabuffer, 10, 0,0,Fapi_DataOnly);

    Now, if you were using the Fapi_AutoEccGeneration mode and tried the above calls, you would generate an INVDAT error, not on the main Flash, but on the ECC locations.

    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.
  • Stefan Zuber
    Posted by Stefan Zuber
    on May 07 2012 09:57 AM
    Prodigy85 points

    John, what is the PGV error bit in the FMSTAT register indicating? What can be wrong if this bit is set after a programming command? I received that error now for several times but cannot find the reason or a more detailed explanation for it in the documentation! Is there a more detailed documentation available for the F021 flash module and the respective API? The F021Flash API Reference Guide is not really explaining a lot... Regards Stefan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Stefan Zuber
    Posted by Stefan Zuber
    on May 08 2012 11:43 AM
    Prodigy85 points

    Hi John,


    I finally figured out what was wrong. I did not set EWAIT before calling Fapi_initializeAPI. This was only stated in the Reference Guide from version 1.51.0 from the F021 API so after updating, things got a little bit clearer because the documentation now includes more information.


    By the way: The Reference guide now tells you that you have to set EWAIT before calling Fapi_initializeAPI. The detailed information of Fapi_writeEwaitValue tells you that this function can only be called after the initialization was successful and to use FAPI_WRITE_LOCKED_FSM_REGISTER to set EWAIT. But now here is the problem: as far as I got it FAPI_WRITE_LOCKED_FSM_REGISTER uses a global variable (Fapi_GlobalInit) which is set to zero before initialization. So using FAPI_WRITE_LOCKED_FSM_REGISTER does not work either before initialization of the API. In my opinion, this is a mistake within the documentation! As a workaround I directly write to the respective registered for WR_ENA and EWAIT.


    Again I have another question: Is there a more detailed description of the flash wrapper and its FSM available? I am thinking of writing my own flash API because I need it for a certification project. Is it planned to to certify the F021? If yes, to which certification standard and which level?


    Regards,
    Stefan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Hall
    Posted by John Hall
    on May 10 2012 08:46 AM
    Expert5245 points

    Hello Stefan,

    Yes, there is the issue of needing to set EWAIT before Fapi_initializeAPI() is called or call the init function twice, once before setting EWAIT and after setting EWAIT.  I am looking into options to handle this differently in the next version of the API.

    We are in the process of updating the Flash chapter in the device Technical Reference Manual to include more information and I am working on an Application Note for Advanced Flash API Usage for program and erase that will document what is needed for the user to create their own optimized program and erase functions, but these will still not contain everything needed to fully replicate the Flash API.  We require the use of our released object library for setting up the Flash Memory Controller for program and erase operations for the Flash data retention specs in the device data sheet to be valid.  We are planning to follow the ISO 26262 process for the next release of the Flash API, v2.0.0.

    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.
  • Calum Mackinnon
    Posted by Calum Mackinnon
    on Oct 29 2012 18:54 PM
    Expert2790 points

    Hi John,

    You stated in your first post the following

    "Flash EEPROM Emulation (FEE) driver is built on top of the F021 Flash API.  We are working on a TI FEE driver for this device and it should be available mid 3rd Quarter of this year.  There are no changes needed to the flash registers to support using a FEE driver."

    My question is -

    Is this driver in the current version of the API (v1.51.0)?  If not, when will it become available?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • John Hall
    Posted by John Hall
    on Oct 30 2012 07:57 AM
    Expert5245 points

    Hi Calum,

    The FEE driver is not a part of the F021 Flash API distribution.  I have forwarded your question on when it will be available to the person responsible for its release and I will get back to you when I have more information.

    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.
  • Calum Mackinnon
    Posted by Calum Mackinnon
    on Nov 05 2012 22:18 PM
    Expert2790 points

    Thanks John - any update on when the driver will be available?

    Cheers

    Calum

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Prathap
    Posted by Prathap
    on Nov 06 2012 01:22 AM
    Expert6175 points

    Hi Calum,

    TI-FEE will be distributed along with HALCoGen from version 03.04.00, which is planned for End of December. Current HALCoGen version is 03.03.01.
    TI-FEE ( HALCoGen) and Flash API are two different releases. Both of them can be can be downloaded from http://www.ti.com/hercules

    Regards
    Prathap

    ~~~ If a post answers your question, please mark it with the"Verify Answer" button. ~~~

    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