From 17b4973d4724d90af00841f791a5472b4239ab04 Mon Sep 17 00:00:00 2001 From: Simon Werner Date: Wed, 25 Oct 2017 17:44:08 +1300 Subject: [PATCH 1/9] docs: Improved documentation for /dev/ttyUSB0 issues Improved documentation for /dev/ttyUSB0 issues. This occurred in Ubuntu, but I'm sure is applies to most distributions. Merges https://github.com/espressif/esp-idf/pull/1158 --- docs/get-started/linux-setup.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/get-started/linux-setup.rst b/docs/get-started/linux-setup.rst index 3fa563a4ca..f4e624b22f 100644 --- a/docs/get-started/linux-setup.rst +++ b/docs/get-started/linux-setup.rst @@ -70,6 +70,15 @@ ESP32 toolchain for Linux is available for download from Espressif website: Instead of ``/home/user-name`` there should be a home path specific to your installation. +Permission issues /dev/ttyUSB0 +------------------------------ + +With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0`` error message when flashing the ESP32. This can be solved by adding the current user to the ``dialout`` group, such as running the following command:: + + sudo adduser $USER dialout + + + Arch Linux Users ---------------- From 4da90f09e7a80aa24fbbbd5e8dcce34387346a35 Mon Sep 17 00:00:00 2001 From: Krzysztof Bociurko Date: Sun, 29 Oct 2017 22:49:41 +0100 Subject: [PATCH 2/9] freertos: minor issue in documentation snippet of queue. taskYIELD was used in ISR context, but portYIELD_FROM_ISR should instead. Merges https://github.com/espressif/esp-idf/pull/1187 --- components/freertos/include/freertos/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/freertos/include/freertos/queue.h b/components/freertos/include/freertos/queue.h index 9d95ad1bb6..638157765a 100644 --- a/components/freertos/include/freertos/queue.h +++ b/components/freertos/include/freertos/queue.h @@ -1106,7 +1106,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; // Now the buffer is empty we can switch context if necessary. if( xHigherPriorityTaskWoken ) { - taskYIELD (); + portYIELD_FROM_ISR (); } } @@ -1177,7 +1177,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; // Now the buffer is empty we can switch context if necessary. if( xHigherPriorityTaskWoken ) { - taskYIELD (); + portYIELD_FROM_ISR (); } } From ad8ebe5b6346b1da81c05e5e95a78d4089524083 Mon Sep 17 00:00:00 2001 From: Dominik Palo Date: Sun, 5 Nov 2017 12:32:54 +0100 Subject: [PATCH 3/9] Update spp_client_demo.c Merges https://github.com/espressif/esp-idf/pull/1229 --- examples/bluetooth/ble_spp_client/main/spp_client_demo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bluetooth/ble_spp_client/main/spp_client_demo.c b/examples/bluetooth/ble_spp_client/main/spp_client_demo.c index 9eadc13b7f..0cc082297a 100644 --- a/examples/bluetooth/ble_spp_client/main/spp_client_demo.c +++ b/examples/bluetooth/ble_spp_client/main/spp_client_demo.c @@ -601,7 +601,7 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par } //the unit of the duration is second uint32_t duration = 0xFFFF; - ESP_LOGE(GATTC_TAG, "Enable Ble Scan:during time 0x%04X minutes.",duration); + ESP_LOGI(GATTC_TAG, "Enable Ble Scan:during time 0x%04X minutes.",duration); esp_ble_gap_start_scanning(duration); break; } From 31711b5ac75e6b2cb05d2554bd9e665cd31b0845 Mon Sep 17 00:00:00 2001 From: Raphael Luba Date: Wed, 8 Nov 2017 13:36:37 +0100 Subject: [PATCH 4/9] SPI: Document TIMEOUT return values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `spi_device_queue_trans` and `spi_device_get_trans_result` can return `ESP_ERR_TIMEOUT` – but this had not been documented. Merges https://github.com/espressif/esp-idf/pull/1243 --- components/driver/include/driver/spi_master.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/driver/include/driver/spi_master.h b/components/driver/include/driver/spi_master.h index f43394d3c1..2dac55782a 100644 --- a/components/driver/include/driver/spi_master.h +++ b/components/driver/include/driver/spi_master.h @@ -184,6 +184,7 @@ esp_err_t spi_bus_remove_device(spi_device_handle_t handle); * never time out. * @return * - ESP_ERR_INVALID_ARG if parameter is invalid + * - ESP_ERR_TIMEOUT if there was no room in the queue before ticks_to_wait expired * - ESP_OK on success */ esp_err_t spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t ticks_to_wait); @@ -205,6 +206,7 @@ esp_err_t spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t * out. * @return * - ESP_ERR_INVALID_ARG if parameter is invalid + * - ESP_ERR_TIMEOUT if there was no completed transaction before ticks_to_wait expired * - ESP_OK on success */ esp_err_t spi_device_get_trans_result(spi_device_handle_t handle, spi_transaction_t **trans_desc, TickType_t ticks_to_wait); From f54e99008deff6596efee563e42a9724d8c28f74 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 17 Nov 2017 10:52:21 +1100 Subject: [PATCH 5/9] spi: Add ESP_ERR_NO_MEM to spi_device_queue_trans() documentation Ref https://github.com/espressif/esp-idf/pull/1243#issuecomment-343103414 --- components/driver/include/driver/spi_master.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/driver/include/driver/spi_master.h b/components/driver/include/driver/spi_master.h index 2dac55782a..4e5b66f628 100644 --- a/components/driver/include/driver/spi_master.h +++ b/components/driver/include/driver/spi_master.h @@ -182,9 +182,10 @@ esp_err_t spi_bus_remove_device(spi_device_handle_t handle); * @param trans_desc Description of transaction to execute * @param ticks_to_wait Ticks to wait until there's room in the queue; use portMAX_DELAY to * never time out. - * @return + * @return * - ESP_ERR_INVALID_ARG if parameter is invalid * - ESP_ERR_TIMEOUT if there was no room in the queue before ticks_to_wait expired + * - ESP_ERR_NO_MEM if allocating DMA-capable temporary buffer failed * - ESP_OK on success */ esp_err_t spi_device_queue_trans(spi_device_handle_t handle, spi_transaction_t *trans_desc, TickType_t ticks_to_wait); From 0dea8bca46a72b77a57c42089026df05cd4ff3e9 Mon Sep 17 00:00:00 2001 From: petermccloud Date: Wed, 15 Nov 2017 19:44:25 -0800 Subject: [PATCH 6/9] fixed broken tcp_perf example by adding nvs_flash --- examples/performance/tcp_perf/main/tcp_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/performance/tcp_perf/main/tcp_main.c b/examples/performance/tcp_perf/main/tcp_main.c index 1497e6150e..c96b0d02b4 100644 --- a/examples/performance/tcp_perf/main/tcp_main.c +++ b/examples/performance/tcp_perf/main/tcp_main.c @@ -33,6 +33,7 @@ step3: #include "freertos/event_groups.h" #include "esp_log.h" #include "esp_err.h" +#include "nvs_flash.h" #include "tcp_perf.h" @@ -123,6 +124,7 @@ static void tcp_conn(void *pvParameters) void app_main(void) { + nvs_flash_init(); #if EXAMPLE_ESP_WIFI_MODE_AP ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP"); wifi_init_softap(); From 3b84c1e8fa994c00a2f9b1fd27e4b73b93192b71 Mon Sep 17 00:00:00 2001 From: petermccloud Date: Wed, 15 Nov 2017 19:52:55 -0800 Subject: [PATCH 7/9] fixed broken udp_perf example by adding nvs_flash Merges https://github.com/espressif/esp-idf/pull/1279 --- examples/performance/udp_perf/main/udp_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/performance/udp_perf/main/udp_main.c b/examples/performance/udp_perf/main/udp_main.c index d4d8b1fa96..cad32a8134 100644 --- a/examples/performance/udp_perf/main/udp_main.c +++ b/examples/performance/udp_perf/main/udp_main.c @@ -36,6 +36,7 @@ step3: #include "freertos/event_groups.h" #include "esp_log.h" #include "esp_err.h" +#include "nvs_flash.h" #include "udp_perf.h" @@ -102,6 +103,7 @@ static void udp_conn(void *pvParameters) void app_main(void) { + nvs_flash_init(); #if EXAMPLE_ESP_WIFI_MODE_AP ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP"); wifi_init_softap(); From 05dd46cd7299a6315a953ce5f13fbb6659cd0bbb Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 20 Nov 2017 16:07:52 +1100 Subject: [PATCH 8/9] udp_perf/tcp_perf examples: Erase NVS if no more free pages Follows same pattern as other examples. Amendment to https://github.com/espressif/esp-idf/pull/1279 --- examples/performance/tcp_perf/main/tcp_main.c | 8 +++++++- examples/performance/udp_perf/main/udp_main.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/performance/tcp_perf/main/tcp_main.c b/examples/performance/tcp_perf/main/tcp_main.c index c96b0d02b4..000ed6d42a 100644 --- a/examples/performance/tcp_perf/main/tcp_main.c +++ b/examples/performance/tcp_perf/main/tcp_main.c @@ -124,7 +124,13 @@ static void tcp_conn(void *pvParameters) void app_main(void) { - nvs_flash_init(); + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK( ret ); + #if EXAMPLE_ESP_WIFI_MODE_AP ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP"); wifi_init_softap(); diff --git a/examples/performance/udp_perf/main/udp_main.c b/examples/performance/udp_perf/main/udp_main.c index cad32a8134..8bbd05ff0f 100644 --- a/examples/performance/udp_perf/main/udp_main.c +++ b/examples/performance/udp_perf/main/udp_main.c @@ -103,7 +103,13 @@ static void udp_conn(void *pvParameters) void app_main(void) { - nvs_flash_init(); + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK( ret ); + #if EXAMPLE_ESP_WIFI_MODE_AP ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP"); wifi_init_softap(); From 4b8c90bce0daf5af37921abeee997c4ba68994d7 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 20 Nov 2017 16:10:38 +1100 Subject: [PATCH 9/9] doc: Unify the two sections about the "dialout" group on Linux An addition to https://github.com/espressif/esp-idf/pull/1158 --- docs/get-started/establish-serial-connection.rst | 4 +++- docs/get-started/linux-setup.rst | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/get-started/establish-serial-connection.rst b/docs/get-started/establish-serial-connection.rst index f3e15250f1..929fe1ec24 100644 --- a/docs/get-started/establish-serial-connection.rst +++ b/docs/get-started/establish-serial-connection.rst @@ -54,10 +54,12 @@ MacOS :: ls /dev/cu.* +.. _linux-dialout-group: + Adding user to ``dialout`` on Linux ----------------------------------- -The currently logged user should have read and write access the serial port over USB. This is done by adding the user to ``dialout`` group with the following command:: +The currently logged user should have read and write access the serial port over USB. On most Linux distributions, this is done by adding the user to ``dialout`` group with the following command:: sudo usermod -a -G dialout $USER diff --git a/docs/get-started/linux-setup.rst b/docs/get-started/linux-setup.rst index f4e624b22f..1c94510e1e 100644 --- a/docs/get-started/linux-setup.rst +++ b/docs/get-started/linux-setup.rst @@ -73,10 +73,7 @@ ESP32 toolchain for Linux is available for download from Espressif website: Permission issues /dev/ttyUSB0 ------------------------------ -With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0`` error message when flashing the ESP32. This can be solved by adding the current user to the ``dialout`` group, such as running the following command:: - - sudo adduser $USER dialout - +With some Linux distributions you may get the ``Failed to open port /dev/ttyUSB0`` error message when flashing the ESP32. :ref:`This can be solved by adding the current user to the dialout group`. Arch Linux Users