Commit graph

647 commits

Author SHA1 Message Date
Ivan Grokhotkov 801b87b48a Merge branch 'bugfix/cross_core_int_init_single_core' into 'master'
esp32: initialize cross-core interrupt in single core mode

The software interrupt originally used as the cross-core interrupt is
now also used to yield from a FreeRTOS critical section; therefore it
must be initialized for single core mode as well.

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

See merge request !640
2017-04-10 12:19:10 +08:00
Ivan Grokhotkov aa817a1475 Merge branch 'bugfix/esp_error_check_release_builds' into 'master'
fix warnings generated by ESP_ERROR_CHECK(variable) in release builds

This uses the same pattern as “assert” in release builds to silence the
warning. At the same time, we make sure that if a statement is wrapped
into ESP_ERROR_CHECK, it is executed in release build as well.

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

See merge request !641
2017-04-10 12:18:47 +08:00
Ivan Grokhotkov 275b574ace fix warnings generated by ESP_ERROR_CHECK(variable) in release builds
This uses the same pattern as “assert” in release builds to silence the
warning. At the same time, we make sure that if a statement is wrapped
into ESP_ERROR_CHECK, it is executed in release build as well.
2017-04-07 15:24:58 +08:00
Ivan Grokhotkov 85e709705b Merge branch 'bugfix/btdm_task_priority' into 'master'
component/bt : modify bluetooth task priority

modify bluetooth task priority to lower than IPC task priority.

See merge request !631
2017-04-07 14:56:31 +08:00
Ivan Grokhotkov 8915c18f8a esp32: initialize cross-core interrupt in single core mode
The software interrupt originally used as the cross-core interrupt is
now also used to yield from a FreeRTOS critical section; therefore it
must be initialized for single core mode as well.

Fixes https://github.com/espressif/esp-idf/issues/496
2017-04-07 14:48:08 +08:00
Alexey Gerenkov c142b9b9e5 esp32: RWDT is used to reboot system in case of panic handler crash
also fixes TG1WDG protection bug in panic handler
2017-04-07 02:34:29 +03:00
Tian Hao ecb75b69fd component/bt : modify bluetooth task priority 2017-04-01 17:17:57 +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 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
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
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 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
XiaXiaotian a401169ea8 wpa2: add authenticate type for wpa2 enterprise 2017-03-17 17:28:01 +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 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
Liu Zhi Fu 67aabbff8f 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
2017-03-14 10:14:26 +08:00
Jeroen Domburg dc6c19f560 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
2017-03-09 20:25:07 +08:00
Jeroen Domburg 17a4a2527d MR things 2017-03-09 19:59:09 +08:00
Jiang Jiang Jian cd4e4fb351 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
2017-03-09 15:35:36 +08:00
Jeroen Domburg 3462b53fbc MR suggestions 2017-03-08 19:27:30 +08:00
Jeroen Domburg e5f54a9dbd Validate more GPIO ROM functions for non-use of static RAM 2017-03-08 19:04:28 +08:00
Jeroen Domburg 0db8b00b8a tight 28k 2017-03-08 19:04:28 +08:00
Ivan Grokhotkov 66c693eebb Merge branch 'feature/deep_sleep_wakeup_from_touch' into 'master'
add wakeup from touch sensor, and deep sleep example

- add new deep sleep wakeup mode
- change documentation to explain incompatibilities between different wakeup mode, add error checks
- add new ULP instructions necessary for ULP wakeup scenario
- fix issues with I_WR_REG, I_SLEEP, I_END instructions
- add deep sleep example, illustrating the use of timer, gpio, touch, and ULP wakeup triggers

See merge request !461
2017-03-08 14:27:58 +08:00
XiaXiaotian 624ad1bd8b wifi deinit: update esp_wifi_deinit()
1. move ets_timer_deinit() to wifi_deinit()

2. delete wifi api mutex when wifi deinit
2017-03-08 11:00:02 +08:00
Jiang Jiang Jian 8b800df720 Merge branch 'feature/btdm_cfg_stack_size' into 'master'
component/bt: optimize stack size of Bluetooth Tasks and make them be configurab…

Bluetooth tasks' stack size are optimized and can be configured by the CONFIG_NEWLIB_NANO_FORMAT option.

See merge request !559
2017-03-07 11:21:07 +08:00
wangmengyang 870389b3ba component/bt: optimize stack size of Bluetooth Tasks and make them be configurable according to the CONFIG_NEWLIB_NANO_FORMAT option 2017-03-06 23:09:42 +08:00
Ivan Grokhotkov 153472d70d Merge branch 'bugfix/soc_io_mux_h' into 'master'
esp32: update io_mux_reg.h to latest version

fixes https://github.com/espressif/esp-idf/issues/349

See merge request !546
2017-03-06 22:36:19 +08:00
Liu Zhi Fu 99102af79e esp32: update wifi lib to fix mpdu len error
Fix mpdu len error which impact espressif smartconfig
2017-03-03 18:06:05 +08:00
Angus Gratton 975be7a2c9 Merge branch 'bugfix/github_small_fixes' into 'master'
Merge small bugfix PRs from github

* https://github.com/espressif/esp-idf/pull/389
* https://github.com/espressif/esp-idf/pull/382
* https://github.com/espressif/esp-idf/pull/367
* https://github.com/espressif/esp-idf/pull/366
* https://github.com/espressif/esp-idf/pull/361
* https://github.com/espressif/esp-idf/pull/355
* https://github.com/espressif/esp-idf/pull/350
* https://github.com/espressif/esp-idf/pull/348
* https://github.com/espressif/esp-idf/pull/339
* https://github.com/espressif/esp-idf/pull/46
* https://github.com/espressif/esp-idf/pull/307



See merge request !541
2017-03-03 12:58:22 +08:00
Angus Gratton d6f183fbb9 esp_err: Use separate code path for ESP_ERROR_CHECK assertion
* Minimum code size overhead
* Makes function safe to use when flash cache is disabled

Builds on #339 https://github.com/espressif/esp-idf/pull/339
2017-03-03 15:33:23 +11:00
Angus Gratton e08cf27b8a esp_err: add NDEBUG guard, comment about flash cache
Follow-up to 316b040
2017-03-03 14:59:15 +11:00
Neil Kolban e14d65d704 Update to ESP_ERROR_CHECK
See request from ESP_Angus here:
https://esp32.com/viewtopic.php?f=18&t=1179

Merges #339 https://github.com/espressif/esp-idf/pull/339
2017-03-03 14:59:15 +11:00
Ivan Grokhotkov 7754647e71 Merge branch 'bugfix/separate_ethernet_and_wifi' into 'master'
Allow separate ethernet & wifi configuration

If only 1/2 of ethernet & WiFi are enabled in config, the other interface is no longer linked into the firmware.

* Fixes bug where enabling Ethernet but not WiFi would fail to compile.
* Also means that enabling WiFi but not Ethernet no longer links some unused ethernet interface functions.


See merge request !525
2017-03-03 11:53:32 +08:00
Ivan Grokhotkov 848494b20f Merge branch 'feature/enable_qio_directly' into 'master'
Enable SPI flash Quad I/O in bootloader

Bootloader checks flash ID, enables Quad I/O mode based on flash type.

See merge request !479
2017-03-03 11:25:52 +08:00
Ivan Grokhotkov 65b7b22c09 esp32: update io_mux_reg.h to latest version
fixes https://github.com/espressif/esp-idf/issues/349
2017-03-02 19:35:28 +08:00
Liu Zhi Fu abdd8feebb esp32: menuconfig adds some WiFi options
1. Add options to enable/disable AMPDU
2. Add options to enable/disable WIFI NVS
3. Add options to configure WiFi RX/TX buffer number
2017-03-02 18:13:49 +08:00