wangmengyang [Thu, 23 Feb 2017 03:59:47 +0000 (11:59 +0800)]
componentbt: work around the crashing issue after a2dp is connected to Android Phone but before audio stream starts to play
The root cause is the bug in bluetooth controller, in which the HCI_SNIFF_MODE command is sent to controller and at the same time the controller has received same request from remote device.
For now change the time-out period of local device to enter the SNIFF mode.
Jeroen Domburg [Thu, 23 Feb 2017 03:19:37 +0000 (11:19 +0800)]
Merge branch 'bugfix/app_tasks_start_on_wrong_cpu' into 'master'
Fix a scheduling bug
Fixes:
- Trivial bug where in some special cases a task could be started on the wrong core (and would run there for max 1 tick)
- More major bug causing a yield to be done with a mux held.
Ivan Grokhotkov [Wed, 22 Feb 2017 06:32:32 +0000 (14:32 +0800)]
Merge branch 'bugfix/bootloader_disable_sar_test_mux' into 'master'
Deep sleep fixes
This change fixes extra 24 uA current consumption in deep sleep mode (https://esp32.com/viewtopic.php?f=2&t=1133).
Recent update to libphy/librtc caused another problem that WiFi related parts of RTC are no longer disabled by RTC sleep functions. This means that if WiFi is not disabled by the application before entering deep sleep, extra ~200uA of current would be consumed. This is fixed, and documentation for esp_deep_sleep and SNTP example are updated to mention that applications should take care of disabling WiFi and BT before going into the deep sleep mode.
Ivan Grokhotkov [Wed, 22 Feb 2017 06:17:40 +0000 (14:17 +0800)]
Merge branch 'bugfix/flash_write_single_core' into 'master'
spi_flash: fix protection issues
This MR fixes the two spi_flash related issues:
- esp_intr_noniram_{disable,enable} not being protected by spi_flash_op_{lock,unlock} in single core mode. This caused a safety assert to be triggered in esp_intr_noniram_disable.
- spi_flash_unlock not being protected by spi_flash_guard_{start,end}. This caused a conflict between SPI0 and SPI1 controllers when accessing SPI flash, manifesting in cache data corruption and IllegalInstruction exceptions, for some flash chips.
Ivan Grokhotkov [Wed, 22 Feb 2017 04:51:16 +0000 (12:51 +0800)]
spi_flash: protect spi_flash_unlock
spi_flash_unlock was missing spi_flash_guard_start, which caused cache
to be enabled during unlock operation, causing hard-to-trace crashes
and cache data corruption.
Angus Gratton [Wed, 22 Feb 2017 02:10:34 +0000 (10:10 +0800)]
Merge branch 'bugfix/make_config_problems' into 'master'
build system: Fix several make & configuration problems
Collection of quasi-related build system fixes:
* Fix issues with "make menuconfig" running twice when no existing sdkconfig
* Fix issues with menuconfig getting into a bad state if "make -jN" and no existing sdkconfig
* Hopefully fix intermittent issue with build system sometimes not picking up all config, leading to missing BT/WiFi libs at compile/link time.
* Fix issues with path resolution on Windows (including in Eclipse)
* Add new BATCH_BUILD variable for IDEs and automated build environments.
Angus Gratton [Fri, 3 Feb 2017 05:02:22 +0000 (16:02 +1100)]
build system: Probable fix for errors due to bad config bypassing components
See github #311 https://github.com/espressif/esp-idf/issues/311
Should fix weird compiler/linker bugs where config says something is
enabled, but build system says it is disabled.
Particularly noticeable when WiFi/BT libraries fail to
compile/link despite being enabled.
Underlying cause is configuration file regenerating, but component
Makefiles not reevaluating.
Entirely removes the idea that we don't need to generate config for some
targets (like 'clean'). We need valid config for these targets,
otherwise they don't know which files to clean (etc).
Ivan Grokhotkov [Tue, 21 Feb 2017 13:57:53 +0000 (21:57 +0800)]
spi_flash: protect esp_intr_noniram_{disable,enable} in 1-core config
MR !441 (7c155ab) has fixed issue with esp_intr_noniram_{disable,enable}
calls not being properly protected by spi_flash_op_{lock,unlock}.
Unit test was added, but the unit test environment tests only dual-core
config. Similar issue was present in the code path for the single-core
config, where esp_intr_noniram_{disable,enable} calls were unprotected.
This change fixes the protection issue and updates the unit test to
run properly in single core config as well.
The issue with running unit tests for single core config will be
addressed in a separate MR.
Ivan Grokhotkov [Tue, 21 Feb 2017 09:00:43 +0000 (17:00 +0800)]
deep sleep: bring some registers into known state
In case WiFi/BT stack has been enabled but wasn’t disabled, some RTC
bits may be left enabled, causing increased current consumption.
This change returns some of the bits back to their default values.
Ivan Grokhotkov [Tue, 21 Feb 2017 04:10:49 +0000 (12:10 +0800)]
bootloader: disconnect VRTC from SAR input in bootloader_random_disable
Bootloader enables SAR ADC in test mode to get some entropy for the RNG.
The bits which control the ADC test mux were not disabled, which caused
extra ~24uA current to be drawn from VRTC, increasing deep sleep current
consumption. This change disables relevant test mode bits in
bootloader_random_disable.
Tian Hao [Fri, 17 Feb 2017 11:24:58 +0000 (19:24 +0800)]
component/bt : add bt enable/disable for power save
1. add new APIs bt controller enable/disab/deinit
2. make bt controller work need to call two APIs of esp_bt_controller_init and enable
3. modify phy init to make mac reset once
Merge branch 'bugfix/btdm_iphone10_0_2' into 'master'
Bugfix/btdm iphone10 0 2
This connection error caused by iPhone, it think that TX data length must large than 27 when slave support EXTEND_DATA_LENGTH. But this should be allow. Besides, the problem cannot be found on higher version of Iphone7, apple seemed to have fixed it.
Actually maybe other BLE device have the same problem.
Tian Hao [Thu, 16 Feb 2017 06:10:44 +0000 (14:10 +0800)]
component/bt : fix connection bug of Iphone7 10.0.2
This connection error caused by iPhone, it think that TX data length must large than 27 when slave support EXTEND_DATA_LENGTH. But this should be allow. Besides, the problem cannot be found on higher version of Iphone7, apple seemed to have fixed it.
Actually maybe other BLE device have the same problem.
Ivan Grokhotkov [Wed, 15 Feb 2017 05:26:22 +0000 (13:26 +0800)]
Merge branch 'bugfix/phy_init_write_nvs_once' into 'master'
phy_init: don’t rewrite valid calibration data
In the default PHY init routine, calibration data is loaded from NVS.
Most of the time the incremental changes to calibration will be fairly
small, so we don’t need to rewrite the existing calibration data stored
in the NVS.
Possible enhancement to be done in the future: expose a function in PHY
library to tell how big was the change in calibration data. If the
change was significant, then calibration data stored in NVS should be
updated.
Ivan Grokhotkov [Wed, 15 Feb 2017 05:25:51 +0000 (13:25 +0800)]
Merge branch 'bugfix/fix_protection_of_queue_list' into 'master'
freertos: fix protection issue in freertos queue event list
When functions in queue.c calls listLIST_IS_EMPTY() to check queue event list, the queue list is
protected by queue mutex, on the other hand, when xTaskIncrementTick() modify the queue list, the
queue list is protected by xTaskQueueMutex, this may cause xTaskRemoveFromEventList operate on
the empty queue list and cause problem.
This change works around the problem by reducing the window where the race condition can happen.
Merge branch 'bugfix/update_wifi_lib_to_include_some_fix_and_optimization' into 'master'
esp32: update wifi lib for some fixes and optimizations
1. Reduce the default static rx buffer size from 25 to 10
2. Adjust ampdu interrupt size to 3, namely, raise 1 interrupt per 3-mpdu
3. Make a copy for all received packets, including AMSDU/AMPDU/MPDU
4. Fix softap mis-forward issue
5. Fix pp q full issue
6. Fix sniffer copy wrong content issue
Liu Zhi Fu [Tue, 24 Jan 2017 12:40:14 +0000 (20:40 +0800)]
freertos: fix protection issue in freertos queue event list
When functions in queue.c calls listLIST_IS_EMPTY() to check queue event list, the queue list is
protected by queue mutex, on the other hand, when xTaskIncrementTick() modify the queue list, the
queue list is protected by xTaskQueueMutex, this may cause xTaskRemoveFromEventList operate on
the empty queue list and cause problem. This commit is to fix this bug.
Liu Zhi Fu [Fri, 10 Feb 2017 02:28:03 +0000 (10:28 +0800)]
esp32: update wifi lib for some fixes and optimizations
1. Reduce the default static rx buffer size from 25 to 10
2. Adjust ampdu interrupt size to 3, namely, raise 1 interrupt per 3-mpdu
3. Make a copy for all received packets, including AMSDU/AMPDU/MPDU
4. Fix softap mis-forward issue
5. Fix pp q full issue
6. Fix sniffer copy wrong content issue
Jeroen Domburg [Wed, 8 Feb 2017 04:19:34 +0000 (12:19 +0800)]
Merge branch 'bugfix/yield_other_core_prio_check_fix' into 'master'
Fix interrupting task on other CPU that has lower prio than current task on current CPU
Fix for a very subtle bug introduced somewhere in december. This bug would cause a cross-core interrupt to only be sent if the activated task has a higher priority than the task currently running on *this* cpu, instead of on the other CPU.
Ivan Grokhotkov [Tue, 7 Feb 2017 07:14:45 +0000 (15:14 +0800)]
phy_init: don’t rewrite valid calibration data
In the default PHY init routine, calibration data is loaded from NVS.
Most of the time the incremental changes to calibration will be fairly
small, so we don’t need to rewrite the existing calibration data stored
in the NVS.
Possible enhancement to be done in the future: expose a function in PHY
library to tell how big was the change in calibration data. If the
change was significant, then calibration data stored in NVS should be
updated.
He Yin Ling [Thu, 2 Feb 2017 13:59:00 +0000 (21:59 +0800)]
CI: get test env config from gitlab
Previous design was put test env config on local runners. It's not easy
to manage as test runners count growing. Now we'll put config files for
test runners to a Gitlab repository. Test runners will get its config
from Gitlab every time before running.