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.

bug in DSPLib fir2() on TMS320VC5505

Other Parts Discussed in Thread: TMS320C5505

Hello all together,

I use the TMS320C5505 dev board (with TMSX320VC5505D silicon) and CCS4
Unfortunately when I replace fir() in my project with fir2() I get a big problem.
When I run to the step before the function call all is fine.As soon as I try to run over it he will never leave the function
Now I try to halt the device to see where he stuck in assembler (I`m very unskilled in assembler).
But when I want to run it again i receive the error:

Can't Run Target CPU:
Error 0x00000020/-1141
Error during: Execution,

For information

x[nx] is aligned to DARAM

h[nh] to DARAM6

result[nx] to DARAM on a 32 bit boundary (#pragma DATA_ALIGN(fir2result, 32); )

dbuffer[nh+2] to DARAM7

nx = 1

nh = 256

Now my question is how to get the fir2() function running. With fir() all is fine.
I think I have fulfilled the requirement that array r[ ] must be aligned on 32-bit boundary
I`m unsure what the requirement "array h[ ] must be located in internal memory because it is accessed withthe coefficient data pointer, CDP." says.
Isn`t it enough when h[] is in DARAM??
Please help.

Thanks a lot,

Steffen

  • Steffen,

    I think you should use:

    #pragma DATA_ALIGN(fir2result, 2);

    for 32-bit alignment.

    Can you try this and see if it works?

     

    Best Regards,

    Peter Chung

     

     

     

  • Hello Peter,

    Thanks for your suggestion but the function fir2 still won`t work

    Steffen

  • Hi Peter.

    I have the same problem using fir2 in sample-by-sample filtering (nx = 1).

    The description of fir2 clearly states that this should work but when I run the debugger the inner loop counter in fir2 asm (used for NX) flips to ffff
    since it is calculated (NX/2 – 1). I can only use it with NX>=2. 

    What are we missing? Can you get it to work with NX=1 ?

    From SPRU422J – fir2
    Description: Computes a real FIR filter (direct-form) using the coefficients stored in vector
    h. The real input data is stored in vector x. The filter output result is stored in
    vector r. This function maintains the array dbuffer containing the previous
    delayed input values to allow consecutive processing of input data blocks. This
    function can be used for both block-by-block (nx ≥2) and sample-by-sample
    filtering (nx = 1). In place computation (r = x) is allowed.

    /Lars

  • Hi Peter,

     

    The description for FIR2 in the manual SPRU422 changed from version ‘h’  (Oct 2004) to apparently allow sample by sample use, prior to that version the sample number (nx) must be even. 

    Looking at the FIR2.asm code versions 2.20.02 (2003) and 2.40.00 (2006), other than the change in version number, are identical! 

    I have confirmed that the filter works OK with nx>1, but it fails with nx=1.

     

    Can you please clarify what is going on and is there a more recent version of the FIR2 filter available?

    Best Regards

    Mike Fitch

  • Mike,

    I am not sure about that. FIR2() is taking advantage of DUAL MAC operation, so I think it requires at least two inputs. Otherwise, I don't think it will work properly. If you want to input one at a time, why don't you use FIR() instead of FIR2()?

    I don't think we have updated DSPLIB version.

    Best Regards,

    Peter Chung

     

  •  

    Steffen,

     

    Can you single step into the routine and step the assembly until it fails, then report where is failing? You might need to set the disassembly to mixed mode in order to single step the assembly.

     

    Looking at fir.asm and fir2.asm, I did not see any difference in the Status register settings between the routines. The main differences apart from the use of a dual-Mac operation is that the pointers are used differently. FIR2 uses AR0, AR1, AR2, AR3, and CDP while FIR uses AR0, AR1, AR2, and AR4. The main loops are in the RPT instruction with the loop counter set to inner_cnt. The outer loop is in the RPTBLOCAL with the loop counter set in BRC0.

     

  • Hi Peter,

    Thanks for the reply.     

    I was hoping to use the FIR2() as the execution time is significantly less than FIR().

    Best Regards

    Mike Fitch