From 058c6afd3ce2cdd354bd7d7e855fc6cb7cec4f4f Mon Sep 17 00:00:00 2001 From: Stephen Bird Date: Mon, 15 Oct 2018 17:28:29 -0700 Subject: [PATCH 01/10] Add option to disable server side SSL session tickets as well as client Closes https://github.com/espressif/esp-idf/pull/2570 --- components/mbedtls/Kconfig | 13 ++++++++++--- .../mbedtls/port/include/mbedtls/esp_config.h | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/mbedtls/Kconfig b/components/mbedtls/Kconfig index 5ad419cec..4d1d527fe 100644 --- a/components/mbedtls/Kconfig +++ b/components/mbedtls/Kconfig @@ -330,13 +330,20 @@ menu "mbedTLS" help Disabling this option will save some code size if it is not needed. - config MBEDTLS_SSL_SESSION_TICKETS - bool "TLS: Support RFC 5077 SSL session tickets" + config MBEDTLS_CLIENT_SSL_SESSION_TICKETS + bool "TLS: Client Support for RFC 5077 SSL session tickets" default y depends on MBEDTLS_TLS_ENABLED help - Support RFC 5077 session tickets. See mbedTLS documentation for more details. + Client support for RFC 5077 session tickets. See mbedTLS documentation for more details. + Disabling this option will save some code size. + config MBEDTLS_SERVER_SSL_SESSION_TICKETS + bool "TLS: Server Support for RFC 5077 SSL session tickets" + default y + depends on MBEDTLS_TLS_ENABLED + help + Server support for RFC 5077 session tickets. See mbedTLS documentation for more details. Disabling this option will save some code size. menu "Symmetric Ciphers" diff --git a/components/mbedtls/port/include/mbedtls/esp_config.h b/components/mbedtls/port/include/mbedtls/esp_config.h index 89cdef892..40ae3ae36 100644 --- a/components/mbedtls/port/include/mbedtls/esp_config.h +++ b/components/mbedtls/port/include/mbedtls/esp_config.h @@ -1308,7 +1308,7 @@ * * Comment this macro to disable support for SSL session tickets */ -#ifdef CONFIG_MBEDTLS_SSL_SESSION_TICKETS +#ifdef CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS #define MBEDTLS_SSL_SESSION_TICKETS #endif @@ -2340,7 +2340,9 @@ * * Requires: MBEDTLS_CIPHER_C */ +#ifdef CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS #define MBEDTLS_SSL_TICKET_C +#endif /** * \def MBEDTLS_SSL_CLI_C From 4430456b64fbe922a9756cbb59ef239ace8cac13 Mon Sep 17 00:00:00 2001 From: Oleg Antonyan Date: Fri, 7 Dec 2018 09:34:15 +0200 Subject: [PATCH 02/10] Change SPI_USE_RXDATA->SPI_TRANS_USE_RXDATA and SPI_USE_TXDATA->SPI_TRANS_USE_TXDATA on documentation Closes https://github.com/espressif/esp-idf/pull/2802 --- components/driver/include/driver/spi_master.h | 4 ++-- docs/en/api-reference/peripherals/spi_master.rst | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/driver/include/driver/spi_master.h b/components/driver/include/driver/spi_master.h index 3b1723381..01348d01a 100644 --- a/components/driver/include/driver/spi_master.h +++ b/components/driver/include/driver/spi_master.h @@ -133,11 +133,11 @@ struct spi_transaction_t { void *user; ///< User-defined variable. Can be used to store eg transaction ID. union { const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - uint8_t tx_data[4]; ///< If SPI_USE_TXDATA is set, data set here is sent directly from this variable. + uint8_t tx_data[4]; ///< If SPI_TRANS_USE_TXDATA is set, data set here is sent directly from this variable. }; union { void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase. Written by 4 bytes-unit if DMA is used. - uint8_t rx_data[4]; ///< If SPI_USE_RXDATA is set, data is received directly to this variable + uint8_t rx_data[4]; ///< If SPI_TRANS_USE_RXDATA is set, data is received directly to this variable }; } ; //the rx data should start from a 32-bit aligned address to get around dma issue. diff --git a/docs/en/api-reference/peripherals/spi_master.rst b/docs/en/api-reference/peripherals/spi_master.rst index b33faab2a..e02bda151 100644 --- a/docs/en/api-reference/peripherals/spi_master.rst +++ b/docs/en/api-reference/peripherals/spi_master.rst @@ -78,8 +78,8 @@ and/or address. This is reflected in the device configuration: when the ``comman fields are set to zero, no command or address phase is done. Something similar is true for the read and write phase: not every transaction needs both data to be written -as well as data to be read. When ``rx_buffer`` is NULL (and SPI_USE_RXDATA) is not set) the read phase -is skipped. When ``tx_buffer`` is NULL (and SPI_USE_TXDATA) is not set) the write phase is skipped. +as well as data to be read. When ``rx_buffer`` is NULL (and SPI_TRANS_USE_RXDATA) is not set) the read phase +is skipped. When ``tx_buffer`` is NULL (and SPI_TRANS_USE_TXDATA) is not set) the write phase is skipped. The driver offers two different kinds of transactions: the interrupt transactions and the polling transactions. Each device can choose one kind of @@ -205,8 +205,8 @@ Tips 1. Transactions with small amount of data: Sometimes, the amount of data is very small making it less than optimal allocating a separate buffer for it. If the data to be transferred is 32 bits or less, it can be stored in the transaction struct - itself. For transmitted data, use the ``tx_data`` member for this and set the ``SPI_USE_TXDATA`` flag - on the transmission. For received data, use ``rx_data`` and set ``SPI_USE_RXDATA``. In both cases, do + itself. For transmitted data, use the ``tx_data`` member for this and set the ``SPI_TRANS_USE_TXDATA`` flag + on the transmission. For received data, use ``rx_data`` and set ``SPI_TRANS_USE_RXDATA``. In both cases, do not touch the ``tx_buffer`` or ``rx_buffer`` members, because they use the same memory locations as ``tx_data`` and ``rx_data``. From 920d35b5d01d001240c7e3e72ea7825be3736de1 Mon Sep 17 00:00:00 2001 From: lenhart Date: Sat, 6 Apr 2019 21:30:10 +0200 Subject: [PATCH 03/10] Update i2c documentation Description for i2c_slave_read_buffer had leftover from copying from write fct. data pointer description described the wrong way (writing into internal buffer) Closes https://github.com/espressif/esp-idf/pull/3268 --- components/driver/include/driver/i2c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/include/driver/i2c.h b/components/driver/include/driver/i2c.h index feb1d78bd..0bd0e2aae 100644 --- a/components/driver/include/driver/i2c.h +++ b/components/driver/include/driver/i2c.h @@ -384,7 +384,7 @@ int i2c_slave_write_buffer(i2c_port_t i2c_num, uint8_t* data, int size, TickType * Only call this function in I2C slave mode * * @param i2c_num I2C port number - * @param data data pointer to write into internal buffer + * @param data data pointer to accept data from internal buffer * @param max_size Maximum data size to read * @param ticks_to_wait Maximum waiting ticks * From 485df5e6c593f8b6e2412271e305d1ddd96ed215 Mon Sep 17 00:00:00 2001 From: Mark Stevens Date: Sun, 7 Apr 2019 10:25:57 +0100 Subject: [PATCH 04/10] Fixed inconcsistent file name Closes https://github.com/espressif/esp-idf/pull/3270 --- docs/en/api-guides/app_trace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/api-guides/app_trace.rst b/docs/en/api-guides/app_trace.rst index c0b0a0bd4..f2e348497 100644 --- a/docs/en/api-guides/app_trace.rst +++ b/docs/en/api-guides/app_trace.rst @@ -384,7 +384,7 @@ Command usage examples: .. highlight:: none -1. Collect SystemView tracing data to files "pro-cpu.SVDat" and "pro-cpu.SVDat". The files will be saved in "openocd-esp32" directory. +1. Collect SystemView tracing data to files "pro-cpu.SVDat" and "app-cpu.SVDat". The files will be saved in "openocd-esp32" directory. :: From b6ad4579041300498ad450f4291b2fcb08758cd6 Mon Sep 17 00:00:00 2001 From: Alois Mbutura Date: Fri, 12 Apr 2019 13:13:21 +0300 Subject: [PATCH 05/10] Update esp_eddystone_api.h Change incorrect bitshifts in big_endian_read_32() function. This was giving wrong values of of the 4 byte fieldswithin the eddystone TLM message, namely 'ADV_CNT' and 'SEC_CNT' --- examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h b/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h index 946abab54..41ad278e8 100644 --- a/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h +++ b/examples/bluetooth/ble_eddystone/main/esp_eddystone_api.h @@ -53,7 +53,7 @@ static inline uint16_t big_endian_read_16(const uint8_t *buffer, uint8_t pos) static inline uint32_t big_endian_read_32(const uint8_t *buffer, uint8_t pos) { - return (((uint32_t)buffer[pos]) << 24) | (((uint32_t)buffer[(pos)+1]) >> 16) | (((uint32_t)buffer[(pos)+2]) >> 8) | ((uint32_t)buffer[(pos)+3]); + return (((uint32_t)buffer[pos]) << 24) | (((uint32_t)buffer[(pos)+1]) << 16) | (((uint32_t)buffer[(pos)+2]) << 8) | ((uint32_t)buffer[(pos)+3]); } /* From 4b1f8ef3a25dae0315c505ea23beed156a6b6ade Mon Sep 17 00:00:00 2001 From: Alois Mbutura Date: Fri, 12 Apr 2019 13:18:44 +0300 Subject: [PATCH 06/10] Correct seconds calculation from TLM data field The SEC_CNT field in the eddystone TLM frame represents the number of centiseconds elapsed since reboot. A divisor of 10 has been placed within the code to derive seconds from SEC_CNT. Closes https://github.com/espressif/esp-idf/pull/3300 --- examples/bluetooth/ble_eddystone/main/esp_eddystone_demo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bluetooth/ble_eddystone/main/esp_eddystone_demo.c b/examples/bluetooth/ble_eddystone/main/esp_eddystone_demo.c index 7f6e67b86..525bcd2ae 100644 --- a/examples/bluetooth/ble_eddystone/main/esp_eddystone_demo.c +++ b/examples/bluetooth/ble_eddystone/main/esp_eddystone_demo.c @@ -70,7 +70,7 @@ static void esp_eddystone_show_inform(const esp_eddystone_result_t* res) ESP_LOGI(DEMO_TAG, "battery voltage: %d mV", res->inform.tlm.battery_voltage); ESP_LOGI(DEMO_TAG, "beacon temperature in degrees Celsius: %6.1f", res->inform.tlm.temperature); ESP_LOGI(DEMO_TAG, "adv pdu count since power-up: %d", res->inform.tlm.adv_count); - ESP_LOGI(DEMO_TAG, "time since power-up: %d s", res->inform.tlm.time); + ESP_LOGI(DEMO_TAG, "time since power-up: %d s", (res->inform.tlm.time)/10); break; } default: From 9495b7a7a61904258f194ec4648e98a1211310c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20M=C3=BCyessero=C4=9Flu?= Date: Mon, 22 Apr 2019 15:31:47 +0300 Subject: [PATCH 07/10] Minor fix on Scheduler Suspension subtitle Closes https://github.com/espressif/esp-idf/pull/3343 --- docs/en/api-guides/freertos-smp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/api-guides/freertos-smp.rst b/docs/en/api-guides/freertos-smp.rst index 51752170b..ac3a49ec8 100644 --- a/docs/en/api-guides/freertos-smp.rst +++ b/docs/en/api-guides/freertos-smp.rst @@ -291,7 +291,7 @@ resumed. Scheduler suspension in vanilla FreeRTOS is a common protection method against simultaneous access of data shared between tasks, whilst still allowing ISRs to be serviced. -In ESP-IDF FreeRTOS, :cpp:func:`xTaskResumeAll` will only prevent calls of +In ESP-IDF FreeRTOS, :cpp:func:`xTaskSuspendAll` will only prevent calls of ``vTaskSwitchContext()`` from switching contexts on the core that called for the suspension. Hence if **PRO_CPU** calls :cpp:func:`vTaskSuspendAll`, **APP_CPU** will still be able to switch contexts. If data is shared between tasks that are From 1c56e33d1cd4f3204135f59a745ca28cd208f8d0 Mon Sep 17 00:00:00 2001 From: Roosted7 Date: Mon, 22 Apr 2019 23:11:53 +0200 Subject: [PATCH 08/10] Improve Linux cmake getting started documentation Closes https://github.com/espressif/esp-idf/pull/3347 --- docs/en/get-started-cmake/index.rst | 2 +- docs/en/get-started-cmake/linux-setup.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/get-started-cmake/index.rst b/docs/en/get-started-cmake/index.rst index 97a8f37db..0181b25ea 100644 --- a/docs/en/get-started-cmake/index.rst +++ b/docs/en/get-started-cmake/index.rst @@ -283,7 +283,7 @@ Linux and MacOS cd ~/esp/hello_world idf.py menuconfig -If your default version of Python is 3.x, you may need to run ``python2 idf.py`` instead. +If your default version of Python is 3.x, you may need to run ``python2 $(which idf.py) menuconfig`` instead. Windows ~~~~~~~ diff --git a/docs/en/get-started-cmake/linux-setup.rst b/docs/en/get-started-cmake/linux-setup.rst index 1edca98b7..38766a7b7 100644 --- a/docs/en/get-started-cmake/linux-setup.rst +++ b/docs/en/get-started-cmake/linux-setup.rst @@ -21,7 +21,7 @@ To compile with ESP-IDF you need to get the following packages: - Arch:: - sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial python2-cryptography python2-future python2-pyparsing python2-pyelftools cmake ninja ccache + sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pip python2-pyserial python2-cryptography python2-future python2-pyparsing python2-pyelftools cmake ninja ccache .. note:: CMake version 3.5 or newer is required for use with ESP-IDF. Older Linux distributions may require updating, enabling of a "backports" repository, or installing of a "cmake3" package rather than "cmake". From 9ade9f68b3c9d9020deda1fb2049b92e4e2343d3 Mon Sep 17 00:00:00 2001 From: technosf Date: Thu, 9 May 2019 23:51:38 -0700 Subject: [PATCH 09/10] Update i2c.rst I2C mode is set during configuration, not the 'op(eration) mode' Closes https://github.com/espressif/esp-idf/pull/3452 --- docs/en/api-reference/peripherals/i2c.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/api-reference/peripherals/i2c.rst b/docs/en/api-reference/peripherals/i2c.rst index da3e1def4..2ff332357 100644 --- a/docs/en/api-reference/peripherals/i2c.rst +++ b/docs/en/api-reference/peripherals/i2c.rst @@ -31,7 +31,7 @@ Configure Driver The first step to establishing I2C communication is to configure the driver. This is done by setting several parameters contained in :cpp:type:`i2c_config_t` structure: -* I2C **operation mode** - select either slave or master from :cpp:type:`i2c_opmode_t` +* I2C **mode** - select either slave or master from :cpp:type:`i2c_mode_t` * Settings of the **communication pins**: * GPIO pin numbers assigned to the SDA and SCL signals @@ -56,7 +56,7 @@ Install Driver Having the configuration initialized, the next step is to install the I2C driver by calling :cpp:func:`i2c_driver_install`. This function call requires the following parameters: * The port number, one of the two ports available, selected from :cpp:type:`i2c_port_t` -* The operation mode, slave or master selected from :cpp:type:`i2c_opmode_t` +* The I2C mode, slave or master, selected from :cpp:type:`i2c_mode_t` * Sizes of buffers that will be allocated for sending and receiving data **in the slave mode** * Flags used to allocate the interrupt From 4f8d5d25c4152e96b96f758c967d51ee388827ba Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 11 Dec 2018 11:06:41 +0100 Subject: [PATCH 10/10] Delete unneeded code fragments from GPIO-example Closes https://github.com/espressif/esp-idf/pull/2822 --- .../main/ble_hidd_demo_main.c | 98 +------------------ 1 file changed, 4 insertions(+), 94 deletions(-) diff --git a/examples/bluetooth/ble_hid_device_demo/main/ble_hidd_demo_main.c b/examples/bluetooth/ble_hid_device_demo/main/ble_hidd_demo_main.c index ae7e0cac9..e26fa38d9 100644 --- a/examples/bluetooth/ble_hid_device_demo/main/ble_hidd_demo_main.c +++ b/examples/bluetooth/ble_hid_device_demo/main/ble_hidd_demo_main.c @@ -29,19 +29,10 @@ /** * Brief: - * This test code shows how to configure gpio and how to use gpio interrupt. - * - * GPIO status: - * GPIO18: output - * GPIO19: output - * GPIO4: input, pulled up, interrupt from rising edge and falling edge - * GPIO5: input, pulled up, interrupt from rising edge. - * - * Test: - * Connect GPIO18 with GPIO4 - * Connect GPIO19 with GPIO5 - * Generate pulses on GPIO18/19, that triggers interrupt on GPIO4/5 - * + * This example Implemented BLE HID device profile related functions, in which the HID device + * has 4 Reports (1 is mouse, 2 is keyboard and LED, 3 is Consumer Devices, 4 is Vendor devices). + * Users can choose different reports according to their own application scenarios. + * BLE HID profile inheritance and USB HID class. */ /** @@ -58,15 +49,6 @@ #define HID_DEMO_TAG "HID_DEMO" -#define GPIO_OUTPUT_IO_0 18 -#define GPIO_OUTPUT_IO_1 19 -#define GPIO_OUTPUT_PIN_SEL ((1<