Commit graph

4925 commits

Author SHA1 Message Date
Tian Hao 069f495006 component/bt : fix bug that set discovery mode will stop ble adv
As the bluedroid original implmentation of BR/EDR and BLE dual mode about discovery mode,
when set discovery mode for BR/EDR, it will stop ble advertising.

Reference to https://github.com/espressif/esp-idf/issues/2306
2018-09-04 17:07:10 +08:00
Konstantin Kondrashov 38098b713f esp32/sleep: Add a function to disable logging from ROM code 2018-09-04 16:03:18 +08:00
Jiang Jiang Jian b91cf5a33f Merge branch 'bugfix/esp_bt_mem_release' into 'master'
components/bt: Fix broken API esp_bt_mem_release() for parameter ESP_BT_MODE_BTDM

See merge request idf/esp-idf!3121
2018-09-04 14:17:10 +08:00
Angus Gratton e54f3d9616 Merge branch 'bugfix/bootloader_random_in_app' into 'master'
esp32: Allow bootloader_random.h use in app, add esp_fill_random() function

See merge request idf/esp-idf!3124
2018-09-04 10:39:12 +08:00
Angus Gratton 49656656c3 Merge branch 'bugfix/lock_up_if_supply_is_varying' into 'master'
bootloader_support: Fix enable wdt for resolve issue with varying supply

See merge request idf/esp-idf!2769
2018-09-04 00:37:52 +08:00
Roland Dobai f755a0371d Use check_python_dependencies everywhere as order-only-prerequisite 2018-09-03 11:42:10 +02:00
Angus Gratton 6976f5671c Merge branch 'bugfix/heap_dma_pool_fixes' into 'master'
heap: Fixes around DMA reserved pool

See merge request idf/esp-idf!3034
2018-09-03 15:43:01 +08:00
Angus Gratton 1a0b39a1b3 Merge branch 'bugfix/add_core_id_to_idle_task_name' into 'master'
freertos: Add core ID to idle task names

See merge request idf/esp-idf!3159
2018-09-03 14:40:37 +08:00
Konstantin Kondrashov 26ee0f5203 esp32/task_wdt: Add timestamp to message isr_twdt
Closes https://github.com/espressif/esp-idf/issues/2270
2018-09-03 14:31:22 +08:00
Konstantin Kondrashov 4fc84306a2 esp32/task_wdt: Add esp_task_wdt_isr_user_handler function
Added esp_task_wdt_isr_user_handler function to receive twdt events in
the user code.

Closes https://github.com/espressif/esp-idf/issues/2270
2018-09-03 14:31:20 +08:00
Darian Leung 977619f23c freertos: Add core ID to idle task names
This commit adds the core number to the name of each idle task.
2018-09-03 13:50:05 +08:00
Konstantin Kondrashov 9c715d7946 bootloader_support: Fix enable rtc_wdt for resolve issue with varying supply
Eliminates the issue with the lock up in the bootloader due to a power drawdown during its operation.

Closes https://github.com/espressif/esp-idf/issues/1814
2018-09-03 05:43:01 +00:00
Angus Gratton 83a179abb0 esp32: Add esp_fill_random() function
Convenience function to fill a buffer with random bytes.

Add some unit tests (only sanity checks, really.)
2018-09-03 04:39:45 +00:00
Angus Gratton 767ec27350 bootloader_support: Move bootloader_random.h to public header directory 2018-09-03 04:39:45 +00:00
Angus Gratton 5f1844a0c8 Merge branch 'bugfix/heap_poison_swap_check' into 'master'
heap: When verifying & swapping a fill pattern, stop swapping if verification fails

See merge request idf/esp-idf!2890
2018-09-03 11:19:16 +08:00
Angus Gratton 084ca82f96 Merge branch 'feature/bootloader_minor_enhancements' into 'master'
Feature/bootloader minor enhancements

See merge request idf/esp-idf!3111
2018-09-03 10:56:30 +08:00
Angus Gratton 27a1758908 Merge branch 'mesh/rewrite_docs' into 'master'
docs/rewrite_mesh_docs

See merge request idf/esp-idf!2990
2018-09-03 10:52:33 +08:00
Darian Leung f4c3917712 docs/rewrite_mesh_docs
The following commit rewrites the ESP-MESH docs. This commit includes
new diagrams and a structure approach to the mesh docs. Some mesh api references
have also been modified.
2018-09-02 21:34:21 +08:00
Darian Leung dc3fa14a26 CAN: Add pm_lock, fix gpio bug, update docs
This commit does the following

- Add power management lock to CAN driver so that APB frequency does not change
whilst CAN driver is in use
- Fix incorrect flag in can_transmit()
- Refactor can_driver_install() and can_driver_uninstall() so that critical sections
are shorter
- Fix CAN gpio configuration bug on RX pin. Closes #2302
- Add docs about multiple ID configuration and fix example links
2018-09-01 02:46:05 +08:00
Hrishikesh Dhayagude 4abe47437f components/bt: Fix broken API esp_bt_mem_release() for parameter ESP_BT_MODE_BTDM
Problem:
The new API esp_bt_mem_release() that was added freed BTDM data to heap from esp_bt_controller_mem_release().
Now with the BT memory optimization commit ee787085f9,
the BTDM data is optimized and reduced to only 32 bytes which is not sufficient amount to be added to heap.
So, using the API leads to assert saying that the region is too small.

Solution:
Modify heap_caps_add_region_with_caps to return ESP_ERR_INVALID_SIZE in case the range is too small to create a new heap.
Do not assert if return value is ESP_ERR_INVALID_SIZE

This also fixes using API esp_bt_controller_mem_release() with ESP_BT_MODE_BTDM

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
2018-08-31 14:28:23 +00:00
Jiang Jiang Jian a557e8cc14 Merge branch 'bugfix/fix_bt_hdr_files' into 'master'
components/bt: Make a pass through Bluetooth header files

See merge request idf/esp-idf!3093
2018-08-31 22:04:39 +08:00
Jiang Jiang Jian 2d0124698e Merge branch 'bugfix/btdm_update_private_address' into 'master'
component/bt: Update BLE private address after it's private address interval

See merge request idf/esp-idf!2987
2018-08-31 21:33:54 +08:00
Jiang Jiang Jian 4542bf19f7 Merge branch 'bugfix/btdm_rfcomm_test_command_cause_crash' into 'master'
component/bt: Fix bug rfcomm test command cause crash

See merge request idf/esp-idf!3080
2018-08-31 21:33:39 +08:00
Jiang Jiang Jian e3778d7bd9 Merge branch 'bugfix/btdm_find_remote_service_by_uuid_always_return_success' into 'master'
component/bt: Fix bug of SDP find services by uuid always return success

See merge request idf/esp-idf!3036
2018-08-31 21:27:21 +08:00
Jiang Jiang Jian 430eeef5a2 Merge branch 'bugfix/esp_wifi_disconnect_fail' into 'master'
update wifi lib to fix two bugs

See merge request idf/esp-idf!3125
2018-08-31 21:01:12 +08:00
Jiang Jiang Jian 76413309a5 Merge branch 'bugfix/tw23350_fix_brownout_reset' into 'master'
when brownout reset occurs, set the phy TX Power to the lowest

See merge request idf/esp-idf!2854
2018-08-31 20:37:18 +08:00
Angus Gratton 38c0626090 cmake app_update: Add "flash blank otadata" functionality to cmake 2018-08-31 12:30:14 +08:00
zhangyanjiao b952031947 fix the esp_wifi_disconnect() err when wifi is not started or inited
Closes: https://github.com/espressif/esp-idf/issues/2336
2018-08-31 10:49:52 +08:00
Jiang Jiang Jian 4cd1643006 Merge branch 'bugfix/btdm_security_vulnerability' into 'master'
fix bluetooth security vulnerability of ECDH public key checking

See merge request idf/esp-idf!3089
2018-08-31 02:02:59 +08:00
XiaXiaotian cfaf6c2729 esp32: reorder MPDU as AMPDU
Some APs transmit AMPDU and MPDU by turns. Moreover, the sequence
    numbers of AMPDU and MPDU are out of order, e.g. MPDU(1253) -
    AMPDU(1251, 1252) - MPDU(1254) - AMPDU(1255, 1256). In order to
    receive both AMPDU and MPDU in order, MPDU must be reordered with
    AMPDU.
2018-08-30 17:18:48 +00:00
Roland Dobai 5395435816 Add basic support for termios.h
Closes https://github.com/espressif/esp-idf/issues/2063
2018-08-30 14:29:20 +02:00
Angus Gratton 5fbfd20f10 Merge branch 'master' into feature/cmake 2018-08-30 18:52:31 +08:00
Angus Gratton a9c4ed7139 Merge branch 'master' into feature/cmake 2018-08-30 18:51:01 +08:00
zhangyanjiao 5425979932 when brownout reset occurs,set the phy TX Power to the lowest 2018-08-30 14:22:03 +08:00
Angus Gratton c4ed9d15f7 heap: Drop priority of DMA reserved memory pool
Ensures that non-reserved memory should be used up first, before allocating from this pool.
2018-08-30 06:18:18 +00:00
Angus Gratton 776c57e0ac heap: When adding a new heap, allocate its metadata block from internal memory only 2018-08-30 06:18:18 +00:00
Ivan Grokhotkov b7e5b28f49 sdmmc: update unit tests for ESP_eMMC_TestBoard_V1
1. New tests for SD card on slot 0. Currently frequency for 4-bit mode
has to be reduced in the test.

2. Change pin for CD/WP tests, re-enable CD tests.
2018-08-30 13:14:26 +08:00
Ivan Grokhotkov 78fab8a0f9 sdmmc: implement partial DDR support
Works for 3.3V eMMC in 4 line mode.
Not implemented:
- DDR mode for SD cards (UHS-I) also need voltage to be switched to 1.8V.
- 8-line DDR mode for eMMC to be implemented later.
2018-08-30 13:11:54 +08:00
Ivan Grokhotkov de42d99b1d sdmmc: command layer refactoring 2018-08-30 13:11:54 +08:00
Tian Hao 5a8917c337 fix bluetooth security vulnerability of ECDH publick key checking 2018-08-30 11:39:19 +08:00
sergiu2014 383464749a eMMC/MMC support for ESP32
Merges https://github.com/espressif/esp-idf/pull/1941
Previous work in https://github.com/espressif/esp-idf/pull/590
2018-08-30 11:36:28 +08:00
Ivan Grokhotkov 80e47a005d sdmmc host: minor cleanup
Code style, comments
2018-08-30 11:36:28 +08:00
He Yin Ling b01e87bbaf Merge branch 'test/bugfix_BTSTK_GATT_25007' into 'master'
test: fix bug of BTSTK_GATT_25007

See merge request idf/esp-idf!3096
2018-08-30 11:19:04 +08:00
Jiang Jiang Jian 9be09692b1 Merge branch 'bugfix/btdm_get_acl_num' into 'master'
component/bt : fix get acl number incorrect due to memory release

See merge request idf/esp-idf!3090
2018-08-30 11:12:46 +08:00
Angus Gratton ff54bfcde1 Merge branch 'bugfix/hwcrypto_mpi_ecp' into 'master'
mbedtls: Don't unnecessarily grow the result of a hardware bignum operation

See merge request idf/esp-idf!3041
2018-08-30 10:00:07 +08:00
Jiang Jiang Jian ba17648aea Merge branch 'bugfix/mesh_fix_hard_to_find_parent' into 'master'
mesh: bugfix and add two APIs

See merge request idf/esp-idf!3107
2018-08-29 23:05:32 +08:00
Angus Gratton 49a910adfb cmake: partition_table: Use PYTHON interpreter when running parttool.py (fixes flasher args on Windows) 2018-08-29 20:22:55 +08:00
Angus Gratton cb158f1194 cmake: Account for missing partition CSV file at cmake runtime
Avoid either breaking menuconfig (if cmake fails), or producing bad build output (if cmake succeeds
but no flashing offsets, etc. were generated.)
2018-08-29 20:22:55 +08:00
Angus Gratton 7f06543817 cmake/partitions: Apply offset to partition table metadata correctly
Also warn if the parttool.py has an error
2018-08-29 20:22:55 +08:00
Mahavir Jain 8227db4f5e spi_flash: fix erase_range for block erase check
Erase in block (64k) as much as possible, before falling back
to sector (4k) erase.

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-08-29 12:04:32 +00:00
Mahavir Jain 62746e414e bootloader: add API for erasing flash region
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-08-29 12:04:32 +00:00
Mahavir Jain 4a987dacca bootloader: keep bootloader_common code to retention region
It is possible to utilize some of the routines related to otadata
partition validation, after firmware image is downloaded to RAM. Hence
these routines should be part of app cpu cache, so that they do not
get overwritten by firmware.

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-08-29 12:04:32 +00:00
Angus Gratton 393c29b656 cmake: Fix bt component dependencies 2018-08-29 19:37:25 +08:00
Angus Gratton 068a3e2f6a cmake: Fix flasher argument generation 2018-08-29 19:37:19 +08:00
Angus Gratton b364f23e17 secure boot: Support secure boot signatures without hardware secure boot
Allows OTA updates to be secured via signature checks, without requiring the overhead or complexity
of a full secure boot implementation.

Uses same signing mechanisms (build system and/or espsecure.py as Secure Boot).

Requires:
* [ ] More testing
* [ ] Documentation
2018-08-29 17:05:29 +08:00
Anton Maklakov 8c040e749f bluetooth: fix format overflow warnings 2018-08-29 14:40:28 +08:00
Anton Maklakov 779bce7681 bluetooth: fix incorrect memset size 2018-08-29 14:40:28 +08:00
Anton Maklakov e8eb8cb2a4 bluetooth: fix missing braces and indentation 2018-08-29 14:40:28 +08:00
Ivan Grokhotkov ed546797d0 heap: test: don’t warn about oversized mallocs 2018-08-29 14:40:28 +08:00
Ivan Grokhotkov 033b694128 bt/a2dp: fix incorrect return type
res was declared as “bool” so expression

((count == 0) ? A2D_SET_ONE_BIT : A2D_SET_MULTL_BIT)

always evaluated to “true”, and was implicitly converted to
A2D_SET_ONE_BIT.
2018-08-29 14:40:28 +08:00
Ivan Grokhotkov 9fbe42c0f1 bt/bta: fix returning value from function returning void 2018-08-29 14:40:28 +08:00
Ivan Grokhotkov 536df958ad bt/btm: fix misplaced debug statement 2018-08-29 14:40:28 +08:00
Ivan Grokhotkov 324004f7b3 spiffs: test: check for truncation in snprintf call 2018-08-29 12:49:15 +08:00
Ivan Grokhotkov 9ba5896d86 driver, ethernet: fix non-static inline functions
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81734
2018-08-29 12:49:15 +08:00
Ivan Grokhotkov fc0c110efd driver: test: fix memset out of bounds in spi_master test 2018-08-29 12:49:15 +08:00
Ivan Grokhotkov 946a823ccb syscalls: fix type conversion for _raise_r stub 2018-08-29 12:49:15 +08:00
Alexey Gerenkov 7e5c235b9d app_trace: Fix tmo initialization 2018-08-29 10:55:39 +08:00
Angus Gratton 669c5ac538 Merge branch 'feature/add_deinit_to_emac_driver' into 'master'
ethernet: support esp_eth_deinit

See merge request idf/esp-idf!3059
2018-08-28 18:09:55 +08:00
Angus Gratton 961f59ff57 mbedtls: Don't unnecessarily grow the result of a hardware bignum operation
Avoids growing the result of hardware bignum operations
(particularly for multiplication)

Fixes bugs where some Elliptic Curve operations fail or corrupt memory,
as they assume length of the number is never greater than the number of
non-zero limbs.

Includes some general refactoring to standardize terminology.

Closes https://github.com/espressif/esp-idf/issues/1556

Fixes TW12984

Adds test cases for both these issues.
2018-08-28 09:08:43 +00:00
Tian Hao eb3f280cd3 component/bt : fix get acl number incorrect due to memory release
1. after memory release MR merged, due to the get acl number condition is not completed, it will cause get acl number value incorrect
2. It may cause set Security Mode (BR/EDR) enable failed
2018-08-28 15:35:40 +08:00
Jiang Jiang Jian 26850880b2 Merge branch 'bugfix/btdm_fix_crash_when_BLE_do_SMP_con_discon_stress_test' into 'master'
component/bt: fix crash when BLE do SMP connect and disconnect stress test

See merge request idf/esp-idf!3077
2018-08-28 13:40:20 +08:00
morris ec07112f5b ethernet: support esp_eth_deinit
1. change static emac-dma memory to dynamic
2. add esp_eth_deinit
3. modify ethernet example
4. add testcase for ethernet deinit function
5. GPIO0 could not output the 50MHz clock to PHY, so remove this configuration
2018-08-28 12:18:48 +08:00
Angus Gratton 1eaf112589 Merge branch 'bugfix/rtc_wdt_interval_overflow' into 'master'
rtc_wdt: fix overflow issue with setting wdt interval

See merge request idf/esp-idf!3110
2018-08-28 12:12:21 +08:00
chensheng d04c101c96 test: fix bug of BTSTK_GATT_25007 2018-08-28 12:00:15 +08:00
Ivan Grokhotkov cc8ad721f9 Merge branch 'bugfix/deep_sleep_stub_ptr_check' into 'master'
reset_reason: fix setting wake stub entry point to 0x80000000

See merge request idf/esp-idf!3101
2018-08-28 11:01:22 +08:00
Jiang Jiang Jian f5b699cee7 Merge branch 'bugfix/btdm_a2dp_sink_pcm_buf_size' into 'master'
bugfix/btdm_a2dp_sink_pcm_buffer_size

See merge request idf/esp-idf!3052
2018-08-28 10:42:36 +08:00
qiyuexia 91dd05662d mesh: bugfix and add two APIs
1. new APIs: esp_mesh_get_subnet_nodes_num() and esp_mesh_get_subnet_nodes_list().
2. fix hard to find the parent during connect.
3. disable Wi-Fi channel switch function.
4. fix a typo of MESH_EVENT_NO_PARENT_FOUND.
2018-08-27 19:12:40 +08:00
Ivan Grokhotkov 6dae5b206f reset_reason: fix setting wake stub entry point to 0x80000000
esp_reset_reason_init would check for reset reason hint, and
unconditionally set RTC_RESET_CAUSE_REG (which is also
RTC_ENTRY_ADDR_REG) to hint value 0, i.e. 0x80000000. However the ROM
code treats this value as valid deep sleep wake stub entry point, and
tries to jump to it.

Clear RTC_RESET_CAUSE_REG only if it contained a valid reset reason
hint, and simply set the register value to 0 when doing so. Also add
a check to esp_get_deep_sleep_wake_stub function that deep sleep wake
stub entry address must be in IRAM.

Reported in https://esp32.com/viewtopic.php?f=13&t=6919.
2018-08-27 19:01:03 +08:00
Angus Gratton 414b84c041 Merge branch 'feature/ci_fuzzer_tests_lwip' into 'master'
ci jobs running fuzz tests on dns, dhcp, dhcps + removed unnecessary references (libexpat)

See merge request idf/esp-idf!2866
2018-08-27 16:25:21 +08:00
Jiang Jiang Jian 147b349799 Merge branch 'bugfix/fix_several_wifi_bugs' into 'master'
esp32: update wifi lib to fix several WiFi bugs

See merge request idf/esp-idf!3095
2018-08-27 14:24:04 +08:00
Jiang Jiang Jian 6519f1833a Merge branch 'bugfix/fix_probable_mem_leak' into 'master'
components/bt: Fix a probable memory leak for BTA_GATTS_CONF_EVT event

See merge request idf/esp-idf!2962
2018-08-27 14:10:22 +08:00
Angus Gratton 2c8c210a66 Merge branch 'feature/py3_for_gen_esp_err_to_name' into 'master'
tools: support python3 in gen_esp_err_to_name.py

See merge request idf/esp-idf!2827
2018-08-27 12:29:03 +08:00
Jiang Jiang Jian 1c676300f0 Merge branch 'bugfix/btdm_fix_get_error_adv_sometimes' into 'master'
Component/bt: fix get error adv packet sometimes

See merge request idf/esp-idf!3035
2018-08-27 12:17:23 +08:00
zwj 430d3da089 component/bt: fix crash when BLE do SMP connect and disconnect stress test 2018-08-27 11:09:29 +08:00
wangmengyang 3faee500bb component/bt: bugfix for incorrect computation of PCM data buffer size in A2DP sink 2018-08-27 02:53:59 +00:00
Jiang Jiang Jian df78612896 Merge branch 'bugfix/btdm_fix_memory_leak_in_security_server' into 'master'
component/bt: fix memory leak in security server

See merge request idf/esp-idf!3014
2018-08-27 10:19:27 +08:00
baohongde 588e006256 component/bt: Fix bug of SDP find services by uuid always return success 2018-08-27 02:14:45 +00:00
Angus Gratton 6c95285bdb Merge branch 'bugfix/app_update_test' into 'master'
app_update: Change NUM_PIN_APP_TEST for unit test

See merge request idf/esp-idf!3050
2018-08-27 08:46:02 +08:00
Jiang Jiang Jian 51a4b4ba27 Merge branch 'bugfix/btdm_check_slave_feats_before_set_afh' into 'master'
bugfix/btdm_check_slave_feature_before_set_afh

See merge request idf/esp-idf!2972
2018-08-26 16:19:48 +08:00
Liu Zhi Fu 6a080febbc esp32: update wifi lib to fix several WiFi bugs
Fix following WiFi bugs:
1. Shouldn't scan when connect
2. Check beacon length in modem sleep
3. Fix the bug that AP may deauth wrong station when inactivity timer expires
4. Fix the bug that WiFi assert the system when receiving empty MCS in association response frame
2018-08-26 12:47:24 +08:00
Hrishikesh Dhayagude 29ec0339f6 components/bt: Fix a probable memory leak for BTA_GATTS_CONF_EVT event
Multiple modules register their callback BTA_GATTS_AppRegister().

If any of the callbacks do not free the allocated pointer in
BTA_GATTS_CONF_EVT event, then this can result in memory leak.

So, free the pointer after the callback function is called and remove
the calls to free in the callback functions as it is now not required

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
2018-08-25 16:26:37 +00:00
Hrishikesh Dhayagude 739b4aadf7 components/bt: Make a pass through Bluetooth header files
This is just a quick glance at all the header files exposed to the
users from cleanup point of view.

Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com>
2018-08-25 21:21:42 +05:30
zhiweijian f74b041288 Component/bt: fix memory leak in security server 2018-08-25 15:47:47 +00:00
Mahavir Jain f0fa66a50e rtc_wdt: fix overflow issue with setting wdt interval
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-08-24 18:06:39 +05:30
wangmengyang 6b0a1bd700 component/bt: check support of AFH in remote slave device's LM feature then determine whether to send LMP_set_AFH 2018-08-24 11:48:12 +00:00
zhiweijian 1ca5b70803 Component/bt: fix get error adv packet sometimes 2018-08-24 09:24:49 +00:00
Konstantin Kondrashov 4e28799709 app_update: Change NUM_PIN_APP_TEST for unit test
Fixed error when `make TESTS_ALL=1`
2018-08-24 16:52:27 +08:00
baohongde 9eefd8c1aa component/bt: Fix bug rfcomm test command cause crash
find when BQB
2018-08-24 14:49:33 +08:00
chensheng ef0287de7d fix bug BTSTK_GAP_14007,BTSTK_GAP_14008,BTSTK_GAP_14009 duplicate summary 2018-08-24 14:25:24 +08:00
Roland Dobai 79b9948cdf tools: support python3 in gen_esp_err_to_name.py 2018-08-24 08:13:01 +02:00