Ivan Grokhotkov [Wed, 22 Mar 2017 14:42:58 +0000 (22:42 +0800)]
Merge branch 'bugfix/vhci_callback' into 'release/v2.0'
component/bt: let "vhci_notify_host_send_available" be called in task context
Previously the callback function "vhci_notify_host_send_available" can be called in both interrupt context or BT controller task context, which is one of the cause that Bluedroid tasks cannot work on dual CPUs.
island [Mon, 6 Mar 2017 09:20:45 +0000 (17:20 +0800)]
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
Merge branch 'feature/add_user_set_mac' into 'master'
Feature/add user set mac
1. Add menuconfig for user to set mac address of wifi, bt and ethernet.
2. Add the number of MAC address generated from efuse for user to choose.
3. Add MAC address derive method.
Liu Zhi Fu [Wed, 1 Mar 2017 06:48:27 +0000 (14:48 +0800)]
Check DHCP rebind timer before checking dhcp release timer in cause they have the same value.
lwip: modify dhcp timer granularity from 60s to 1s
Current DHCP granularity is 60 seconds, it's not accurate, it can cause DHCP release/rebind/renew timer
timeout at the same time, also it may renew/rebind/release at wrong time, thus cause problem.
Merge branch 'bugfix/btdm_adv_scan_enable_report' into 'master'
component/bt : add adv/scan start complete event
1. indicate adv/scan start complete success or failed
2. controller do limit of adv/scan concurrence, so add some codes to report adv/scan start failed or not.
Ivan Grokhotkov [Thu, 23 Feb 2017 10:21:16 +0000 (18:21 +0800)]
Merge branch 'feature/btdm_ram_config' into 'master'
Optimize or release memory in bluetooth
1. add option to release about 30K from BT if BLE only
2. later BT/BLE will be separated by BT/BLE macro, but this option should use when user make sure that in BLE only mode.
Tian Hao [Thu, 23 Feb 2017 09:32:46 +0000 (17:32 +0800)]
component/bt : add adv/scan start complete event
1. indicate adv/scan start complete success or failed
2. controller do limit of adv/scan concurrence, so add some codes to report adv/scan start failed or not.
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