• 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 » Programming using Flash APIs
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

Programming using Flash APIs

Programming using Flash APIs

This question has suggested answer(s)
Hemchand
Posted by Hemchand
on Mar 17 2011 12:30 PM
Prodigy70 points

Hi,

I am working on boot loader development for Hardware having TM570LS20216. I have observed that time taken to erase the Flash contents is fine but the time taken fro Programming is too large. I am trying to write 2-9 sectors of Bank0 (0 and 1 sectors are allocated for my boot loader). upon debugging observed that control is remains for much time in Feed_Watchdog_V function.

Request to update me on:

1.Why Feed_Watchdog_V function is required

2.Probable reasons of Why Programming may take long time.

3. Will there be any improvement if HCLK is increased.

 

Please suggest as the time it is consuming to program is not acceptable for our use.

 

Thanks in avdvance,

Hemchand

 

Flash API
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 Mar 18 2011 07:33 AM
    Expert5525 points

    Hello Hemchand,

    Without knowing which API functions and sequence you are using to program the Flash, I could only speculate on why you are observing long programming times.  Due to the looping nature of some of the functions in the API and depending on the time those functions take, Feed_Watchdog_V() is called to service either the internal or an external watchdog timer.  If you do not need the watchdog to be feed, you can override the API function to be a null function.

    FClk which is the Flash Clock speed is based off of HClk.  Maximum FClk for the TMS570LS20216 device is 20MHz, so optimal HClk settings for flash performance can be calculated.  The formula is FCLK = HCLK / (RWAIT + 1).  Note: Pipeline mode does not support zero waitstates.  If RWAIT is 0, 1 waitstate is automatically added.

    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.
  • Hemchand
    Posted by Hemchand
    on Mar 19 2011 02:29 AM
    Prodigy70 points

    John,

    I am using pf035a_api.lib and function Flash_Prog_B to Program. Logic written reads every record from input .s37 file and programs the contents into Flash area by calling Flash_Prog_B. Request you to please share how can I override Feed_Watchdof_V(). Will be source code of pf035a_api.lib will be available for editing and compiling, so the I can override the contents to NULL.

    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 Mar 21 2011 06:36 AM
    Suggested Answer
    Expert5525 points

    The way to override Feed_Watchdog_V() is to compile your own version and override the library version at link time.  TI will only guarantee Flash programming when the TI supplied object library is used.

     

    The more tunable way to program is to use the Flash_Start_Prog_B().

     

    Psuedo Code

     

    setup_state_machine(<beginning address of bank to be programmed>,

                                                    <Flash Bank to be programmed>,

                                                    <Delay parameter from API document>,

                                                    <Base address of Flash Register>);

     

    for(x=0; x < [number of 32bit words to program]; x++)

    {

                    Flash_Start_Prog_B(<Address of data to be programmed>,

                                                                    <32 bit word to be programmed>,

                                                                    <Flash Bank of address to be programmed>,

                                                                    <Delay parameter from API document>,

                                                                    <Base address of Flash Register>);

                    while((result = Flash_Status_U16(<Base address of Flash Register>)) & 0x100) /* check for Ready/Busy status */

                    {

                    }

    }

    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.
  • Enrique Lizarraga
    Posted by Enrique Lizarraga
    on Nov 18 2011 12:15 PM
    Prodigy710 points

    Hello Hemchand:

    Could you confirm if the provided answer solved your questions?

    Regards

    Enrique.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Tom Cauchois
    Posted by Tom Cauchois
    on Jun 28 2012 17:06 PM
    Intellectual290 points

    Hi John,

    I'm using a system with a 100ms watchdog, and since Feed_Watchdog_V claims to be run every 200ms, this won't work for me.  I assume I can use the above code snippet with Flash_Start_{Prog, Erase, Compact}_B and put my watchdog code inside the while loop to be run periodically.  Is this the recommended course of action in my case?

    Is there any performance penalty to using this code instead of Flash_Prog_B?

    Thanks!

    Tom

    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 Jul 01 2012 11:57 AM
    Expert5525 points

    Tom,

    Yes, this would be my recommended course of action.  I would not expect a performance penalty and it gives you the capability to do other things like downloading the next set of data, service the watchdog on your own schedule, etc.

    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.
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