Skip to main content
KAJIK.1
Associate III
September 26, 2020
Question

Request to revise I2S section of HAL document. (UM1725)

  • September 26, 2020
  • 5 replies
  • 1254 views

Hello,

In Section 36. I2S Generic Driver of HAL document (UM1725), I found an incorrect or misleading explanation.

In the explanation of HAL_I2S_Transmit, there is a "notes" below.

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

HAL_I2S_Transmit (I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout)

Notes: When a 16-bit data frame or a 16-bit data frame extended is selected during the I2S configuration phase, the Size parameter means the number of 16-bit data length in the transaction

and when a 24-bit data frame or a 32-bit data

frame is selected the Size parameter means the number of 16-bit data length.

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

(Same explanation is shown many times in the source code of stm32f4xx_hal_i2s.c.)

However, Code is implemented as below.

 if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
 {
 hi2s->TxXferSize = (Size << 1U);
 hi2s->TxXferCount = (Size << 1U);
 }
 else
 {
 hi2s->TxXferSize = Size;
 hi2s->TxXferCount = Size;
 }

That means,

when a 24-bit data frame or a 32-bit data

frame is selected the Size parameter means the number of 16-bit 24/32-bit data length. (or the number of 24/32-bit data)

Original explanation is incorrect or misleading for the beginner like me, please consider to change as above.

Thanks,

This topic has been closed for replies.

5 replies

Imen GH
ST Employee
September 29, 2020

Hello,

I have raised your feedback internally to take into consideration.

Imen

KAJIK.1
KAJIK.1Author
Associate III
September 29, 2020

Dear Imen,

Many Thanks for your kind reply.

And please convey my appreciation for the great effort of HAL team.

K.A.

Imen GH
ST Employee
September 30, 2020

​Hello @KAJIK.1​,

Thanks  

You are welcome.

LFerr.1
Visitor II
November 9, 2020

Hi all,

I've a different question on the same topic: what does "length in transaction" mean?

Thanks

L.F.

waclawek.jan
Super User
November 9, 2020

"number of 16-bit data length in the transaction" supposedly means "number of data, 16-bit long, in the transaction".

I am not native English speaker either...

JW