Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted I2S DMA output #168

Open
mrx23dot opened this issue Feb 3, 2024 · 1 comment
Open

Unwanted I2S DMA output #168

mrx23dot opened this issue Feb 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working dma DMA-related issue or pull-request. hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system

Comments

@mrx23dot
Copy link

mrx23dot commented Feb 3, 2024

on F401 I setup I2S in slave,fullduplex mode with circular DMA,
issue

__HAL_DMA_DISABLE(&hdma_spi2_rx);
__HAL_DMA_DISABLE(&hdma_i2s2_ext_tx);
__HAL_I2S_DISABLE(&hi2s2);

inject more I2S clock in, and DMA still outputs I2S stream to i2s2_ext pin.
With unknown const values
2024-02-03_182404_Xi

internal state
2024-02-03_183900_Cv

S4CR.EN is 0!

It should be silent if disabled.

code

  /* i2s uses SPI */
  hi2s2.Instance = SPI2;
  hi2s2.Init.Mode = I2S_MODE_SLAVE_RX;
  hi2s2.Init.Standard = I2S_STANDARD_PHILIPS;
  hi2s2.Init.DataFormat = I2S_DATAFORMAT_32B;
  hi2s2.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
  hi2s2.Init.AudioFreq = I2S_AUDIOFREQ_44K;
  hi2s2.Init.CPOL = I2S_CPOL_LOW;              /* idle low clock */
  hi2s2.Init.ClockSource = I2S_CLOCK_EXTERNAL; /* not PLL */
  hi2s2.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_ENABLE;
  ASSERT(HAL_I2S_Init(&hi2s2) == HAL_OK);
  __HAL_RCC_I2S_CONFIG(RCC_I2SCLKSOURCE_EXT); 

  /* I2S2_EXT_TX Init */
  hdma_i2s2_ext_tx.Instance = DMA1_Stream4; /* also in task */
  hdma_i2s2_ext_tx.Init.Channel = DMA_CHANNEL_2;
  hdma_i2s2_ext_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
  hdma_i2s2_ext_tx.Init.PeriphInc = DMA_PINC_DISABLE;
  hdma_i2s2_ext_tx.Init.MemInc = DMA_MINC_ENABLE;
  hdma_i2s2_ext_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; /* 16 even for 32bit */
  hdma_i2s2_ext_tx.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
  hdma_i2s2_ext_tx.Init.Mode = DMA_CIRCULAR;
  hdma_i2s2_ext_tx.Init.Priority = DMA_PRIORITY_VERY_HIGH;
  hdma_i2s2_ext_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
  ASSERT(HAL_DMA_Init(&hdma_i2s2_ext_tx) == HAL_OK);
  __HAL_LINKDMA(&hi2s2, hdmatx, hdma_i2s2_ext_tx);
  /* DMA1_Stream4_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(DMA1_Stream4_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(DMA1_Stream4_IRQn);
@ALABSTM ALABSTM added bug Something isn't working hal HAL-LL driver-related issue or pull-request. labels Feb 5, 2024
@ALABSTM ALABSTM added the dma DMA-related issue or pull-request. label May 27, 2024
@TOUNSTM TOUNSTM assigned KRASTM and unassigned TOUNSTM Aug 15, 2024
@KRASTM
Copy link
Contributor

KRASTM commented Aug 19, 2024

ST Internal Reference: 188897

@KRASTM KRASTM added the internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dma DMA-related issue or pull-request. hal HAL-LL driver-related issue or pull-request. internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system
Projects
Development

No branches or pull requests

4 participants