Commit graph

1524 commits

Author SHA1 Message Date
wangmengyang a25cb988bb component/bt: transport btif_profile_queue.c/h to btc_profile_queue.c/h 2017-02-28 17:06:11 +08:00
wangmengyang acab9e7ae4 fix btc_dm.c/h and replace the functions which are originally in btif_core.c and btif_dm.c 2017-02-28 15:43:02 +08:00
wangmengyang 8f65322a84 component/bt: modify the enable/disable function 2017-02-28 11:47:04 +08:00
wangmengyang 667ac172df component/bt: modify the init/deinit function 2017-02-24 20:39:41 +08:00
wangmengyang c7dac035ae component/bt: add module btc_gap_bt and port function esp_bt_gap_set_scan_mode 2017-02-24 17:28:33 +08:00
wangmengyang 41070f6768 Merge branch 'master' into feature/btdm_avrc
1. merge master into feature/btdm_avrc
2. add call of esp_bt_controller_enable() in app_main
2017-02-23 15:10:25 +08:00
wangmengyang 118131109e component/bt: modification to a2dp API to support reconnection
1. add API esp_a2d_sink_connect() to initiate connection to other devices;
2. modify lower layers to transfer the disconnection reason upwards
2017-02-23 14:30:08 +08:00
wangmengyang 80cdfc9e0a 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.
2017-02-23 11:59:47 +08:00
wangmengyang 1d98c9849e component/bt: remove the A2DP decoding timer and instead trigger decoding directly upon data arrival 2017-02-23 11:56:38 +08:00
Jeroen Domburg 7dfb1c2e97 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.

See merge request !523
2017-02-23 11:19:37 +08:00
Jeroen Domburg c057f067c7 Merge branch 'bugfix/spi_master_length' into 'master'
Fix SPI master transmit length

Tx/Rx length fix from https://github.com/espressif/esp-idf/pull/336

I also added an extra commit in to make use of a define instead of a literal, plus fix a (harmless) off-by-one condition.

See merge request !521
2017-02-22 17:11:00 +08:00
Jeroen Domburg ce7d0a7015 Fixed a small bug where a task could initially be scheduled on a wrong CPU, and a much bigger bug where a yield was performed with a held mux. 2017-02-22 17:04:51 +08:00
Ivan Grokhotkov d772e1489b 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.

See merge request !516
2017-02-22 14:32:32 +08:00
Ivan Grokhotkov dca0377e19 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.


See merge request !522
2017-02-22 14:17:40 +08:00
Ivan Grokhotkov cbb71baca9 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.
2017-02-22 12:51:16 +08:00
Angus Gratton c3544dc090 Build system: Fix error if librtc submodule not available to bootloader
Closes #220 https://github.com/espressif/esp-idf/issues/220
2017-02-22 11:59:37 +11:00
Angus Gratton de28d3a655 Merge branch 'feature/partition_table_envvars' into 'master'
partition tables: Expand environment variables in gen_esp32part

Allows parametrizing partition table with (exported) make variables.

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

See merge request !505
2017-02-22 07:22:04 +08:00
Ivan Grokhotkov e76c187efb 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.
2017-02-21 21:57:53 +08:00
Jeroen Domburg e35ebbf813 Use THRESH_DMA_TRANS define everywhere, make code match "smaller or equal" description 2017-02-21 18:27:56 +08:00
Lourens Naudé 04f7d96623 Fix SPI read edges in spi_intr
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-02-21 18:26:03 +08:00
Ivan Grokhotkov 26dec992eb deep sleep: add note about disabling WiFi and BT
This change adds a note to esp_deep_sleep that applications should disable WiFi and BT before going into deep sleep.
SNTP example is also updated.
2017-02-21 17:07:16 +08:00
Ivan Grokhotkov d3fde5188e 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.
2017-02-21 17:07:15 +08:00
Ivan Grokhotkov 3b583c150f 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.
2017-02-21 17:07:15 +08:00
XiaXiaotian a51f378ecc bugfix: it causes exception that wifi interrupt happens when read/write flash, if pp_post() is on icache. 2017-02-21 14:25:34 +08:00
XiaXiaotian 678ec0bd04 Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into feature/disable_phy_rf_when_disable_wifi_bt 2017-02-21 01:20:48 +08:00
Tian Hao 12a7293b31 component/bt : add bluetooth status check
1. add bluetooth controller/host initialize status check
2. separate bluetooth controller task schedule loop from controller init
2017-02-21 01:05:37 +08:00
XiaXiaotian bb0298bc71 coexist: enable coexist when wifi&bt are enabled, disable coexist when one of wifi&bt is disabled. 2017-02-20 23:53:25 +08:00
Ivan Grokhotkov 7eaf1c76dc Merge branch 'bugfix/vfat_open_append' into 'master'
Fix fopen() in “a” (append) mode

fopen() does not work when file is opened in “a” (append) mode

* Merges github PR #302 https://github.com/espressif/esp-idf/pull/302
* Closes #328 https://github.com/espressif/esp-idf/issues/328

See merge request !503
2017-02-20 13:32:32 +08:00
XiaXiaotian 770c2ade05 phy init: modify some comments 2017-02-20 10:44:40 +08:00
Angus Gratton 4db4e28b6e uart driver docs: Remove references to setting interrupt number
Closes #185 https://github.com/espressif/esp-idf/issues/185
2017-02-20 10:39:29 +11:00
Angus Gratton bfdfcbfaef docs: Add missing peripheral driver docs (ADC, DAC, RTC I/O, I2S) 2017-02-20 10:39:29 +11:00
Angus Gratton 21964a42fb rtc_gpio: Replace RTC_GPIO_IS_VALID_GPIO macro with inline function 2017-02-20 10:39:29 +11:00
Tian Hao 4bd5b0c91a 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
2017-02-17 19:24:58 +08:00
XiaXiaotian 8f3d1d3184 fix compile error that if enable CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION compile fail 2017-02-17 15:29:11 +08:00
Tian Hao ad890aa5ea component/bt : wide range work temperature for bluetooth RF
1. add PLL track for bluetooth RF for wide range temperature
2. move some initialized codes to cache
2017-02-17 12:26:28 +08:00
XiaXiaotian cd13c9e95d disable phy and rf
1. add a macro in menuconfig for users to choose whether store phy calibration data into NVS or not.

2. rename some disable phy and rf APIs so that existing code which calls old APIS will fail to compile.
2017-02-17 10:24:55 +08:00
XiaXiaotian eb14284c92 disable PHY and RF when stop WiFi and disable BT
1. Add disable PHY and RF when WiFi and BT are both disabled(including call sniffer disable API).

2. Do not init PHY and RF when cpu start. Init PHY and RF when call Wifi or BT start APIs(including sniffer enable API).

3. Add a temporary lib: librtc_clk.a and will delete it when CPU frequency switching function is done.

4. Add an function to get OS tick rate.

5. Do not put the whole pp.a in iram0, only put lmac.o, ieee80211_misc.o, ets_time.o and wdev.o in iram0.
2017-02-17 10:24:54 +08:00
Jiang Jiang Jian 61c7bd3c3a Merge branch 'bugfix/btdm_gatt' into 'master'
component/bt : fix gatt write memory leak

fix bug of GATT write cause memory leak 

See merge request !506
2017-02-16 15:13:05 +08:00
Jiang Jiang Jian 6c139c8ffb Merge branch 'feature/ethernet_phy_power' into 'master'
ethernet: add a gpio to enable/disable phy power

ethernet board v2 use gpio 17 .

See merge request !495
2017-02-16 15:12:09 +08:00
Tian Hao 6648ff427c 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.
2017-02-16 14:15:46 +08:00
Tian Hao 5023e30a33 component/bt : fix gatt write memory leak 2017-02-15 20:08:39 +08:00
Angus Gratton 9cea5ea075 fatfs: Add unit test for overwrite/append fix 2017-02-15 18:04:28 +11:00
Ivan Grokhotkov 413f05ce09 Merge branch 'docs/flash_encryption_disable' into 'master'
Docs: Document flash encryption disable steps, clean up flash encryption & secure boot docs

Generate clean up of flash encryption & secure boot docs

Including steps for disabling flash encryption (for people who accidentally enable it).

See merge request !500
2017-02-15 13:31:08 +08:00
Ivan Grokhotkov dd5401749d 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.

See merge request !487
2017-02-15 13:26:22 +08:00
Ivan Grokhotkov 01c4a980ee 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.

See merge request !465
2017-02-15 13:25:51 +08:00
Ivan Grokhotkov 25f05bef71 Merge branch 'bugfix/OTA_and_flash_encryption_incompatible' into 'master'
bootloader_support: fix bug OTA & flash encryption incompatible

github issue:https://github.com/espressif/esp-idf/issues/253

See merge request !464
2017-02-15 13:24:10 +08:00
Angus Gratton 24cfe78962 partition table: Fix comment at top of gen_esp32part.py 2017-02-15 10:28:45 +11:00
Angus Gratton 7c7edab328 flash encryption/secure boot: Restructure documentation
Also add steps to disable flash encryption, as some people seem to
accidentally enable it.

Explicitly mark the flash encryption and secure boot as "READ DOCS
FIRST" in menuconfig.
2017-02-15 09:42:46 +11:00
Deomid Ryabkov 22c3877183 Expand environment variables in gen_esp32part
Allows parametrizing partition table with (exported) make variables.
2017-02-14 13:53:17 +08:00
nineisk 57af0d70d3 Fix fopen() in “a” (append) mode
fopen() does not work when file is opened in “a” (append) mode
2017-02-14 16:15:08 +11:00