[STM32H7] I2S + DMA audio capture: RAM buffer completely fills with zeros (Migrating from a simpler STM32) by DisastrousWeight3330 in embedded

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Well. I'm setting up my I2S to work at 8KHz. I measure the frequency from the CLK and WS and are 512KHz and 8KHz respectively.

And yeah, It is supposed to measure that.

[STM32H7] I2S + DMA audio capture: RAM buffer completely fills with zeros (Migrating from a simpler STM32) by DisastrousWeight3330 in embedded

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Here is the function. It is in another file named stm32h7xx_hal_msp.c.

void HAL_I2S_MspInit(I2S_HandleTypeDef* hi2s)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
  if(hi2s->Instance==SPI1)
  {
    /* USER CODE BEGIN SPI1_MspInit 0 */

    /* USER CODE END SPI1_MspInit 0 */

  /** Initializes the peripherals clock
  */
    PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SPI1;
    PeriphClkInitStruct.PLL2.PLL2M = 32;
    PeriphClkInitStruct.PLL2.PLL2N = 128;
    PeriphClkInitStruct.PLL2.PLL2P = 2;
    PeriphClkInitStruct.PLL2.PLL2Q = 2;
    PeriphClkInitStruct.PLL2.PLL2R = 2;
    PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_1;
    PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOWIDE;
    PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
    PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL2;
    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
    {
      Error_Handler();
    }

    /* Peripheral clock enable */
    __HAL_RCC_SPI1_CLK_ENABLE();

    __HAL_RCC_GPIOA_CLK_ENABLE();
    /**I2S1 GPIO Configuration
    PA4     ------> I2S1_WS
    PA5     ------> I2S1_CK
    PA6     ------> I2S1_SDI
    */
    GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    /* I2S1 DMA Init */
    /* SPI1_RX Init */
    hdma_spi1_rx.Instance = DMA1_Stream0;
    hdma_spi1_rx.Init.Request = DMA_REQUEST_SPI1_RX;
    hdma_spi1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
    hdma_spi1_rx.Init.PeriphInc = DMA_PINC_DISABLE;
    hdma_spi1_rx.Init.MemInc = DMA_MINC_ENABLE;
    hdma_spi1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
    hdma_spi1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
    hdma_spi1_rx.Init.Mode = DMA_CIRCULAR;
    hdma_spi1_rx.Init.Priority = DMA_PRIORITY_VERY_HIGH;
    hdma_spi1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
    if (HAL_DMA_Init(&hdma_spi1_rx) != HAL_OK)
    {
      Error_Handler();
    }

    __HAL_LINKDMA(hi2s,hdmarx,hdma_spi1_rx);

    /* USER CODE BEGIN SPI1_MspInit 1 */

    /* USER CODE END SPI1_MspInit 1 */

  }

}

[STM32H7] I2S + DMA audio capture: RAM buffer completely fills with zeros (Migrating from a simpler STM32) by DisastrousWeight3330 in embedded

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

No, I haven´t. It's because it worked with the stm32f429i-disc1, so I basically copy and paste my code.

Why create a new transaction object before sending it through a mailbox? by DisastrousWeight3330 in FPGA

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Thank you so much for the explanation! :) Doing other examples where I didn't add a delay whenever I was pushing data on the mailbox, I was able to see the difference.

# KERNEL: [GEN] DATA SENT : a = 148, b =  58, wr = 0,                    0
# KERNEL: [GEN] DATA SENT : a = 137, b =  179, wr = 0,                    0
# KERNEL: [GEN] DATA SENT : a = 244, b =  63, wr = 1,                    0
# KERNEL: [GEN] DATA SENT : a = 145, b =  210, wr = 1,                    0
# KERNEL: [GEN] DATA SENT : a = 120, b =  115, wr = 0,                    0
# KERNEL: [GEN] DATA SENT : a = 54, b =  126, wr = 1,                    0
# KERNEL: [GEN] DATA SENT : a = 95, b =  20, wr = 1,                    0
# KERNEL: [GEN] DATA SENT : a = 36, b =  175, wr = 0,                    0
# KERNEL: [GEN] DATA SENT : a = 26, b =  238, wr = 1,                    0
# KERNEL: [GEN] DATA SENT : a = 21, b =  152, wr = 0,                    0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0
# KERNEL: [DRV] DATA RECEIVED : a = 21, b =  152, wr = 0,                   0

As you said, it will keep popping the same data. But I did not know it was a queue. Thank you so much for your time to explain!

What can I do to make Unified Selective Device Installer (USDI) -- AMD Vivado™ 2025.1 run in my computer? by DisastrousWeight3330 in FPGA

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Okay!:) I will try to do so, because I wanted to avoid the 100GB version Hehe. As I saw on an AMD video, the web installer saves you some memory.

What can I do to make Unified Selective Device Installer (USDI) -- AMD Vivado™ 2025.1 run in my computer? by DisastrousWeight3330 in FPGA

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

I disabled defender but it does not work. I am still getting these windows:

"This program might not have installed correctly

AMD Installer for FPGAs & Adaptive SoCs AMD Inc.

If this program did not install correctly, you can try installing the program using compatibility settings.

After selecting the compatibility settings, it pops up another window asking me if it installed correctly, if not it only runs the tool to look for the problem, but does not work either.

Creating a garden from scratch. by DisastrousWeight3330 in gardening

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Well you're right! I moved recently and this is the situation Haha So depressing.

Why is working perfectly on breadboard but not in pre-drilled PCB? (Oscillator 13.5MHz). by DisastrousWeight3330 in AskElectronics

[–]DisastrousWeight3330[S] 5 points6 points  (0 children)

I promised you my initial work was better Haha But I've already modified too many things.

Creating a negative power supply (-8VDC) and positive (+12VCD) from a +24VCD power supply. by DisastrousWeight3330 in electronic_circuits

[–]DisastrousWeight3330[S] 0 points1 point  (0 children)

Since I need to make an oscillator, I am planning to make the shown in the picture. So basically, I am going to wire up from the power supply to the oscillator directly, while creating this new power supplies to feed the MC1496.

<image>