cancel
Showing results for 
Search instead for 
Did you mean: 

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

KAJIK.1
Associate III

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,

5 REPLIES 5
Imen GH
ST Employee

Hello,

I have raised your feedback internally to take into consideration.

Imen

KAJIK.1
Associate III

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

​Hello @KAJIK.1​,

Thanks  

You are welcome.

LFerr.1
Associate

Hi all,

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

Thanks

L.F.

"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