I'm trying to make a I2S sound generator with DMA and PIO.
The PIO works so far.
If I generate a array.array with a length above 8 words I get in trouble with ... mhm "fragmentation"???
Here is how my code looks like:
Code: Select all
ring_buffer_size = 8
ring_buffer = array.array('L', (0x80000000 for _ in range(ring_buffer_size)))
time.sleep_ms(100) #wait for gc
ring_buffer_address = uctypes.addressof(ring_buffer)
#next lines are abstract to give you an idea
dma_init(ring_buffer_address, ring_buffer_size)
pio_init()
pio_start(i2s_config)
time.sleep_ms(1)
dma_start()
while True:
pass
My Question is, how I can make an array wich is represented by a compact bunch of words in SRAM followed by each other?
If you need more of my code for understanding it, let me know.
Best
Steven