I'm trying to add I2S/SAI functionality to an existing project. I started from the sai_dma_demo from MQX 4.1 but I get these errors:
'SIZE' is not a member of class 'struct i2s_statistics_struct' | K60_Run | C/C++ Problem | |||
'IN_BUFFER' is not a member of class 'struct i2s_statistics_struct' | sh_audio.c | C/C++ Problem | |||
'OUT_BUFFER' is not a member of class 'struct i2s_statistics_struct' | sh_audio.c | C/C++ Problem | |||
undefined identifier 'IO_IOCTL_I2S_START_RX' | sh_audio.c | /K60_Run/Sources/SourceFiles | line 445 | C/C++ Problem | |
undefined identifier 'IO_IOCTL_I2S_UPDATE_RX_STATUS' | sh_audio.c | /K60_Run/Sources/SourceFiles | line 471 | C/C++ Problem | |
undefined identifier 'IO_IOCTL_I2S_WAIT_RX_EVENT' | sh_audio.c | /K60_Run/Sources/SourceFiles | line 454 | C/C++ Problem | |
undefined identifier 'IO_IOCTL_I2S_START_TX' | sh_audio.c | /K60_Run/Sources/SourceFiles | line 445 | C/C++ Problem |
undefined identifier 'IO_IOCTL
undefined identifier 'IO_IOCTL_I2S_WAIT_TX_EVENT' | sh_audio.c | /K60_Run/Sources/SourceFiles | line 454 | C/C++ Problem |
I'm using an existing BSP where I enabled I2S.
Any idea what I'm missing?
Thanks!
Hi patrick degry,
Please double check that you enable in the user_config.h the below line
#define BSPCFG_ENABLE_SAI | 1 |
In addition please build the BSP, PSP and MFS libraries.
Please let me know if this helps.
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for the feedback!
I'm using CW10.3, MQX4.0 and started from a bsp twr60F120. The device is a MK60FN1M0VLQ12.
I see that the file sai.h is included which is located in "C:\Freescale\Freescale_MQX_4_0\mqx\source\io\sai"
This file contains the structure below which lacks SIZE, IN_BUFFER, and OUT_BUFFER. I see that it is present in the sai.h of MQX 4.1.
Does it mean that I have to switch to 4.1 (which might be a small risk for the existing project) or can I just copy the 4.1 file to the 4.0 directory?
typedef struct i2s_statistics_struct
{
/* Number of SAI interrupts so far */
uint_32 INTERRUPTS;
/* FIFO error */
uint_32 FIFO_ERROR;
/* FIFO sync error */
uint_32 BUFFER_ERROR;
/* Number of valid bytes received (not dummy receives) */
uint_32 RX_PACKETS;
/* Number of valid bytes transmitted (not dummy transmits) */
uint_32 TX_PACKETS;
/* Number of bytes currently read or wrote */
uint_32 PACKETS_PROCESSED;
/* Number of bytes currently buffered */
uint_32 PACKETS_QUEUED;
/* Number of bytes requested for reading or writing */
uint_32 PACKETS_REQUESTED;
} I2S_STATISTICS_STRUCT, _PTR_ I2S_STATISTICS_STRUCT_PTR;
Hi,
struct i2s_statistics_struct is defined in sai.h. When I look at my copy it contains SIZE, IN_BUFFER, and OUT_BUFFER.
You mentioned that you have an existing BSP where you enabled I2S. I think the example makes use of the SAI driver. Did you set BSPCFG_ENABLE_SAI to true in user_config.h?