In my attempt to create a BSP Audio Driver for Nucleo boards, I am having difficulty visualizing how to get data out of the incoming audio packets.
Currently in my project, I am guessing where the audio buffers are located (by watching the memory for a block of data that changes every 1ms with the length 0x3E00) since I can't get that info out of the local USB Audio Device. Once I guess it, I set my DAC double-buffered DMA Audio to this address to play the data out thru the internal 12-bit DAC.
Obviously, it is a ridiculous way to code since every time I re-compile the code, the buffer location is different. Also, since I have no way of sensing where the read and write pointers are pointing to in the buffer, it is hard to synchronize the incoming data to the speed of the DMA transfers. The results is that the audio plays, but very erratically.
The USB Audio Device structures and variables seem to be local only. I'm assuming it is because the code has been written in HAL.
How could I get to the data from within my main program (I.E. - USB Audio Buffer Location Address, Read Pointer, Write Pointer, etc).
Any Ideas, comments, or suggestions would be greatly appreciated!