Commit graph

3309 commits

Author SHA1 Message Date
Ivan Grokhotkov 6e7eb3c776 esp_timer: fix for the case when timer is deleted in callback
Timer callback can delete the timer. If CONFIG_ESP_TIMER_PROFILING was
enabled, this caused an access to invalid (freed) memory.
This fix adds a pointer to track the timer while executing the callback.
This is needed so that we can check if callback deletes the timer,
in which case we won't try updating profiling counters for this timer
after the callback is done.
2017-11-29 11:44:46 +08:00
yulong 7353307ca5 component/bt: reset the p_cmd_list pointer after release the mem. 2017-11-29 10:50:03 +08:00
Angus Gratton 1d5389668b Merge branch 'feature/dhcp_server_options_menuconfig' into 'master'
dhcpserver: Option to change lease time multiplier and number of max

See merge request !1595
2017-11-29 07:07:09 +08:00
Tian Hao 59931cd63b component/bt : fix actvie scan cannot send scan_req in a certain case 2017-11-28 20:11:40 +08:00
zhangyanjiao e315d7ca08 fix the dhcps default behaviour chenged by dns
Closes https://github.com/espressif/esp-idf/issues/1285
2017-11-28 16:39:00 +08:00
yulong 5b9131cc60 compoent/bt: Fix the bug when do the BLE pressure test will lead to memory leak will appear WDT. 2017-11-28 15:43:33 +08:00
Krzysztof Bociurko 626ad5f577 dhcpserver: Option to change lease time multiplier and number of max
stations connected to it.

Merges: https://github.com/espressif/esp-idf/pull/1206
2017-11-28 15:58:03 +11:00
Jiang Jiang Jian 0554bc59a2 Merge branch 'bugfix/tw16551_buffer_overflow' into 'master'
fix buffer overflow

See merge request !1605
2017-11-27 22:18:58 +08:00
Jiang Jiang Jian a83fbd3364 Merge branch 'bugfix/tw16287_tcp_send_succeed_after_station_disconnect' into 'master'
In STA mode, tcp_send cannot catch err after disconnect station

See merge request !1540
2017-11-27 21:30:46 +08:00
Jiang Jiang Jian 886047fb46 Merge branch 'bugfix/TW16564_tcp_connect/disconnect_crash' into 'master'
fix tcp connect/disconnect carsh

See merge request !1598
2017-11-27 21:30:11 +08:00
Jiang Jiang Jian 7980255498 Merge branch 'bugfix/btdm_scan_lead_to_conn_error' into 'master'
component/bt: Fixed the bug when stop scan if not set back the scan params will …

See merge request !1590
2017-11-27 21:21:13 +08:00
zhangyanjiao 768bbcd8aa fix buffer overflow in ipc.c 2017-11-27 18:47:40 +08:00
Ivan Grokhotkov 9e530fd063 Merge branch 'bugfix/allow_external_stack' into 'master'
freertos: fix a bug for incorrect check of allow-external-stack

See merge request !1596
2017-11-27 16:31:27 +08:00
zhangyanjiao 0b644ee515 fix tcp connect/disconnect carsh 2017-11-27 10:18:58 +08:00
Angus Gratton fccc30d2d5 bootloader: Only apply VDDSDIO 1.8V->1.9V if regulator is enabled
Fixes bug if regulator is disabled via efuse.
2017-11-27 10:33:41 +11:00
Angus Gratton 75ff6dce15 Merge branch 'docs/esp_ipc' into 'master'
docs/ipc documentation

See merge request !1584
2017-11-27 07:24:37 +08:00
Angus Gratton 5e7478a055 Merge branch 'bugfix/ledc_fade_scale' into 'master'
driver(LEDC): add scale value check in ledc_set_fade API

See merge request !1583
2017-11-27 07:23:19 +08:00
Yulong c71318ce88 component/bt: Fix the bug when write ccc sometimes will lead to repeatedly release the memory. 2017-11-25 05:06:14 -05:00
Darian Leung 4c13b2f391 docs/ipc documentation
This commit updates doxygen comments in the IPC header files and adds an rst
docs page.
2017-11-24 15:31:28 +08:00
Kedar Sovani e7743d090d freertos: fix a bug for incorrect check of allow-external-stack 2017-11-24 09:53:47 +05:30
Angus Gratton 02304ad83e Merge branch 'feature/freertos_backported_functions' into 'master'
freertos/backport and test v9.0.0 functions

See merge request !1515
2017-11-24 08:49:59 +08:00
Jiang Jiang Jian e5b2c1cf4c Merge branch 'bugfix/btdm_corret_bt_h_comment' into 'master'
component/bt: Correct the ESP_BLE_PWR_TYPE_CONN_HDL0-9 comment in the bt.h file t…

See merge request !1570
2017-11-24 00:14:14 +08:00
Jiang Jiang Jian 082f5716c6 Merge branch 'feature/enable_disable_ampdu_rx_tx_independently' into 'master'
Feature/enable disable ampdu rx tx independently

See merge request !1560
2017-11-23 22:22:43 +08:00
Yulong 177c92f15e component/bt: Change the code format. 2017-11-23 06:42:04 -05:00
Yulong 2458d15d2d component/bt: recovery the scan parameter to the controller before start scan. 2017-11-23 06:36:00 -05:00
panfeng b553c925b1 bugfix: while scale equals 0 will cause crash 2017-11-23 17:56:18 +08:00
Yulong f14699068d component/bt: Fixed the bug when stop scan if not set back the scan params will lead to connection request sent the empty packet to the peer device. 2017-11-23 03:54:29 -05:00
Ivan Grokhotkov 983ec73413 libstdc++: update the library built with PSRAM workaround 2017-11-23 15:34:23 +08:00
Darian Leung c1d101dd41 freertos/backport and test v9.0.0 functions
This commit backports the following features from FreeRTOS v9.0.0
- uxSemaphoreGetCount()
- vTimerSetTimerId(), xTimerGetPeriod(), xTimerGetExpiryTime()
- xTimerCreateStatic()
- xEventGroupCreateStatic()
- uxSemaphoreGetCount()

Functions backported previously
- xTaskCreateStatic()
- xQueueCreateStatic()
- xSemaphoreCreateBinaryStatic(), xSemaphoreCreateCountingStatic()
- xSemaphoreCreateMutexStatic(), xSemaphoreCreateRecursiveMutexStatic()
- pcQueueGetName()
- vTaskSetThreadLocalStoragePointer()
- pvTaskGetThreadLocalStoragePointer()

Unit tests were also written for the functions above (except for pcQueueGetName
which is tested in a separate Queue Registry MR). The original tlsp and del cb test case
was deleted and integrated into the test cases of this MR.
2017-11-23 14:18:09 +08:00
Ivan Grokhotkov b669b415e6 Merge branch 'feature/cxx_exceptions_emg_pool' into 'master'
esp32: Adds C++ exceptions emergency pool size menuconfig option

See merge request !1561
2017-11-23 13:02:49 +08:00
Amey Inamdar edb2400742 pthread: Added support for pthread condition variables
This is required for std::condition_variable support

Signed-off-by: Amey Inamdar <amey.inamdar@gmail.com>
2017-11-23 11:26:51 +08:00
Alexey Gerenkov 7df96718a2 esp32: Adds C++ exceptions emergency pool size menuconfig option 2017-11-23 06:14:11 +03:00
Liu Zhi Fu 3f6a8f1430 esp32: add options to disable/enable TX/RX AMPDU independently
Make menuconfig can disable/enable TX/RX AMPDU independently
2017-11-23 09:42:31 +08:00
Ivan Grokhotkov 597ce3b800 Merge branch 'bugfix/ringbuf_buflen_bugfix' into 'master'
Bugfix/ringbuf buflen bugfix

See merge request !1562
2017-11-22 22:30:11 +08:00
Ivan Grokhotkov c237c5c966 Merge branch 'bugfix/gpio_disable_api' into 'master'
driver: GPIO can be disabled by calling  gpio_set_direction

See merge request !1575
2017-11-22 22:26:54 +08:00
Ivan Grokhotkov cf47012111 Merge branch 'feature/prs_from_github' into 'master'
PRs from Github

See merge request !1578
2017-11-22 22:26:40 +08:00
Ivan Grokhotkov 5fe91ae7cd Merge branch 'bugfix/cpp_guards' into 'master'
Add C++ guards to freertos/ringbuf.h, heap headers

See merge request !1552
2017-11-22 22:26:26 +08:00
kooho ada33fe3dd Add GPIO input and output disable option 2017-11-22 15:00:27 +08:00
Ivan Grokhotkov 08be5213db Merge branch 'bugfix/uxportcompare_check_addr_range' into 'master'
portmacro: add assert to check address validity in uxPortCompareSet

See merge request !1519
2017-11-22 11:44:09 +08:00
Angus Gratton 3607b404c0 Merge branch 'feature/lwip_socket_pcb_num_config' into 'master'
lwip: Expose number of active socket limits in menuconfig

See merge request !1433
2017-11-22 11:36:55 +08:00
Angus Gratton 4ce68f6163 lwip: Expose number of active socket limits in menuconfig 2017-11-22 14:10:08 +11:00
Frank Sautter 157371effb Set GPIO-mode for MDC and MDIO pins
Merges #1127
2017-11-22 11:01:43 +08:00
Andrew Dikarev 08ba79cc2b return old handler from esp_log_set_vprintf()
Merges #1286
2017-11-22 11:01:43 +08:00
Vitor Massaru Iha cf768380b1 soc: Remove redefinition of MCU_SEL_M
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>

Merges #1290
2017-11-22 11:01:42 +08:00
Krzysztof Bociurko 969911b7c2 freertos: enabled use of pxTaskGetStackStart and cleaned up it's implementation
Merges #1298
2017-11-22 11:01:42 +08:00
Angus Gratton 4332a2c4bc Merge branch 'bugfix/cxx-exceptions-missing-stubs' into 'master'
cxx_exceptions: Add missing stubs for cxx exceptions with exceptions disabled

See merge request !1574
2017-11-22 09:26:24 +08:00
Angus Gratton a556e1c782 heap: Add C++ header guards to heap headers
Closes https://github.com/espressif/esp-idf/issues/1195
2017-11-22 10:08:50 +11:00
Adrián Paníček 0b48d5978e ringbuf.h: Add anti name-mangling definition
When using CPP and C combination this particular file threw error on linking.

Merges https://github.com/espressif/esp-idf/pull/1249

(Amended to add INC_FREERTOS_H guard, comment on #endif)
2017-11-22 10:08:15 +11:00
Piyush Shah 4f33339c1d test_ringbuf: Add tests for arbitrary length ring buffer
This will test the ring buffer for buffer length that is not
a multiple of 4

Signed-off-by: Piyush Shah <piyush@espressif.com>
2017-11-21 17:18:54 +05:30
Piyush Shah 7dd9c4f57f ringbuf: Fixes to header files for better understanding
1. Usage of this module required applications to include additional
files. What files to include is not very intuitive. Instead, it is
better for the header file itself to include other files as required.
2. Even though it may seem logical, it is better to explicitly mention
that an item needs to be "Returned" after a Receive

Signed-off-by: Piyush Shah <piyush@espressif.com>
2017-11-21 17:16:04 +05:30
Piyush Shah 62f44e45df ringbuf: Bugfixes for managing arbitrary sizes of ring buffer
It was observed that if the ring buffer size provided by application
is not a multiple of 4, some checks were failing (as read_ptr and write_ptr
could shoot beyond the ring buffer boundary), thereby causing asserts.
Simply wrapping around the pointers for such cases fixes the issue.

Moreover, because of the logic for maintaining 4-byte boundary,
it was also possible that a wrap-around occurred for some data,
even when the actual size remaining was sufficient for it.
Eg. Buffer available: 34, data size: 34, 4-byte aligned size: 36
Since the logic compares against 36, it writes 34 bytes and does a
wraparound. But since all 34 bytes are already written, there is
nothing to write after wrapping. It is better to just re-set the
write pointer to the dtart of ring buffer in such cases.

Tested send/receive for various arbitrary sizes of data and for
arbitrary sizes of ring buffer.

Alternative Solutions:
1) Allow only sizes which are multiples of 4, and return error otherwise.
Appropriate code and documentation change would be required
2) Allow arbitrary sizes, but internally add upto 3 bytes to make
the total size a multiple of 4

Signed-off-by: Piyush Shah <piyush@espressif.com>
2017-11-21 17:15:53 +05:30
Ivan Grokhotkov 6e1453e864 Merge branch 'feature/bot' into 'master'
CI: support customize test with @bot

See merge request !1502
2017-11-21 18:43:56 +08:00
Amey Inamdar 78ed138453 cxx_exceptions: Add missing stubs for cxx exceptions with exceptions
disabled

The misssing stubs get pulled in from the toolchain's libstdc++ also
causing to pull in defined stubs. This results in redefinition of
symbols. Fixing it by simply adding the missing stubs when exceptions
are disabled.

Signed-off-by: Amey Inamdar <amey.inamdar@gmail.com>
2017-11-21 12:41:49 +05:30
Ivan Grokhotkov 46673bb6f1 Merge branch 'bugfix/rtc_apll_disable' into 'master'
soc/rtc: don't power down BIAS_I2C along with APLL if other PLL is used

See merge request !1568
2017-11-21 12:13:07 +08:00
Ivan Grokhotkov d135a017f4 Merge branch 'bugfix/ut_startup_time' into 'master'
By default, don't print test menu in unit-test-app

See merge request !1565
2017-11-21 12:12:46 +08:00
Angus Gratton 93c75b4978 Merge branch 'bugfix/update_BOD_voltages' into 'master'
esp32/Update brownout voltages

See merge request !1520
2017-11-21 05:37:55 +08:00
Yulong 729e0c2544 component/bt: Correct the SP_BLE_PWR_TYPE_CONN_HDL0-9 comment in the bt.h file to ESP_BLE_PWR_TYPE_CONN_HDL0-8 2017-11-20 08:05:35 -05:00
He Yin Ling 81f806e676 test: change initial condition of unit test:
now UT App will not print test menu by default. it will print a prompt
to indicate it's ready. we can check this prompt instead of delay.
2017-11-20 17:51:27 +08:00
Ivan Grokhotkov 024e4c4337 Merge branch 'feature/openssl_cn_hostname_verification' into 'master'
openssl: Add CN hostname verification

See merge request !1554
2017-11-20 15:59:15 +08:00
Ivan Grokhotkov 18f4696371 Merge branch 'bugfix/pthread_test_mem_leaks' into 'master'
pthread: Fixes memory leaks and stack overflow in tests

See merge request !1563
2017-11-20 15:58:53 +08:00
Ivan Grokhotkov 4b8f55aadf Merge branch 'bugfix/minor_fixes_github' into 'master'
Minor fixes from github

See merge request !1555
2017-11-20 15:58:34 +08:00
Ivan Grokhotkov 3369f15fa3 soc/rtc: don't power down BIAS_I2C along with APLL if other PLL is used
If enable == false, and SOC_CLK_SEL == PLL, the code would would
erroneously set RTC_CNTL_BIAS_I2C_FORCE_PD. This change fixes the logic.
2017-11-20 15:27:16 +08:00
zhangyanjiao 9fbcc6f922 In STA mode, tcp_send cannot catch err after disconnect station 2017-11-20 15:19:19 +08:00
Andy Green ae1f1e9b84 openssl wrapper: introduce X509_VERIFY_PARAM_set/clear_hostflags
This defines the OpenSSL X509_CHECK_FLAG_...s and the set/clear
accessors.  Since none of them are supported, the set / clear
accessor currently always does nothing and returns error.

This call is often part of the generic openssl user code to
set up certificate verification.  This patch allows it to
compile for ESP32 and decide at runtime what to do about
unsupported flags.

Merges https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:25:57 +11:00
Angus Gratton 4395f7c94e Merge branch 'feature/spi_flash_lock_recursive' into 'master'
spi_flash: Expose recursive op_lock for atomic multi-part flash operations

See merge request !1556
2017-11-20 13:24:41 +08:00
Andy Green effc6c6d0d openssl wrapper: introduce X509_VERIFY_PARAM_set1_host
This lets the user code set the mbedtls hostname using the standard OpenSSL
X509_VERIFY_PARAM_set1_host() API semantics.

The API takes an X509_VERIFY_PARAM pointer.  We use the fact that is
a composed member of the SSL struct to derive the SSL pointer.

The X509_VERIFY_PARAM_set1_host() is unusual in that it can accept a
NUL terminated C string as usual, or a nonterminated pointer + length.
This implementation converts the latter to the former if given, before
using it.

This is enough for user code to get the openssl wrapper to make
mbedtls confirm the CN on the peer cert belongs to the hostname used
to reach it, by doing, eg

	X509_VERIFY_PARAM_set1_host(SSL_get0_param(myssl), myhostname, 0);

Merges https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:24:06 +11:00
Andy Green 0f02a38262 openssl wrapper: introduce SSL_get0_param
This adds the standard OpenSSL api to get a pointer to the SSL struct's
X509_VERIFY_PARAM.  We need this for the OpenSSL api to set the peer
hostname introduced in the next patch.

Part of https://github.com/espressif/esp-idf/pull/980
2017-11-20 16:23:18 +11:00
Angus Gratton f54e99008d spi: Add ESP_ERR_NO_MEM to spi_device_queue_trans() documentation
Ref https://github.com/espressif/esp-idf/pull/1243#issuecomment-343103414
2017-11-20 16:06:59 +11:00
Angus Gratton 7a924bd85a spi_flash: Expose an accessor the current SPI flash guard functions
Change places which uses g_flash_guard_default_ops to use this. Probably exact same data, but a bit
cleaner.
2017-11-20 15:54:31 +11:00
Angus Gratton e72e5a9706 spi_flash: Make spi_flash op_lock/op_unlock recursive
Allows chaining of multiple flash operations as an atomic operation.
2017-11-20 15:54:31 +11:00
Darian Leung 91ccf588d1 esp32/Update brownout voltages
This commit updates the voltages of each brownout level in Kconfig.
Note that there is some variation of brownout voltage between each chip.
2017-11-20 12:26:13 +08:00
Ivan Grokhotkov 1fbd3ffac8 Merge branch 'feature/fatfs_r013a' into 'master'
fatfs: update to R0.13a

See merge request !1524
2017-11-20 10:16:39 +08:00
Ivan Grokhotkov 148130066f Merge branch 'feature/esp32_stack_protector' into 'master'
esp32: Adds Stack Smashing Protection Feature

See merge request !1537
2017-11-20 10:16:15 +08:00
Alexey Gerenkov 7ce945a9de pthread: Fixes memory leaks and stack overflow in tests
Also this commit replaces FreeRTOS list used for pthread internals
with simple one from rom/queue.h
2017-11-17 16:57:33 +03:00
Alexey Gerenkov 692a890232 esp32: Adds Stack Smashing Protection Feature
These changes add posibility to enable GCC stack protector via menuconfig
for all source files in project.
2017-11-17 12:08:36 +03:00
michael 02573a8dc9 fix(spi_master): release temporary memory when queue new trans timeout. 2017-11-17 12:15:19 +08:00
michael 13d38f10ee test(spi): internal connection test master with slave for address and command field. 2017-11-17 12:15:19 +08:00
michael 57e1d47ad7 fix(spi_master): fix the CS pin issue with GPIO 0.
Closes #909
2017-11-17 12:15:19 +08:00
michael 842292523f fix(spi_slave): add interrupt free into bus free process. 2017-11-17 12:14:40 +08:00
Raphael Luba 31711b5ac7 SPI: Document TIMEOUT return values
`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
2017-11-17 10:50:54 +11:00
Krzysztof Bociurko 4da90f09e7 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
2017-11-17 10:44:19 +11:00
He Yin Ling 0c40b2ec9d test: collect performance for esp-timer / spinlock 2017-11-16 17:48:48 +08:00
He Yin Ling 9395a702ef test: check and collect performance via CI 2017-11-16 17:48:30 +08:00
Ivan Grokhotkov 7e8c2a9c00 Merge branch 'bugfix/newlib_strptime' into 'master'
newlib: Add strptime(), qsort_r(), nanf() to libc & libc_nano

See merge request !1547
2017-11-16 17:40:27 +08:00
Jiang Jiang Jian c03d12b9e5 Merge branch 'bugfix/btdm_delete_gattc_cache_write' into 'master'
component/bt: delete gattc cache write operation

See merge request !1543
2017-11-16 17:39:22 +08:00
Jiang Jiang Jian af367452b0 Merge branch 'bugfix/rebind_pcb_when_ip_changed' into 'master'
lwip: rebind UDP/TCP pcb to valid ip address when ip is changed

See merge request !1535
2017-11-16 17:28:06 +08:00
Jiang Jiang Jian 88e1a374a0 Merge branch 'bugfix/fix_airkiss_macro_typo' into 'master'
Fix an airkiss macro error

See merge request !1532
2017-11-16 17:25:45 +08:00
island 7bd8133639 component/bt: delete api bta_gattc_cache_write 2017-11-16 16:40:18 +08:00
Angus Gratton 7d20e4e422 newlib: Remove out of date libc_discard.list 2017-11-16 17:43:05 +11:00
Angus Gratton 239ac0e17b newlib: Add strptime(), qsort_r(), nanf() to libc & libc_nano
These functions were discarded but not provided in ROM.

Generated from commit 8ad0aa7d6 in newlib script repo. Didn't rebuild most of libc/libc_nano,
only appended the missing object files to the existing archives (should save some git churn).
2017-11-16 17:35:18 +11:00
Jiang Jiang Jian 2d148cd34b Merge branch 'bugfix/heap_region_add' into 'master'
component/heap : fix heap_region_add check bug

See merge request !1523
2017-11-16 13:45:10 +08:00
island 5789a8a6e9 component/bt: delete gattc cache write operation 2017-11-16 11:18:17 +08:00
Tian Hao e7a9ddcf72 component/heap : fix heap_region_add check bug 2017-11-16 11:10:13 +08:00
XiaXiaotian eef595501c Fix an airkiss macro error 2017-11-15 21:44:12 +08:00
Liu Zhi Fu 095d163050 lwip: rebind UDP/TCP pcb to valid ip address when ip is changed
This change fix the issue UDP/TCP pcb failed to rebind to correct ip address when ip is changed
2017-11-15 16:15:24 +08:00
krzychb d488bb7bac Provided more meaningful parameter names by renaming 'bit_num' to 'duty_resolution' and 'div_num' to 'clock_divider' 2017-11-15 08:08:12 +01:00
Angus Gratton b83792f504 Merge branch 'doc/esp_wifi_types' into 'master'
docs: Add esp_wifi_types.h items to wifi API reference

See merge request !1320
2017-11-15 15:03:02 +08:00
Ivan Grokhotkov da141a2c7e Merge branch 'bugfix/touch_pad_register_mismatch' into 'master'
Bugfix/touch pad register mismatch

See merge request !1469
2017-11-15 14:52:13 +08:00
Ivan Grokhotkov c6d25dd9cc Merge branch 'features/http2_demo' into 'master'
HTTP2 Client Demo

See merge request !1475
2017-11-15 14:51:51 +08:00
Ivan Grokhotkov fac2e78bfe Merge branch 'bugfix/emac_rx_process' into 'master'
component/emac: fix process rx err

See merge request !1529
2017-11-15 14:51:33 +08:00