• 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 » F28035 Piccolo Flash Erase Crashes, Does Not Work
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

    F28035 Piccolo Flash Erase Crashes, Does Not Work

    This question is answered
    Bayer
    Posted by Bayer
    on Jun 08 2011 08:08 AM
    Prodigy40 points

    I am attempting to use the flash API to erase & write to flash memory from within my program during runtime. 

     

    I can succesfully write data to the flash. Here is the code I am using to write a number to the flash:

    status = Flash2803x_Program( (Uint16 *) 0x3F4000, &number , 1, &FlashStatus );
    if (status != 0) { TxString("Error programming flash!\n\r"); TxNumber(status); }

     

    However, I am not able to erase the flash. Here is the code I am trying to erase with:

    status = Flash2803x_Erase( SECTORG,&FlashStatus );
    if (status != 0) {  TxString("Error erasing flash!\n\r"); TxNumber(status); }

     

    When I call that erase code, it does not ever finish with the Flash2803x_Erase function, and so it does not spit out an erase status. When I call it, the program crashes and it seems memory is overwritten (all of my watch variables become 2989). In order to run the program again, I have to reprogram the chip. CCS reports the following when the chip crashes:

    Trouble Reading PC Register:
    Error 0x00000004/-1142
    Error during: Register, 
    Processor blocked debug accesses. An operation was attempted while the CPU was in a non-debuggable context. To continue to honor the debug context, press Cancel. To force debug access, press Rude Retry.

     

    Any suggestions?

    Thanks,
    Brandon 

     

    P.S. Below is some of my initialization code:

    #define SECTORA   (Uint16)0x0001
    #define SECTORB   (Uint16)0x0002
    #define SECTORC   (Uint16)0x0004
    #define SECTORD   (Uint16)0x0008
    #define SECTORE   (Uint16)0x0010
    #define SECTORF   (Uint16)0x0020
    #define SECTORG   (Uint16)0x0040
    #define SECTORH   (Uint16)0x0080

    #define SECTOR_F2803x (SECTORA|SECTORB|SECTORC|SECTORD|SECTORE|SECTORF|SECTORG|SECTORH)

    typedef struct {
    Uint16 *StartAddr;
    Uint16 *EndAddr;
    }SECTOR;


    #define OTP_START_ADDR  0x3D7800    
    #define OTP_END_ADDR    0x3D7C00 
    #define FLASH_END_ADDR    0x3F7FFF 
    #define FLASH_START_ADDR  0x3E8000


    SECTOR Sector[8]= {
    (Uint16 *) 0x3E8000,(Uint16 *) 0x3E9FFF,   /**< Contains the address of each sector of flash */
    (Uint16 *) 0x3EA000,(Uint16 *) 0x3EBFFF,
    (Uint16 *) 0x3EC000,(Uint16 *) 0x3EDFFF,
    (Uint16 *) 0x3EE000,(Uint16 *) 0x3EFFFF,
    (Uint16 *) 0x3F0000,(Uint16 *) 0x3F1FFF,
    (Uint16 *) 0x3F2000,(Uint16 *) 0x3F3FFF,
    (Uint16 *) 0x3F4000,(Uint16 *) 0x3F4002,
    (Uint16 *) 0x3F6000,(Uint16 *) 0x3F7F80,
    };

     

     

     

    TMS320F28035 28035 flash 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
    • Bayer
      Posted by Bayer
      on Jun 08 2011 10:48 AM
      Verified Answer
      Verified by Bayer
      Prodigy40 points

      Problem solved!

      Turns out that the sectors were defined wrong. I changed the definitions as seen below and it works like a charm:

      #define SECTORH   (Uint16)0x0001
      #define SECTORG   (Uint16)0x0002
      #define SECTORF   (Uint16)0x0004
      #define SECTORE   (Uint16)0x0008
      #define SECTORD   (Uint16)0x0010
      #define SECTORC   (Uint16)0x0020
      #define SECTORB   (Uint16)0x0040
      #define SECTORA   (Uint16)0x0080

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • jason wiseman
      Posted by jason wiseman
      on Apr 27 2012 09:34 AM
      Intellectual570 points

      Bayer,

      Are you saying that the sector definitions in the TI supplied headers are incorrect?

      The one you showed originally are the same as the TI headers.

      The changed definitions are in the reverse order.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vaishnavi Ramachandran
      Posted by Vaishnavi Ramachandran
      on Apr 27 2012 12:54 PM
      Intellectual1930 points

       Bayer

      You seem to be programming the 0x3F4000 which is Sector B ( refer data sheet for sector address definition)

      But the erase function you call is for Sector G.

      Please replace with correct Sector and this should solve the problem.

      The API example provides the correct sector definition.

       


      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.
    • jason wiseman
      Posted by jason wiseman
      on Apr 27 2012 15:52 PM
      Intellectual570 points

      Thanks Vaishnavi!

      That makes sense now.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Brandon Bayer
      Posted by Brandon Bayer
      on Apr 30 2012 07:50 AM
      Prodigy10 points

      I have reverted to the original headerfile definitions. I don't recall what was causing me to have to reverse the order.

      #define SECTORA (Uint16)0x0001
      #define SECTORB (Uint16)0x0002
      #define SECTORC (Uint16)0x0004
      #define SECTORD (Uint16)0x0008
      #define SECTORE (Uint16)0x0010
      #define SECTORF (Uint16)0x0020
      #define SECTORG (Uint16)0x0040
      #define SECTORH (Uint16)0x0080

      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