Page 1 of 1

UDMA Decoder and linked-list

Posted: Fri Feb 14, 2020 8:32 am
by Binogof
Hello Support Team and others,

i'm starting a project using ESP32 UART to receive data and need to configure UDMA,
but i can't understand the documentation,


from the UDMA part :
The UART DMA follows a format of (separator + data + separator). The Encoder is used for adding separators before and after data, as well as using special-character sequences to replace data that are the same asseparators. The Decoder is used for removing separators before and after data, as well as replacing the special-character sequences with separators. There can be multiple consecutive separators marking the beginning or end of data. These separators can be configured through UHCIx_SEPER_CH, with the default values being 0xC0. Data that are the same as separators can be replaced with UHCIx_ESC_SEQ0_CHAR0(0xDB by default) and UHCIx_ESC_SEQ0_CHAR1 (0xDD by default). After the transmission process is complete,a UHCIx_OUT_TOTAL_EOF_INT interrupt will be generated. After the reception procedure is complete, aUHCIx_IN_SUC_EOF_INT interrupt will be generated.
1) i can't use the specified format, what will happen if received data are the same as special-character sequences, will they be modified by the Decoder? Do i really need separator?

2) Do i have way not to use the Decoder?



from the DMA linked-list part:
•length (DW0) [23:12]: The number of valid bytes in the buffer corresponding to the current linked list. The field value indicates the number of bytes to be transferred to/from the buffer denoted by word DW1.
•size (DW0) [11:0]: The size of the buffer corresponding to the current linked list
i don't really get what the difference is here, do you have an example of how to create a linked list?


i hope you can help me,
thanks for reading!

Re: UDMA Decoder and linked-list

Posted: Thu Feb 20, 2020 5:17 pm
by ESP_houwenxiang
Hi, Binogof,
The encode and the decode is optional. If you don't want to use encoding and decoding, you should clear the following register:
[ conf0: seper_en, head_en, crc_rec_en, encode_crc_en ] and
[ escape_conf: tx_c0_esc_en, tx_db_esc_en, tx_11_esc_en, tx_13_esc_en, rx_c0_esc_en, rx_db_esc_en, rx_11_esc_en, rx_13_esc_en]


2: DMA linked list is a linked list formed by nodes of type lldesc_t,

Code: Select all

// defination in /components/esp32/include/rom/lldesc.h

/* this bitfield is start from the LSB!!! */
typedef struct lldesc_s {
    volatile uint32_t size  :12,
                        length:12,
                        offset: 5, /* h/w reserved 5bit, s/w use it as offset in buffer */
                        sosf  : 1, /* start of sub-frame */
                        eof   : 1, /* end of frame */
                        owner : 1; /* hw or sw */
    volatile uint8_t *buf;       /* point to buffer data */
    union{
        volatile uint32_t empty;
        STAILQ_ENTRY(lldesc_s) qe;  /* pointing to the next desc */
    };
} lldesc_t;
You can refer to how to use DMA link in I2S driver.