]> granicus.if.org Git - esp-idf/log
esp-idf
7 years agoMerge branch 'bugfix/windows_install_paths' into 'master'
Angus Gratton [Thu, 30 Mar 2017 02:51:01 +0000 (10:51 +0800)]
Merge branch 'bugfix/windows_install_paths' into 'master'

Fix expansion of PATH on Windows setup

Was accidentally expanding in context of setup script, not at runtime.

See merge request !624

7 years agodoc: Fix some Windows Setup Guide links
Angus Gratton [Thu, 30 Mar 2017 00:29:03 +0000 (11:29 +1100)]
doc: Fix some Windows Setup Guide links

7 years agowindows: Don't expand PATH when generating setup
Angus Gratton [Wed, 29 Mar 2017 23:58:58 +0000 (10:58 +1100)]
windows: Don't expand PATH when generating setup

Ref #467 https://github.com/espressif/esp-idf/issues/467

7 years agoMerge branch 'bugfix/git_porcelain_arg' into 'master'
Ivan Grokhotkov [Wed, 29 Mar 2017 09:37:34 +0000 (17:37 +0800)]
Merge branch 'bugfix/git_porcelain_arg' into 'master'

make: remove version parameter from git status porcelain option

Version parameter was added in git 2.11, while default git on macOS is
currently 2.10. According to the latest git docs, if the version
parameter is not provided, it defaults to ‘v1’, so removing it doesn’t
change the format.

See merge request !616

7 years agoMerge branch 'bugfix/cpu1_isr_stack_location' into 'master'
Ivan Grokhotkov [Wed, 29 Mar 2017 04:05:31 +0000 (12:05 +0800)]
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

7 years agoMerge branch 'feature/mdns_dnssd_metaquery' into 'master'
Angus Gratton [Wed, 29 Mar 2017 01:29:31 +0000 (09:29 +0800)]
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

7 years agoMerge branch 'bugfix/example_naming' into 'master'
Angus Gratton [Wed, 29 Mar 2017 00:50:49 +0000 (08:50 +0800)]
Merge branch 'bugfix/example_naming' into 'master'

examples: Standardise naming of files, symbols, etc. in examples

* Use "example" in all example function & variable names,
  ie use i2c_example_xxx instead of i2c_xxx for example functions.
  Closes #198 https://github.com/espressif/esp-idf/issues/198
* Mark example functions, etc. static
* Replace uses of "test" & "demo" with "example"
* Split the UART example into two
* Rename "main" example files to end with "_main.c" for disambiguation

See merge request !601

7 years agomdns: add simple dns-sd meta query support
negativekelvin [Tue, 14 Feb 2017 04:53:46 +0000 (21:53 -0700)]
mdns: add simple dns-sd meta query support

tabs to spaces

match domain

7 years agoFix finding location of ISR stack space for CPU1
Jeroen Domburg [Tue, 28 Mar 2017 07:50:10 +0000 (15:50 +0800)]
Fix finding location of ISR stack space for CPU1

7 years agomake: remove version parameter from git status porcelain option
Ivan Grokhotkov [Tue, 28 Mar 2017 06:22:27 +0000 (14:22 +0800)]
make: remove version parameter from git status porcelain option

Version parameter was added in git 2.11, while default git on macOS is
currently 2.10. According to the latest git docs, if the version
parameter is not provided, it defaults to ‘v1’, so removing it doesn’t
change the format.

7 years agoMerge branch 'bugfix/windows_setup' into 'master'
Angus Gratton [Tue, 28 Mar 2017 02:49:08 +0000 (10:49 +0800)]
Merge branch 'bugfix/windows_setup' into 'master'

Windows setup improvements

* Tweak Makefile to significantly reduce startup time on Windows (also reduced on other platforms, but less obvious.)
* Revise windows setup installation script to fix various issues, use latest toolchain.
* Tweak Windows config docs

See merge request !597

7 years agoexamples: Standardise naming of files, symbols, etc. in examples
Angus Gratton [Wed, 22 Mar 2017 04:36:11 +0000 (12:36 +0800)]
examples: Standardise naming of files, symbols, etc. in examples

* Use "example" in all example function & variable names,
  ie use i2c_example_xxx instead of i2c_xxx for example functions.
  Closes #198 https://github.com/espressif/esp-idf/issues/198
* Mark example functions, etc. static
* Replace uses of "test" & "demo" with "example"
* Split the UART example into two
* Rename "main" example files to end with "_main.c" for disambiguation

7 years agoMerge branch 'feature/doc_boards_and_modules' into 'master'
Angus Gratton [Mon, 27 Mar 2017 06:39:12 +0000 (14:39 +0800)]
Merge branch 'feature/doc_boards_and_modules' into 'master'

doc: add dev module and boards by Espressif

Overview, picture, link to schematic, ref. design, etc. for the following development module and boards:

- ESP-WROOM-32
- ESP32 Core Board V2 / ESP32 DevKitC
- ESP32 Demo Board V2
- ESP32 WROVER KIT V1 / ESP32 DevKitJ V1
- ESP32 WROVER KIT V2

See merge request !560

7 years agoMerge branch 'feature/ulp_toolchain' into 'master'
Ivan Grokhotkov [Mon, 27 Mar 2017 05:54:51 +0000 (13:54 +0800)]
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

7 years agoulp: add build system integration and example
Dmitry Yakovlev [Mon, 9 Jan 2017 04:38:20 +0000 (07:38 +0300)]
ulp: add build system integration and example

7 years agodocs: Mention the 'examples' dir in the setup docs
Angus Gratton [Tue, 21 Mar 2017 07:37:17 +0000 (15:37 +0800)]
docs: Mention the 'examples' dir in the setup docs

7 years agowindows config: Update Windows setup script, pre-installed image, instructions.
Angus Gratton [Tue, 21 Mar 2017 03:17:19 +0000 (11:17 +0800)]
windows config: Update Windows setup script, pre-installed image, instructions.

Add notes about MSYS2 package mirrors & HTTP proxies for users in China.

Closes #260 https://github.com/espressif/esp-idf/issues/260
Closes #281 https://github.com/espressif/esp-idf/issues/281
Closes #200 https://github.com/espressif/esp-idf/issues/200
Closes #430 https://github.com/espressif/esp-idf/pull/430
Accomplishes similar goals to #264 https://github.com/espressif/esp-idf/pull/264

7 years agoMerge branch 'bugfix/reset_mac_cause_bt_cannot_rx_data' into 'master'
Jiang Jiang Jian [Fri, 24 Mar 2017 09:02:26 +0000 (17:02 +0800)]
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

7 years agofix compile bug
XiaXiaotian [Fri, 24 Mar 2017 00:41:34 +0000 (08:41 +0800)]
fix compile bug

1. split some unused rtc functions that calls phy function

2. make check bt idle more safe when reset wifi mac

7 years agoMerge branch 'feature/add_auth_type_for_wpa2_enterprise' into 'master'
Ivan Grokhotkov [Fri, 24 Mar 2017 07:56:21 +0000 (15:56 +0800)]
Merge branch 'feature/add_auth_type_for_wpa2_enterprise' into 'master'

wpa2: add authenticate type for wpa2 enterprise

See merge request !588

7 years agoMerge branch 'bugfix/spi_flash_lock_period' into 'master'
Ivan Grokhotkov [Fri, 24 Mar 2017 07:55:42 +0000 (15:55 +0800)]
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

7 years agoMerge branch 'feature/ci_tags_release_branches' into 'master'
Ivan Grokhotkov [Fri, 24 Mar 2017 07:55:15 +0000 (15:55 +0800)]
Merge branch 'feature/ci_tags_release_branches' into 'master'

CI support for testing & deploying release tags & branches

For CI testing & deployment of release branches:
* Test release tags as well as branches
* Swap gitlab submodule URLs to github when testing release tags or branches.

These changes are already pushed to the release/v2.0 branch.

See merge request !604

7 years agoMerge branch 'bugfix/esp32_core_dump_issues' into 'master'
Ivan Grokhotkov [Fri, 24 Mar 2017 06:41:07 +0000 (14:41 +0800)]
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

7 years agoesp32: Move heap_alloc_caps to IRAM
Angus Gratton [Fri, 24 Mar 2017 02:41:45 +0000 (10:41 +0800)]
esp32: Move heap_alloc_caps to IRAM

Rest of malloc() path was already in IRAM

7 years agoesp32: make soc header compatible with assembler
Ivan Grokhotkov [Sat, 18 Mar 2017 09:27:19 +0000 (17:27 +0800)]
esp32: make soc header compatible with assembler

7 years agodriver/rtc: add APIs to enable/disable hold function
Ivan Grokhotkov [Sun, 19 Mar 2017 15:59:19 +0000 (23:59 +0800)]
driver/rtc: add APIs to enable/disable hold function

7 years agoMerge branch 'feature/ci-use-local-registry' into 'master'
Ivan Grokhotkov [Thu, 23 Mar 2017 12:58:23 +0000 (20:58 +0800)]
Merge branch 'feature/ci-use-local-registry' into 'master'

ci: allow passing Hub account or registry name from the environment

This change allows to set registry name or Hub account name using CI Variables. Needs all runners to be updated to gitlab-ci-runner v1.8+ in order for the auth feature to work.

See merge request !605

7 years agoMerge branch 'bugfix/minor_fixes' into 'master'
Angus Gratton [Thu, 23 Mar 2017 09:57:28 +0000 (17:57 +0800)]
Merge branch 'bugfix/minor_fixes' into 'master'

Minor fixes and PRs cherry-picked from Github

See merge request !602

7 years agoMerge branch 'bugfix/nvs_init_check_empty_pages' into 'master'
Ivan Grokhotkov [Thu, 23 Mar 2017 09:57:15 +0000 (17:57 +0800)]
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

7 years agoMerge branch 'bugfix/idf_monitor' into 'master'
Angus Gratton [Thu, 23 Mar 2017 09:56:56 +0000 (17:56 +0800)]
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 https://github.com/espressif/esp-idf/commit/02fdf8271de3a6db2ab9d4d6f023c160c84ebdbe#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

7 years agotw11087: fix wifi restore exception
XiaXiaotian [Thu, 23 Mar 2017 09:47:48 +0000 (17:47 +0800)]
tw11087: fix wifi restore exception

1. stop wifi before restore wifi

7 years agoReset WIFI mac when wifi start and update wifi lib
XiaXiaotian [Thu, 23 Mar 2017 03:33:46 +0000 (11:33 +0800)]
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

7 years agoidf_monitor: Use ANSI color codes for all output we inject into stderr
Angus Gratton [Thu, 23 Mar 2017 02:41:14 +0000 (10:41 +0800)]
idf_monitor: Use ANSI color codes for all output we inject into stderr

7 years agobuild system: Add explicit DEBUG_FLAGS variable, pass to assembler also
Angus Gratton [Tue, 21 Mar 2017 08:46:48 +0000 (16:46 +0800)]
build system: Add explicit DEBUG_FLAGS variable, pass to assembler also

7 years agoci: allow passing Hub account or registry name from the environment
Ivan Grokhotkov [Wed, 22 Mar 2017 13:59:40 +0000 (21:59 +0800)]
ci: allow passing Hub account or registry name from the environment

7 years agoci: Swap github/gitlab submodules for release branches & tags also
Angus Gratton [Wed, 22 Mar 2017 10:39:28 +0000 (18:39 +0800)]
ci: Swap github/gitlab submodules for release branches & tags also

7 years agoci: Also run deployment steps for tags of form vX.Y (with optional -suffix)
Angus Gratton [Wed, 22 Mar 2017 10:25:28 +0000 (18:25 +0800)]
ci: Also run deployment steps for tags of form vX.Y (with optional -suffix)

7 years agounit test: Measure test wall time with CCOUNT, so it includes time w/ interrupts off
Angus Gratton [Wed, 22 Mar 2017 03:50:05 +0000 (11:50 +0800)]
unit test: Measure test wall time with CCOUNT, so it includes time w/ interrupts off

7 years agospi_flash: Split large SPI flash operations into parts, allowing preemption
Angus Gratton [Wed, 22 Mar 2017 03:48:33 +0000 (11:48 +0800)]
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.

7 years agoethernet: Fix typo in log message
rudi ;-) [Thu, 2 Mar 2017 22:41:18 +0000 (23:41 +0100)]
ethernet: Fix typo in log message

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

7 years agofreertos: Add config parameters to customize FreeRTOS behaviour.
Daniel Campora [Mon, 20 Mar 2017 21:32:01 +0000 (22:32 +0100)]
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

7 years agocomponent/bt: allow to use alternative Bluetooth stack by disabling Bluedroid
Matthias Ringwald [Tue, 7 Mar 2017 17:20:33 +0000 (18:20 +0100)]
component/bt: allow to use alternative Bluetooth stack by disabling Bluedroid

Merges #408 https://github.com/espressif/esp-idf/pull/440

7 years agoFix late argument verification in emac-main
alarruskain [Mon, 13 Mar 2017 12:31:01 +0000 (13:31 +0100)]
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

7 years agobuild: Check for .git, but it doesn't have to be a directory, so that esp-idf will...
Edmund Huber [Mon, 20 Mar 2017 06:11:13 +0000 (23:11 -0700)]
build: Check for .git, but it doesn't have to be a directory, so that esp-idf will work as a submodule

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

7 years agoesp32: esp_wifi.h: Replace a non-working #error statement with a working _Static_asse...
Edmund Huber [Sun, 19 Mar 2017 18:34:35 +0000 (11:34 -0700)]
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

7 years agobuild: pass more arguments to git describe so that it always works even if detached...
Edmund Huber [Sun, 19 Mar 2017 19:06:37 +0000 (12:06 -0700)]
build: pass more arguments to git describe so that it always works even if detached branch, etc

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

7 years agoREADME: Remove link typo
rudi ;-) [Fri, 17 Mar 2017 20:23:44 +0000 (21:23 +0100)]
README: Remove link typo

link typo removed char > from end of the link
products/hardware/esp32/overview

Merges #439 https://github.com/espressif/esp-idf/issues/450
Closes #437 https://github.com/espressif/esp-idf/issues/437

7 years agobt: Fix typo ESP_BT_MODE_ILDE
Angus Gratton [Wed, 22 Mar 2017 06:41:44 +0000 (14:41 +0800)]
bt: Fix typo ESP_BT_MODE_ILDE

Closes #450 https://github.com/espressif/esp-idf/issues/450

7 years agormt driver: Remove accidental ESP_LOGE in isr handler
Angus Gratton [Wed, 22 Mar 2017 06:29:16 +0000 (14:29 +0800)]
rmt driver: Remove accidental ESP_LOGE in isr handler

Closes #451 https://github.com/espressif/esp-idf/issues/451

7 years agormt driver: Fix parameter & description of rmt_driver_install
Angus Gratton [Wed, 22 Mar 2017 04:30:34 +0000 (12:30 +0800)]
rmt driver: Fix parameter & description of rmt_driver_install

Closes #187 https://github.com/espressif/esp-idf/issues/187

7 years agobugfix: fixed path to esptool when there is no compiled python module for it
Alexey Gerenkov [Wed, 15 Mar 2017 09:44:14 +0000 (12:44 +0300)]
bugfix: fixed path to esptool when there is no compiled python module for it
bugfix: GDB inernal failure handling was added

7 years agoMerge branch 'bugfix/btdm_blufi' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 09:54:19 +0000 (17:54 +0800)]
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

7 years agocomponent/bt : fix blufi bug of sec_mode reset
Tian Hao [Tue, 21 Mar 2017 09:17:07 +0000 (17:17 +0800)]
component/bt : fix blufi bug of sec_mode reset

7 years agolinker scripts: Add explicit symbols for _iram_start and _flash_cache_start
Angus Gratton [Tue, 21 Mar 2017 08:29:57 +0000 (16:29 +0800)]
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

7 years agoidf_monitor: Fix issues using Ctrl-F/Ctrl-A/gdb with older pyserial
Angus Gratton [Tue, 21 Mar 2017 08:08:06 +0000 (16:08 +0800)]
idf_monitor: Fix issues using Ctrl-F/Ctrl-A/gdb with older pyserial

Previously error was "AttributeError: 'Console' object has no attribute 'cancel'"

7 years agoidf_monitor: Small fixes (baud rate, EOL, /dev/tty.X on macOS, Ctrl-T on failure)
Angus Gratton [Fri, 17 Mar 2017 10:41:18 +0000 (18:41 +0800)]
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 https://github.com/espressif/esp-idf/commit/02fdf8271de3a6db2ab9d4d6f023c160c84ebdbe#commitcomment-21369196

7 years agobuild system: Call 'git status' w/ machine-readable output once to check submodules
Angus Gratton [Tue, 14 Mar 2017 10:55:12 +0000 (18:55 +0800)]
build system: Call 'git status' w/ machine-readable output once to check submodules

This is substantially faster than the 'git submodule status' command, has same effect. Particularly noticeable on
Windows, where 'submodule status' takes 2 seconds and 'status' takes 0.2 seconds.

7 years agoMerge branch 'feature/ledc_low_speed_channels' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 07:35:40 +0000 (15:35 +0800)]
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

7 years agoMerge branch 'bugfix/i2c_spikes_on_master_init_#393_from_github' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 07:09:16 +0000 (15:09 +0800)]
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

7 years agoMerge branch 'bugfix/touch_pad_read_takes_too_much_time' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 06:46:30 +0000 (14:46 +0800)]
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

7 years agoMerge branch 'bugfix/i2c_driver_error_under_release_optimization_level' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 06:39:29 +0000 (14:39 +0800)]
Merge branch 'bugfix/i2c_driver_error_under_release_optimization_level' into 'master'

bugfix: i2c driver not working in 'RELEASE' configuration

This issue is reported from https://github.com/espressif/esp-idf/issues/304.

We found that when we operate the hw command registers in I2C struct, sometimes the behaviour would be different in DEBUG/RELEASE optimisation level:

The code looks like this:
```
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
```

In DEBUG configuration:
```
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f3ab0:    3388          l32i.n    a8, a3, 12
400f3ab2:    14c882            addi    a8, a8, 20
400f3ab5:    a08840            addx4    a8, a8, a4
400f3ab8:    0020c0            memw
400f3abb:    2898          l32i.n    a9, a8, 8
400f3abd:    0020c0            memw
400f3ac0:    28b8          l32i.n    a11, a8, 8
400f3ac2:    74a090            extui    a10, a9, 0, 8
400f3ac5:    00af92            movi    a9, 0xffffff00
400f3ac8:    109b90            and    a9, a11, a9
400f3acb:    2099a0            or    a9, a9, a10
400f3ace:    0020c0            memw
400f3ad1:    2899          s32i.n    a9, a8, 8
```

In RELEASE configuration:

```
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f2ba2:    580572            l8ui    a7, a5, 88
400f2ba5:    747070            extui    a7, a7, 0, 8
400f2ba8:    0020c0            memw
400f2bab:    584572            s8i    a7, a5, 88
```

Looks like the compiler will make it a 8bit operation after optimisation.

But the register value changes from 0x901 to 0x101.

After this 8-bit optimisation, the 11th bit changed from 1 to zero, which caused this error.

We are still trying to find out why that happens, because there might be some risk when operating the register struct.

This is a workaround to avoid "-=" operation on I2C register struct fields.

See merge request !592

7 years agoMerge branch 'feature/adc_demo' into 'master'
Ivan Grokhotkov [Tue, 21 Mar 2017 06:38:54 +0000 (14:38 +0800)]
Merge branch 'feature/adc_demo' into 'master'

feat(adc): add add adc1 channl4(GPIO32) for adc example

add adc example

See merge request !572

7 years agoadd adc1 example
Chu Shu Chen [Fri, 10 Mar 2017 13:30:30 +0000 (21:30 +0800)]
add adc1 example

7 years agobugfix: I2C spikes on master init #393 from github
Wangjialin [Sun, 19 Mar 2017 09:05:07 +0000 (17:05 +0800)]
bugfix: I2C spikes on master init #393 from github

Fix I2C spikes on master init.
This issue is reported from https://github.com/espressif/esp-idf/issues/393
Before I2C io init, set high level on SDA/SCK IOs.

7 years agobugfix: i2c driver not working in 'RELEASE' configuration
Wangjialin [Sun, 19 Mar 2017 08:09:44 +0000 (16:09 +0800)]
bugfix: i2c driver not working in 'RELEASE' configuration

This issue is reported from https://github.com/espressif/esp-idf/issues/304.
We found that when we operate the hw command registers in I2C struct, sometimes the behaviour would be different in DEBUG/RELEASE optimisation level:

The code looks like this:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;

In DEBUG configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f3ab0:    3388          l32i.n    a8, a3, 12
400f3ab2:    14c882            addi    a8, a8, 20
400f3ab5:    a08840            addx4    a8, a8, a4
400f3ab8:    0020c0            memw
400f3abb:    2898          l32i.n    a9, a8, 8
400f3abd:    0020c0            memw
400f3ac0:    28b8          l32i.n    a11, a8, 8
400f3ac2:    74a090            extui    a10, a9, 0, 8
400f3ac5:    00af92            movi    a9, 0xffffff00
400f3ac8:    109b90            and    a9, a11, a9
400f3acb:    2099a0            or    a9, a9, a10
400f3ace:    0020c0            memw
400f3ad1:    2899          s32i.n    a9, a8, 8

In RELEASE configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f2ba2:    580572            l8ui    a7, a5, 88
400f2ba5:    747070            extui    a7, a7, 0, 8
400f2ba8:    0020c0            memw
400f2bab:    584572            s8i    a7, a5, 88

Looks like the compiler will make it a 8bit operation after optimisation.
But the register value changes from 0x901 to 0x101.
After this 8-bit optimisation, the 11th bit changed from 1 to zero, which caused this error.

We are still trying to find out why that happens, because there might be some risk when operating the register struct.
This is a workaround to avoid "-=" operation on I2C register struct fields.

7 years agowpa2: add authenticate type for wpa2 enterprise
XiaXiaotian [Fri, 17 Mar 2017 09:28:01 +0000 (17:28 +0800)]
wpa2: add authenticate type for wpa2 enterprise

7 years agoFeature: add ledc low speed channels
Wangjialin [Wed, 8 Feb 2017 11:52:18 +0000 (19:52 +0800)]
Feature: add ledc low speed channels

1. Add low speed channels for LEDC module.
2. Improve fade object allocate mechanism.
3. Improve ledc example, add 2 low speed channels in example.
4. Remove debug code
5. Improve the register bit field name of slow clock.

7 years agoMerge branch 'bugfix/push_master_github' into 'master'
Ivan Grokhotkov [Fri, 17 Mar 2017 06:21:45 +0000 (14:21 +0800)]
Merge branch 'bugfix/push_master_github' into 'master'

ci: Fix master branch being pushed to master

Previous change in 8b6993f7 doesn't work if branch exists locally.

See merge request !587

7 years agoci: Fix master branch being pushed to master
Angus Gratton [Fri, 17 Mar 2017 04:00:25 +0000 (12:00 +0800)]
ci: Fix master branch being pushed to master

Previous change in 8b6993f7 doesn't work if branch exists locally.

7 years agoMerge branch 'bugfix/push_release_branches' into 'master'
Ivan Grokhotkov [Thu, 16 Mar 2017 07:05:23 +0000 (15:05 +0800)]
Merge branch 'bugfix/push_release_branches' into 'master'

build/CI: Push release branches to github

Previously CI deployment only pushed to master.

See merge request !579

7 years agoMerge branch 'feature/update_wifi_lib_for_some_fixs_and_features' into 'master'
Ivan Grokhotkov [Thu, 16 Mar 2017 01:39:16 +0000 (09:39 +0800)]
Merge branch 'feature/update_wifi_lib_for_some_fixs_and_features' into 'master'

esp32: update wifi lib for some bugfix/features

1. add options to disable nvs
2. add station keepalive with softap
3. fix beacon rx start time not accurate issue
4. set wifi rx desc/buffer boundary check to internal memory boundary

See merge request !578

7 years agobuild/CI: Push all allocated release branches to github
Angus Gratton [Tue, 14 Mar 2017 09:27:56 +0000 (17:27 +0800)]
build/CI: Push all allocated release branches to github

Previously CI deployment only pushed to master.

7 years agonvs: print page state as text in nvs_dump
Ivan Grokhotkov [Wed, 15 Mar 2017 08:51:52 +0000 (16:51 +0800)]
nvs: print page state as text in nvs_dump

7 years agoexamples: check return value of nvs_flash_init
Ivan Grokhotkov [Tue, 14 Mar 2017 13:39:44 +0000 (21:39 +0800)]
examples: check return value of nvs_flash_init

nvs_flash_init may return an error code in some cases, and applications
should check this error code (or at least assert on it being ESP_OK, to
make potential issues more immediately obvious).

This change modifies all the examples which use NVS to check the error
code. Most examples get a simple ESP_ERROR_CHECK assert, while NVS
examples, OTA example, and NVS unit tests get a more verbose check which
may be used in real applications.

7 years agoMerge branch 'feature/idf_monitor' into 'master'
Angus Gratton [Wed, 15 Mar 2017 02:41:08 +0000 (10:41 +0800)]
Merge branch 'feature/idf_monitor' into 'master'

Expand  'make monitor' support

New 'make monitor' idf_monitor tool for better monitor output. Running 'make monitor' will now:
* Automatically look up code addresses via addr2line and print function, source file, line number in terminal.
* Can reset the ESP32 by typing Ctrl-T Ctrl-R.
* Can run "make flash" by typing Ctrl-T Ctrl-F.
* Can run "make app-flash" by typing Ctrl-T Ctrl-A.
* If gdb stub starts, monitor will automatically run gdb and connect. When gdb exits, ESP32 resets and monitor resumes.
* Exit is still Ctrl-[

Have some more features I'd like to add (log output to file, crash dump support) but I think this is at the point of being useful.

See merge request !565

7 years agoMerge branch 'bugfix/mbedtls_non_blocking_sockets' into 'master'
Ivan Grokhotkov [Wed, 15 Mar 2017 02:39:53 +0000 (10:39 +0800)]
Merge branch 'bugfix/mbedtls_non_blocking_sockets' into 'master'

mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets

Previous code read non-blocking status via fcntl first, which resets errno.

* Closes #424 https://github.com/espressif/esp-idf/pull/424
* Merges #425 https://github.com/espressif/esp-idf/pull/425

See merge request !575

7 years agoexamples: remove nvs_flash_init from examples which do not use NVS
Ivan Grokhotkov [Tue, 14 Mar 2017 13:35:20 +0000 (21:35 +0800)]
examples: remove nvs_flash_init from examples which do not use NVS

7 years agophy_init: move NVS init into relevant function, check errors
Ivan Grokhotkov [Tue, 14 Mar 2017 13:27:27 +0000 (21:27 +0800)]
phy_init: move NVS init into relevant function, check errors

This change also modifies logging statements to print hexadecimal error codes, which are easier to look up.

7 years agonvs: check that storage has at least one free page
Ivan Grokhotkov [Tue, 14 Mar 2017 13:24:56 +0000 (21:24 +0800)]
nvs: check that storage has at least one free page

This change adds a check for the free page count to nvs_flash_init.
Under normal operation, NVS keeps at least one free page available,
except for transient states such as freeing up new page. Due to external
factors (such as NVS partition size reduction) this free page could be
lost, making NVS operation impossible. Previously this would cause an
error when performing any nvs_set operation or opening a new namespace.
With this change, an error is returned from nvs_flash_init to indicate
that NVS partition is in such a state.

7 years agonvs: add missing error code descriptions
Ivan Grokhotkov [Tue, 14 Mar 2017 13:18:22 +0000 (21:18 +0800)]
nvs: add missing error code descriptions

7 years agoMerge branch 'bugfix/mdns_security_issues' into 'master'
Ivan Grokhotkov [Tue, 14 Mar 2017 13:42:06 +0000 (21:42 +0800)]
Merge branch 'bugfix/mdns_security_issues' into 'master'

Bugfix/mdns security issues

Fixes a series of security issues with MDNS.

STACK-SMASH: https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L494:
The sprintf is not limited. We can execute the sprintf codeflow as
many times as we want, allowing arbitrary long data being written
into stack.

PACKET-OF-DEATH:
https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L502.
The compare allows equal, and thus jumping back to it self infinite
recursion -> guaranteed crash

TXT-SMASH: https://github.com/espressif/esp-idf/blob/dd3f18d2d88ee78909d4af2840dfdf0b9f715f28/components/mdns/mdns.c#L1381
The loop does not check on reaching a->txt maximum size (1024),
resulting in stack overflow.

See merge request !576

7 years agoaddress security issues with mDNS
me-no-dev [Mon, 13 Mar 2017 09:56:50 +0000 (11:56 +0200)]
address security issues with mDNS

7 years agoMerge branch 'bugfix/make_test_components' into 'master'
Ivan Grokhotkov [Tue, 14 Mar 2017 07:16:51 +0000 (15:16 +0800)]
Merge branch 'bugfix/make_test_components' into 'master'

make: don’t override TEST_COMPONENTS

When idf_monitor is launched from make, it gets modified `TEST_COMPONENTS`
variable which contains full paths to the test components instead of the
names. This causes `TEST_COMPONENT_PATHS` to be empty and the unit test
app gets built without any test components.

This change introduces an internal `TEST_COMPONENTS_LIST` variable which
gets set either from `COMPONENTS` if `TESTS_ALL` is 1, or from
`TEST_COMOPONENTS` otherwise.
Bootloader makefile is also fixed to avoid propagating `TESTS_ALL` to the
bootloader build step.

See merge request !569

7 years agoMerge branch 'bugfix/fix_uart_stop_bit_2bit_error' into 'master'
Ivan Grokhotkov [Tue, 14 Mar 2017 06:17:55 +0000 (14:17 +0800)]
Merge branch 'bugfix/fix_uart_stop_bit_2bit_error' into 'master'

bug fix: fix uart data bug when stop-bit is set as 2-bit mode

This is a workaround for a hardware bug.
When we want to use 2-stop-bit mode, we need to set stop-bit-1 and set dl1_en in rs485 register.

See merge request !544

7 years agoMerge branch 'feature/aws_iot_sdk' into 'master'
Angus Gratton [Tue, 14 Mar 2017 02:21:08 +0000 (10:21 +0800)]
Merge branch 'feature/aws_iot_sdk' into 'master'

Amazon AWS IoT SDK

Amazon IoT SDK component, plus two examples derived from their Linux samples.

See merge request !132

7 years agoesp32: update wifi lib for some bugfix/features
Liu Zhi Fu [Tue, 14 Mar 2017 02:14:26 +0000 (10:14 +0800)]
esp32: update wifi lib for some bugfix/features

1. add options to disable nvs
2. add station keepalive with softap
3. fix beacon rx start time not accurate issue
4. set wifi rx desc/buffer boundary check to internal memory boundary

7 years agoAWS IoT Device SDK Support
Angus Gratton [Wed, 5 Oct 2016 05:32:09 +0000 (16:32 +1100)]
AWS IoT Device SDK Support

Use device cert/key embedded in firmware, or loaded from filesystem.

7 years agombedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets
Neil Kolban [Mon, 13 Mar 2017 03:32:00 +0000 (22:32 -0500)]
mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets

Previous code read non-blocking status via fcntl first, which resets errno.

Closes #424 https://github.com/espressif/esp-idf/pull/424
Merges #425 https://github.com/espressif/esp-idf/pull/425

7 years agoMerge branch 'bugfix/unit_test_app_print_tests_in_correct_order' into 'master'
Angus Gratton [Mon, 13 Mar 2017 07:43:01 +0000 (15:43 +0800)]
Merge branch 'bugfix/unit_test_app_print_tests_in_correct_order' into 'master'

Fix unit test app to print tests in the same order they are given in test file

This fixes the unit test app to print test cases in the same order they are given in test file.

See merge request !460

7 years agofix unit test app to print tests in the same order they are given in files
antti [Mon, 23 Jan 2017 04:54:35 +0000 (12:54 +0800)]
fix unit test app to print tests in the same order they are given in files

7 years agotools: New idf_monitor 'make monitor' tool for smarter monitor output
Angus Gratton [Tue, 7 Mar 2017 22:15:19 +0000 (09:15 +1100)]
tools: New idf_monitor 'make monitor' tool for smarter monitor output

7 years agobugfix: fix uart 2-stop-bit error
Wangjialin [Thu, 2 Mar 2017 05:41:32 +0000 (13:41 +0800)]
bugfix: fix uart 2-stop-bit error

Fix uart data bug when stop-bit is set as 2-bit mode.
This is just a software workaround.

7 years ago fix(touch_pad): modify touch pad read function and touch_pad_deinit
Chu Shu Chen [Thu, 2 Mar 2017 08:13:30 +0000 (16:13 +0800)]
 fix(touch_pad): modify touch pad read function and touch_pad_deinit

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".

7 years agoMerge branch 'bugfix/adv_type_error' into 'master'
Ivan Grokhotkov [Fri, 10 Mar 2017 06:16:33 +0000 (14:16 +0800)]
Merge branch 'bugfix/adv_type_error' into 'master'

component/bt: modify BLE advertising type error

fix BLE advertising type error

See merge request !568

7 years agoMerge branch 'feature/tighter_rom_memory_defines' into 'master'
Jeroen Domburg [Thu, 9 Mar 2017 12:25:07 +0000 (20:25 +0800)]
Merge branch 'feature/tighter_rom_memory_defines' into 'master'

Use more regions reserved for ROM routines/stack we don't use for heap.

This frees up about 28K of RAM.

See merge request !467

7 years agoMR things
Jeroen Domburg [Thu, 9 Mar 2017 11:59:09 +0000 (19:59 +0800)]
MR things

7 years agomake: don’t override TEST_COMPONENTS
Ivan Grokhotkov [Thu, 9 Mar 2017 11:42:46 +0000 (19:42 +0800)]
make: don’t override TEST_COMPONENTS

When idf_monitor is launched from make, it gets modified TEST_COMPONENTS
variable which contains full paths to the test components instead of the
names. This causes TEST_COMPONENT_PATHS to be empty and the unit test
app gets built without any test components.

This change introduces an internal TEST_COMPONENTS_LIST variable which
gets set either from $(COMPONENTS) if TESTS_ALL is 1, and from
TEST_COMOPONENTS otherwise.
Bootloader makefile is also fixed to avoid propagating TESTS_ALL to the
bootloader build step.

7 years agocomponent/bt: modify BLE advertising type error
island [Thu, 9 Mar 2017 07:36:22 +0000 (15:36 +0800)]
component/bt: modify BLE advertising type error

7 years agoMerge branch 'feature/wifi_deinit_2' into 'master'
Jiang Jiang Jian [Thu, 9 Mar 2017 07:35:36 +0000 (15:35 +0800)]
Merge branch 'feature/wifi_deinit_2' into 'master'

wifi deinit: update esp_wifi_deinit()

1. move ets_timer_deinit() to wifi_deinit()

2. delete wifi api mutex when wifi deinit

See merge request !563

7 years agoMerge branch 'bugfix/btdm_gatt_attribute_table_debug' into 'master'
Ivan Grokhotkov [Thu, 9 Mar 2017 05:28:11 +0000 (13:28 +0800)]
Merge branch 'bugfix/btdm_gatt_attribute_table_debug' into 'master'

bt component: fix bluetooth gatt packets process bugs

1. Add process of prepare write request packets
2. Add process of execute write request packets
3. Add process of reliable write request packets
4. Fix bug of processing read blob request packets
5. Fix bug of processing write request packets
6. Optimize error check and process in stack

See merge request !558