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.

[C6713] Code works fine in emulation mode but not when boot from Flash

Other Parts Discussed in Thread: CCSTUDIO

Hello folks,

 

I am facing a strange problem these days. I am working on the development of a system that has to boot from Boot Flash. It is based on C6713 DSP with 256 MB SDRAM on CCStudio 3.0.  

The code works fine when i am executing it in emulation mode (using Spectrum Digital XDS510 usb emulator). But as soon as i convert the .out file to .hex file using hex conversion utility and transfer the code to Boot Flash. The system successfully boots on power reset but after some time the system resets. 

One possible reason be, EMIF timings may be the reason; In emulation mode, the timings are slow, so system works fine but when the system boot from flash, it resets. 

 

please do give me your ideas...

thanx

  • If you suspect the EMIF timings, then try recompiling the .OUT using a higher EMIF divider and maxing out the setup and hold times. You can also try using a higher PLL divider to slow the entire system down and see if it still resets.

    Jeff

  • Most of the time when there is a case of emulation mode works and bootload mode fails, the problem is that some initialization done in the GEL files is not done in the bootloader or in the bootloaded code.

    One way to check would be to remove the GEL file from the workspace or edit it to change the name of StartUp() and anything starting with On...(). For example, insert an x in front of the function name, xStartUp().

    If you then close CCS, power-cycle the board, open CCS, connect to your DSP, load the program using emulation, and it fails, you will know that something was needed from the GEL file.

  • I tried to slow the PLL, as you guys suggested. but still em not getting what em expacting. I can't understand why it works in emulation mode......

    all of you DSP gurus out there, plzz speak out.....help me in solving this problem !

    waiting...

  • Have you tried the other things we have already suggested above? Please reply back with those results to help us know how to help you. If the suggestions were not clear, please point out the items you need more information about.

  • Dear fellows,

    Here is the progress that i made.

    1. I wrote the initialization routine, that executes just after the system boots. In this routine, i initialize all my peripherals including PLL, emif and fpga. This way the initialization routine runs either we run from emulator or boot from flash. Therefore, the doubt about pll and emif timings removed !!!

    Now when i run the code, scenerio does not change. Now i did a little more change. I mapped the text section of code to SDRAM instead of IRAM. (Note that in previous case my code was on IRAM). In this new configuration, every thing works absolutely fine....just as expected....

    My code size is almost 90 K and em using following compiler switches.

    1. C run time autoinitialization

    2. Mem Model : Far Calls & agg data

    3. Speed most critical

    All of my code is written in C++ with extern calls. Please do give me some idea. I have discussed this issue with lot of people, none could give me any sound answer..... I have deadline by friday....plzzz help me asap!!!

  • Compiler switches: no -On optimization level selected?

    adnan khan said:
    In this new configuration, every thing works absolutely fine....just as expected....

    This seems to say you have everything working. I do not know what you need help with. Going back to your original post:

    adnan khan said:
    The system successfully boots on power reset but after some time the system resets.

    What does "after some time" mean?
    How long after successful boot-up does the reset occur?
    Do you observe successful system operation until the reset occurs?
    What system events occur around the time when the reset occurs?

  • Thank you RandyP for your quick Reply....i really appreciate it. I am expacting other gurus to do the same !!1

     

    RandyP said:

    Compiler switches: no -On optimization level selected?

    Yes. This option is selected.

     

    RandyP said:

    This seems to say you have everything working. I do not know what you need help with. 

    Actually my system starts up in a command loop, where it is expecting some commands to be recieved on serial port, At a particular command, the system switches to processing loop where it deals with heavy chunks of data, serial ports, timers, etc. Now my problem is that, when i put my .text section on SDRAM, nothing goes wrong. However, if i put .text section on IRAM, system works fine in the initial command loop, but as soon as it is switched to processing loop, something goes wrong, system resets and boot process start again, i.e. SYSTEM RESETS ( as I mentioned in my orignal post)

     

    RandyP said:

    What does "after some time" mean? 

    How long after successful boot-up does the reset occur?
    Do you observe successful system operation until the reset occurs?
    What system events occur around the time when the reset occurs?

     

    I hope i answer all of these questions in the above reply

    Regards

  • history said:

    RandyP: Compiler switches: no -On optimization level selected?

    adnan khan: Yes. This option is selected.

    Will you please list the compiler switches being used? Not in text descriptions, and you can leave off the -i or -include_path ones.

    Are you now at the point where you get the same behavior with emulation and with boot from Flash?

    If there is still a difference, meaning that .text in IRAM works okay with emulation, you need to continue to figure out what is different between the two. This means looking at all configuration registers that get setup in emulation and comparing them to the values after boot from flash.

    If there is not a difference, then you now have a debug situation. You can use emulation with breakpoints to narrow down the function call or line of code when the reset occurs. Then you may need to debug further back to find out what causes some pointer to get corrupted or some memory location to get corrupted.

  • I have made some improvements. The code now works but i am still unable to fully comprehend the logical reason for this. I therefore need ur suggestion on that. !!

     

    i was studying some of the help topics in the documentation related to linker command file. and i came to the following topic "Allocation Using Multiple Memory Ranges". From there i got this idea to put the section on iram or sdram like this :

    SECTIONS

    {

       .text  : { } > IRAM | SDRAM

    }

    After this change, my system started working. Mean that my code runs in boot mode from IRAM. (No reset Problem). One other thing that is noteworthy, my iram that is being used is 0x00024140 out of 0x0003fc00.

    As far as compiler switches are concerned. following are my linker switches 

    -b -c -h -m".\Debug\app.map" -o".\Debug\App.out" -w -x -j -priority

    Ur Comments are urgently needed.

     

  • Where did you find the topic "Allocation Using Multiple Memory Ranges"? I am not familiar with the syntax you show, "IRAM | SDRAM". You can point me to the document, page, section, and line, or else post to the compiler forum for their expertise. I will be happy if you point me to the info so I will be smarter, and I will try to help.

    You might also attach your linker .map file, perhaps with the .txt extension if there is a problem with the file type for an attachment. Or you can include it in a reply, but only the first two parts, not the global symbols which makes a very long file.

    Linker switches are not compiler switches. If you wish to list your compiler switches, please do.

    I am glad your system works. Congratulations! Good job, to make that happen! You have made many changes over the time of our discussion, so it may not be possible to determine why it failed and now works. But I will answer whatever I can answer.