|
发表于 2010-3-11 04:35:43
|
显示全部楼层
杯具了,已经确认,STM32的SPI2口有硬件BUG,I2S Slave模式不能正常使用。所以大家只能继续使用STM32 I2S Master模式了。
SPI3口也有另一个硬件BUG,同样有影响I2S Slave功能的可能性,但目前短时间测试未见明显异常。
以下是ST最新勘误表的相关内容:
2.15 Parasitic TXE generation in SPI2/I2S2 slave mode + 16-bit data frame mode
注:此BUG会随机使TXE连续两次置位,无论DMA/IRQ/轮询模式均无法避开由此引起的TxBuffer数据错误覆盖导致的数据丢失及帧错位情况。(见8楼截图)
Description
When the SPI2/I2S2 slave mode is used either in transmit or in full-duplex mode, and the
data frame format is configured to 16-bit, the TXE flag may go high two times before RXNE
is set, that is, TXE may be asserted before the data already in the data register are
transmitted. This may result in data loss during transmission.
Workarounds
1. In SPI mode, use the 8-bit data frame mode instead of the 16-bit mode.
2. The 16-bit mode may be used if the master stops the clock for every data transfer. The
SPI2/I2S2 slave then has enough time to load the data register on the RXNE flag going high.
----------------------------- 杯具的分隔线 -----------------------------
2.6 SPI3 in I2S slave mode: timing sensitivity between I2S3_WS and I2S3_CK
此BUG在I2S3的WS信号先于CK信号改变时可能发生,导致数据错位或丢失。问题仅限于I2S和PCM模式,MSB和LSB没问题,故日后万一不幸再碰上此BUG的解决方案就是使用MSB或LSB模式。
Description
When SPI3 is configured in I2S slave audio modemode in I2S Philips or PCM modes, If the
I2S3_WS signal arrives too early with respect to the active edge of I2S3_CK, a wrong
communication starting too soon may result: then, depending on the clock polarity and the
Audio mode selected, it is either shifted by one bit from start to end or, the first left and right
data items are lost and the others, shifted.
Workaround
None. Use I2S3 in slave mode in the MSB/LSB justified mode only. |
|