cancel
Showing results for 
Search instead for 
Did you mean: 

Hello ST community Experts , MEMS mic + STM32f4xx evaluation board I am trying to stream PCM data serially on UART . Some issues please help?

SG.4
Associate II

Configurations :- STM32CubeMX M4-F446RE+ICS43432 mic

sysclk-168MHz HSE, DMA- circular,SPI2_RX ,half word

I2S2 - half duplex ,master receive mode 32KHz audio frequency

USART2 - 9600 B/s

PDM2PCM middleware use for conversion

..

1)Can Anyone suggest is there anything wrong with the configuration?

2) Now how do I acquire the PCM streaming data to print serially over UART?

3) And how I interface the BSP package before generating the code in the cubeMX

....

Thanks in advance.

7 REPLIES 7

Hello

9600 bps is not adequate rate for this job

32khz sample rate with 16 bit samples need at least 640kbps rate .

Hi @Vangelis Fortounas​ ,

Appreciate your reply thank you .

ok will look into it.

..

Further of the question any ideas answers if you have any experience please support.

Hello

I have no experience for audio over async serial transportation but i use serial ports.

UART can't send 16 bits and how the receiver will handle the situation that one byte is missing ? (everything is shifted and garbaged )

A "sync pattern" added every some words is fair solution for synchronization between transmitter and receiver but adds some data overhead.

if data integrity is crucial need a second layer tranportation protocol with packet counting , checksums, ACKs, resend, etc.

> 32khz sample rate with 16 bit samples need at least 640kbps rate .

This is a very optimistic estimate.

You need to add start/stop bits to each byte, and add redundancy to check for transmission errors and keep synchronicity.

And baudrates to external devices beyond 0,5Mbps are unrealistic in my experience.

I2S is made for this.

SG.4
Associate II

Hi @Ozone​ ,

Yes baud rate is taken care , but i want is 16 bit PCM and the UART is only 8bit +1 stop bit ... so how do I print 2 bytes on UART.?any suggestions

SG.4
Associate II

Hi @Vangelis Fortounas​ ,

Yes I got the point what you are explaining.

Thank you for your suggestion.

By sending multiple characters (bytes).

I would use text format, otherwise every lost or corrupted byte will desynchronize the reception.

Your protocol must be able to detect corrupted transmissions, and self-correct.

Otherwise, you will never get a stable communication, and errors can only be corrected by resetting one or both participants.