Skip to main content
ebrombaugh1
Associate III
April 15, 2026
Solved

CubeMX2: I2S Sample rate calculation does not match value computed in hardware by HAL

  • April 15, 2026
  • 1 reply
  • 165 views

In CubeMX2 when configuring the I2S peripheral on an STM32C542 running from a clock of 144MHz and selecting an audio clock rate of 96000Hz, CubeMX2 computes a nearest reachable frequency of 97826Hz (I2SDIV = 23, ODD = 0). When code is generated and run on actual hardware, the HAL2 I2S driver computes a different value of 95744Hz (I2SDIV = 23, ODD = 1). The HAL2 hardware value has less error from the desired 96000Hz than the value reported by CubeMX2, but the CubeMX2 value may be used in designing other aspects of the firmware and result in unexpected performance.

 

ebrombaugh1_0-1776231757798.png

 

Best answer by STackPointer64

Hello @ebrombaugh1,

I have escalated the issue to the relevant team for resolution. It is being tracked internally under ticket number CDM0061754.

Best regards,

1 reply

STackPointer64Best answer
Technical Moderator
April 15, 2026

Hello @ebrombaugh1,

I have escalated the issue to the relevant team for resolution. It is being tracked internally under ticket number CDM0061754.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.