This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Erasing whole Flash before debugging the code

Hi everyone,

I am using LM4F232H5QC controller's evaluation board.

I am debugging with code red debugger and Red suite 4 debugging tool.

When I am downloading code on the board, It is overwriting code into flash locations.

Is there any way or any setting into the project that first erases the whole flash before downloading the code?

I am now using LM Flash programmer for complete erase flash. I Want it to be done automatically before debugging.

I want to erase the whole flash before downloading the code.

For freescale controller, they are having this facility in CodeWarrior.

Please help in this.

Regards,

Gunjan

  • Gunjan,

    I am not a Code Red user, but a quick google search turned up this page on programming the flash: http://support.code-red-tech.com/CodeRedWiki/GuiFlashProgramming.  I would try selecting the "Mass erase" option on the Program flash memory tab.

  • My experience in the past (a couple years ago) with Code Red was that it chose whether or not to erase the entire flash based on the size of your final executable, not on any project settings.  I wanted the opposite of what you need, I needed it to just erase what was necessary to download my code most of the time, and wanted to preserve a parameter section of the flash.  When my code went above a certain size (still less than 1/2 of the available flash in my part) Code Red decided to do the mass erase instead, when previously it had only erased the necessary pages.  

    When I contacted their support, they said that it makes the decision based on which it thinks will be the fastest, but that there was no way (at that time) for the user to override the behavior.

  • Hi John,

    Thanks for your reply.

    I have already installed that GUI flash programmer. And I often use it also. But I want to know that is there any setting in the red-suite 4 to erase the flash before debugging?

    Means when we press debug option in the red-suite, it should first erase the flash and after that it should download the code.

    please help if you know something.

    Regards,

    Gunjan

  • Hi Slandrum,

    Thanks for your reply.

    You are saying that it doesn't depend upon the project settings.

    Let me give you one example.

    I have downloaded a code which fits in a locations 0x0000 to 0x2000. Then I made some changes and then i downloaded which takes 0x0000 to 0x1500.

    But when i checked the memory locations while debugging in the red-suite,the other remaining locations(0x1500 to 0x2000) were having some data which was i think of previously downloaded code.

    I want to erase whole flash memory before every-time I download the new code for debugging. Is there any way?

    And I don't want to use LM flash programming GUI tool every-time.

    Please help me in this.

    Regards,

    Gunjan