Commit graph

2156 commits

Author SHA1 Message Date
Dmitry Yakovlev a6e4e89592 ulp: add build system integration and example 2017-03-27 12:41:00 +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
Ivan Grokhotkov d3ce5c3504 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
2017-03-23 20:58:23 +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
Angus Gratton e88226c256 idf_monitor: Use ANSI color codes for all output we inject into stderr 2017-03-23 10:41:14 +08:00
Angus Gratton a3ce95e482 build system: Add explicit DEBUG_FLAGS variable, pass to assembler also 2017-03-23 10:30:42 +08:00
Ivan Grokhotkov d96b8c317a ci: allow passing Hub account or registry name from the environment 2017-03-22 21:59:40 +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 5272bd899b 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
2017-03-22 15:03:53 +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
Edmund Huber 6a58e173b8 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
2017-03-22 14:51:47 +08:00
rudi ;-) 36e685580a 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
2017-03-22 14:48:01 +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
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 5f3b9876b8 idf_monitor: Fix issues using Ctrl-F/Ctrl-A/gdb with older pyserial
Previously error was "AttributeError: 'Console' object has no attribute 'cancel'"
2017-03-21 16:08:06 +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
Ivan Grokhotkov 55e34c5464 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
2017-03-21 14:39:29 +08:00
Ivan Grokhotkov e57da86baf Merge branch 'feature/adc_demo' into 'master'
feat(adc): add add adc1 channl4(GPIO32) for adc example

add adc example

See merge request !572
2017-03-21 14:38:54 +08:00
Chu Shu Chen bab7a2df80 add adc1 example 2017-03-20 14:46:41 +08:00
Wangjialin 1ad68de8b8 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.
2017-03-19 17:05:07 +08:00
Wangjialin 94b91ee4af 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.
2017-03-19 16:09:44 +08:00
Wangjialin 7670e93639 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.
2017-03-17 17:26:30 +08:00
Ivan Grokhotkov 57486a1f61 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
2017-03-17 14:21:45 +08:00
Angus Gratton 364476c1cd ci: Fix master branch being pushed to master
Previous change in 8b6993f7 doesn't work if branch exists locally.
2017-03-17 12:02:46 +08:00
Ivan Grokhotkov f784381c32 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
2017-03-16 15:05:23 +08:00
Ivan Grokhotkov 51323482b2 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
2017-03-16 09:39:16 +08:00
Angus Gratton 8b6993f7aa build/CI: Push all allocated release branches to github
Previously CI deployment only pushed to master.
2017-03-15 17:36:41 +08:00
Ivan Grokhotkov 447ffb23d5 nvs: print page state as text in nvs_dump 2017-03-15 17:28:07 +08:00
Ivan Grokhotkov 4813ab2d28 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.
2017-03-15 10:44:54 +08:00
Angus Gratton 02fdf8271d 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
2017-03-15 10:41:08 +08:00
Ivan Grokhotkov 829800f272 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
2017-03-15 10:39:53 +08:00
Ivan Grokhotkov f59f13efd5 examples: remove nvs_flash_init from examples which do not use NVS 2017-03-14 22:03:40 +08:00
Ivan Grokhotkov 94b9898ca7 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.
2017-03-14 22:03:39 +08:00
Ivan Grokhotkov 5a23ec4dc4 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.
2017-03-14 22:03:39 +08:00
Ivan Grokhotkov 817bbb4bf9 nvs: add missing error code descriptions 2017-03-14 22:03:39 +08:00
Ivan Grokhotkov 577290aaba Merge branch 'bugfix/mdns_security_issues' into 'master'
Bugfix/mdns security issues

Fixes a series of security issues with MDNS.

STACK-SMASH: dd3f18d2d8/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:
dd3f18d2d8/components/mdns/mdns.c (L502).
The compare allows equal, and thus jumping back to it self infinite
recursion -> guaranteed crash

TXT-SMASH: dd3f18d2d8/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
2017-03-14 21:42:06 +08:00
me-no-dev c89e11c8fa address security issues with mDNS 2017-03-14 10:08:38 +02:00