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.

LONG Problem in TMS320C6416

Other Parts Discussed in Thread: TMS320C6416

Hi

I am currently working on a project for real time implementation on TMS320C6416 fixed point DSP processor. But when I run the code and input any .wav format file, in debug mode it works and generate the output file but when I put it off it stops working.. What is the problem? I won't understand. Please help me in this matter...

Is this with the LONG data type problem? If it is than why code runs in debug mode it must stuck during that also...

  • Welcome to the TI E2E Forums.

    Since your program works when you compile with the Debug configuration, can you just run it with that configuration? Do you require faster performance, or do you seek faster performance as a study project?

    What is the "LONG data type problem" that you mention?

    To debug this problem, you will use Code Composer Studio (CCS) to determine what part of the program is failing. Since it works in Debug (if I understand you correctly), then you have a good comparison to make between the working values (buffers, pointers, indexes, interrupts, etc.) and the non-working values.

    There are two things I can recommend you check for now:

    - Make sure you are using the latest tools. This includes the compiler and CCS.

    - Side-effect variables (set in an interrupt routine) and delay loops and may be optimized out. You can use the "volatile" keyword to instruct the compiler that a variable may be changed outside the scope of the current function.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • Hi

    Yes when I compile it and run it with debug configuration, it runs smoothly and give the output but when i put the debugger off, it haults in the beginning. My project is study based and I want faster performance and implement it on real time.

    LONG data type problem is that my code is using Long type. is this because of it because i don't think so 6416 processor support long data type which is 40 bit for this processor.

    [the code runs and after that when the output is generated. I put the debugger off and run the code, When I compile the code initially in debug mode and check each and every variables, it runs and generate the output. But if I do start this project initially without debugger it stucks in the beginning and won't run.]

  • Let me tell you its another behaviour. When I compile it initially in debug mode and check the values in every section of it it runs and generate the output file. After that I put the debugger off and again compile the code and run it, it runs and generate the output file.

    After that I restart the code composer studio and run the code without debugging it, it stucks in the beginning...

  • Waqas Ahmed said:
    when i put the debugger off, it halts in the beginning.

    Please explain more about the first part and the second part of this statement. I am not sure if you are talking about the Debug and Release Build Configurations or if you are talking about using the JTAG debugger through CCS and then taking the JTAG debugger off the board and trying to run it.

    Waqas Ahmed said:
    LONG data type problem is that my code is using Long type. is this because of it because i don't think so 6416 processor support long data type which is 40 bit for this processor.

    With my apologies, it is difficult to understand the concern. I cannot tell where the punctuation should separate the phrases in this sentence.

    But if the Compiler User's Guide for the C6416 says it supports the "long" data type of 40-bits, then it does. This may not be an efficient storage type, but it will still function correctly if the UG says it is supported for this processor.

    Waqas Ahmed said:
    After that I put the debugger off and again compile the code and run it, it runs and generate the output file.

    How do you run it if the debugger is not connected? How do you load the program and tell it to run?

    As you can tell, some step is slightly different between the cases where it runs and the case where it does not. Your precise steps may be needed to understand that difference. Perhaps the DSP is getting reset and does not get properly re-initialized by the GEL files?

    Regards,
    RandyP

    [Please do not use the Tag field for text entry. This field is intended for you to include keywords like C6416 so that others can quickly find your questions that may be related to theirs, and so that support people at TI can be notified when a certain tag is used.]

  • Hi

    The problem I am discussing of debugger is in build options. In the build options when I put on full symbolic debug the output is generated and when I use the build option no debug, it doesn't work. ok

  • What version of CCS are you using? Of Code Generation Tools (compiler, etc.)? What emulator are you using?

    Are you using BIOS? If so, which version?

    What are all of the compiler switches that you use in the working case and in the failing case? You can cut-and-paste from the Build Options window. The long string of -switches and arguments will be good; the check boxes and dialogs are not needed at this time.

    Waqas Ahmed said:
    Let me tell you its another behaviour. When I compile it initially in debug mode and check the values in every section of it it runs and generate the output file. After that I put the debugger off and again compile the code and run it, it runs and generate the output file.

    After that I restart the code composer studio and run the code without debugging it, it stucks in the beginning...

    When you compile, does CCS automatically load the program and run to main()?

    If you build with -g, load, run to main(), and then run, is it always successful? Or is it only successful if you also "check the values in every section"? If the checking is the only way to get it to work, please explain what you check.

    After you build with -g, load, run successfully, if you build without -g, load, and run, will it be successful over and over?

    What steps do you take to "restart the code composer studio" when the build without -g fails? There is a restart button or menu item, or you could be exiting from CCS and then opening CCS, or you could also be power cycling the board.

    This sequence of successes and fails implies an initialization step is missing. Since the build without -g can be successful and it can fail, the program and the build process would not be the aspects to examine because they are common to the pass and fail scenarios.

    Your answers will help to shed more light on the problem you are experiencing. Please excuse these requests for more information. It is the only way I know to help.

    Regards,
    RandyP

  • Hi let me clarify all the problems which i face.

    1. My code is working fine when I use full symbolic debug in the build options.

    2. When I use no debug in the build options my code stops working.

    3. What is the alternate solution for "long" data type ?

    Please help me in this regard

    Thanks

    Waqas

     

  • Hi

    My  version of CCS is 3.1 and emulator is DSK6416.

    1. When i use -g build option it always generate output whenever I run it.

    2. When i won't use -g build option the code haults immediatey.

    3. I restart by switching the board as well as code composer studio off and than restart.

     

  • Waqas Ahmed said:
    2. When I use no debug in the build options my code stops working

    This is confusing because you have also said that this build without -g will work if it is run immediately after running the build with -g. This is a vital detail, so please explain the different statements.

    Waqas Ahmed said:
    3. What is the alternate solution for "long" data type ?

    What problem do you have with the 40-bit long data type? It is a fixed-point data type with resolution of 40-bits, and it exists for backward compatibility with older C6000 devices. The more efficient fixed-point data types are the 32-bit int data type (native, very efficient) and the 64-bit long long data type. There are also short and char data types. Some of these might not be available, but I do not know which Compiler version you are using. Please look in your Compiler User's Guide for information on data types.

     

    Do you use internal memory only or do you also use external SDRAM? When the program fails, can you view and edit the external SDRAM?

     

    When you have time to address my other questions, please post those answers.

    At the top of your CCS Project Window will be a list of GEL files that are loaded. There is probably only one. What is its name?

    In the GEL file, there is a StartUp() function that will run every time you open CCS. There are other functions that may operate automatically when you load a program (OnFileLoaded), when you reset (OnReset), and when you restart (OnRestart), among others. Not all are implemented in every GEL file. Many will perform initialization steps that will affect the operation of the DSP.

    Regards,
    RandyP

     

  • Hi

    [quote user =" Randy P" This is confusing because you have also said that this build without -g will work if it is run immediately after running the build with -g. This is a vital detail, so please explain the different statements.

    About this, I just say this build without -g won't work and with -g work always.

    Do you use internal memory only or do you also use external SDRAM? When the program fails, can you view and edit the external SDRAM?

    we are only using IRAM (Internal RAM) and if we use external SDRAM, first problem that we face is speed because our aim is real time implementation and second problem is the same as with IRAM.

    At the top of your CCS Project Window will be a list of GEL files that are loaded. There is probably only one. What is its name?

    The name of GEL file is DSK5416.gel

    In the GEL file, there is a StartUp() function that will run every time you open CCS. There are other functions that may operate automatically when you load a program (OnFileLoaded), when you reset (OnReset), and when you restart (OnRestart), among others. Not all are implemented in every GEL file. Many will perform initialization steps that will affect the operation of the DSP.

    These all functions are present in gel file

  • hi

    this is the command file which i am using


    -l rts6400.lib

    MEMORY
    {
    IVECS: org=0h, len=0x220
    IRAM: org=0x00000220, len=0x00F3FDE0 /*internal memory*/
    SDRAM: org=0x80000000, len=0x00100000 /*external memory*/
    FLASH: org=0x90000000, len=0x00020000 /*flash memory*/
    }
    SECTIONS
    {
    .EXT_RAM :> SDRAM
    .vectors :> IVECS /*in vector file*/
    .text :> IRAM
    .bss :> IRAM
    .cinit :> IRAM
    .stack :> IRAM
    .sysmem :>IRAM
    .const :> IRAM
    .switch :> IRAM
    .far :> IRAM
    .cio :> IRAM
    .csldata :> IRAM
    }

  • Waqas Ahmed said:
    About this, I just say this build without -g won't work and with -g work always.

    [When you are writing a reply, you can highlight with the cursor a portion of the previous post above the edit window. If you click the red Quote link, the highlighted text will be inserted as a boxed quotation. It took me several months to find this useful feature.]

    I apologize for asking this again, but if this statement is a simplification to direct the conversation then it may invalidate the conversation. If you run successfully with -g and then build/load/run without -g but without exiting CCS and without power cycling the DSK, does that "no -g" build work?

    Waqas Ahmed said:
    The name of GEL file is DSK5416.gel

    May I assume this is a typo rather than using the wrong file?

     

    Since there are still many more questions outstanding, I will allow others to offer their advice when the work week resumes. Please post any additional answers or information that you think will be useful. And please post any debug results that you find as you work on this.

    Kind regards,
    RandyP

  •  

    I apologize for asking this again, but if this statement is a simplification to direct the conversation then it may invalidate the conversation. If you run successfully with -g and then build/load/run without -g but without exiting CCS and without power cycling the DSK, does that "no -g" build work?

    OK no problem. No when after with -g option, without -g and without exiting CCS, it does not work.

    Waqas Ahmed said:
    The name of GEL file is DSK5416.gel

    May I assume this is a typo rather than using the wrong file?

    Sorry the file is DSK6416.gel

    Regards

    Waqas

  • Hi

    sir i have got a solution to get, this is I think memory mapping problem. Can you please help me in choosing command file or linker file which is well suited for us. The command file which we are using is:

     

     

    -l rts6400.lib

     

    MEMORY

    {

    IVECS: org=0h, len=0x220

    IRAM: org=0x00000220, len=0x00F3FDE0 /*internal memory*/

    SDRAM: org=0x80000000, len=0x00100000 /*external memory*/

    FLASH: org=0x90000000, len=0x00020000 /*flash memory*/

    }

    SECTIONS

    {

    .EXT_RAM :> SDRAM

    .vectors :> IVECS /*in vector file*/

    .text :> IRAM

    .bss :> IRAM

    .cinit :> IRAM

    .stack :> IRAM

    .sysmem :> IRAM

    .const :> IRAM

    .switch :> IRAM

    .far :> IRAM

    .cio :> IRAM

    .csldata :> IRAM

    }

     

    What would be the alternate solution?????

     

    Thanks

    Regards

    Waqas Ahmad

  • Why do you think it is a memory mapping problem?
    Do you get warnings or errors in the build process or the load process?
    Do you use different linker command files for the -g and no -g builds?

    Your linker command file looks fine to my eyes. What would you like changed?

    Examine the linker .map output files for the -g and no -g builds and compare for differences. What do you find?

     

    There is not enough information to help you. There are many questions of mine that are left unanswered from previous replies in this thread. Some may lead to a solution and some may not. This Question & Answer process is the only way I can help you. We can accomplish remote debug, but I need your help.

    Regards,
    RandyP

  • Hi

    I have got the solution of my problem.. Its not the memory mapping problem not the long problem.. The problem was with the project file which is now resolved...

    Thanks for your time

     

    Regards

    Waqas Ahmed