• 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 » Failed to erase flash
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

Failed to erase flash

This question is answered
J Yin
Posted by J Yin
on Apr 12 2012 09:41 AM
Intellectual275 points

Hi,

I am working on TMS570 20216. After tried to copy flash block from 0x00080000 to 0x00000000, the error occur:

CortexR4: Flash Programmer: Error initializing device.
CortexR4: Flash Programmer: Error erasing Flash memory.
CortexR4: Flash Programmer: Error erasing Bank 0, Sector 0. Operation Cancelled.
CortexR4: Trouble Writing Memory Block at 0x80000 on Page 0 of Length 0x8
CortexR4: GEL: File: C:\test.elf: Load failed.
I am using CCS5.1.1. 
I have read several threads about this problem in the forum but no one got verified answer. It seems that the flash was locked (from other threads) but I don't know how to check it and why it was locked. 
Where can I find something like CSM? I can't find it in On-Chip Flash. 
Anyone has any idea?
thanks
CCS Emulator JTAG 510USB JTAG Flash Programming TMS570LS20216
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • J Yin
    Posted by J Yin
    on Apr 13 2012 06:41 AM
    Intellectual275 points

    some words can't displayed in my last post: 

    It seems that the flash was locked (from other threads) but I don't know how to check it and why it was locked. 
    Where can I find something like CSM (code security module)? I can't find it in On-Chip Flash. 
    I only found CSM (command state machine) in reference manual, are they the same things?
    is there anyone could give me an idea of locking flash?
    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 Apr 16 2012 09:40 AM
    Prodigy710 points

    Hello:

    I'll check with our experts to get an answer for your problem.

    Regards,

    Enrique Lizarraga

    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 Apr 16 2012 13:12 PM
    Verified Answer
    Verified by J Yin
    Prodigy710 points

    Good afternoon:

    Could you try the following and let me know the outcome?

    1)      Try programming the flash using nowFlash instead of CCS and see if that works.

    2)      Try connecting in a step-by-step way instead of clicking on the “Debug Active Project” in CCS:

              -  Right click on the target configuration file (.ccxml) and launch configuration

              -  Reset the target

              -  Connect to the target

              -  Go to Tools->On-chip Flash and click on Erase to erase the flash

    Thank you,

    Enrique Lizarraga

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 17 2012 04:13 AM
    Intellectual275 points

    Hi, Enrique

    The second method does work.

    But it is strange because I have did this way before without "-Reset the target", it didn't work. I do "Reset the target" before connection this time, it works. Why?

    Thank you very much anyway.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 17 2012 09:08 AM
    Intellectual275 points

    Hi, Enrique

    It only works once!

    Now, the same problem occur and I can't erase flash in this way.

    By the way, I can't using nowFlash cause the process on a Jtag chain.

    I still want to know in what condition the flash can't be erased through Jtag?

    thanks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • AartiG
    Posted by AartiG
    on Apr 17 2012 14:08 PM
    Guru70435 points

    J Yin

    By the way, I can't using nowFlash cause the process on a Jtag chain.



    Based on this comment, I assume you are using a custom board and not a TMDX570LS20SMDK. Is that correct?


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

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 18 2012 04:00 AM
    Intellectual275 points

    Yes, I am using custom board.

    It always works find until I do copy data between the sections in the Flash. I did this kind of copy many times,

    most of them are successful, then the problem jumped out.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • AartiG
    Posted by AartiG
    on Apr 18 2012 10:24 AM
    Guru70435 points

    J Yin

    It always works find until I do copy data between the sections in the Flash. I did this kind of copy many times,

    most of them are successful, then the problem jumped out.

    Just to make sure I understand what you mean here, are you saying that your code copies some data between Flash sectors at runtime? And with this code you have been able to erase/reprogram the flash many times in the past, but the problem has started appearing recently? What I am trying to understand is if this error has always appeared when trying to erase/program the device or only started appearing in a particular situation, and if so, what is it that triggered it to start appearing.

    Can you also attach a screenshot of your Flash programmer settings (where you can set which sectors are to be erased etc)?

     


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

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 18 2012 11:34 AM
    Intellectual275 points

    Hi, you are right.

    I run the application on 0x00080000,  erase bootloader at 0x0 (bank 0, sector 0 to 3) and copy a new bootloader to that address. Then reset to run from 0x0.

    This function is under testing, so I have modified the bootloader, maybe copy in some unexpected data, but I can't remember any specific trigger for this error.

    I just thought that no matter what data was write (no matter where) in the flash, it should not forbid to erase flash through Jtag. am I right?

    thanks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • AartiG
    Posted by AartiG
    on Apr 18 2012 11:46 AM
    Guru70435 points

    Can you try changing the Erase options setting from "Necessary sector only" to "Entire Flash" and see if that helps?


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

    Search the wikis for common questions: CGT, BIOS,  CCSv3, CCSv4
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 23 2012 07:10 AM
    Intellectual275 points

    I have done this but same error messages.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J Yin
    Posted by J Yin
    on Apr 23 2012 07:12 AM
    Intellectual275 points

    I have done this but same error messages.

    thanks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ricky Lau
    Posted by Ricky Lau
    on Apr 25 2012 16:22 PM
    Intellectual2815 points

    Hi,

    Just to clarify, your TMS570 20216 does is not locked, as this device does not support CSM/password programming.

    But based on the initial error "Error initializing device.", it is having trouble with the Flash operation setup sequence. The error itself does not provide enough information on the cause of the problem though.

    Just for your information, the main functionality of the initializing sequence is to set up the clock settings/PLL value of the device; based on the crystal value, which I can see you have it at the default value of 16MHz. Another thing thing to note is that the Flash algorithm is perform on target RAM memory, so make sure that is available.

    Other suggestions to try:

    1. Power cycle the device, and make sure the device is in a good state before trying to erase again.

    2. Generate the Debug Server logs (more information here: http://processors.wiki.ti.com/index.php/Troubleshooting_CCS#Debug_Server_Logging) during the test case, which might provide us with more information on where exactly the code is failing, although it most cases, it still does not give us enough information for debugging purposes. Either way, it could be a good thing to try.

    Please let me know if you have any questions.

    Thanks,

    Ricky

    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