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.

C6727 DSP



Hello,

I have a little problem with C6727 DSP. I compiled a small bare metal application and strange things started to happen. Finally I managed to isolate the problem, but I don't really understand the reason for that.

First of all, the very small code segment which does not work properly (or in other words, I just have something wrong...)

---------------------------------------------------------------------------------------------

10001000 01880C2A MVK.S2 0x1018,B3
10001004 0188006A MVKH.S2 0x10000000,B3
10001008 000C0362 B.S2 B3
1000100C 00008000 NOP 5
10001010 00000000 NOP
10001014 00000000 NOP
10001018 01890C2B MVK.S2 0x1218,B3
1000101C 04A80FD9 || OR.L1 0,A10,A9
10001020 08200028 || MVK.S1 0x4000,A16
10001024 00000091 B.S1 0x10001024 (PC+4 = 0x10001024)
10001028 04A00274 || STW.D1T1 A9,*+A8[0]
1000102C 08200274 STW.D1T1 A16,*+A8[0]
10001030 00006000 NOP 4
10001034 00000000 NOP
10001038 00000000 NOP
1000103C 00000000 NOP
10001040 00000000 NOP
10001044 00000000 NOP

---------------------------------------------------------------------------------------------

I set the PC in the code composer studio connected to the HW manually to 10001000. The PC branches to 10001018 as expected. But the next instruction does not execute correctly. PC branches back to 10001000 in some reason...

Second piece of code works as expected. I just moved the branch target a bit.

---------------------------------------------------------------------------------------------

10001000 0188102A MVK.S2 0x1020,B3
10001004 0188006A MVKH.S2 0x10000000,B3
10001008 000C0362 B.S2 B3
1000100C 00008000 NOP 5
10001010 00000000 NOP
10001014 00000000 NOP
10001018 00000000 NOP
1000101C 00000000 NOP
10001020 01890C2B MVK.S2 0x1218,B3
10001024 04A80FD9 || OR.L1 0,A10,A9
10001028 08200028 || MVK.S1 0x4000,A16
1000102C 00000191 B.S1 0x1000102C (PC+12 = 0x1000102c)
10001030 04A00274 || STW.D1T1 A9,*+A8[0]
10001034 08200274 STW.D1T1 A16,*+A8[0]
10001038 00006000 NOP 4
1000103C 00000000 NOP
10001040 00000000 NOP

---------------------------------------------------------------------------------------------

Here the first branch is taken to address 10001020 and everything seems to be ok. Next parallel instruction is executed correctly and PC carries on to the loop that follows.

Im very new to TI DSP and there might be something very basic (e.g. processor flags)... I run into that problem as compiling the C with gcc. Maybe its related to branch alignment?

Any help or hints would be greatly appreciated!

Thank you,

Madis

  • Hi,

    Thanks for your post.

    May be a compiler switch option would have caused a mess-up. Just check it and you could try the suggestion below:

    The -mv6700 switch will build for the C67xx DSP whereas the -mv67p switch will build for the C67x+ DSP core. Because the C6727 contains a C67x+ core you should use the -mv67p switch. Please check section 1.2.1 from the c6713 to c672x migration guide below:

    http://www.ti.com/lit/an/spraa78/spraa78.pdf

    As well, you could check the c6000 assembly tools user guide below in which, you could refer section 3.13 for debugging the assembly source, would provide you better clarity:

    http://www.ti.com/lit/ug/spru186w/spru186w.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Hello,

    thank you for you response!

    The thing is that I used gcc 5.3 for compiling. But, as again, I just isolated the assembler segments (and removed anything unnecessary to repeat the problem) to test the branch failure in order to rule out discussion about the compiler. As soon as I know the root course I can tweak the compiler to overcome it.

    I just downloaded the instructions to RAM with TI tools and single stepped thru the code. In the first case the branching fails and the second case works as expected. The code is initially generated by the compiler but going thru the assembler manual I can not see anything wrong in there. So could you please try the two code segments and maybe you can give some hints whats the reason of the strange behavior...?

    BR, Madis

  • Madis,

    Please attach your source files including linker cmd file and assembly files.

    And include also your .out file that you load into RAM.

    It may be outside our scope to debug a non-TI assembler output, but a little looking might be okay if you can supply all the files. Finding hardware to run on may be a challenge.

    Are you actually using the C6727B and not the outdated C6727?

    Are you applying the patches at the start of the program each time you load it?

    Regards,
    RandyP