Missing fsl_soundcard.h and others for the sai demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Missing fsl_soundcard.h and others for the sai demo

1,045 Views
aerodame
Contributor III

That sai demo code was posted for us is missing the following files and neither the FRDM or TWR board SDKs have the files and drivers needed it appears.   The demo project (that will not compile for the FRDM-K22F platform).

 

Specifically 

   audio.c  is looking for:

               fsl_soundcard.h

               fsl_sai_driver.h

 

  main.c is looking for:

               fsl_clock_manager.h

               fsl_soundcard.h

 

 

Presumably there are C files that go along with these as well.

 

I’ve scoured the SDK API and there don't seem to be any files like this on the SDK

 

Does anyone have these files or can give us pointers on where we can get them?

Original Attachment has been moved to: frdmk22f_sai_demo_kds.zip

Labels (1)
0 Kudos
6 Replies

712 Views
carlos_neri
NXP Employee
NXP Employee

Stephen,

That's correct, you should deploy the sample code in:

{KSDK_1_3}\examples\frdmk22f\demo_apps

Definitely modifying the wsd file is not needed. I'm checking on a fresh KSDK 1.3 installation the demo code and see if I get the same errors.

Regards,

Carlos Neri

0 Kudos

712 Views
aerodame
Contributor III

Carlos, do you have a feel for complication of porting to SDK 2.0?  I'm starting down this path, but unsure about what things I might need to shim to make the audio and sai code compatible with SDK 2.0.  One area of question is the OSA layer and how to adapt that or what dependency there is (I haven't yet studied OSA very much yet).

0 Kudos

712 Views
aerodame
Contributor III

So, after going down a hopeless path of trying to start with a clean 1.3 project, adding the demo files to it and then trying to manually include the SDK 1.3, I ran into so many USB problems basically unresolved include references no matter whether I had the right include paths or not.

So, I decided to take the approach of dropping your demo files right into the SDK 1.3 examples under the frdm_k22f directory.  That seems like a better approach because I CAN get, for example, the bubble level demo to run correctly.   I suppose now that this is what I was supposed to do.

But the .wsd file is not correct for the platform path names and I'm still fighting it...  I did a little renaming of references in the .wsd file as follows:

(mainly to get the platform on the right name convention....  ksdk_platform_lib_K22F51212)

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

<?xml version="1.0"?>

<workspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="workingsets.xsd">

  <projects>

  <project><name>ksdk_platform_lib_K22F51212</name><path>../../../../../lib/ksdk_platform_lib/kds/K22F51212</path><open>true</open><activeconfig>debug</activeconfig><buildreferences config="debug">false</buildreferences><activeconfig>release</activeconfig><buildreferences config="release">false</buildreferences></project><project><name>sai_demo_frdm_k22f</name><path>.</path><open>true</open><activeconfig>debug</activeconfig><buildreferences config="debug">false</buildreferences><activeconfig>release</activeconfig><buildreferences config="release">false</buildreferences></project></projects>

  <workingsets>

  <workingSet editPageId="org.eclipse.cdt.ui.CElementWorkingSetPage" id="1323268527287_1" label="sai_demo" name="sai_demo"><item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/ksdk_platform_lib_K22F51212" type="4"/><item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/sai_demo_frdm_k22f" type="4"/></workingSet></workingsets>

  <cdtconfigurations>

  <workingSet name="sai_demo"><config name="debug"><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="ksdk_platform_lib_K22F51212" configName="debug"/><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="sai_demo_frdm_k22f" configName="debug"/></config><config name="release"><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="ksdk_platform_lib_K22F51212" configName="release"/><project config="com.freescale.arm.cdt.toolchain.config.arm.release.695495605" name="sai_demo_frdm_k22f" configName="release"/></config></workingSet></cdtconfigurations>

</workspace>

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

Here's the output from an attempted build...

make -k all

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/platform/utilities/src/fsl_debug_console.c', needed by `utilities/fsl_debug_console.o'.

Building file: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/startup.c

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/platform/utilities/src/fsl_misc_utilities.c', needed by `utilities/fsl_misc_utilities.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/platform/utilities/src/print_scan.c', needed by `utilities/print_scan.o'.

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -DDEBUG -DARM_MATH_CM4 -DCPU_MK22FN512VLH12 -DFRDM_K22F -DFREEDOM -I../../../../../../platform/osa/inc -I../../../../../../platform/utilities/inc -I../../../../../../platform/CMSIS/Include -I../../../../../../platform/devices -I../../../../../../platform/devices/MK22F51212/include -I../../../../../../platform/devices/MK22F51212/startup -I../../../../../../platform/hal/inc -I../../../../../../platform/drivers/inc -I../../../../../../platform/system/inc -I../.. -I../.. -I../../../../../../platform/composite/inc -I../../../../../../platform/drivers/src/edma -I../../../../../../platform/drivers/src/sai -I../../../../../../platform/drivers/src/i2c -I../../../.. -std=gnu99 -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"startup/startup.d" -MT"startup/startup.o" -c -o "startup/startup.o" "/Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/startup.c"

Finished building: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/startup.c

Building file: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/gcc/startup_MK22F51212.S

Invoking: Cross ARM GNU Assembler

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -x assembler-with-cpp -DDEBUG -fno-common  -ffunction-sections  -fdata-sections  -ffreestanding  -fno-builtin  -mapcs  -std=gnu99 -MMD -MP -MF"startup/startup_MK22F51212.d" -MT"startup/startup_MK22F51212.o" -c -o "startup/startup_MK22F51212.o" "/Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/gcc/startup_MK22F51212.S"

Finished building: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/gcc/startup_MK22F51212.S

Building file: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/system_MK22F51212.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -DDEBUG -DARM_MATH_CM4 -DCPU_MK22FN512VLH12 -DFRDM_K22F -DFREEDOM -I../../../../../../platform/osa/inc -I../../../../../../platform/utilities/inc -I../../../../../../platform/CMSIS/Include -I../../../../../../platform/devices -I../../../../../../platform/devices/MK22F51212/include -I../../../../../../platform/devices/MK22F51212/startup -I../../../../../../platform/hal/inc -I../../../../../../platform/drivers/inc -I../../../../../../platform/system/inc -I../.. -I../.. -I../../../../../../platform/composite/inc -I../../../../../../platform/drivers/src/edma -I../../../../../../platform/drivers/src/sai -I../../../../../../platform/drivers/src/i2c -I../../../.. -std=gnu99 -fno-common  -ffreestanding  -fno-builtin  -mapcs -MMD -MP -MF"startup/system_MK22F51212.d" -MT"startup/system_MK22F51212.o" -c -o "startup/system_MK22F51212.o" "/Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/system_MK22F51212.c"

Finished building: /Users/pw315c/GIT_REPO/KDS_Mac_Working/SDK_1.3_FRDM-K22F/platform/devices/MK22F51212/startup/system_MK22F51212.c

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/audio.c', needed by `source/audio.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/equalizer.c', needed by `source/equalizer.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/main.c', needed by `source/main.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/terminal_menu.c', needed by `source/terminal_menu.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/platform/composite/src/soundcard/fsl_soundcard.c', needed by `soundcard/fsl_soundcard.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/fsl_edma_irq.c', needed by `interrupt_handlers/fsl_edma_irq.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/fsl_i2c_irq.c', needed by `interrupt_handlers/fsl_i2c_irq.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/fsl_sai_irq.c', needed by `interrupt_handlers/fsl_sai_irq.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/fsl_sgtl5000_driver.c', needed by `codec/fsl_sgtl5000_driver.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/board.c', needed by `board/board.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/gpio_pins.c', needed by `board/gpio_pins.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/demo_apps/sai_demo/hardware_init.c', needed by `board/hardware_init.o'.

make: *** No rule to make target `/Applications/KDS_v3.app/KSDK_1.3.0/examples/frdmk22f/pin_mux.c', needed by `board/pin_mux.o'.

make: Target `all' not remade because of errors.

So, basically no joy yet.     ANy idea how I can get the IDE to reindex so that the source code files sitting there will build?

0 Kudos

712 Views
carlos_neri
NXP Employee
NXP Employee

Stephen,

Make sure to use KSDK 1.3 mainline release:

https://nxp.flexnetoperations.com/control/frse/product?entitlementId=124043367&lineNum=1&authContact...

The demo you currently have was ported from a different board (twrk24f120m) using KSDK 1.3 and KDS 3.0.0. However, the project should work with latest KDS version.

Regards,

Carlos Neri

0 Kudos

712 Views
aerodame
Contributor III

Progress update :  Finally got all the Eclipse platform links corrected and was able to build the exact project.

Carlos, is there an APP NOTE written to go along with this SAI demo?  It is fairly complicated with its use of DMA, etc. and it would be good to have something to read along as I make changes to it for our app.

What would be your strategy for porting it over to SDK 2.0?  Bring the fsl_soundard.* files over and attempt to reuse as much of the API as possible?

Thanks for the sample.  It does work afterall and we should be able to adapt it to our SGTL5000 shield we are developing so we can use the stock FRDM-K22F boards.

0 Kudos

712 Views
aerodame
Contributor III

Hello Carlos, I was out on business for a couple of days, but now getting back into this project.  I have not been able to successfully generate a build yet because of all the missing dependencies from the file project set I have.  I've rolled back to KDS 1.3 and trying to put the right files into the right places, but have differences and missing header files I'm constantly trying to resolve.

The link above only returns "NULL" so that's not helpful.  Ideally I would like to just drop the zipped up file project right into some environment where it will just build instead of my having to chase down include files from whatever directory they are in and moving them into this project.

I'm still hacking at it (and this is certainly hacking).  But it would sure be nice if I didn't have to waste my time on this and could just get the whole project that is ready to build clean.

There are a ton of files related to this but I'm not sure which ones are actually needed.  

A sampling of the build errors...

make: *** [source/equalizer.o] Error 1

In file included from ../drivers/fsl_soundcard.h:35:0,

                 from ../source/audio.c:43:

../drivers/fsl_edma_driver.h:37:26: fatal error: fsl_edma_hal.h: No such file or directory

#include "fsl_edma_hal.h"

=========================

In file included from ../drivers/fsl_edma_driver.h:36:0,

                 from ../drivers/fsl_soundcard.h:35,

                 from ../source/audio.c:43:

../drivers/fsl_edma_request.h:993:5: error: redeclaration of enumerator 'kDmaRequestMux0CMP0'

     kDmaRequestMux0CMP0 = 42|0x100U, /*!< CMP0. */

     ^

In file included from ../CMSIS/fsl_device_registers.h:45:0,

                 from ../drivers/fsl_edma_driver.h:35,

                 from ../drivers/fsl_soundcard.h:35,

                 from ../source/audio.c:43:

../CMSIS/MK22F51212.h:358:5: note: previous definition of 'kDmaRequestMux0CMP0' was here

     kDmaRequestMux0CMP0             = 42|0x100U,   /**< CMP0. */

     ^

In file included from ../CMSIS/fsl_device_registers.h:45:0,

                 from ../drivers/fsl_edma_driver.h:35,

                 from ../drivers/fsl_soundcard.h:35,

                 from ../source/equalizer.c:43:

../CMSIS/MK22F51212.h:365:5: note: previous definition of 'kDmaRequestMux0PortA' was here

     kDmaRequestMux0PortA            = 49|0x100U,   /**< PTA. */

     ^

In file included from ../drivers/fsl_edma_driver.h:36:0,

                 from ../drivers/fsl_soundcard.h:35,

                 from ../source/equalizer.c:43:

../drivers/fsl_edma_request.h:1001:5: error: redeclaration of enumerator 'kDmaRequestMux0PortB'

     kDmaRequestMux0PortB = 50|0x100U, /*!< PTB. */

     ^

Now that I have a redeclaration I'm suspecting I included two different files that redeclare kDmaRequestMux0PortB (etc.)...

Very frustrating broken out of the box experience!

0 Kudos