Commit graph

1689 commits

Author SHA1 Message Date
Angus Gratton bdbeaf97d6 freertos tests: Fix accidental "0 delay" in event group tests
Was a slight race condition where tasks on other CPU may not have finished waking up on BIT_CALL when the unity task
polled the event group state.
2017-04-04 10:10:08 +10:00
Angus Gratton 45581dbaca freertos: Delay context switch from queue/task APIs until exiting critical section
Closes #374: https://github.com/espressif/esp-idf/issues/374
2017-04-04 10:10:08 +10:00
Jiang Jiang Jian fc15d72038 Merge branch 'feature/implement_lwip_critical_protect_with_mutex' into 'master'
lwip: implement lwip critical session with mutex

Currently lwip critical session is based on interrupt, now replace it with mutex

See merge request !595
2017-04-01 17:27:20 +08:00
Liu Zhi Fu 68e27f8188 optimize tcpip adapter layer 2017-04-01 16:41:51 +08:00
Liu Zhi Fu 778a475136 lwip: implement lwip critical session with mutex
Currently lwip critical session is based on interrupt, now replace it with mutex
2017-04-01 16:24:58 +08:00
Jiang Jiang Jian 74d0edec0f Merge branch 'feature/tw10169_optimize_dhcp_renew_rebind_timer' into 'master'
lwip: optimize dhcp renew/rebind timer

This MR is used to replace MR581 since MR581 use a bad branch name.

See merge request !585
2017-04-01 16:04:13 +08:00
Ivan Grokhotkov 47b8f78cb0 Merge branch 'bugfix/flash_op_deadlock' into 'master'
spi_flash: fix race condition in s_flash_op_complete access

Flash operation complete flag was cleared by the CPU initiating flash operation. If the other core was running an ISR, then IPC task could be late to enter the loop to check `s_flash_op_complete` by the time next flash operation started. This would cause a deadlock, as the IPC task would still be waiting for `s_flash_op_complete` to be set (which was already cleared by the next flash operation), while the flash operation task would be blocked waiting for IPC task to set `s_flash_op_can_start`.

If the flag is cleared on the CPU waiting on this flag, then the race condition can not happen.

See merge request !615
2017-03-31 16:02:26 +08:00
Jeroen Domburg a4acf7b67b Merge branch 'bugfix/spi_timing_issues' into 'master'
Fix timing adjustment needed for higher speeds of SPI master bus.

Ref https://github.com/espressif/esp-idf/issues/363 . It was found out the master SPI driver didn't exactly calculate the delay compensation needed, breaking 20 and 26MHz full-duplex mode. This fixes these use cases. We also found out 40MHz full-duplex routed over the GPIO matrix does not work because of a hardware quirk; this MR adds a check/error for that case until we find a workaround.

See merge request !547
2017-03-31 10:44:37 +08:00
XiaXiaotian 4f89cc73e6 Add WiFi static and dynamic tx buffer choice
If static tx buffer is selected, WiFi tx buffers are allocated when WiFi is initialized and released

    when WiFi is de-initialized. If dynamic tx buffer is selected, WiFi tx buffer is allocated when tx

    data is delivered from LWIP to WiFi and released when tx data is sent out by WiFi.

    The size of each static tx buffers is fixed to about 1.6KB and the size of dynamic tx buffers is

    depend on the length of the data delivered from LWIP.

    If PSRAM is enabled, "STATIC" should be selected to guarantee enough WiFi tx buffers.

    If PSRAM is disabled, "DYNAMIC" should be selected to improve the utilization of RAM.
2017-03-30 21:25:44 +08:00
Jiang Jiang Jian 73612b004f Merge branch 'feature/add_scan_time_config' into 'master'
wifi scan: add wifi scan type and time config



See merge request !586
2017-03-30 20:56:30 +08:00
XiaXiaotian c690447dd9 wifi scan: add wifi scan type and time config 2017-03-30 20:36:52 +08:00
Ivan Grokhotkov 39c376f0c3 Merge branch 'bugfix/cpu1_isr_stack_location' into 'master'
Fix finding location of ISR stack space for CPU1

Up to now, the CPU1 interrupts erroneously used the area *after* the ISR stack region, leading to bugs in BT Classic. This fixes that.

See merge request !618
2017-03-29 12:05:31 +08:00
Angus Gratton 6ba469e7a4 Merge branch 'feature/mdns_dnssd_metaquery' into 'master'
mdns: add simple dns-sd meta query support

Merges PR #340 https://github.com/espressif/esp-idf/pull/340

See merge request !619
2017-03-29 09:29:31 +08:00
negativekelvin 96e8a3c725 mdns: add simple dns-sd meta query support
tabs to spaces

match domain
2017-03-29 11:48:19 +11:00
Jeroen Domburg 0e39b77d4e Fix finding location of ISR stack space for CPU1 2017-03-28 15:50:10 +08:00
Jeroen Domburg 76295c7a13 Fix timing adjustment needed for higher speeds of SPI master bus. 2017-03-28 11:31:59 +08:00
Ivan Grokhotkov 92436021ab spi_flash: fix race condition in s_flash_op_complete access
Flash operation complete flag was cleared by the core initiating flash
operation. If the other core was running an ISR, then IPC task could
be late to enter the loop to check s_flash_op_complete by the time next
flash operation started. If the flag is cleared on the CPU waiting on
this flag, then the race condition can not happen.
2017-03-28 01:34:17 +08:00
Ivan Grokhotkov 41c6914454 Merge branch 'feature/ulp_toolchain' into 'master'
ULP coprocessor toolchain integration

- build system support for ULP coprocessor toolchain
- documentation for ULP coprocessor instruction set
- documentation for ULP code execution flow, loading programs, exchanging data
- example: counting pulses using ULP


See merge request !394
2017-03-27 13:54:51 +08:00
Dmitry Yakovlev a6e4e89592 ulp: add build system integration and example 2017-03-27 12:41:00 +08:00
Jiang Jiang Jian 8ee6f8227e Merge branch 'bugfix/reset_mac_cause_bt_cannot_rx_data' into 'master'
Reset WIFI mac when wifi start and update wifi lib

1. reset wifi mac when wifi start

2. roll back rx hung workaround for beacon timeout

3. fix amsdu ap interface wrong issue

4. fix amsdu header parse error

5. fix amsdu flag wrong issue

6. PHY: V350, fix BT rssi bug

7. RTC: V225, fix bt will be not work when wifi is reset

See merge request !606
2017-03-24 17:02:26 +08:00
XiaXiaotian a30c98c1a2 fix compile bug
1. split some unused rtc functions that calls phy function

2. make check bt idle more safe when reset wifi mac
2017-03-24 16:42:44 +08:00
Ivan Grokhotkov 5cf9ccf6ab Merge branch 'feature/add_auth_type_for_wpa2_enterprise' into 'master'
wpa2: add authenticate type for wpa2 enterprise



See merge request !588
2017-03-24 15:56:21 +08:00
Ivan Grokhotkov 710c853adc Merge branch 'bugfix/spi_flash_lock_period' into 'master'
SPI flash operations lock for shorter periods

Based on bug report here:
https://esp32.com/viewtopic.php?f=13&t=1489&p=6816#p6773

Long SPI flash erase (and possibly write/read) cycles block all tasks on both CPUs for an extended period, and can lead to WiFi dissassociation (and general priority inversion.)

This MR inserts preemption breaks into large operations (all erases, writes every 8KB, reads every 16KB).

Overhead of a single spi_flash_guart_start()/spi_flash_guard_end() cycle measured at approx 67us (assuming no preemption.)

See merge request !600
2017-03-24 15:55:42 +08:00
Ivan Grokhotkov 65baf502b7 Merge branch 'bugfix/esp32_core_dump_issues' into 'master'
bugfix: ESP32 Core Dump reported issues

This MR fixes the following issues:
1.  fixed path to esptool when there is no compiled python module for it
2. GDB inernal failure handling was added

See merge request !599
2017-03-24 14:41:07 +08:00
Angus Gratton 0e31eb458e esp32: Move heap_alloc_caps to IRAM
Rest of malloc() path was already in IRAM
2017-03-24 10:41:45 +08:00
Ivan Grokhotkov 573cc7d36f esp32: make soc header compatible with assembler 2017-03-24 10:11:14 +08:00
Ivan Grokhotkov 6ad0a157e3 driver/rtc: add APIs to enable/disable hold function 2017-03-24 10:11:13 +08:00
Angus Gratton b9a06e68dd Merge branch 'bugfix/minor_fixes' into 'master'
Minor fixes and PRs cherry-picked from Github



See merge request !602
2017-03-23 17:57:28 +08:00
Ivan Grokhotkov ecee175962 Merge branch 'bugfix/nvs_init_check_empty_pages' into 'master'
Error handling in NVS initialization

Previously nvs_flash_init worked under an assumption that there should always be at least one free page available. This is true during normal operation, but in some cases (such as when changing application partition table from a non-OTA to an OTA one), NVS partition may get truncated, which will cause empty pages to be lost.

This MR adds error checks for this condition, and updates code which calls `nvs_flash_init` to check for the return code.
For most examples, a simple `ESP_ERROR_CHECK` is added around `nvs_flash_init`. For NVS examples and the OTA example, more robust error handling is added.

This change also removes nvs_flash_init calls from examples which don't use NVS.

See merge request !582
2017-03-23 17:57:15 +08:00
Angus Gratton 0f1109a9a2 Merge branch 'bugfix/idf_monitor' into 'master'
idf_monitor: Small fixes (baud rate, EOL, /dev/tty.X on macOS, Ctrl-T on failure)

* "make monitor" now passed the configured baud rate.
  Closes #436 https://github.com/espressif/esp-idf/issues/436
* Pass toolchain prefix from sdkconfig into monitor tool
* Allow setting EOL in idf_monitor.py, use CRLF by default
* Detect if /dev/tty.X is used on macOS, warn and replace with /dev/cu.X
* If a build fails or gdb exits, ignore Ctrl-T (allowing Ctrl-T Ctrl-A/F to be same key sequence everywhere)
* Add a note about winpty on Windows.
  Ref 02fdf8271d (commitcomment-21369196)
* Fix problems with Console.cancel() not existing in older pyserial
* Print more user-friendly symbols for "start of iram" and "start of flash"

See merge request !594
2017-03-23 17:56:56 +08:00
XiaXiaotian 61de08b0dd tw11087: fix wifi restore exception
1. stop wifi before restore wifi
2017-03-23 17:47:48 +08:00
XiaXiaotian 6181c39f05 Reset WIFI mac when wifi start and update wifi lib
1. reset wifi mac when wifi start

2. roll back rx hung workaround for beacon timeout

3. fix amsdu ap interface wrong issue

4. fix amsdu header parse error

5. fix amsdu flag wrong issue

6. PHY: V350, fix BT rssi bug

7. RTC: V225, fix bt will be not work when wifi is reset
2017-03-23 14:28:27 +08:00
Angus Gratton 8352e7e9ec unit test: Measure test wall time with CCOUNT, so it includes time w/ interrupts off 2017-03-22 15:35:54 +08:00
Angus Gratton d8fda48551 spi_flash: Split large SPI flash operations into parts, allowing preemption
* Erase range operations allow preemption after each block or sector.
* Write operations allow preemption every 8KB of data.
* Reado operations allow preemption every 16KB of data.
2017-03-22 15:35:54 +08:00
rudi ;-) 5362c7ac50 ethernet: Fix typo in log message
Merges #394 https://github.com/espressif/esp-idf/pull/394
2017-03-22 15:22:27 +08:00
Daniel Campora 01ad387ac8 freertos: Add config parameters to customize FreeRTOS behaviour.
The options are:
    - SUPPORT_STATIC_ALLOCATION
    - ENABLE_STATIC_TASK_CLEAN_UP_HOOK
    - TIMER_TASK_PRIORITY
    - TIMER_TASK_STACK_DEPTH
    - TIMER_QUEUE_LENGTH

Merges #444 https://github.com/espressif/esp-idf/pull/444
2017-03-22 15:21:38 +08:00
Matthias Ringwald 3e7b786af5 component/bt: allow to use alternative Bluetooth stack by disabling Bluedroid
Merges #408 https://github.com/espressif/esp-idf/pull/440
2017-03-22 15:13:25 +08:00
alarruskain eba6789e6c Fix late argument verification in emac-main
Prevent crash when emac_phy_power_enable is not set.

Merges #426 https://github.com/espressif/esp-idf/pull/426
2017-03-22 15:12:12 +08:00
Edmund Huber 0aab67f0aa esp32: esp_wifi.h: Replace a non-working #error statement with a working _Static_assert statement
Merges #440 https://github.com/espressif/esp-idf/pull/440
2017-03-22 15:01:40 +08:00
Angus Gratton 8438b8aa92 bt: Fix typo ESP_BT_MODE_ILDE
Closes #450 https://github.com/espressif/esp-idf/issues/450
2017-03-22 14:41:44 +08:00
Angus Gratton 64f26be053 rmt driver: Remove accidental ESP_LOGE in isr handler
Closes #451 https://github.com/espressif/esp-idf/issues/451
2017-03-22 14:33:22 +08:00
Angus Gratton c30bba8c63 rmt driver: Fix parameter & description of rmt_driver_install
Closes #187 https://github.com/espressif/esp-idf/issues/187
2017-03-22 12:30:34 +08:00
Alexey Gerenkov a593d8a518 bugfix: fixed path to esptool when there is no compiled python module for it
bugfix: GDB inernal failure handling was added
2017-03-21 13:30:38 +03:00
Ivan Grokhotkov fbaeb55c15 Merge branch 'bugfix/btdm_blufi' into 'master'
component/bt : fix blufi bug of sec_mode reset

fix BLUFI cannot be reconnected by phone without re-init.

See merge request !598
2017-03-21 17:54:19 +08:00
Tian Hao 13f0737883 component/bt : fix blufi bug of sec_mode reset 2017-03-21 17:17:07 +08:00
Angus Gratton 6afea0e81c linker scripts: Add explicit symbols for _iram_start and _flash_cache_start
This is to avoid confusion when idf_monitor prints the first symbol in each section, ie "WindowOverflow4" or similar,
when bootloader prints the section mapping address.

Closes #447 https://github.com/espressif/esp-idf/issues/447
2017-03-21 16:45:13 +08:00
Angus Gratton e477ce93e9 idf_monitor: Small fixes (baud rate, EOL, /dev/tty.X on macOS, Ctrl-T on failure)
* "make monitor" not passed the configured baud rate
  Closes #436 https://github.com/espressif/esp-idf/issues/436
* Pass toolchain prefix from sdkconfig into monitor tool
* Allow setting EOL in idf_monitor.py, use CRLF by default
* Detect if /dev/tty.X is used on macOS, warn and replace with /dev/cu.X
* If a build fails or gdb exits, ignore Ctrl-T (allowing Ctrl-T Ctrl-A/F to be same key sequence everywhere)
* Add a note about winpty on Windows
  Ref 02fdf8271d (commitcomment-21369196)
2017-03-21 16:00:32 +08:00
Ivan Grokhotkov 9254d2846f Merge branch 'feature/ledc_low_speed_channels' into 'master'
add ledc low speed channels

1. add low speed channels
2. modify example code.

See merge request !490
2017-03-21 15:35:40 +08:00
Ivan Grokhotkov 91d35f01f2 Merge branch 'bugfix/i2c_spikes_on_master_init_#393_from_github' into 'master'
bugfix: I2C spikes on master init

Fix I2C spikes on master init.
Before I2C io init, set high level on SDA/SCK IOs.

Fixes https://github.com/espressif/esp-idf/issues/393

See merge request !593
2017-03-21 15:09:16 +08:00
Ivan Grokhotkov e4e8a903c3 Merge branch 'bugfix/touch_pad_read_takes_too_much_time' into 'master'
modify touch pad read function

The touch pad read function taks too much time within spin lock waiting for the "done bit". (about 7.6ms as we tested)
So we try to use a mutex on the touch read function and any other functions might change the "done bit".

See merge request !543
2017-03-21 14:46:30 +08:00