Skip to content

piolib: Please add some method of unblocking DMA write #117

@henryjliu

Description

@henryjliu

All I want to do is stream data without gaps but it doesn't seem possible on RP1 pio.

I set a large buffer:
#define BUF_SIZE 32768
uint8_t databuf[BUF_SIZE];
pio_sm_config_xfer(pio, sm, PIO_DIR_TO_SM, BUF_SIZE, 1);
while (1) {
pio_sm_xfer_data(pio, sm, PIO_DIR_TO_SM, sizeof(databuf), databuf);
sleep_ms(1); //simulate some calculation here
}

This works fine but the sleep_ms(1) inserts 1ms delay even though packet is 42ms long.

Doing:
while (1) {
pio_sm_xfer_data(pio, sm, PIO_DIR_TO_SM, sizeof(databuf), databuf);
}

In attempts to do continous data out, adds random blips of 100us and up to 5ms spacing.

Is there anyway around this eg automatic ring buffer or ping pong buffer? I don't understand what the last argument in pio_sm_config_xfer(pio, sm, PIO_DIR_TO_SM, BUF_SIZE, 1); does: different values doesn't seem to do anything -> any clues?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions