Initialize a vector for DMA transfer

I am new to the PNYQ board and just following your tutorial for learning purposes. I can see that you have used random data to input in the buffer.

for i in range(data_size):
    input_buffer[i] = i + 0xcafe0000

What if we want to initialize a vector such as vec=[1,2,3,…1000] rather than random values in buffer? How can we do it? Kindly guide me. Thanks

The DMA buffers are numpy arrays so you can initialize them in the same way as you would for any other numpy array.

Cathal

1 Like