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.

Code Composer Simulator vs real-time execution inconsitency/anomally ?!?

Other Parts Discussed in Thread: TLV320AIC3204

Hi,

I am stuck with a problem of executing some source code on our custom C5505 target board. This same source code functions as expected when simulated on the Code Composer v3.2 Simulator, verified with some input data files, and validating the correct output file etc. The same source code when compiled for a C5505, with the appropriate function interfaces to allow the input and output from and to the TLV320AIC3204 codec, does not work as expected.

The codec looped back with no signal processing at all works as expected (sound in, sound out), however when the signal processing blocks (compression/decompression) are inserted to treat the sound, the output is not as expected (in fact there is just some low level noise) ! The same signal processing function have been used and verified on the Simulator, which seems to suggests that somewhere in the process in shifting from the simulator, to a real DSP target, there has been some change to the resulting compiled code that results in the code no longer working as with the simulator.

I am sure to say the signal processing blocks do not require more than about 4ms of DSP time. The codec obtains the data through the DMA channel to play on the speakers every 80ms.

The original source code was intended for a C5509 DSP, however porting it to the C5505 should not be an issue. I just cannot seem to find out why the simulator simulates the source correctly, but the target does not produce the same result ?!? Is there something I am missing here when moving the code to the real C5505 target ??

Perhaps others have had similar issues with the simulators vs real-time execution ... Would greatly appreciate any thoughts on this and how perhaps to resolve the unexpected results.

Cheers, Mike

  • Mike,

    You say you are using CCSv3.2 simulator.  Which one (device, functional, cycle accurate)?  The C5505 is based on the v3.3 CPU.  Did you use that version of the simulator.  That could be one thing.

    When you use the codec loop through how are you determining that the signal passes through cleanly? 

    Hard to say what is the problem in your case, but peripheral operation and memory useage are the biggest areas where migrating from simulator to HW gets messed up.  In your case, since you say that signal path is working (codec loop back), I would look at the signal processing block(s) and passing the data to it.  If you use the same input signal on simulator and HW, does the signal processing block give you the same results?

    Regards.

  • Hi,

     

    Thanks for the reply. It was with the cycle accurate simulator, however I think I may have found the problem. It was probably simpler than expected, but will verify it tomorrow. Basically there are some functions word2byte() and byte2word() that are required when reading from and to the PC, when using the simulator, because of the 16-bit char on the C5505. These may screw-up the dmabuff[] & dmabuff2[] etc. when used on the real-target, as the target already has the data in short data types. Gotta verify it though, but its a good hunch ! Was thinking it has to do something with the pointer arithmetic. I guess it got me the 16-bit char (not the norm), and also I notice the int type is 16-bit (was expecting 32-bit there).

    Thanks for the suggestions. I will verify those too, and certainly may need to keep them in mind !

    Since you do mention memory usage, could you suggest a good tutorial or app note that deals thoroughly with the memory mapping of the C55x DSPs, ie MEMORY and SECTIONS usage to correctly define memory areas. I did go through the linker user manual, but it is more explaining what the various functions do, rather than how to use them depending on application, and there is a lack of examples. A good tutorial based on examples, say for DSPs with or without external memory, and depending on specifi applications etc. Aligning memory sections is also not gone through in any great detail, even though it is rather essential to avoiding problems later ... For instance when to do it, and when its not necessary, and why etc. Any suggestions ??

    Regards, M

  • M,

    I didn't think we had anything, but I took a quick look through the app notes for the C5500 devices and found this: Advanced Linker Techniques for Convenient and Efficient Memory Usage (http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?sectionId=3&tabId=409&literatureNumber=spraa46a&docCategoryId=1&familyId=325).  Seems more advanced than what you were asking for, but might be useful.

    I will pass on your request for basic How-To for memory useage to the C5000 Product team and ask them to put it on their back log.

  • Hi Tommy,

    Yes thanks for that, it seems there's plenty of material to sift through to find what I am after with plenty more if necessary, however a quick start guide to memory usage, with some typical examples could be a goer.

    thanks !