Skip to main content
DOyad.1
Associate
March 3, 2023
Solved

Hello, How would you go about storing the PCM data on an SD card, instead of via USB on the X-NUCLEO-AMICAM1 expansion board? I'm trying to modify the sample code that was provided. Thanks,

  • March 3, 2023
  • 2 replies
  • 2995 views

..

    This topic has been closed for replies.
    Best answer by SimonePradolini

    Hello @DOyad.1​ 

    AudioProcess is the right callback, where 1ms of audio samples are ready to be used in your application.

    How are you saving the files? If it is a .wav, have you added the proper header and description in the file before opening it and start saving data?

    Look at the example Datalog_Audio available here: https://www.st.com/en/embedded-software/stsw-stlkt01.html

    It has been developed on another ST platform, but it is still based on an STM32L4, so porting should be feasible.

    Let me know if this can help you

    Best regards

    Simone

    2 replies

    SimonePradolini
    Technical Moderator
    March 6, 2023

    Hello @DOyad.1​ 

    It should be feasible, but there is no X-NUCLEO from ST that is natively supporting SD card.

    SD card pinout changes in base of the HW provider and depends also from the NUCLEO used; there is no a unique standard to support SD for X-NUCLEO-AMICAM1.

    Best regards

    Simone

    In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
    DOyad.1
    DOyad.1Author
    Associate
    March 6, 2023

    Hi Simone @SPRAD.1​ ,

    I'm using the STM32L476RG board and a MicroSD breakout board for the SD card. I'm using SPI to communicate with the SD card, which works fine.

    My issue is saving the PCM data into an SD card. The sample code provided uses the USB interface. I thought it would be straightforward since a function transmits the data over USB. I could just take the PCM data and store it on an SD Card instead of over USB.

    When I play back the audio, I get a lot of noise.

    0693W00000aIJ4vQAG.pngW_002 is the data stored on the SD card, and Audio Track is audio transmitted over USB.

    I've been trying to store the data in the PCM buffer on the SD card.0693W00000aIJ4lQAG.png 

    Is it possible to store the PCM data on the SD Card, or must something else be done before I can save it onto the SD card?

    Thanks,

    Daniel

    SimonePradolini
    SimonePradoliniBest answer
    Technical Moderator
    March 8, 2023

    Hello @DOyad.1​ 

    AudioProcess is the right callback, where 1ms of audio samples are ready to be used in your application.

    How are you saving the files? If it is a .wav, have you added the proper header and description in the file before opening it and start saving data?

    Look at the example Datalog_Audio available here: https://www.st.com/en/embedded-software/stsw-stlkt01.html

    It has been developed on another ST platform, but it is still based on an STM32L4, so porting should be feasible.

    Let me know if this can help you

    Best regards

    Simone

    In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
    DOyad.1
    DOyad.1Author
    Associate
    March 6, 2023

    Hi Simone,

    I'm using the STM32L476RG board and a MicroSD breakout board for the SD card. I'm using SPI to communicate with the SD card, which works fine.

    My issue is saving the PCM data into an SD card. The sample code provided uses the USB interface. I thought it would be straightforward since a function transmits the data over USB. I could just take the PCM data and store it on an SD Card instead of over USB.

    When I play back the audio, I get a lot of noise.

    0693W00000aIJ4vQAG.pngW_002 is the data stored on the SD card, and Audio Track is audio transmitted over USB.

    I've been trying to store the data in the PCM buffer on0693W00000aIJ4lQAG.png the SD card.

    Is it possible to store the PCM data on the SD Card, or must something else be done before I can save it onto the SD card?

    Thanks,

    Daniel