Page 1 of 1

esp_console.h init and deinit issue

Posted: Sun Mar 10, 2019 12:37 pm
by Kalveo
In a project I'm working on I am using

Code: Select all

esp_err_t esp_console_init(const esp_console_config_t* config)
and

Code: Select all

esp_err_t esp_console_deinit()
In the scenario when I'm using them in the order init -> deinit -> init I get the error ESP_ERR_INVALID_STATE. Debugging shows that this is because s_tmp_line_buf is not NULL in

Code: Select all

if (s_tmp_line_buf) {
        return ESP_ERR_INVALID_STATE;
    }
despite being freed in the deinit function. Is this intended behavior or is this a bug?

Re: esp_console.h init and deinit issue

Posted: Sun Mar 10, 2019 4:48 pm
by ESP_igrr
Looks like a bug, esp_console_deinit should set s_tmp_line_buf to NULL after freeing.