Is a simplified program available for testing LPDSP32 codec using echoDSP?

I am trying to understand how to make a codec in LPDSP32 using RSL10_lpdsp32_support_manual.pdf chapter 6, 7 and Appendix A

For a start I have loaded “\RSL10_LPDSP32_Software_Package\RSL10_LPDSP32_3.1.0.144\AudioCodecs” project in Eclipse. This project contains the .c/.h files for the compiled LPDSP32 program for all codecs (for example, inside “AudioCodecs\src\dsp\echo”) so I am assuming I don’t need to compile my own LPDSP32 program to use this sample project

In Appendix A, section A.4.6.1, in step 5 it says if I can single step past the dspHandshake() function in main(), it means LPDSP32 has been correctly initialized. If I single step into that function I have found that the loop
while (config->dspStatus != 1);
never ends (in baseDSPCodec.c line 153). So this means LPDSP32 is not loaded correctly?
In main(), I have tried changing the first argument to “populateCodec(G722_PLC_DSP,” to ECHO_DSP and G722_DSP, and I get the same behaviour.

In section A.4.6.2, if I understand correctly the python code is supposed to load an Arm Cortex elf file, run it, send it raw data and save G722 encoded data in /audio/out/G722/enc_48000.raw. Is this correct? With the default code, this is what I get in the console after running this python code:

$ set prompt ___GDB___\n
$ target remote localhost:2331
$ monitor reset
$ file 'D:\\rsl10_workspace\\AudioCodecs_echo\\Debug\\AudioCodecs_echo.elf'
$ load
$ break main
$ continue
$ set gdbParameters.sampleRate = 16000
$ set gdbParameters.frameSize = 160
$ set gdbParameters.blockSize = 4
$ delete
$ break gdbRead
$ break gdbWriteComplete
$ x/128bu &Buffer.configuration[0]
0000 : 00000000 00000000 00000000 00000000 
0010 : 00000000 00000000 00000000 00000000 
0020 : 00000000 00000000 00000000 00000000 
0030 : 00000000 00000000 00000000 00000000 
0040 : 00000000 00000000 00000000 00000000 
0050 : 00000000 00000000 00000000 00000000 
0060 : 00000000 00000000 00000000 00000000 
0070 : 00000000 00000000 00000000 00000000 

$ x/256bu &Buffer.scratch[0]
0000 : 00000000 00000000 00000000 00000000 
0010 : 00000000 00000000 00000000 00000000 
0020 : 00000000 00000000 00000000 00000000 
0030 : 00000000 00000000 00000000 00000000 
0040 : 00000000 00000000 00000000 00000000 
0050 : 00000000 00000000 00000000 00000000 
0060 : 00000000 00000000 00000000 00000000 
0070 : 00000000 00000000 00000000 00000000 
0080 : 00000000 00000000 00000000 00000000 
0090 : 00000000 00000000 00000000 00000000 
00a0 : 00000000 00000000 00000000 00000000 
00b0 : 00000000 00000000 00000000 00000000 
00c0 : 00000000 00000000 00000000 00000000 
00d0 : 00000000 00000000 00000000 00000000 
00e0 : 00000000 00000000 00000000 00000000 
00f0 : 00000000 00000000 00000000 00000000 

$ x/16bu &gdbParameters
0000 : 0004a000 00003e80 00000000 00000000 

$ continue

What can I understand from this output? It did not make /audio/out/G722/enc_48000.raw file. Does this mean the python code is not working?

I am more interested in looking at a working demonstration of the echo_dsp project. Is a simplified version of this sample program with only echo_dsp (both Arm Cortex and LPDSP32 code) and the python code to test it, available? What is the easiest way to modify the given AudioCodecs and AudioCodecsDSP projects to only test the echo_dsp sample?

Hi @mahaju
We don’t have a simplified version for this echo_dsp program.

  1. First I think you have finished Fibonacci project from beginning.
  2. Now we have AudioCodecs project which has more Audio codecs.
    (I do believe you already could get success to pass the “dspHandshake(myCodec);”.
  3. We have the echo LPDSP32 source code in the AudioCodeDSP project.
  4. so using Fibonacci project for reference, you might be able to create the simplified echo_dsp program.

regards,
Larry

@larry.zhu
If I step through the default AudioCodecs project (without changing anything), the program doesn’t go past dspHandshake(myCodec). And inside that function, it specifically doesn’t go past this loop:

while (config->dspStatus != 1);

What does it mean when this loop does not stop? Is it an LPDSP32 code loading problem?

Hi @mahaju ,
I have no issue by using default AudioCodecs (without changing anything). This is for G722_PLC_DSP codec.
and I also changed to ECHO_DSP, it still can pass the dspHandshake(myCodec).
Here is the picture to show this.

and I have attached this echo project for your reference.
AudioCodecs_echo.7z (1.7 MB)

regards,
Larry

@larry.zhu

Your code has the same problem, it doesn’t go past the dsphandshake() function.

Here is what I am doing:

  1. Import your attached project AudioCodecs_echo.7z into my workspace

  2. Clean and build the project

  3. Right click AudioCodecs_echo.elf → Debug As → Debug Configuration → Debug

  1. Single step until I reach the dspHandshake() function. This much works

  1. Enter the dspHandshake() function by pressing F5, single step until I reach the problematic while loop. The program works upto this point as well

If I try to single step past this while loop the program seems to be stuck in an infinite loop

The console keeps getting updated with some message

05-console_scrolling

This is the same problem I was describing in my original question, and I can see the same behaviour in the code you attached.

  1. How do I troubleshoot this problem? What is this indicating? Does this mean the DSP program has not been loaded in PRAM correctly?

  2. It looks like an interrupt from LPDSP32 should change the value of config->dspStatus to 1 while it is in this loop while (config->dspStatus != 1);, but I can’t find where value of config->dspStatus is changed. Where is the value of config->dspStatus updated?

I am using:

CMSIS Pack ver 3.5.285,

ON Semiconductor IDE Version: 3.4.0.48
Eclipse Version: 2020-12
Build id: 20210226-1917

Hi @mahaju ,
I have double checked on my side, There is no any issue.
1, I have tried to use " run". NO issue.


2. I have tried to use F6 to step over. No issue.

a. You could load “blinky” and make sure it work.
b. Then load this echo project again and see if it still does not work.

I am using
CMSIS Pack ver 3.5.285

Larry

@larry.zhu

Yes Blinky is working

I imported Blinky in the Workspace containing AudioCodecs_echo using the CMSIS pack Manager, after which Blinky compiled and downloaded fine

However, now when I try to compile your project I keep getting compiler errors related to #include file paths, such as

10:53:02 **** Clean-only build of configuration Debug for project AudioCodecs_echo ****
make -j4 clean 
rm -rf  ./src/io/gdb/ioGDB.o  ./src/io/g722/ioG722Decode.o ./src/io/g722/ioG722Encode.o  ./src/io/echo/ioEcho.o  ./src/io/celt/ioCeltDecode.o ./src/io/celt/ioCeltEncode.o  ./src/io/base/ioBase.o  ./src/dsp/loader/flashCopier.o ./src/dsp/loader/loader.o  ./src/dsp/g722_plc/g722_plc_dsp.o ./src/dsp/g722_plc/g722_plc_dsp_DM_Hi.o ./src/dsp/g722_plc/g722_plc_dsp_DM_Lo.o ./src/dsp/g722_plc/g722_plc_dsp_PM.o  ./src/dsp/g722/g722_dsp.o ./src/dsp/g722/g722_dsp_DM_Hi.o ./src/dsp/g722/g722_dsp_DM_Lo.o ./src/dsp/g722/g722_dsp_PM.o  ./src/dsp/echo/echo_dsp.o ./src/dsp/echo/echo_dsp_DM_Hi.o ./src/dsp/echo/echo_dsp_DM_Lo.o ./src/dsp/echo/echo_dsp_PM.o  ./src/dsp/celt_enc/celt_enc_dsp.o ./src/dsp/celt_enc/celt_enc_dsp_DM_Hi.o ./src/dsp/celt_enc/celt_enc_dsp_DM_Lo.o ./src/dsp/celt_enc/celt_enc_dsp_PM.o  ./src/dsp/celt_dec/celt_dec_dsp.o ./src/dsp/celt_dec/celt_dec_dsp_DM_Hi.o ./src/dsp/celt_dec/celt_dec_dsp_DM_Lo.o ./src/dsp/celt_dec/celt_dec_dsp_PM.o  ./src/dsp/celt/celt_dsp.o ./src/dsp/celt/celt_dsp_DM_Hi.o ./src/dsp/celt/celt_dsp_DM_Lo.o ./src/dsp/celt/celt_dsp_PM.o  ./src/codecs/echoDSP/echoDSPCodec.o  ./src/codecs/echo/echoCodec.o  ./src/codecs/celtEncDSP/celtEncDSPCodec.o  ./src/codecs/celtDecDSP/celtDecDSPCodec.o  ./src/codecs/celtDSP/celtDSPCodec.o  ./src/codecs/baseDSP/baseDSPCodec.o  ./src/codecs/base/baseCodec.o  ./src/codecs/G722PLCDSP/g722_PLC_DSPCodec.o  ./src/codecs/G722DSP/g722DSPCodec.o  ./src/codecs/codec.o ./src/codecs/codecFactory.o  ./src/audioProcessor.o ./src/logger.o ./src/lpdsp32_JTAG.o ./src/main.o ./src/scratch.o ./src/sharedBuffers.o  ./RTE/Device/RSL10/rsl10_protocol.o ./RTE/Device/RSL10/rsl10_romvect.o ./RTE/Device/RSL10/rsl10_sys_asrc.o ./RTE/Device/RSL10/rsl10_sys_audio.o ./RTE/Device/RSL10/rsl10_sys_clocks.o ./RTE/Device/RSL10/rsl10_sys_crc.o ./RTE/Device/RSL10/rsl10_sys_dma.o ./RTE/Device/RSL10/rsl10_sys_flash.o ./RTE/Device/RSL10/rsl10_sys_power.o ./RTE/Device/RSL10/rsl10_sys_power_modes.o ./RTE/Device/RSL10/rsl10_sys_rffe.o ./RTE/Device/RSL10/rsl10_sys_timers.o ./RTE/Device/RSL10/rsl10_sys_uart.o ./RTE/Device/RSL10/rsl10_sys_version.o ./RTE/Device/RSL10/sbrk.o ./RTE/Device/RSL10/start.o ./RTE/Device/RSL10/startup_rsl10.o ./RTE/Device/RSL10/system_rsl10.o  AudioCodecs_echo.hex  AudioCodecs_echo.siz  ./RTE/Device/RSL10/startup_rsl10.d  ./src/io/gdb/ioGDB.d  ./src/io/g722/ioG722Decode.d ./src/io/g722/ioG722Encode.d  ./src/io/echo/ioEcho.d  ./src/io/celt/ioCeltDecode.d ./src/io/celt/ioCeltEncode.d  ./src/io/base/ioBase.d  ./src/dsp/loader/flashCopier.d ./src/dsp/loader/loader.d  ./src/dsp/g722_plc/g722_plc_dsp.d ./src/dsp/g722_plc/g722_plc_dsp_DM_Hi.d ./src/dsp/g722_plc/g722_plc_dsp_DM_Lo.d ./src/dsp/g722_plc/g722_plc_dsp_PM.d  ./src/dsp/g722/g722_dsp.d ./src/dsp/g722/g722_dsp_DM_Hi.d ./src/dsp/g722/g722_dsp_DM_Lo.d ./src/dsp/g722/g722_dsp_PM.d  ./src/dsp/echo/echo_dsp.d ./src/dsp/echo/echo_dsp_DM_Hi.d ./src/dsp/echo/echo_dsp_DM_Lo.d ./src/dsp/echo/echo_dsp_PM.d  ./src/dsp/celt_enc/celt_enc_dsp.d ./src/dsp/celt_enc/celt_enc_dsp_DM_Hi.d ./src/dsp/celt_enc/celt_enc_dsp_DM_Lo.d ./src/dsp/celt_enc/celt_enc_dsp_PM.d  ./src/dsp/celt_dec/celt_dec_dsp.d ./src/dsp/celt_dec/celt_dec_dsp_DM_Hi.d ./src/dsp/celt_dec/celt_dec_dsp_DM_Lo.d ./src/dsp/celt_dec/celt_dec_dsp_PM.d  ./src/dsp/celt/celt_dsp.d ./src/dsp/celt/celt_dsp_DM_Hi.d ./src/dsp/celt/celt_dsp_DM_Lo.d ./src/dsp/celt/celt_dsp_PM.d  ./src/codecs/echoDSP/echoDSPCodec.d  ./src/codecs/echo/echoCodec.d  ./src/codecs/celtEncDSP/celtEncDSPCodec.d  ./src/codecs/celtDecDSP/celtDecDSPCodec.d  ./src/codecs/celtDSP/celtDSPCodec.d  ./src/codecs/baseDSP/baseDSPCodec.d  ./src/codecs/base/baseCodec.d  ./src/codecs/G722PLCDSP/g722_PLC_DSPCodec.d  ./src/codecs/G722DSP/g722DSPCodec.d  ./src/codecs/codec.d ./src/codecs/codecFactory.d  ./src/audioProcessor.d ./src/logger.d ./src/lpdsp32_JTAG.d ./src/main.d ./src/scratch.d ./src/sharedBuffers.d  ./RTE/Device/RSL10/rsl10_protocol.d ./RTE/Device/RSL10/rsl10_romvect.d ./RTE/Device/RSL10/rsl10_sys_asrc.d ./RTE/Device/RSL10/rsl10_sys_audio.d ./RTE/Device/RSL10/rsl10_sys_clocks.d ./RTE/Device/RSL10/rsl10_sys_crc.d ./RTE/Device/RSL10/rsl10_sys_dma.d ./RTE/Device/RSL10/rsl10_sys_flash.d ./RTE/Device/RSL10/rsl10_sys_power.d ./RTE/Device/RSL10/rsl10_sys_power_modes.d ./RTE/Device/RSL10/rsl10_sys_rffe.d ./RTE/Device/RSL10/rsl10_sys_timers.d ./RTE/Device/RSL10/rsl10_sys_uart.d ./RTE/Device/RSL10/rsl10_sys_version.d ./RTE/Device/RSL10/sbrk.d ./RTE/Device/RSL10/start.d ./RTE/Device/RSL10/system_rsl10.d  AudioCodecs_echo.elf
 

10:53:02 Build Finished. 0 errors, 0 warnings. (took 442ms)

10:53:02 **** Build of configuration Debug for project AudioCodecs_echo ****
make -j4 all 
Building file: ../src/io/gdb/ioGDB.c
Building file: ../src/io/g722/ioG722Decode.c
Building file: ../src/io/g722/ioG722Encode.c
Building file: ../src/io/echo/ioEcho.c
Invoking: Cross ARM C Compiler
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -DRSL10_CID=101 -D_RTE_ -I"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -isystem"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -std=gnu11 -MMD -MP -MF"src/io/gdb/ioGDB.d" -MT"src/io/gdb/ioGDB.o" -c -o "src/io/gdb/ioGDB.o" "../src/io/gdb/ioGDB.c"
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -DRSL10_CID=101 -D_RTE_ -I"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -isystem"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -std=gnu11 -MMD -MP -MF"src/io/g722/ioG722Decode.d" -MT"src/io/g722/ioG722Decode.o" -c -o "src/io/g722/ioG722Decode.o" "../src/io/g722/ioG722Decode.c"
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -DRSL10_CID=101 -D_RTE_ -I"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -isystem"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -std=gnu11 -MMD -MP -MF"src/io/echo/ioEcho.d" -MT"src/io/echo/ioEcho.o" -c -o "src/io/echo/ioEcho.o" "../src/io/echo/ioEcho.c"
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections  -g3 -DRSL10_CID=101 -D_RTE_ -I"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -I"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -isystem"C:/Users/username/ON_Semiconductor/PACK/ONSemiconductor/RSL10/3.5.285/include" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE" -isystem"D:\rsl10_temp_workspace_20210419\AudioCodecs_echo/RTE/Device/RSL10" -std=gnu11 -MMD -MP -MF"src/io/g722/ioG722Encode.d" -MT"src/io/g722/ioG722Encode.o" -c -o "src/io/g722/ioG722Encode.o" "../src/io/g722/ioG722Encode.c"
In file included from ../src/io/gdb/ioGDB.c:21:
../src/io/gdb/ioGDB.h:17:10: fatal error: sharedBuffers.h: No such file or directory
   17 | #include "sharedBuffers.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
../src/io/g722/ioG722Decode.c:17:10: fatal error: scratch.h: No such file or directory
   17 | #include "scratch.h"
      |          ^~~~~~~~~~~
compilation terminated.
../src/io/echo/ioEcho.c:16:10: fatal error: logger.h: No such file or directory
   16 | #include "logger.h"
      |          ^~~~~~~~~~
compilation terminated.
make: *** [src/io/gdb/subdir.mk:20: src/io/gdb/ioGDB.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [src/io/g722/subdir.mk:23: src/io/g722/ioG722Decode.o] Error 1
make: *** [src/io/echo/subdir.mk:20: src/io/echo/ioEcho.o] Error 1
In file included from ../src/io/g722/ioG722Encode.c:17:
../src/io/g722/ioG722Encode.h:17:10: fatal error: sharedBuffers.h: No such file or directory
   17 | #include "sharedBuffers.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/io/g722/subdir.mk:23: src/io/g722/ioG722Encode.o] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

10:53:03 Build Failed. 9 errors, 0 warnings. (took 1s.116ms)

A relevant section of the console message above containing just the error is given below:

In file included from ../src/io/gdb/ioGDB.c:21:
../src/io/gdb/ioGDB.h:17:10: fatal error: sharedBuffers.h: No such file or directory
   17 | #include "sharedBuffers.h"
      |          ^~~~~~~~~~~~~~~~~

This is happening even though I have not changed anything in the source code and it’s happening in every new Eclipse workspace I create. It looks like something damaged the RSL10 IDE settings after importing the blinky project. How can I reset the RSL10 IDE to it’s previous working condition? The Blinky project that I imported using the CMSIS pack manager works properly at this point, problem is with the project I imported by going to File → Import

I should note that this is not happening if I manually import the AudioCodecs project in the “RSL10_LPDSP32_Software_Package\RSL10_LPDSP32_3.1.0.144\AudioCodecs” project downloaded from On Semiconductor website. This error is only happening when importing your attached project

EDIT:
The compiler errors aren’t important
How do I troubleshoot why the program isn’t executing past dspHandshake() function? The blinky program runs normally so this isn’t an issue with the cable connections.