cancel
Showing results for 
Search instead for 
Did you mean: 

48 kHz 32 bit sampling on STM32F769DI

IWhit.2
Associate II

I've used pizza and beer's code (https://www.youtube.com/watch?v=O2XaCFsWxSw&t=1399s) for a 48 kHz in out CODEC routine on a STM32F769DI board successfully.

My issue is that the incoming data in memory needs shifting before I can convert it to a float value. Data in memory is organised as (eight bytes representing left and right samples, from low to high address)

LB02, LB03, LB00, LB01, RB02, RB03, RB00, RB01 .......

which then has to be shifted/reorganised to

LB03, LB02, LB01, LB00, RB03, RB02, RB01, RB00 .......

so it can be recreated as float32 values for left and right channels.

I've gone through the DMA/SAI and WM8994 code to see if I can correct the byte ordering so as not to necessitate manual reordering once the DMA buffer half is complete but can't find where to fix.

Best regards

Ian

1 REPLY 1

> I've gone through the DMA/SAI and WM8994 code

What code?

That ordering is typically result of using SPI/I2S unit, due to it being 16-bit, so transmitting/receiving 32-bit words in two chunks; plus that I2S is MSB-first. SAI shouldn't result in that ordering.

JW