• 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 » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » F021 Flash API Example Code
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    F021 Flash API Example Code

    This question has suggested answer(s)
    Mario Willeit
    Posted by Mario Willeit
    on Jan 09 2012 07:43 AM
    Prodigy550 points

    Hello,

    are there any code examples available how to use the F021 Flash API in Concerto ?

    I'm especially interested how to properly link the F021_API_CortexM3_LE.lib so that it can be copied to SRAM for execution
    and how to set/get the the correct load (SRAM) and store (Flash) addresses.

    Thank you in advance,
    Mario

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Vamsi Gudivada
      Posted by Vamsi Gudivada
      on Mar 14 2012 17:29 PM
      Intellectual2885 points

      Christian,

      When you try to program a Flash bit that is already programmed with a value of 0, Flash wrapper will not program it.  It will program only the bits that are still 1s to make them 0s.  So, you don't have to worry about wear and tear.      

      I need to check on the other question that you asked and I will try to reply you some time late next week.

      Thanks and regards,
      Vamsi

       

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Piergiovanni Bazzana
      Posted by Piergiovanni Bazzana
      on Apr 26 2012 09:43 AM
      Prodigy40 points

      Hello everybody,

      I am not able to erase the FLASH on the C28 either with the 75/150 MHz (M3/C28) and the 100/100 MHz (M3/C28),

      I used the code provided in the previous posts but if did not work.

      I am using the F021 Flash API ver 1.50, the F28M35x Control suite V110, and the compiler v6.0.2.

      By the way when calling the function, as in the example in this forum:

      Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, 2);

      I get an error since the prototype of the Fapi_issueAsyncCommandWithAddress  in the F021.h is

      extern Fapi_StatusType Fapi_issueAsyncCommandWithAddress(Fapi_FlashStateCommandsType oCommand, uint32 *pu32StartAddress);

      Using the address of a C28 FLASH segment (e.g.0x102000) doesn't work as well.

      Thank you.

      Piergiovanni

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Apr 26 2012 10:44 AM
      Genius14440 points

      Piergiovanni,

      Try updating controlSUITE to the latest version (v120) and try running the flash example that comes with this version.  This example has been verified to work correctly.

      Regards,

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Piergiovanni Bazzana
      Posted by Piergiovanni Bazzana
      on Apr 26 2012 15:43 PM
      Prodigy40 points

      Thank you Trey,

      I have updated the controlSUITE to the version v120.

      I have found examples of code running from Flash, but not about F28M35 flash erasing and reprogramming.

      Could you pls give hint about where I can find it?

      Is the F021 v 1.50 that I am using the good one?

      Thanks, Piergiovanni

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vamsi Gudivada
      Posted by Vamsi Gudivada
      on Apr 26 2012 17:07 PM
      Intellectual2885 points

      Piergiovanni,

      An example for F021 Flash API usage on master subsystem and control subsystem can be found in controlsuite at C:\TI\controlSUITE\libs\utilities\flash_api\f28m35x.

      F021 v1.50 is good to use.

      Thanks and regards,
      Vamsi

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Piergiovanni Bazzana
      Posted by Piergiovanni Bazzana
      on Apr 27 2012 04:47 AM
      Prodigy40 points

      Thank you Vamsi.

      The example works fine and I can start writing my code.

      Piergiovanni

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Piergiovanni Bazzana
      Posted by Piergiovanni Bazzana
      on May 04 2012 08:05 AM
      Prodigy40 points

      I have succesfully modified the example and I have been able to erase and write the FLASH correctly.

      Now what I want to do is dumping using the debugger API, the entire content of the FLAS and restore it later on (complete flash image).

      I want to do this becuase I want to be able to store a compete configuration including the code and the parameters for version maintenance and without using the CCS but only a light GUI developed for the user on top of the debugger API.

      Dumping and restoring the parameters sections only (sectors different from sector A) is OK, but when I erase and write the sector A (which contains the boot part at 0x13FFFF0) exactly with the previous content, then I have problems.

      I cannot program the Concerto again also using the CCS. The only way to gain the control of the Concerto again is to erase the sector A using my code and then gain access to the board using the CCS debugger to reload my application in FLASH.I have also tried to call the   "CsmUnlock();"   function before starting programming and after erasing sector A but without success.

      Could you please tell me how to dump a complete flash image and restore it correctly using the FLASH API?

      (by the way I did this succesfully when working with the Piccolo which in fact is quite similar to the control part of the Concerto).

      Thank you

         Piergiovanni

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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