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.

Run before click run button

Other Parts Discussed in Thread: AM3359

Hi

I am using AM3359 and XDS100V2 as JTAG debugger. All thing was perfect till I added some codes about GPMC. At this time when I load code into the processor via XDS100v2, the emulator does NOT go to "main," as is normal. It downloads, and looks like it the processor is running before I press RUN Button. I can halt, reset, and restart, but the result is not correct.

When I comment the new code everything is right. I am so confused. Please advise me.

thanks

Mohsen

  • Mohsen,

    There could be many scenarios that contribute to such behavior where the code does not reach main. There is C runtime initialization that happens before the jump to main, so something may be going wrong there or taking too long.

    Are you using a GEL file that does peripheral initialization etc for your board? If the hardware is not initialized properly or the code is causing something to run out of the control, that could cause it to not reach main. I am not a hardware expert but since you mentioned the only change was adding GPMC code I would make sure that if any relevant initialization needs to be done, that it is taken care of.

    You could disable the autorun to main, which will allow you to halt at the entry point _c_int00 (under menu Run --> Debug Configurations, select your configuration in the left pane, and  select the Target tab in the right pane. You should find it under Auto Run Options). Then you could step through the code to see where it might be getting stuck, however note that it may not be easy to debug C runtime initialization code and could be a long laborious task.  

  • Hi AartiG

    Yes I am using gel file but the point is: I have two board : beaglebone with embedded XDS100V2 and My customized board with external XDS100V2. my board is similar to Beaglebone. I have the problem with my board and when I load the same program on Beaglebone everything is OK! what is the source of error?

    Thanks

    Mohsen

  • Mohsen Taheri said:
    I have the problem with my board and when I load the same program on Beaglebone everything is OK!



    If the code runs fine on Beaglebone that verifies that the code and CCS software is not at fault. As I mentioned before there could be some required hardware initialization or configuration that is happening correctly on the Beaglebone but doesn't happen with your custom board. Unfortunately these types of symptoms do not point to a single cause or reason. All I can suggest at this point is to carefully inspect all hardware initialization, be it in code or GEL file. You can also try to further diagnose where it is getting locked up by de-selecting the option that runs automatically to main() and do a step-by-step execution of the startup code. That may reveal something more to help you diagnose the problem.