Commit graph

3228 commits

Author SHA1 Message Date
Angus Gratton bd9c5d9adc Merge branch 'feature/fatfs_kconfig_options' into 'master'
fatfs: expose some configuration values in Kconfig

See merge request !1415
2017-11-11 02:48:15 +08:00
Angus Gratton 4468825028 Merge branch 'bugfix/TW#16106_esp_heap_trace.h_C++_include_guards' into 'master'
freertos/add C++ include guards for esp_heap_caps.h

See merge request !1516
2017-11-11 02:47:10 +08:00
He Yin Ling be405d69d8 test: ut only test app core reset on dual core 2017-11-10 17:53:59 +08:00
Jiang Jiang Jian e24ea6207b Merge branch 'bugfix/btdm_osi_alarm' into 'master'
component/bt: use esp_timer instead of FreeRTOS timer to implement osi_alarm in bluedroid

See merge request !1506
2017-11-10 15:34:11 +08:00
Jiang Jiang Jian b8694eeeb9 Merge branch 'bugfix/tw16339_sta_cant_connect_ap_in_channel_14' into 'master'
Bugfix/tw16339 sta cant connect ap in channel 14

See merge request !1514
2017-11-10 15:31:19 +08:00
He Yin Ling b1d13ded1a test: only test app core sleep on dual core 2017-11-10 13:26:11 +08:00
Darian Leung fff482acd9 freertos/add C++ include guards for esp_heap_caps.h 2017-11-10 12:01:30 +08:00
wangmengyang 53273172fe component/bt: modify the implementation and interface of osi_alarm module
1. use esp_timer instead of FreeRTOS timer to implement osi_alarm in bluedroid
2. Remove two APIs: osi_alarm_now() and osi_alarm_time_diff() and modify the hci layer logic that use them
3. Implement osi_alarm_get_remaining_ms()
4. Move the definition of struct alarm_t in source file "alarm.c"
5. Add definition of module error code
2017-11-10 11:53:55 +08:00
Ivan Grokhotkov 7632c6a80c Merge branch 'test/UT_reset_check' into 'master'
Test/ut reset check

See merge request !1086
2017-11-10 11:30:46 +08:00
Ivan Grokhotkov 3eedf3ed18 Merge branch 'bugfix/to_docs_from_github' into 'master'
Documentation bugfixes from the github

See merge request !1501
2017-11-10 11:13:25 +08:00
Ivan Grokhotkov d1f6030921 Merge branch 'bugfix/from_github' into 'master'
Bug fixes from Github

See merge request !1487
2017-11-10 11:13:04 +08:00
Ivan Grokhotkov cfe1f4724c Merge branch 'bugfix/cas_for_pthread_once' into 'master'
pthread: Fix pthread_once to use atomic compare and set

See merge request !1497
2017-11-10 11:12:46 +08:00
Liu Zhi Fu 2041ba9add esp32: fix station can't connect esp32 softap in channel 14
Channel 14 only supports HT20 while ESP32 softap channel 14 is HT40, fix it.
2017-11-10 10:55:08 +08:00
Ivan Grokhotkov 8e04b86153 Merge branch 'bugfix/tg_wdt_reboot_uart_garbage' into 'master'
bootloader: wait for UART FIFO to be empty before switching frequency

See merge request !1511
2017-11-09 17:14:13 +08:00
Yulong ee43527108 compoent/bt: Modify bta_gattc_utils.c The value pointer copy is overwritten when a write event occurs. 2017-11-09 14:47:11 +08:00
Yulong e6b2c19eea component/bt: Fix the write value not store in the queue command bug. 2017-11-09 14:47:11 +08:00
Yulong 68833fe94c component/bt: Change the bta_gattc_pop_command_to_send function to static. 2017-11-09 14:47:11 +08:00
Yulong 0ae5320f50 component/bt: Added the gattc command queue support. 2017-11-09 14:47:11 +08:00
Yulong 7a27e3c74d component/bt: added the queue to store the gattc commands. 2017-11-09 14:47:11 +08:00
Yulong 1ceef12238 compoent/bt: Modify bta_gattc_utils.c The value pointer copy is overwritten when a write event occurs. 2017-11-09 01:44:16 -05:00
Ivan Grokhotkov afa9a85396 bootloader: wait for UART FIFO to be empty before switching frequency 2017-11-09 13:17:58 +08:00
Anton Maklakov bb4838314c doc: Add internal links for chapters and fix typos
Used 'git grep -i -E "see *\`[^\`]+\`[^_]"' to find the invalid links
2017-11-09 11:45:13 +08:00
Liu Zhi Fu 710055025e esp32/lwip: adjust task stack size according 'nano' print
1. Adjust tcpip/main/event/timer task stack size according 'nano' print
2. If 'nano' print is disabled the task stack size reduces 512 bytes
2017-11-09 10:09:42 +08:00
Ivan Grokhotkov f22c681c1c soc/rtc: raise core voltage when 80MHz flash frequency is used
To achieve reliable operation with GD flash at 80MHz, need to raise
core voltage.
This causes the following current consumption increase:

At 80MHz: from 29mA to 33mA
At 160MHz: from 41mA to 47mA

Test conditions: 2 cores running code from IRAM, remaining peripherals
clock gated.
2017-11-08 21:13:02 +08:00
Jiang Jiang Jian 793ea56204 Merge branch 'bugfix/fail_to_scan_all_matched_ap' into 'master'
Wifi: bugfix/fail_to_scan_all_matched_ap

See merge request !1493
2017-11-08 17:39:29 +08:00
Yulong 8ca40818eb component/bt: Fix the write value not store in the queue command bug. 2017-11-08 04:23:12 -05:00
Anton Maklakov 27c1fc52ba Added .command_timeout_ms = 0 to SDSPI_HOST_DEFAULT() too 2017-11-08 12:52:50 +08:00
Seppe Stas a106dc183d Clean up documentation of esp_wifi_set_country
Signed-off-by: krzychb
2017-11-07 20:26:22 +01:00
Jiang Jiang Jian dfe4e68cc3 Merge branch 'bugfix/btdm_lib_update_for_psram' into 'master'
component/bt: update toolchain and add compile options to build libbtdm_app.a to support PSRAM

See merge request !1491
2017-11-07 20:01:14 +08:00
Ivan Grokhotkov 5f9ac5fadb Merge branch 'doc/freertos_port_comments' into 'master'
freertos: Update comments in "port" section (portMUX/etc)

See merge request !1431
2017-11-07 19:31:21 +08:00
Ivan Grokhotkov 744896bde2 Merge branch 'bugfix/hardware_mpi_sign' into 'master'
hwcrypto mpi: Fix losing sign when multiplying by -1 (github PR)

Contribution from github: https://github.com/espressif/esp-idf/pull/1181/

See merge request !1471
2017-11-07 19:30:31 +08:00
Mahavir Jain 158ecdcfd5 pthread: Fix pthread_once to use atomic compare and set
Earlier recursive mutex was being used for this but since
SCOMPARE1 is already being saved/restored during context
switch, atomic compare and set can be used for this.

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2017-11-07 14:28:43 +05:30
wangmengyang 016a49f8e3 component/bt: update toolchain and add compile options to build libbtdm_app.a to support PSRAM 2017-11-07 16:08:47 +08:00
houchenyao f80824a2d8 test: support test for UT cases expect to reset 2017-11-07 12:19:39 +08:00
Ivan Grokhotkov 1613044aef Merge branch 'bugfix/restart_reconfigure_flash_pins' into 'master'
esp32: reconfigure SPI flash pins in esp_restart

See merge request !1492
2017-11-07 12:08:52 +08:00
Ivan Grokhotkov a45e9c806d Merge branch 'bugfix/new_task_watchdog_API_false_trigger' into 'master'
feat/New Task Watchdog API

See merge request !1380
2017-11-07 10:43:56 +08:00
Deng Xin 092e99c05d Wifi: bugfix/fail_to_scan_all_matched_ap
fail to scan all matched ap in fast scan mode
2017-11-06 21:31:45 +08:00
Ivan Grokhotkov 5f6be9b4ce esp32: reconfigure SPI flash pins in esp_restart 2017-11-06 16:44:26 +08:00
Darian Leung 637ba2e8bb freertos: Test untested functions
Test cases were added for the following functions
- xTaskNotify(), xTaskNotifyGive(), xTaskNotifyFromISR(), vTaskNotifyGiveFromISR(),
- xTaskNotifyWait(), ulTaskNotifyTake()
- vTaskDelayUntil()

The following function was made smp compatible and tested as well
- eTaskGetState()
2017-11-06 15:31:01 +08:00
Angus Gratton 2c72223a4e Merge branch 'bugfix/protect_spiflash_regions' into 'master'
spi_flash: Abort on writes to dangerous regions (bootloader, partition table, app)

See merge request !1452
2017-11-04 12:40:21 +08:00
Angus Gratton 670733df9f spi_flash: Abort on writes to dangerous regions (bootloader, partition table, app)
Can be disabled or made into a failure result in kconfig if needed.
2017-11-03 15:52:27 -07:00
Jiang Jiang Jian abacf8d2a0 Merge branch 'bugfix/rtc_and_restart_fixes' into 'master'
rtc_clk and esp_restart fixes

See merge request !1458
2017-11-04 01:34:38 +08:00
Liu Zhi Fu 13621852dd esp32: add wifi lib which is compiled with psram gcc
Add psram wifi lib because it doesn't impact the WiFi throughput once the psram is not enabled in IDF menuconfig
2017-11-03 23:02:35 +08:00
Frederik Merz 20ccec1061 Disable all UART CLKs that are not console 2017-11-03 19:03:00 +08:00
Philip Ashmore d72bef02e9 Added .command_timeout_ms = 0 to SDMMC_HOST_DEFAULT() in components/driver/include/driver/sdmmc_host.h 2017-11-03 17:15:44 +08:00
Siarhei Volkau 6e24566186 components/mdns: wrong Message compression detect
Old behavior assumes message compressed when any of 2 most significant bits are set,
But in fact Message compressed only when both those bits are set to 1.

Also maximal label length should be 63 bytes.
2017-11-03 16:52:22 +08:00
jeanleflambeur 8712fd3ccf Update esp_err.h
Renamed the internal rc to __err_rc to avoid clashes with local variables.
This code would not do the expected thing with the original ESP_ERROR_CHECK macro:

esp_err_t my_func(esp_err_t x)
{
  assert(x == 23);
}

esp_err_t rc = 23; //some value that is important fo the user
ESP_ERROR_CHECK(my_func(rc));

The macro will expand to:
esp_err_t rc = (my_func(rc));

And the code will assert, as my_func will receive a random value - whatever is in the internal macro rc temp variable. This is due to the C weirdness of allowing this code:

int x = x; //x has a random value.
2017-11-03 16:45:28 +08:00
Dmitry4Bh a0cedb1f44 Fix type conversion error in components/lwip/api/pppapi.c
Pointer tcpip_api_call *m  should be converted to pppapi_msg* instead of pppapi_msg_msg*
in pppapi_do_ppp_set_default(), pppapi_do_ppp_free() and so on.

It solve this issue https://github.com/espressif/esp-idf/pull/1028
so there is no need to patch ip4.c because now netif_defauilt is setted correctly.
Also it prevents memory corruption when pppapi_free() is called.
2017-11-03 16:42:56 +08:00
Tom Vijlbrief 58b411a5fe fix makefile for multiple source files 2017-11-03 16:40:15 +08:00
Wangjialin cea7dfbe90 psram: improve clock signal generation, increase drive strength
Also check the chip type when initializing.
2017-11-03 16:30:10 +08:00
Wangjialin d034bc9ca0 bootloader: add configuration of flash pins and VDDIO boost 2017-11-03 16:29:56 +08:00
Ivan Grokhotkov a02b30ccda efuse: add package definitions for PICOD2/D4 2017-11-03 15:49:10 +08:00
Ivan Grokhotkov fb9c106bcb soc/rtc: add function to get/set VDDSDIO configuration
Also consider case of VDDSDIO force powered on in rtc_sleep.
2017-11-03 15:49:09 +08:00
Ivan Grokhotkov 5a294c9acd soc/gpio: fix description of GPIO_STRAP_REG 2017-11-03 15:49:09 +08:00
Jiang Jiang Jian b13cd4adf8 Merge branch 'feature/btdm_add_value_callback_when_send_notification_or_indicate_failed' into 'master'
component/bt: add value callback when send notification or indicate failed

See merge request !1457
2017-11-03 10:05:29 +08:00
zhiweijian 9a96187655 Component/bt: modify some log 2017-11-02 19:45:13 +08:00
Ivan Grokhotkov 80eb3b6ddb Merge branch 'bugfix/light_sleep_current' into 'master'
soc/rtc: fix increased current consumption in light sleep

See merge request !1483
2017-11-02 18:26:23 +08:00
Darian Leung 9d63e1da4a New Task Watchdog API (Revert of Revert)
This commit reverts the revert on the new task watchdog API. It also
fixes the following bug which caused the reversion.

- sdkconfig TASK_WDT_TIMEOUT_S has been reverted from the unit of ms back to the
unit of seconds. Fixes bug where projects using the new API without rebuilding sdkconfig
would cause the old default value of 5 to be interpreted in ms.

This commit also adds the following features to the task watchdog

- Updated idle hook registration to be compatible with dual core hooks

- Updated dual core hooks to support deregistration for cpu

- Legacy mode has been removed and esp_task_wdt_feed() is now replaced by
  esp_task_wdt_reset().  esp_task_wdt_feed() is deprecated

- Idle hooks to reset are now registered/deregistered when the idle tasks are
  added/deleted from the Task Watchdog instead of at Task Watchdog init/deinit

- Updated example
2017-11-02 16:47:51 +08:00
XiaXiaotian 27b52dfd18 fix some phy bugs
1. V366, fix a problem which initialize current can reach 800mA.

    2. V365, fix a problem for pll_cap tracking in Coexist (BT & WIFI)
       mode. The problem will make Coexist (BT & WIFI) WIFI AP mode TX
       Fail in high temperature(>70).

    3. V364, fix a bug of BT and Wifi coexist (hung in function of
       force_wifi_mode())
2017-11-02 15:53:17 +08:00
Jiang Jiang Jian 1de3fc4a2c Merge branch 'bugfix/btdm_master_dont_send_pair_req_#13686' into 'master'
component/bt: Fix the bug of master don't send pair request to the slave when the sec_act set to the value of ESP_BLE_SEC_ENCRYPT.

See merge request !1376
2017-11-02 15:49:27 +08:00
XiaXiaotian 42cefc173f refractor WiFi clock setting
Do not set WiFi clock in PHY initializing function, move it to WiFi
   start/stop function.
2017-11-02 15:24:21 +08:00
wangmengyang bd6394db92 component/bt: clean up WIFI_CLK_EN_REG settings for Bluetooth
1. move settings of WIFI_CLK_EN_REG for bluetooth into controller init/deinit APIs
2. modify the bit mask used in phy_rf init/deinit to use WIFI-BT shared bits
2017-11-02 15:24:21 +08:00
Jiang Jiang Jian da178e446d Merge branch 'feature/increase_dynamic_tx_buffer_number' into 'master'
Feature/increase dynamic tx buffer number

See merge request !1473
2017-11-02 15:09:37 +08:00
Ivan Grokhotkov 9bfb45aa1d soc/rtc: fix increased current consumption in light sleep
This fixes a configuration issue of RTC, which caused light sleep current
to be 1.35mA instead of 0.85mA.
2017-11-02 13:57:26 +08:00
zhiweijian e7020460c6 Component/bt: add value callback when send notification or indicate failed 2017-11-01 11:00:08 +08:00
zhiweijian 481e436587 Component/bt: modify close event and disconnection event params
- modify close event params
- modify disconnection event params
- modify connect event params
2017-11-01 10:40:03 +08:00
Kedar Sovani b65f47c586 [openssl] Add support for SNI (sending the hostname) 2017-10-31 16:57:38 +05:30
Kedar Sovani 3420baa01b [openssl] Add support for defining ALPN protocols 2017-10-31 16:57:38 +05:30
XiaXiaotian 50b6912bf8 Increase maximum number of WiFi dynamic transmitting buffer 2017-10-31 15:18:20 +08:00
XiaXiaotian 87d3986b87 Fix the return value of esp_now_send() 2017-10-31 15:18:20 +08:00
Jiang Jiang Jian 19aa3c72e9 Merge branch 'bugfix/wrong_ap_info_in_all_channel_scan' into 'master'
Wifi: bugfix of get wrong ap information in all channel scan

See merge request !1470
2017-10-31 15:15:07 +08:00
Jiang Jiang Jian 939b46596f Merge branch 'bugfix/btdm_unable_use_esp_ble_gatts_get_attr_value_after_long_write' into 'master'
component/bt: Fix the bug cann't use esp_ble_gatts_get_attr_value to get the att…

See merge request !1381
2017-10-31 14:45:17 +08:00
Jiang Jiang Jian 07f92f0bd1 Merge branch 'bugfix/btdm_smp_decide_association_model' into 'master'
component/bt: Fix bug of function smp_decide_association_model

See merge request !1377
2017-10-31 14:34:41 +08:00
Jiang Jiang Jian c4bb378e4c Merge branch 'bugfix/btdm_set_MAX_L2CAP_CHANNELS_error' into 'master'
component/bt: Fix bug of set MAX_L2CAP_CHANNELS error

See merge request !1448
2017-10-31 14:32:53 +08:00
Deng Xin ccfbecd25f Wifi: bugfix of get wrong ap information in all channel scan
fix the issue get wrong ap information in all channel scan
2017-10-31 11:35:11 +08:00
Jiang Jiang Jian 97dffbfc47 Merge branch 'bugfix/btdm_disable_role_switch' into 'master'
component/bt: disable the use of ROLE_SWITCH feature for classic BT as workaround

See merge request !1446
2017-10-31 11:31:15 +08:00
Jiang Jiang Jian 182cd1ce4d Merge branch 'bugfix/btdm_fix_crash_when_set_device_name_null' into 'master'
component/bt: fix crash when set device name NULL

See merge request !1462
2017-10-31 11:17:49 +08:00
Jiang Jiang Jian 5b19cf23fc Merge branch 'feature/reduce_default_wifi_static_buffer_number' into 'master'
esp32: reduce default wifi static tx buffer

See merge request !1465
2017-10-31 11:16:22 +08:00
Angus Gratton 696dfbcfee Merge branch 'bugfix/fix_tcp_crash' into 'master'
fix tcp crash

See merge request !1444
2017-10-31 06:18:49 +08:00
Darian Leung b908b3cd58 unit_tests/Update unit test timer divider
This commit updates various test cases throughout esp-idf such that
the values used for timer divider pass the assertions in the timer component.
Timer divider values must be between 2 to 65536
2017-10-30 19:42:16 +08:00
michael 0330ec270a feat(spi_master): add new feature allow use variable command and address field length for the same device.
Closes #654
2017-10-30 19:33:41 +08:00
Liu Zhi Fu 1195ced75c esp32: reduce default wifi static tx buffer
Modify the the default WiFi static tx buffer from 32 to 16
2017-10-28 12:15:40 +08:00
Alexey Skalozub 5405255928 Fix losing sign when multiplying by -1 2017-10-28 03:47:00 +03:00
Angus Gratton 7c9b24b407 Merge branch 'bugfix/fix_uart_vfs_test_error' into 'master'
bugfix(uart): Don't disable console uart peripheral

See merge request !1456
2017-10-27 19:20:13 +08:00
Jiang Jiang Jian a9b63b796e Merge branch 'bugfix/btdm_cpu_core' into 'master'
component/bt : fix bug of sw interrupt cause to run btdm to different cpu core.

See merge request !1434
2017-10-27 18:36:59 +08:00
Wangjialin 102eb96c8b bugfix(uart): Don't disable console UART peripheral 2017-10-27 16:46:10 +08:00
zhiweijian 15c75974de component/bt: fix crash when set device name NULL 2017-10-27 15:21:00 +08:00
Angus Gratton ffeecde9e2 Merge branch 'feature/docs_update_timer_api' into 'master'
Timer API docs update, refactored example

See merge request !1316
2017-10-27 13:31:18 +08:00
krzychb 9b7d5d76a7 Timer API docs update, refactored example 2017-10-27 07:13:59 +02:00
Ivan Grokhotkov 00bf160f94 Merge branch 'bugfix/pthread_once' into 'master'
[pthread] Perform init_routine execution outside of the mutex

See merge request !1453
2017-10-27 09:21:55 +08:00
Angus Gratton 3338f1074f Merge branch 'bugfix/set_cppflags' into 'master'
Ensure that C++ and C compilers get the same preprocessor setup (from github)

See merge request !1459
2017-10-26 20:21:49 +08:00
Ivan Grokhotkov eb5752c635 esp_restart: fix possible race while stalling other CPU, enable WDT early
Previously esp_restart would stall the other CPU before enabling RTC_WDT.
If the other CPU was executing an s32c1i instruction, the lock signal
from CPU to the arbiter would still be held after CPU was stalled. If
the CPU running esp_restart would then try to access the same locked
memory pool, it would be stuck, because lock signal would never be
released.

With this change, esp_restart resets the other CPU before stalling it.
Ideally, we would want to reset the CPU and keep it in reset, but the
hardware doesn't have such feature for PRO_CPU (it is possible to hold
APP_CPU in reset using DPORT register). Given that ROM code will not use
s32c1i in the first few hundred cycles, doing reset and then stall seems
to be safe.

In addition to than, RTC_WDT initialization is moved to the beginning of
the function, to prevent possible lock-up if CPU stalling still has any
issue.
2017-10-26 19:53:53 +08:00
Ivan Grokhotkov f11ad0c904 soc/rtc: fix spurious warnings about XTAL frequency on startup
1. Make sure that 8MD256 clock used to estimate XTAL frequency is enabled
   before trying to use rtc_clk_cal_ratio.
   This fixes "Bogus XTAL frequency: 0 MHz" warnings after software reset.

2. Don't call rtc_clk_xtal_freq_estimate if XTAL frequency is already
   known. This reduces startup time after deep sleep or software reset.

3. Compare known XTAL frequency and estimated one before printing a
   warning. This fixes "Possibly invalid CONFIG_ESP32_XTAL_FREQ setting
   (40MHz). Detected 40 MHz." warnings.
2017-10-26 19:53:53 +08:00
Ivan Grokhotkov 9317cb3434 soc/rtc: add tests for CPU frequency switching
These tests switch between PLL and XTAL frequencies for 10 seconds.
2017-10-26 19:53:53 +08:00
Ivan Grokhotkov 6d4ed4ff6c soc/rtc: wait for SLOW_CLK cycle when switching CPU clock
Previous implementation waited for 20us after setting
RTC_CNTL_SOC_CLK_SEL_XTL register, using ets_delay_us, assuming that
the CPU was running at XTAL frequency. In reality, clock switch happened
on the next RTC_SLOW_CLK cycle, and CPU could be running at the previous
frequency (for example, 240 MHz) until then.
ets_delay_us would wait for 20 us * 40 cycles per us = 800 CPU cycles
(assuming 40 MHz XTAL; even less with a 26 MHz XTAL).
But if CPU was running at 240 MHz, 800 cycles would pass in just 3.3us,
while SLOW_CLK cycle could happen as much as 1/150kHz = 6.7us after
RTC_CNTL_SOC_CLK_SEL_XTL was set. So the software would not actually wait
long enough for the clock switch to happen, and would disable the PLL
while CPU was still clocked from PLL, leading to a halt.

This implementation uses rtc_clk_wait_for_slow_cycle() function to wait
until the clock switch, removing the need to wait for a fixed number of
CPU cycles.
2017-10-26 19:53:53 +08:00
Ivan Grokhotkov 05a0fbd49b soc/rtc: add a function to wait for slow clock cycle
Some RTC features are synchronized to RTC_SLOW_CLK, so sometimes
software needs to wait for the next slow clock cycle.
This function implements waiting using Timer Group clock calibration
feature.
2017-10-26 19:53:53 +08:00
Andreas Pokorny 2a1906cf50 Ensure that C++ and C compilers get the same preprocessor setup
CPPFLAGS is applied for both languages while CFLAGS only for C

Signed-off-by: Andreas Pokorny <andreas.pokorny@siemens.com>
2017-10-26 13:04:41 +02:00
Angus Gratton 9159e2b807 Merge branch 'bugfix/panic_handler_debugexception' into 'master'
panic handler: Print correct PC & backtrace for debug exceptions

See merge request !1441
2017-10-26 15:49:30 +08:00
Angus Gratton f5b3a370cd Merge branch 'feature/adc2_driver' into 'master'
feature(adc2): add support to use ADC2 when WIFI is disabled

See merge request !1237
2017-10-26 15:48:48 +08:00
Angus Gratton baf1641c29 Merge branch 'bugfix/uart_set_default_idle_time_to_zero' into 'master'
bugfix(uart): set default tx idle num

See merge request !1419
2017-10-26 15:17:45 +08:00
Angus Gratton 5c5d5f0acb Merge branch 'bugfix/tcpip_stack_overflow_logging_printf' into 'master'
lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose

See merge request !1396
2017-10-26 15:09:22 +08:00
michael 87f2b27dc4 refactor(rtc): re-organize code in rtc_module.c 2017-10-26 14:35:30 +08:00
michael d30f3e7aa8 example(adc2): add example and test case for adc2.
closes #461
2017-10-26 14:35:30 +08:00
esp32de 7c0020bfd0 feat(adc2): append adc2 support and api and the lock with WIFI module
append adc support and api
- esp_err_t adc2_config_width(adc_bits_width_t width_bit);
- esp_err_t adc2_config_channel_atten(adc2_channel_t channel, adc_atten_t atten);
- int adc2_get_voltage(adc2_channel_t channel);
2017-10-26 14:35:29 +08:00
Kedar Sovani 07992b08e8 [pthread] Perform init_routine execution outside of the mutex
The mutex is common across all the threads. It needn't be held across
the init_routine() call as long as the 'once' behaviour is guaranteed

Saw a deadlock case, where init_routine of one thread was waiting for
the completion of init_routine in another thread.

t2: wait for command
t1: pthread_once:
         lock once_mux
         init_routine:
               inform thread t2
               wait for signal from t2
t2: received command
         pthread_once
             lock once_mux (already held by t1)
---- Deadlock ----
2017-10-25 13:57:39 +05:30
Wangjialin 303b9f60db bugfix(uart): set default tx idle num
Reported from:
https://github.com/espressif/esp-idf/issues/703
https://github.com/espressif/esp-idf/issues/917
In uart driver we didn't change the default value of tx idle num, so there would be a delay after tx FIFO is empty.

1. Add API to set tx idle interval before next data transmission. (The UART hardware can add an interval after tx FIFO is empty).
2. Set default tx idle interval to zero.
3. Add hardware disable in uart driver delete function.
2017-10-25 13:29:02 +08:00
baohongde 3dab0fd340 component/bt: Fix bug of set MAX_L2CAP_CHANNELS error 2017-10-25 12:02:41 +08:00
island 4e7de126dc component/bt: Fix scan problem of bonded device using public address 2017-10-25 11:52:03 +08:00
Tian Hao 85eb5d4374 component/bt : fix bug of sw interrupt cause to run btdm to different cpu core.
1. add sw interrupt cause osi to controller.
2. modify the kconfig to improve the option view.
3. add option of the cpu core which bluedroid run.
4. add option of the cpu core which bluetooth controller run.
2017-10-24 16:13:58 +08:00
wangmengyang 837678e4f3 component/bt: disable the use of ROLE_SWITCH feature for classic BT as workaround 2017-10-24 14:44:53 +08:00
michael a6ac5b33c9 feat(rtc): open adc*(dac)_pad_get_io_num functions to public. 2017-10-24 12:06:14 +08:00
michael cff8d30c25 refactor(rtc): change register writing from macros to structures in *_struct.h 2017-10-24 12:05:52 +08:00
zhangyanjiao 18dcbfa1e2 fix tcp crash 2017-10-24 09:44:44 +08:00
Ivan Grokhotkov 552ba35da5 add missing ioctl declaration
Previously ioctl was declared as a macro in lwip/sockets.h.
Disabling LWIP_POSIX_SOCKETS_IO_NAMES removed that declaration.

This adds sys/ioctl.h file and the missing declaration.
Also adds missing includes in vfs.c.
2017-10-23 19:47:33 +08:00
Angus Gratton 2c2e7f6303 Merge branch 'bugfix/optmize_ipv6_event' into 'master'
bugfix: add netif info in event message when got ipv6 address

See merge request !959
2017-10-23 17:00:10 +08:00
Angus Gratton c61060e673 panic handler: Print correct PC & backtrace for debug exceptions 2017-10-23 15:46:43 +08:00
baohongde 84a55f9ee4 component/bt: Fix bug of function smp_decide_association_model 2017-10-23 15:34:02 +08:00
yulong a9a423a025 component/bt: Added the sec_act != BTM_BLE_SEC_ENCRYPT check in the btm_ble_set_encryption function when the sec_act is BTM_BLE_SEC_ENCRYPT_NO_MITM or BTM_BLE_SEC_ENCRYPT_MITM. 2017-10-23 15:12:36 +08:00
Yulong da32fbce7a component/bt: Fix the bug of can't pair if master send pair req but slave don't send sec req. 2017-10-23 15:12:36 +08:00
Tian Zhong Xing 55e95b04bd bugfix: add netif info in event message when got ipv6 address 2017-10-23 13:50:43 +08:00
Ivan Grokhotkov 91d9cb98d3 Merge branch 'bugfix/unit_tests_build' into 'master'
spi_flash: fix build error with profiling enabled

See merge request !1437
2017-10-23 12:14:10 +08:00
Angus Gratton 454e47385c Merge branch 'bugfix/select_fdset' into 'master'
LWIP: Fix select() FD_SET/FD_GET/etc

See merge request !1435
2017-10-23 10:55:33 +08:00
Angus Gratton 01befe4d6a Merge branch 'bugfix/i2c_hw_fsm_recover' into 'master'
bugfix(i2c): add I2C hardware reset if the hw FSM get stuck

See merge request !1272
2017-10-23 10:16:02 +08:00
Ivan Grokhotkov fbd52dcf34 spi_flash: fix build error with profiling enabled 2017-10-22 12:57:56 +08:00
Ivan Grokhotkov f039aac1e5 Merge branch 'bugfix/i2s_bck_polariy' into 'master'
bugfix(i2s): fix bck polarity issue when using pll clock.

See merge request !1428
2017-10-22 12:36:27 +08:00
Ivan Grokhotkov 000a4f5941 Merge branch 'bugfix/rmt_thresh_check' into 'master'
bugfix(rmt): fix event thresh check issue

See merge request !1423
2017-10-22 12:35:44 +08:00
Ivan Grokhotkov 59b7d98fec Merge branch 'feature/dfs' into 'master'
Dynamic frequency scaling

See merge request !1189
2017-10-22 12:34:11 +08:00
Wangjialin ed1e32f583 bugfix(i2c): add I2C hardware reset if the hw FSM get stuck
Reported from different sources from github or bbs:

https://github.com/espressif/esp-idf/issues/680

https://github.com/espressif/esp-idf/issues/922

We tested reading several sensor or other I2C slave devices, if the power and SDA/SCL wires are in proper condition, everything works find with reading the slave.
If we remove the power supply for the slave during I2C is reading, or directly connect SDA or SCL to ground, this would  cause the I2C FSM get stuck in wrong state, all we can do is the reset the I2C hardware in this case.
After this commit, no matter whether the power supply of I2C slave is removed or SDA / SCL are shorted to ground, the driver can recover from wrong state.

We are not sure whether this the save issue with the reported one yet, but to make the driver more robust.

Further information:

1. For I2C master mode, we have tested different situations, e.g., to short the SDA/SCL directly to GND/VCC, to short the SDA to SCL, to un-plug the slave device, to power off the slave device. Under all of those situations, this version of driver can recover and keep working.
2. Some slave device will die by accident and keep the SDA in low level, in this case, master should send several clock to make the slave release the bus.
3. Slave mode of ESP32 might also get in wrong state that held the SDA low, in this case, master device could send a stop signal to make esp32 slave release the bus.

Modifications:

1. Disable I2C_MASTER_TRAN_COMP interrupt to void extra interrupt.
2. Disable un-used timeout interrupt for slave.
3. Add bus reset if error detected for master mode.
4. Add bus clear if SDA level is low when error detected.
5. Modify the argument type of i2c_set_pin.
6. add API to set timeout value
7. add parameter check for timing APIs
2017-10-21 02:10:59 +08:00
Angus Gratton f76a3c45c0 newlib: Disable sys/types.h implementations of FD_SET, etc.
Temporary measure, until we have VFS-level select() support.

Closes https://github.com/espressif/esp-idf/issues/1141
2017-10-20 18:11:32 +08:00
Angus Gratton e5ae0f5927 lwip: Make LWIP_SOCKET_OFFSET signed, remove need for underflow check
This reverts commit 541493d877.
2017-10-20 18:04:28 +08:00
Angus Gratton 22756b6c02 Merge branch 'feature/FreeRTOS_Trace_Facilities' into 'master'
feature/make freertos trace facility configurable

See merge request !1420
2017-10-20 16:42:15 +08:00
Ivan Grokhotkov b6f37bda97 Merge branch 'feature/i2s_built_in_adc' into 'master'
feature(I2S-ADC): add ADC mode for I2S.

See merge request !1077
2017-10-20 15:52:56 +08:00
Darian Leung a6854b72cd freertos/make trace facility configurable
This commit makes configUSE_TRACE_FACILITY and
configUSE_STATS_FORMATTING_FUNCTIONS configurable in kconfig. Test cases fro the
functions enabled by the two configurations above have also been added.

Test cases for the following functions have been added...

- uxTaskGetSystemState()
- uxTaskGetTaskNumber()
- vTaskSetTaskNumber()

- xEventGroupClearBitsFromISR()
- xEventGroupSetBitsFromISR()
- uxEventGroupGetNumber()

- uxQueueGetQueueNumber()
- vQueueSetQueueNumber()
- ucQueueGetQueueType()

Test cases for the following functions were not required...

- prvListTaskWithinSingleList()
- prvWriteNameToBuffer()
- vTaskList()
2017-10-20 15:17:17 +08:00
Angus Gratton 477ed8ce62 Merge branch 'bugfix/touchpad_dac_mismatch_on_tp8_tp9' into 'master'
bugfix(touch): add workaround for touch pad DAC hardware source mismatch on tp8 and tp9.

See merge request !1288
2017-10-20 14:18:32 +08:00
Ivan Grokhotkov dbebece1d2 Merge branch 'feature/unit-test-configs' into 'master'
unit-test-app: add support for testing multiple configurations

See merge request !1249
2017-10-20 14:03:53 +08:00
Angus Gratton b30c0d1bbb Merge branch 'feature/add_dns_api' into 'master'
tcpip_adapter/lwip: add dns api

See merge request !1405
2017-10-20 11:54:20 +08:00
Angus Gratton 47aaf402b8 heap: Add heap_caps_dump() / heap_caps_dump_all() functions
Dump the structure of the heap for debugging purposes.
2017-10-20 11:38:24 +08:00
Angus Gratton b10e1a92b6 freertos: Update comments in "port" section (portMUX/etc)
Some comments had fallen out of date.
2017-10-20 11:17:44 +08:00
Wangjialin a84db78eb1 bugfix(i2s): fix bck polarity issue when using pll clock.
reported from github: https://github.com/espressif/esp-idf/issues/1119

Digital team think it is due to the decimal divider.
We can reset the i2s tx and rx when calling i2s_stop to avoid this.
2017-10-19 23:23:01 +08:00
Ivan Grokhotkov 90bbcbcdc0 unit tests: fix warnings, build with -Werror
- libsodium: silence warnings
- unit tests: fix warnings
- spiram: fix warnings
- ringbuf test: enable by default, reduce delays
2017-10-19 21:35:23 +08:00
Ivan Grokhotkov b52e3fae64 build system: fix warning about undefined variable 'quote' 2017-10-19 21:35:23 +08:00
Ivan Grokhotkov ae7404972c sleep: don't power down VDD_SDIO in light sleep if SPIRAM is enabled 2017-10-19 21:35:23 +08:00
Ivan Grokhotkov d55ddfe56d update libstdc++.a built with pSRAM workaround 2017-10-19 21:35:22 +08:00
Ivan Grokhotkov 8990549e89 spi_flash: fix spi_flash_read into buffer in external RAM, add test 2017-10-19 21:35:21 +08:00
Ivan Grokhotkov 099565635b soc: correct values of SOC_BYTE_ACCESSIBLE_LOW, SOC_MEM_INTERNAL_LOW
Internal byte accessible memory starts with Internal ROM 1 at 0x3FF90000.
Region of RTC fast memory starting at 0x3FF80000 is not used in IDF as
it is mapped to PRO CPU only.
2017-10-19 21:35:21 +08:00
Ivan Grokhotkov ee99bdfbad spi_flash_cache_enabled: report correct result in single core mode 2017-10-19 21:35:21 +08:00
Ivan Grokhotkov cc67500d3e unit test: adapt tests to single core configuration 2017-10-19 21:35:21 +08:00
He Yin Ling 1fc2ac8b09 unit-test: esp timer use same name as ets timer
We will use case name to select test cases in UT jobs.
Same case name is not allowed.
2017-10-19 21:35:21 +08:00
Ivan Grokhotkov 6cc8099610 Merge branch 'bugfix/malloc_failure' into 'master'
heap: Fix race condition causing malloc() to fail under some conditions

See merge request !1424
2017-10-19 21:30:26 +08:00
Ivan Grokhotkov c360f8dece Merge branch 'bugfix/heap_check_integrity' into 'master'
heap: Fix spurious heap_caps_check_integrity() errors in Comprehensive mode

See merge request !1421
2017-10-19 21:30:16 +08:00