ST意法半导体
直播中

吴晓成

7年用户 362经验值
私信 关注
[问答]

如何配置I2S应用程序?

嗨,大家好,
经过多天的痛苦,我正在寻求一些帮助。
我正在尝试将基本的uSD写入I2S应用程序,但结果真的很难看。
我正在使用STM3240G评估板和Adafruit MAX98357板。
我正在使用fatfs和sdio来读取我的uSD卡上的wave文件。
我正在填充2或3个缓冲区并同时通过I2S发送数据。
我已将I2S DMA配置如下:
模式循环,数据宽度:半字,突发尺寸:单个。
我的I2S配置如下:
模式主传输
MSB First
32位帧上的16位数据
48 KHz
时钟极性低
首先,我首先初始化胖文件系统并读取音频文件。然后我在填充uint16_t缓冲区之前提取标题。
然后,我使用'HAL_I2S_Transmit_DMA'将数据从我的缓冲区发送到I2S。
然后使用'HAL_I2S_TxCpltCallback'来更改发送的缓冲区和要填充的缓冲区。
因此,每次transfert完成后,我通过I2S DMA发送下一个缓冲区,并重新填充最后一个缓冲区。
当我在调试模式下检查缓冲区时,它们似乎很好。时钟也很好。
我可以听到播放音乐的某些部分,但它真的不能听。
我已将一些音频文件导入Audacity并将其导出为带符号的16位PCM波形文件。
你能帮助我或指导我如何配置我的系统吗?
这让我疯狂 ! ><
非常感谢你 !
项目的文件夹已附加。

以上来自于谷歌翻译


以下为原文




Hi everyone,
I'm looking for some help after many days of pain.
I'm trying to write basic uSD to I2S application, but the result is really ugly.
I'm using STM3240G eval board and Adafruit MAX98357 board.
I'm using fatfs and sdio to read a wave file on my uSD card.
I'm filling 2 or 3 buffers and sending data through I2S at the same time.
I've configured the I2S DMA as following :
Mode Circular, Data Width : Half Word, Burst Size : Single.
My I2S is configured as following :
Mode Master Transmit
MSB First
16 bits data on 32 bits frame
48 KHz
Clock Polarity Low
So first, i initilialize the fat file system and read the audio file. I then extrac the header before filling my uint16_t buffers.
Then, i use 'HAL_I2S_Transmit_DMA' to send the data from my buffer to I2S.
The 'HAL_I2S_TxCpltCallback' is then used to change the buffer sent and the buffer to fill.
So, each time a transfert is complete, i send the next buffer through I2S DMA, and refill the last buffer .
When i check the buffers in debug mode, they seem good. Clocks are good too.
I can hear some parts of the music played but it is really not listenable.
I've imported some audio file into Audacity and exported them into signed 16 bits PCM wave files.
Can you please help me or guide me on how i should configure my system ?
It's driving me crazy ! ><
Thank you very much !
Project's folder is attached.

回帖(1)

符伯峪

2019-7-26 09:48:45
对于商业项目,请联系当地销售/支持办公室并与FAE讨论
论坛迁移中的附件丢失
没有活动&gt; 1个月

以上来自于谷歌翻译


以下为原文

For commercial projects contact local sales/support office and discuss with an FAE
Attachment lost in forum migration
No activity >1month
举报

更多回帖

发帖
×
20
完善资料,
赚取积分