Skip to content

Firmware not flashing after hard reset. #49

Description

@nikhil-robinson

Was trying the launchpad with DIY options to flash my own firmware which uses esp32s3 usb serial example normal uplodas work fine but when i do rest device the decives boots up and cannot upload again i need to disconnect and connect my esp32s3 again.

Dev board esp32s3.

firmware :

static void initUart() {


    /* Disable buffering on stdin */
    setvbuf(stdin, NULL, _IONBF, 0);
    setvbuf(stdout, NULL, _IONBF, 0);

    // /* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
    // esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(ESP_LINE_ENDINGS_NONE);
    // /* Move the caret to the beginning of the next line on '\n' */
    // esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(ESP_LINE_ENDINGS_NONE);

    /* Enable non-blocking mode on stdin and stdout */
    fcntl(fileno(stdout), F_SETFL, 0);
    fcntl(fileno(stdin), F_SETFL, 0);

    usb_serial_jtag_driver_config_t usb_serial_jtag_config;
    usb_serial_jtag_config.rx_buffer_size = 1024;
    usb_serial_jtag_config.tx_buffer_size = 1024;

    esp_err_t ret = ESP_OK;
    /* Install USB-SERIAL-JTAG driver for interrupt-driven reads and writes */
    ret = usb_serial_jtag_driver_install(&usb_serial_jtag_config);
    if (ret != ESP_OK) {
        return;
    }

    /* Tell vfs to use usb-serial-jtag driver */
    esp_vfs_usb_serial_jtag_use_driver();

}



static void Receive_callback(void *argument)
{

    // char buf1[1024]; // Assuming a maximum of 99 characters input
    int idx = 0;
    char ch;
    for (;;)
    {
        while ((ch = fgetc(stdin)) != EOF) 
        {
            stream_data[usb_offset] =ch;
            usb_offset++;
        }
    }
}

void usb_init()
{
     initUart();
    xTaskCreate(Receive_callback,"UART receive callback",4096,NULL,5,NULL); // receiving commands from main uart
    vTaskDelay(10);
    usb_offset =0;
}

void app_main()
{
        esp_log_level_set("*",ESP_LOG_NONE);
        usb_init();
        while (1)
	{
		printf("hello world\n");
		delay_ms(1);
	}
}

sdkconfig :
sdkconfig.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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