esp32-s3-korvo-2 uart does not receive

femahm
Posts: 2
Joined: Tue Feb 27, 2024 11:05 pm

esp32-s3-korvo-2 uart does not receive

Postby femahm » Tue Feb 27, 2024 11:18 pm

I am using a esp32-s3-korvo-2. It has tx0 and rx0 pins available on the board. I am trying to use the uart through these pins but Korvo only sends data and doesn't receive anything. I checked the pins using a logic analyzer and I can see the data coming to the rx0.

here is the loopback example that I am running. I'm wondering if there is any hardware limitation or any issue with my code.

Code: Select all

static void echo_task(void *arg)
{
    /* Configure parameters of an UART driver,
     * communication pins and install the driver */
    uart_config_t uart_config = {
        .baud_rate = ECHO_UART_BAUD_RATE,
        .data_bits = UART_DATA_8_BITS,
        .parity    = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
        .source_clk = UART_SCLK_DEFAULT,
    };
    int intr_alloc_flags = 0;

#if CONFIG_UART_ISR_IN_IRAM
    intr_alloc_flags = ESP_INTR_FLAG_IRAM;
#endif

    ESP_ERROR_CHECK(uart_driver_install(ECHO_UART_PORT_NUM, BUF_SIZE * 2, 0, 0, NULL, intr_alloc_flags));
    ESP_ERROR_CHECK(uart_param_config(ECHO_UART_PORT_NUM, &uart_config));
    ESP_ERROR_CHECK(uart_set_pin(ECHO_UART_PORT_NUM, ECHO_TEST_TXD, ECHO_TEST_RXD, ECHO_TEST_RTS, ECHO_TEST_CTS));

    // Configure a temporary buffer for the incoming data
    uint8_t *data = (uint8_t *) malloc(BUF_SIZE);
    // Write data to UART.
    char* test_str = "This is a test string.\n";
    uart_write_bytes(ECHO_UART_PORT_NUM, (const char*)test_str, strlen(test_str));
 
    while (1) {

        // Read data from the UART
        int len = uart_read_bytes(ECHO_UART_PORT_NUM, data, (BUF_SIZE - 1), 100);
        uart_write_bytes(ECHO_UART_PORT_NUM, (const char *) data, len);

        // Write data back to the UART
        // 
        if (len) {
            data[len] = '\0';
            ESP_LOGI(TAG, "Recv str: %s", (char *) data);
        }
    }
}


ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: esp32-s3-korvo-2 uart does not receive

Postby ESP_Sprite » Wed Feb 28, 2024 1:44 am

The Korvo has an usb-serial chip connected to those pins, and that interferes with the signal you're sending. Suggest picking other GPIOs that are not occupied.

femahm
Posts: 2
Joined: Tue Feb 27, 2024 11:05 pm

Re: esp32-s3-korvo-2 uart does not receive

Postby femahm » Tue Mar 12, 2024 6:18 pm

ESP_Sprite wrote:
Wed Feb 28, 2024 1:44 am
The Korvo has an usb-serial chip connected to those pins, and that interferes with the signal you're sending. Suggest picking other GPIOs that are not occupied.

thanks for your reply. I tried other pins but no change. Also, I prefer to use the available header on the Korvo so if there is a solution to use the uart as it is configured.

Who is online

Users browsing this forum: No registered users and 62 guests