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.

LM Flash Programmer Programming error 0x1

I am trying to flash an Stellaris LM4F-120XL with LM Flash Programmer Build 1460 in Windows 7 64 bit.

I am flashing the original qs-rgb.bin as descibed in Lab 2 of Getting Started with the Stelleris Launchpad Workshop (described too in StellaroisLaunchPadWorkshop.pdf).

When I try to flash I receive the error: **ERROR**: Programming error 0x1.

I have tried to change offset to 0x1000 as described in trying to solve this problem in another post. Same Error. Tried to run programmer as Admin with no result. Changed board to LM4F232 (as described as alternative in Workshop) and nothing.

When I program board with Code Composer Studio it works fine. I am not running CCS at the same time.

Part of the memory seems to have been flashed.

When I upload the contents of memory to a bin and compare with the qs-rgb.binIi find that it has stopped at 0x0800 and after this it has only FF till the end of memory.

If I upload the flash from a factory programmed board, try to reprogram with same bin I have uploaded  I have the same error and if  upload again and try to compare they are equal until 0x01000.

If I erase entire flash and check for blank it checks ok.

  • Airton,

    What are your  settings on the 'Configuration' tab of LM Flash Programmer?  Running LM Flash Programmer as an administrator isn't as important as installing it as an administrator.  Have you made any modifications to the board?

    Based on the information you have provided, the issue appears to isolated to LM Flash Programmer.  I recommend the following steps:

    1.)  Set your 'Configuration' exactly as shown below:

    2.) If you still have issues, slow the Speed (Hz) to 500000 and retry. 

    3.)  If you still have issues, do a jtag unlock found on the 'Other Utilities' tab.  Hold reset while powering on, and go through the steps as prompted after click unlock. (select blizzard for device)

    4.)  If none of the previous recommendations work, do a complete un-install of LM Flash Programmer and re-install.  When installing, run as an administrator.  

    I have seen issues in the past similar to yours, and have all been fixable following these four basic steps.  Please let me know your result.

    Lela 

  • Thanks for the tips. At first I was unsure how to reinstall an MSI as admin, but I opened a command prompt and I was able to install it.

    But none had any effect. I tried twice in each of two boards and nothing.

    I was willing to try in another computer, but first I tried to rebuild the bin from CCS. I built the project and flashed it from CCS.

    I was unable to generate the bin (copying the post build step from one example), then I uploaded from board the bin I had just flashed and flashed again with Flash Programmer. I used 8MHz.

    But then I works at any configuration and with any bin. When I tried in the other board with the original bin It failed. I just built and load the project from CCS and now it works too.

    On a third board it worked at the first time.

    I tried to flash with a bin I got uploaded from a factory set board and it fails. When I flash with the other bin it works.

    I will try to reproduce behavior in another computer anyway and make sure I have committed no mistake. You know what they say: when a trouble goes away alone, it comes back later with company. I don't like mysteries.

    Thanks again Lela.

    Airton

  • Airton,

    I'm a little confused. 

    When you use LM Flash Programmer to program a .bin generated by CCS is does not "work"? 

    But when you upload a binary and use LM Flash Programmer to program it back it does "work"? yes/no...

    Explain what you mean by work (or fail)?  i.e. Does LM Flash Programmer give an error?  The board doesn't respond as if the device is programmed? etc.

    Lela

  • Ok.

    After the failure (the one with the error **ERROR**: Programming error 0x1.)  I extracted the bin from the board (via Upload Flash Contents to a bin file in contents in LM Flash Programmer).

    The bin I extracted is larger because I uploaded the entire flash. But they differ before the end of the the smaller file.

    Then I extracted the entire flash from a factory programmed board and tried to flash it back to the first board. I got the same error. After the failed flash I extracted the content of the first board (via Upload Flash Contents to a bin file in contents in LM Flash Programmer).

    Comparing the bin I extracted after the first failure, the bin I extracted from a factory programed board and the one I extracted after the second failure the 3 are different.

    The initial parts are the same as the flash failed after the completion. The board after the failure is not responding, I think because  the flash was partially written.

    After building the original project (qs-rgb) and flashing the board via CCS. I always can flash the board with the original qs_rgb.bin with LM Flash programmer.

    If I try to flash (LM Flash programmer) the bin files I extracted after the failure one of them fails, but I still can program the original qs_rgb.bin (that comes with StellarisWare).

    I understand that:

    1. Is not a problem with the boards because after building and flashing the qs-rgb project I always can program with LM Flash Programmer, except with some bin files I extracted after the failure.

    2. Is not a problem with LM Flash Programmer, because after the first successful flash via building the project (not any project, but only the qs-rgb project after I put a post build step to generate the bin, but I always can build and flash any project via CCS, but not with LM Flash Programmer until I build this specific project qs-rgb with post build step to create the bin file).

    3. It seemed that the original qs-rgb.bin was somehow corrupted, and I recreated it without noticing (although the date on file is the original).

    I had no time to confirm all this in a second test, because I wanted to explain it better for you.

    I will post something more after some more tests. But what confuses me is:

    1. Why at first I could not flash any bin I tried with LM Flash programmer (always the same error **ERROR**: Programming error 0x1)?

    2. What happened that changed this situation (no change in configuration of the LM Flash Programmer)?

    3. Why some .bin  files I extracted from boards still not flash (same error)?

    I  am now just curious, as my problem was solved. And it was good because I explored the LM Flash Programmer way better than I would do in the workshops, but this still puzzles me.

    Thanks

  • Airton,

    Here's my theory of what happened...

    LM Flash Programmer is a very simple programming interface in that what it reports for errors and JTAG capabilities for interrupting, fault handling, and gaining bus control are limited. 

    From the time you power on your board, the CPU of the LM4Fxxx will start executing code.  Until you invoke the ICDI with LM Flash Programmer, it will not send JTAG commands.  Once ICDI is invoked, it will establish JTAG communication and then go through a process of sending dap commands.  If JTAG is unable to halt core or gain bus access during this process, LM Flash Programmer will give a connection error.   It will not attempt to reset the device or resolve any exception faults that prevent JTAG communication.  Sophisticated IDE's, such as CCS, Keil, IAR, etc...have much more complex JTAG communication routines.  I suspect, this is why you don't have an issue with CCS, but do with LM Flash Programmer.  The device going into a bus fault can cause LM Flash Programmer to appear inconsistent because the connection results can vary based the timing of the JTAG command versus the bus fault handling by the core.  

    For more best results in programming with LM Flash Programmer, start with blank flash.  Select Flash Utilities tab and do an Erase of Entire Flash.  If you get a connection error, then select Other Utilities tab to do a JTAG Unlock, and select blizzard, then click unlock.  Follow the prompts for holding external reset low while powering up, then power cycling.  JTAG unlock performs a mass erase, so you can go straight from this step back to programming.

    Lela

  • This thread solved my problem.. I was flashing from a Makefile and added the full erase line in front of my normal flash line and also added the 16MHZ speed parameter to the actual device load command line.

    ...inside of my 'make flash' target

    @lmflash --erase=all
    @lmflash --verify --reset --erase=all --frequency=16 ${COMPILER}/${TARGET}.bin
  • Dear David,

              Can you explain me what exactly you did to solve this 0x1 error in LM flash programming? Because I am also facing the same problem. So you please explain what you did and


    1. I don't understand the process of Debug Port UNLOCK (Other Utilities Option), kindly elaborate this process e.g. when to press Reset and reset of my application board or Reset Button of launchpad. Because I think I am doing these steps wrong and it increases my error occurrence.

    2.  As you explain

    "...inside of my 'make flash' target

    @lmflash --erase=all
    @lmflash --verify --reset --erase=all --frequency=16 ${COMPILER}/${TARGET}.bin   "

    where you did this change ? I checked my Make file in Debug folder but I can't find such lines over there.

    Kindly Reply

             

  • I've got the same problem: an error message from LM Flash Programmer when I tried to unlock the board. So I installed the Stellaris Driver on Windows and the LM Flash Programmer worked fine. Check it out. At Linux it's only needed the libusb-1.0 installed... The OpenOCD has an option called "stellaris recover", but I didn't try it. Type "info openocd" at terminal and search for "stellaris recover".

    Best regards