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.

Loading program error on RM57

Other Parts Discussed in Thread: UNIFLASH

Hello.

I've developed my own RM57 board with CCS 6.0.1. It has worked until few hours ago..I changed some codes and build it, then I cannot write it to flash in RM57..I can't start debug mode.

Progress of loading program is stop in '0' when I push the debug button. It will be close soon and I can see a message as "Load program Error. File:C:\path\projectname\Debug\projectname.out: Load failed."

These are Console messages.

CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset

CortexR5: Flash operation timed out wating for the algorithm to complete. Operation cancelled.

CortexR5: GEL: File: C:\path\projectname\Debug\projectname.out: Load failed.

CortexR5: Trouble Removing Breakpoint with the Action "Remain Halted" at 0x8000080: (Error -1066 @ 0x8000080) unable to set/clear requested breakpoint. Verify that the breakpoint address is in valid memory. (Emulation package 5.1.507.2)

CortexR5: Unable to terminate memory download: NULL buffer pointer at 0x3a9f

CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset

 

I've tried latest version of my project operated well,  but there is a same problem.. I guess it is not a code problem..

I tested another board, it works well. So I thought it is just hardware problem.. but.. it happen again in this new board after debuggin it few times later. I guess it is related to use breakpoint because it works well before I set breakpoints. Is it wrong that starting debug mode remain some breakpoints?

  • Hello Wonjae,

      Can you at least connect to the target?

      Somehow your new code may have created some exception to the CPU that prevents flash loader from operation.

      I wonder if the exception is due to the MPU since you were having MPU setup issue in the other thread. So let's try to see if MPU is the problem. If you can connect to the target please try below :

      In CCS, go to Tools->ARM Advanced Features. Please uncheck the MPU enabled checkbox. Then go to Tools->On Chip Flash. In the Erase Options, first select "Entire Flash" checkbox. Then go the very bottom to hit the Erase Flash button..

      If you can successfully erase the flash then the next thing to do is to modify your HL_sys_intvecs.asm. In the HL_sys_intvecs.asm modify your reset vector to below:

    resetEntry

        b #-8   ;  _before it was b _c_int00

    Now reprogram your code again. Every time you power up it will be looping at the ResetEntry. You will need to manually move the program counter to the entry point at _c_int00(). You can then single step and hopefully eventually will come to the point where your new code which might have caused the problem you have.

  • Hello Charles,

    Thank you for reply. I found 'Entier Flash checkbox', but I can't find ARM Advanced Features and MPU enable check box. The 'tools' you said means 'Properties'?

    I've tired to find it in 'CCS menu - Project - Properties'. Could you explain it again?

  • Hi Wonjae,

      Please see below screenshot. In the menu under Tools, you should find ARM Advanced Features as the 4th sub-menu,  Click on it you will find various options to control the ARM. See the lower right corner of the screenshot where you will find the MPU Enable checkbox.

     

  • Hello Charles,

    I'm using CCS version 6.0.1.00040, there is no 'ARM advanced features' menu.

    There are Pin Connect, Port Connect, Save memory Load Memory, Fill Memory, RTOS Object View, RTOS Analyzer...etc. in my 'Tools' menu.

    What is wrong in my CCS?

     

  • Hi Wonjae,

      I will try to find out why your CCS does not display "ARM Advanced features" and get to you later. In the meantime, you can disable MPU via the CP15 CPU system control register. Please see below image. The bit 0 is to enable/disable the MPU. In debugger you can clear this bit to disable the MPU.

  • Hi Wonjae,

      I circle the "ARM Advanced Features" in the below screenshot. Can you tell me what you see under the Tools menu? You mentioned that you only see Pin Connect, Port Connect and etc. Do you even see Memory Map, GEL Files and On-chip Flash under the Tools? In my last reply, I also suggested another way to disable MPU.

  • Hello Charles,

    This is my Tools menu. Unfortunately it looks like different with you...

    Oh, I found why there are no menus like 'ARM Advanced Features'. The menus are appeared when debug mode is started nomarlly. But it cannot start debugging mode in my situation. Erasing flash and download *.out file is impossible. The error is occured in loading program process. So I cannot try it above alternative way as set register.

     

     

  • Hi Wonjae,

      this is what I'd like you to try.

    1. Short your Oscillator by shorting the  OSCIN to OSCOUT in your custom board. This will force the internal clock detection circuitry to detect an oscillator failure and automatically switch to an internal oscillator.

    2. Now try to connect to the target and let me know if you are able to connect this time.

    3. If you are able to connect then you can try what I suggested to disable the MPU. I will suggest to also disable the cache.

    4. Erase the flash.

    5. If step 3 does not help you to erase flash then try to perform the following steps.

    6. write 0xEAFFFFFE to memory location 0x08000000. This is a branch to itself instruction.

    7. In the CPU register window force the PC (program counter) to 0x08000000.

    8. Run the program to make sure that the CPU is now looping.

    9. Try to erase the flash again.

  • Hello Charles,

    Thank you for your detailed reply :)

    I've cleared this problem using uniflash, it can erase whole flash and then the CPU works normally. But this is not a solution for basic cause. I can use my board now. I will develop my s/w continuosly and check it if the same problem occured again.

     

  • Hi Wonjae,

      Glad that the problem is resolved. In case the problem occurs again you can try what I suggested. Also in your future code development, I will also suggest to change your reset vector to branch to itself instead of jumping to _cint00. Or you can add some code early in the program such that if a specific GIO pin is high then it will stay in a while loop or else it will continue in the normal flow. If some exception happens after the GIO pin setup that might have caused you not able to connect then you can assert the GIO pin into a state that can allow you to connect.

      You also have another post on the RM57 EMIF shown in below link. If this is also resolved can you please close the thread. Thanks.

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/369528.aspx

     

  • Hello Charles,

    I will try it your ways when it occurs again.

    It is not resolved EMIF problem yet. It was stopped because I can't download my project.. I will try to resolve the problem and then it will be closed. Thank you.

  • Wonjae,

    I'm having the same flash problem you had and could not erase the flash. I was not able to use uniflash to erase the RM57 flash - how did you do it?

    Ray