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.

CC1352P7: PDM driver not compatible with TI-Clang

Part Number: CC1352P7

Hi,
How can I use the PDM driver with TI Clang?
My issue is with calling the functions pdm2pcm16k/pdm2pcm8k written in assembly.
This works fine when using the default TI CCS compilers and pdm2pcm_cc26x2_ccs.asm.
Can you somehow change one of the pdm2pcm_cc26x2_ccs.asm/pdm2pcm_cc26x2_gcc.asm/pdm2pcm_cc26x2_iar.asm assembly files to make it compatible with Clang?
Regards,
Erlend

  • Hi Erlend,

    You can invoke the TI-syntax ARM assembler from the TI-clang compiler. So you can use the pdm2pcm_cc26x2_ccs.asm assembly source file in your project. 

    The instructions to do this can be found in this guide.

    https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/getting_started_guide/assembling_legacy_ti_syntax.html

    Regards,

    Sid

  • Hi,

    I am afraid I will need more help.

    How can I add  "tiarmasm <options> <path/to/file/>pdm2pcm_cc26x2_ccs.asm"  to our project specification, and what are the <options> I need to include?


    Regards,
    Erlend

  • One way would be to

    1. Add the file pdm2pcm_cc26x2_ccs.asm file to your already imported project.

    2. Right click on it and click "Show Build Settings". Click on Apply Custom Build Step Overriding Other Tools.

    3. Add the filename and output object name. 

    4. Add the compiler command with all the options. For example, as given below. 

    "C:/ti/ccs1100/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang.exe" -c -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mlittle-endian -mthumb -march=armv7e-m -x ti-asm -o"pdm2pcm_cc26x2_ccs.o" "../pdm2pcm_cc26x2_ccs.asm"

    But having said this, there seems to be a much simpler way. It seems easier to reuse the pdm2pcm_cc26x2_gnu.asm file. by commenting out all the .sect, .func and .endfunc lines from the pdm2pcm_cc26x2_gnu.asm file.

    Just add this file with the above mentioned lines commented out and build the project again. This seems to be a much simpler solution. 

    Regards,

    Sid

  • Thanks. Using modified pdm2pcm_cc26x2_gnu.asm is a great solution for our project.

  • After commenting out sect, .func and .endfunc like this:
    /***CLANG*** .sect ".text.pdm2pcm16k" ***/
    The project buildt sucessfully, but the audio data was all garbage.

    Building the object file like you suggested using works builds fine, and audio data are good:
    "C:/ti/ccs1100/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang.exe" -c -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mlittle-endian -mthumb -march=armv7e-m -x ti-asm -o"pdm2pcm_cc26x2_ccs.o" "../pdm2pcm_cc26x2_ccs.asm"