Commit graph

5507 commits

Author SHA1 Message Date
Ivan Grokhotkov b1ee25afde bootloader: account for load address when mapping cache pages
Bootloader used to calculate the number of cache pages assuming that
load address was aligned, while in reality load address for DROM and
IROM was offset by 0x20 bytes from the start of 64kB page. This
caused the bootloader to map one less page if the size of the image
was 0x4..0x1c less than a multiple of 64kB.

Reported in https://esp32.com/viewtopic.php?f=13&t=6952.
2019-01-23 17:02:02 +08:00
Ivan Grokhotkov cccaa68467 bootloader: fix IROM and DROM swapped in log messages 2019-01-23 17:02:02 +08:00
Ivan Grokhotkov 6080767379 vfs: fix unregister removing top level VFS instead of nested
Credits @neoniousTR.

Fixes https://github.com/espressif/esp-idf/pull/2770
2019-01-23 16:28:48 +08:00
Ivan Grokhotkov 42b6c4953d bootloader, esp32: add workaround for Tensilica erratum 572
If zero-overhead loop buffer is enabled, under certain rare conditions
when executing a zero-overhead loop, the CPU may attempt to execute an invalid instruction. Work around by disabling the buffer.
2019-01-23 16:23:56 +08:00
XiaXiaotian 746e831c19 esp32: fix invalid channel state information(CSI) data index
Due to a hardware limitation in ESP32, the first four bytes of some
    CSI data is invalid, not the last four bytes.

    Correct a mistake of CSI sub-carrier index in documentation.
2019-01-22 20:30:05 +08:00
Wangjialin 553ba51924 bugfix(i2c): reduce speed of I2C master bus reset routine and release SDA
closes https://github.com/espressif/esp-idf/issues/2494
closes https://github.com/espressif/esp-idf/pull/2493
closes https://github.com/espressif/esp-idf/pull/2496

1. Change bus reset to handle interrupted READ sequences.
2. Slow down I2C to 100khz during reset
3. If a SLAVE device was in a read operation when the bus was interrupted, the SLAVE device is controlling SDA.The only bit during the 9 clock cycles of a byte READ the MASTER(ESP32) is guaranteed control over, is during the ACK bit period.
If the SLAVE is sending a stream of ZERO bytes, it will only release SDA during the ACK bit period. The master(ESP32) cannot generate a STOP unless SDA is HIGH. So, this reset code synchronizes the bit stream with, Either, the ACK bit, Or a 1 bit.
2019-01-22 11:43:55 +08:00
chuck todd 929d98538e 1. Slow down I2C to 100khz During Reset
I am stealing this delay coding from @jeremyherbert #2493 pr.

2. Change Bus Reset to handle interrupted READ sequences.

The current code does not handle interrupted READ cycles.

 If a SLAVE device was in a read operation when the bus was interrupted, the SLAVE device is controlling SDA.

The only bit during the 9 clock cycles of a byte READ the MASTER(ESP32) is guaranteed control over, is during the ACK bit period.

If the SLAVE is sending a stream of ZERO bytes, it will only release SDA during the ACK bit period. The master(ESP32) cannot generate a STOP unless SDA is HIGH.

So, this reset code synchronizes the bit stream with, Either, the ACK bit, Or a 1 bit.

3. fix typo

correct `sda_id` to `sda_io` in `i2c_master_clear_bus()` @ryan-ma found it.  This typo was generated when I manually edited this patch on GitHub, I should have done a Copy/Paste operation!
2019-01-22 11:43:40 +08:00
jeremy b810b32675 reduce speed of i2c master bus reset routine and release sda 2019-01-22 11:43:28 +08:00
Tian Hao a953f73c64 Fix some bugs in phy
1. fix bug PHY/RTC functions called in ISR (update phy to v4007)
2. add UnitTest to test it
3. fix task watchdog bug when wifi change channel
4. disable/enable agc to mac deinit/init
2019-01-16 22:04:49 +08:00
jack a80bfc1dcf esp32: fix the incorrect tx complete state issue 2019-01-12 19:40:52 +08:00
Liu Zhi Fu ca54a5ce2a esp32: fix wrongly deleting hardware BA index bug
Fix the bug that hardware BA index will be wrongly removed in
WiFi mode WIFI_MODE_APSTA.
2019-01-11 21:46:28 +08:00
XiaXiaotian f0a6432717 esp32: do defragmentation only for data and management frame
Check frame type before defragmentation. Only data and management frame
    can do defragmentation.
2019-01-10 14:17:21 +08:00
Jiang Jiang Jian c18e86a826 Merge branch 'bugfix/coex_unforce_wifi_if_no_data_buffered_in_beacon_v3.2' into 'release/v3.2'
esp32: unforce wifi if receiving beacon with no data buffered in dream (backport v3.2)

See merge request idf/esp-idf!4036
2019-01-10 14:11:02 +08:00
Jiang Jiang Jian b5d53a0eff Merge branch 'bugfix/timer_delete_dispatch_race_v3.2' into 'release/v3.2'
esp_timer: do not allow deleting timers while callbacks are dispatched (backport v3.2)

See merge request idf/esp-idf!4062
2019-01-10 13:44:15 +08:00
XiaXiaotian 10afc3de77 esp32: unforce wifi if receiving beacon with no data buffered in dream
state and reduce force receiving broadcast data time

    1. If receiving beacon which indicates that there is no data buffered,
    do not force to receive WiFi data.
    2. If receiving beacon which indicates that there is broadcast data
    buffered, reduce the time to force receiving broadcast data.
2019-01-09 14:13:08 +08:00
Jiang Jiang Jian ec7909956d Merge branch 'bugfix/fix_mbox_thread_safe_issue_v3.2' into 'release/v3.2'
tcpip: fix mbox thread-safe issue  (backport v3.2)

See merge request idf/esp-idf!4005
2019-01-09 10:21:22 +08:00
Ivan Grokhotkov d9c3a08813 Merge branch 'bugfix/mdns_udp_send_protected_backport3.2' into 'release/v3.2'
mdns networking udp send protected (Backport 3.2)

See merge request idf/esp-idf!4020
2019-01-08 12:04:23 +08:00
Ivan Grokhotkov eb9a93f9b7 Merge branch 'bugfix/mdns_crash_when_query_backport3.2' into 'release/v3.2'
mdns crash when query (backport 3.2)

See merge request idf/esp-idf!3950
2019-01-08 12:03:52 +08:00
Jiang Jiang Jian 710019a47f Merge branch 'bugfix/fix_the_country_code_bug_v3.2' into 'release/v3.2'
wifi: fix the bug that STA can scan the channel out of the country regdomain range (backport v3.2)

See merge request idf/esp-idf!4068
2019-01-07 20:33:02 +08:00
zhangyanjiao b80eba8d5a wifi: fix the bug that STA can scan the channel out of the country regdomain range 2019-01-04 14:34:36 +08:00
Liu Zhi Fu efa70bc8e3 lwip: fix mbox thread-safe issue
Fix a mbox free thread-safe issue that can lead to crash in sys_arch_mbox_fetch.
2019-01-02 22:48:19 +08:00
Ivan Grokhotkov 31b7db5c38 esp_timer: do not allow deleting timers while callbacks are dispatched
timer_process_alarm function of esp_timer holds a spinlock for the
entire duration of its operation, except for the time when timer
callback function is called. It is possible that when
timer_process_alarm releases the spinlock, a higher priority task may
run and delete the timer. Then the execution will return to
timer_process_alarm, and this will either cause a crash, or undesired
execution of callback after the timer has been stopped or deleted.

To solve this problem, add a mutex which will prevent deletion of timers
while callbacks are being dispatched.
2019-01-02 20:06:06 +11:00
Mahavir Jain 62eb0f4c12 i2s: add (optional) support to clear tx descriptor in underflow case
It has been observed that, in case of underflow (data unavailability) in
I2S transmission, previously filled up tx descriptors continue to get
transmitted on line, causing noise in case of audio use case.

This change adds optional `tx_desc_auto_clear` field during I2S driver intialization
than can zero initialize tx descriptor in case of underflow situation in
interrupt handler itself.

Closes: https://github.com/espressif/esp-idf/issues/1789
(cherry picked from commit 765bf674d0)
2018-12-31 13:42:26 +05:30
Jiang Jiang Jian 155f034b1e Merge branch 'feature/freemodbus_move_rs485_mode_control_v3.2' into 'release/v3.2'
examples: freemodbus port serial slave move uart mode settings into example (backport v3.2)

See merge request idf/esp-idf!4015
2018-12-29 10:28:27 +08:00
Jiang Jiang Jian 47dea73b03 Merge branch 'doc/btdm_modem_sleep_EVED_mode_for_v3.2' into 'release/v3.2'
doc/btdm_modem_sleep_EVED_mode_for_v3.2(backport v3.2)

See merge request idf/esp-idf!4016
2018-12-29 10:27:52 +08:00
Jiang Jiang Jian 28fdf96828 Merge branch 'bugfix/ota_magic_byte_issue_v3.2' into 'release/v3.2'
Bugfix/ota magic byte issue v3.2(backport v3.2)

See merge request idf/esp-idf!4004
2018-12-29 10:24:24 +08:00
Jiang Jiang Jian 3969fe0dad Merge branch 'bugfix/lwip_add_hostname_option_in_dhcp_discover_v3.2' into 'release/v3.2'
add hostname option in dhcp discover (backport v3.2)

See merge request idf/esp-idf!3938
2018-12-29 10:07:50 +08:00
Jiang Jiang Jian c70c25afd0 Merge branch 'mesh/bugfix_v3.2' into 'release/v3.2'
mesh: when no parent is found, send probe request

See merge request idf/esp-idf!3940
2018-12-28 14:02:23 +08:00
Jiang Jiang Jian d59d9eef4f Merge branch 'bugfix/bbpll_wakeup_reset_v3.2' into 'release/v3.2'
BBPLL reset fixes (backport v3.2)

See merge request idf/esp-idf!4011
2018-12-24 18:16:47 +08:00
David Cermak 22514e12d8 mdns: fix networking running udp_sendif from lwip thread 2018-12-21 16:44:15 +01:00
David Cermak f48ffb37f2 mdns: check all mallocs for failure and add default hook to log error with free heap
solves crash about _mdns_result_txt_create when stress test
2018-12-21 16:27:58 +01:00
David Cermak 0f041ee7bb mdns: fixed static memory leak 2018-12-21 16:26:39 +01:00
David Cermak c320a3ee4c mdns: resolve memory leak when txt record received multiple times 2018-12-21 16:26:39 +01:00
David Cermak 1f35716ef4 mdns: skip sending search when finished, not properly locked timer task 2018-12-21 16:26:39 +01:00
wangmengyang 358de85eb3 component/bt: add more information and description for bluetooth modem sleep
Add remark that "EVED" mode for bluetooth modem sleep is only used for internal test
2018-12-21 19:29:47 +08:00
qiyueixa 84277e5887 mesh: when no parent is found, send probe request via broadcast
1. fix error in checking Wi-Fi commit ID.
2018-12-21 17:49:58 +08:00
Jiang Jiang Jian 52a70e0489 Merge branch 'bugfix/ext_ram_bss_align_v3.2' into 'release/v3.2'
Fix ext_ram_bss alignment crash (backport v3.2)

See merge request idf/esp-idf!4014
2018-12-21 17:31:33 +08:00
aleks 6523d912f2 examples: freemodbus port serial slave move uart mode settings into example
Update freemodbus component file esp-idf/components/freemodbus/port/portserial.c to remove UART mode settings;
Move UART mode settings into esp-idf/examples/protocols/modbus_slave/main/freemodbus.c
Move UART pin settings from Component config into example Kconfig.projbuild file
Move setup of UART port pins from freemodbus component into example file

TW#27721
Closes https://github.com/espressif/esp-idf/issues/2784#issuecomment-443600157
2018-12-21 09:54:26 +01:00
Angus Gratton aa0d2078b7 psram: Use 8-bit type for _ext_ram_bss_start/_ext_ram_bss_end
Fixes pointer arithmetic when printing size of remaining heap
2018-12-21 19:03:12 +11:00
Angus Gratton 348d6d5d3f multi_heap: Fix bug when start of heap is unaligned
Alignment was accounted for in one place only.

TW27954
2018-12-21 19:03:12 +11:00
Angus Gratton 46228db9a8 linker external bss: Align end of ext bss to word boundary
TW27954
2018-12-21 19:03:12 +11:00
Jiang Jiang Jian 2cac11f162 Merge branch 'bugfix/btdm_fix_crash_adv_scan_coex_v3.2' into 'release/v3.2'
component/bt: fix crash when adv and scan coex and optimize duplicate scan (backport v3.2)

See merge request idf/esp-idf!3994
2018-12-21 15:59:53 +08:00
Jiang Jiang Jian 64eeee4532 Merge branch 'bugfix/btdm_fix_two_bugs_about_pairing_v3.2' into 'release/v3.2'
components/bt: Fix two bugs about pairing(backport 3.2)

See merge request idf/esp-idf!3995
2018-12-21 14:26:19 +08:00
Ivan Grokhotkov c7a297195f soc/rtc: reset another BBPLL related register
Follow-up to b21ffc8a: an additional register needs to be reset.

Ref. https://github.com/espressif/esp-idf/issues/2711
2018-12-21 12:40:08 +08:00
Ivan Grokhotkov 19e96add8a soc/rtc: reset BBPLL configuration after enabling it
A workaround to reset BBPLL configuration after light sleep. Fixes the
issue that Wi-Fi can not receive packets after waking up from light
sleep.

Ref. https://github.com/espressif/esp-idf/issues/2711
2018-12-21 12:39:49 +08:00
Supreet Deshpande 04aebc464c bugfix/ota_magic_byte_issue: Fix indent and replace constant by macro
Replace 0xE9 by ESP_IMAGE_HEADER_MAGIC.
2018-12-20 12:29:25 +05:30
Supreet Deshpande 30e01847ad bugfix/ota_magic_byte_issue: Fixes OTA magic byte error
On enabling flash encryption, OTA fails with magic byte error in the second chunk
if the http data is split into two or more chunks and first chunk is less than 16.
2018-12-20 12:29:00 +05:30
zwj 3f6033d8bd fix crash when adv and scan coex and optimize duplicate scan 2018-12-19 19:53:01 +08:00
baohongde 45e59a9f56 components/bt: Fix two bugs about pairing
1. Fix Legacy Pairing failed without remote device name
2. Fix discovery no device after disabling SSP
2018-12-19 19:42:47 +08:00
wangmengyang 587e6ec93f component/bt: use a pm_lock to prevent light sleep when bluetooth is enabled due to current imcompatibility 2018-12-18 14:51:19 +08:00
Jiang Jiang Jian 6d00c7fc49 Merge branch 'bugfix/btdm_assert_ble_65536_v3.2' into 'release/v3.2'
fix bug that there's very low ratio to cause BLE assert(65536, 0) in rwble.c at line 222

See merge request idf/esp-idf!3968
2018-12-18 12:03:21 +08:00
Jiang Jiang Jian c418714ec6 Merge branch 'bugfix/btdm_fix_receive_adv_pkt_when_duplicate_scan_enabled_v3.2' into 'release/v3.2'
Component/bt: fix receive adv pkt when enable duplicate scan (backport v3.2)

See merge request idf/esp-idf!3942
2018-12-18 11:45:28 +08:00
Liu Zhi Fu cb650382ca esp32: fix WiFi stop bug in WiFi/BT coexist mode
This fix includes following changes:
1. Fix the bug that esp_restart()/esp_wifi_stop() sometimes fails in WiFi/BT coexist mode.
2. Add a timer for WiFi stop and stop WiFi forcibly once the timer expires.
2018-12-17 20:52:40 +08:00
Tian Hao e5e592e5b6 fix bug that there's very low ratio to cause BLE assert(65536, 0) in rwble.c at line 222 2018-12-17 20:50:42 +08:00
zhiweijian 28e20e90e3 Component/bt: fix receive adv pkt when enable duplicate scan 2018-12-17 15:51:28 +08:00
Jiang Jiang Jian 1c4d9f2aca Merge branch 'bugfix/btdm_modem_sleep_cowork_with_DFS_for_v3.2' into 'release/v3.2'
Bugfix/btdm modem sleep cowork with dfs for v3.2(backport v3.2)

See merge request idf/esp-idf!3962
2018-12-14 20:28:31 +08:00
Jiang Jiang Jian ded8b0102a Merge branch 'bugfix/btdm_fix_auth_mode_error_when_reconnection_in_smp_v3.2' into 'release/v3.2'
Component/bt: fix auth_mode error when reconnection in SMP (backport v3.2)

See merge request idf/esp-idf!3955
2018-12-14 18:24:01 +08:00
wangmengyang 401970495d component/bt: add DRAM_ATTR attribute to global variables(mostly in bss segment) in bt.c which can be accessed in ISR 2018-12-14 14:59:41 +08:00
wangmengyang 8de9149b11 component/bt: bugfix of bluetooth modem sleep not being able to work with Dynamic Frequency Scaling
1. start an esp_timer on entering sleep to acquire pm_lock before wake up from modem sleep
2. decrease the clock division of XTAL fed to bluetooth low power clock from 32us to 2us period to allow to work under 240MHz Max CPU frequency
3. decrease the minimum sleep duration threshold to allow shorter bluetooth modem sleep period, especially for BLE with short connection interval
4. reconfigure bluetooth baseband(BT-BB) settings after PHY/RF init upon waking up from modem sleep to avoid packet RX/TX performance degradation
2018-12-14 14:56:29 +08:00
zhiweijian 2c1e3d1ef2 Component/bt: fix save keys when auth mode without bond 2018-12-13 15:45:53 +08:00
zhiweijian bf608b6709 Component/bt: fix auth_mode error when reconnection in SMP 2018-12-13 15:33:37 +08:00
Jiang Jiang Jian 24ebdbd3f4 Merge branch 'test/add_case_to_detect_ds2ds_issue_v3.2' into 'release/v3.2'
test: add case to detect ds2ds issue (backport v3.2)

See merge request idf/esp-idf!3851
2018-12-13 14:52:58 +08:00
Jiang Jiang Jian fd00d3213b Merge branch 'bugfix/btdm_fix_accept_specified_sec_auth_v3.2' into 'release/v3.2'
Component/bt: fix accept specified sec auth error(backport v3.2)

See merge request idf/esp-idf!3836
2018-12-13 11:20:02 +08:00
Ivan Grokhotkov ade85cc850 panic: dump some instruction memory on IllegalInstruction exception 2018-12-12 11:58:55 +08:00
Xia Xiaotian 5c8d25b795 add hostname option in dhcp discover
Hostname option has been removed from dhcp discover since IDFv3.2.
But it remains in dhcp request due to which ESP32 can not get IPv4 address
from some APs. Re-add hostname option to dhcp discover to solve this issue.
2018-12-10 21:26:24 +08:00
Jiang Jiang Jian ac051f0afc Merge branch 'bugfix/btdm_assert_ble_32768_v3.2' into 'release/v3.2'
fix bug that there's very low ratio to cause BLE assert(32768, 0) in rwble.c at line 222

See merge request idf/esp-idf!3919
2018-12-10 15:04:44 +08:00
Jiang Jiang Jian bb47146710 Merge branch 'fix/spi_callback_in_iram_v3.2' into 'release/v3.2'
spi: fix the crash when callbacks are not in the IRAM (Backports v3.2)

See merge request idf/esp-idf!3884
2018-12-07 10:37:07 +08:00
Jiang Jiang Jian 4f805d558c Merge branch 'bugfix/fix_uart_read_bug_when_using_dual_core_v3.2' into 'release/v3.2'
driver(uart): fixed uart read error bug when using dual core (backport v3.2)

See merge request idf/esp-idf!3813
2018-12-07 10:35:17 +08:00
He Yin Ling 6b5649190f test: add test case to receive ds2ds packet 2018-12-07 02:04:55 +00:00
Tian Hao f44507de53 fix bug that there's very low ratio to cause BLE assert(32768, 0) in rwble.c at line 222 2018-12-06 21:35:19 +08:00
morris a338c1b712 ethernet: phy init timeout
When ethernet enable again after disable it before, phy init will report timeout.
The cause of this problem is that the enabling of emac clock is too late, and should be placed before phy init.
2018-12-05 16:32:24 +08:00
Michael (XIAO Xufeng) 44bd6f72bc spi: fix the crash when callbacks are not in the IRAM
Introduced in 9c23b8e5 and 4f87a62f. To get higher speed, menuconfig
options are added to put ISR and other functions into the IRAM.  The
interrupt flag ESP_INTR_FLAG_IRAM is also mistakenly set when the ISR is
put into the IRAM. However callbacks, which are wrote by the user, are
called in the master and slave ISR. The user may not be aware of that
these callbacks are not disabled during flash operations. Any cache miss
during flash operation will cause panic.

Essentially IRAM functions and intrrupt flag ESP_INTR_FLAG_IRAM are
different, the latter means not disabling the ISR during flash
operations.  New bus_config flag intr_flags is offered to help set the
interrupt attribute, including priority level, SHARED, IRAM (not
disabled during flash operations).  It introduced a small BREAK to
IDFv3.1 (but the same as IDFv3.0) that the user has to manually set IRAM
flag now (therefore he's aware of the IRAM thing) to void the ISR being
disabled during flash operations.
2018-12-04 21:35:20 +08:00
Tian Hao 2d67ce3109 component/bt and esp32: fix two bluetooth bugs that caused by coexist module
1. Fix interrupt watchdog timeout in bluetooth "btdm_bb_isr"
    2. Fix BLE assert(512) or assert(1536)  in rwble.c at line 222
    3. Update librtc.a to fix BLE assert(512) in rwble.c at line 222

    The #1 and #2 occurs random.
    The #3 bug occurs in certain scenario:
    	1. If Wifi start softap and BLE is working
    	2. If wifi start station, but do not use normal station operation, such
    		as just use espnow, while BLE is working
    	3. Any other scenario, that wifi works without use software coexist
    		operation, while BLE is working(such as do advertising and ...)

    4. update libcoexist.a version to v1.1.2
2018-12-03 19:30:28 +08:00
Ivan Grokhotkov 7969a566e3 Merge branch 'bugfix/fat_lock_log_v3.2' into 'release/v3.2'
fatfs: Do not log from critical sections (backport v3.2)

See merge request idf/esp-idf!3721
2018-11-29 23:00:55 +08:00
Ivan Grokhotkov be05b1e654 Merge branch 'bugfix/uart_select_buffer_v3.2' into 'release/v3.2'
VFS: select() on UART should return immediately when data is buffered (backport v3.2)

See merge request idf/esp-idf!3829
2018-11-29 23:00:17 +08:00
zhiweijian ca51b60033 Component/bt: fix accept specified sec auth error 2018-11-29 20:46:08 +08:00
Ivan Grokhotkov 9b3ff1bed0 Merge branch 'bugfix/i2c_hardware_filter_default_enable_v3.2' into 'release/v3.2'
driver(i2c): enable I2C master hardware filter by default for release/v3.2

See merge request idf/esp-idf!3815
2018-11-29 19:28:32 +08:00
Roland Dobai f859f9e25b VFS: select() on UART should return immediately when data is buffered 2018-11-29 10:08:26 +01:00
Jiang Jiang Jian f2ae151dab Merge branch 'bugfix/btdm_rf_reg_v3.2' into 'release/v3.2'
fix bug to unsupport rf reg access from hci cmd

See merge request idf/esp-idf!3786
2018-11-28 21:20:05 +08:00
kooho bae0d8a313 driver(i2c): enable I2C master hardware filter by default for release/v3.2 2018-11-28 17:02:04 +08:00
kooho cfcc0edc33 driver(uart): fixed uart read error bug when using dual core for release/v3.2. 2018-11-28 16:37:59 +08:00
Roland Dobai 5110d4b303 fatfs: Do not log from critical sections
Logging in the critical section can result in a deadlock when the logger
is redirected to FATFS.

Closes https://github.com/espressif/esp-idf/issues/1693
2018-11-26 09:21:44 +01:00
Konstantin Kondrashov 16d32c58e7 newlib: Fix UT adjtime 2018-11-26 15:55:17 +11:00
Angus Gratton 3d926da642 Merge branch 'bugfix/fix_cmake_args_issue_backport_3.2' into 'release/v3.2'
Fix cmake args issue (backport 3.2)

See merge request idf/esp-idf!3789
2018-11-26 09:53:38 +08:00
Tian Hao 9bb719dd68 fix bug to unsupport rf reg access from hci cmd
Always return 0 when read rf register and do nothing when write rf register
2018-11-24 14:21:25 +08:00
Jiang Jiang Jian 536cb0489e Merge branch 'bugfix/fix_some_wifi_bugs_1121_v3.2' into 'release/v3.2'
esp32: fix some wifi bugs (backport v3.2)

See merge request idf/esp-idf!3762
2018-11-23 17:08:31 +08:00
Renz Christian Bagaporo 98c7cb5560 cmake: remove unecessary info passed to bootloader build 2018-11-23 16:12:14 +08:00
Renz Christian Bagaporo 4baf333c79 ulp: fix passing ulp srcs due to cmake_args bug 2018-11-23 16:10:54 +08:00
Jiang Jiang Jian 79401934a1 Merge branch 'bugfix/backports_v3.2' into 'release/v3.2'
Multiple v3.2 backports

See merge request idf/esp-idf!3727
2018-11-23 13:43:24 +08:00
Jiang Jiang Jian ec1daf32e1 Merge branch 'bugfix/btdm_move_func_into_iram_v3.2' into 'release/v3.2'
components/bt: Move function in interrupt into IRAM(backport 3.2)

See merge request idf/esp-idf!3758
2018-11-23 13:39:27 +08:00
Liu Zhi Fu 1cac0d2cf2 esp32: fix some wifi bugs
Fix some Wifi bugs:
1. Enable RX BAR
2. Fix the bug that ESP32 AP negotiates with iphone to 11g
3. Fix the bug that ESP32 STA has ap_loss because CMCC AP contains two SSID
2018-11-22 20:27:52 +08:00
baohongde 8d1594c339 components/bt: Move function in interrupt into IRAM
1. Move function in interrupt into IRAM
2. Delete unused code, saving 240B DRAM and some code size
2018-11-22 16:19:21 +08:00
qiyueixa 802d94aa35 utest: increase IDF_PERFORMANCE_MAX_VFS_OPEN_WRITE_CLOSE_TIME to 50000 2018-11-22 00:39:38 +08:00
qiyueixa 3c3e375d8d mesh: bugfix
1. fix failture of mesh stop caused by block-sending.
2. fix when FIXED_ROOT is set, 2nd layer devices can not receive mesh event ESP_ERR_MESH_NO_PARENT_FOUND.
3. fix when FIXED_ROOT is set and the root turns off mesh function, 2nd layer devices do not look for new parents.
4. add APIs esp_mesh_disconnect() and esp_mesh_connect().
5. disconnect from parent/router when the DSSS channel in received beacon is different from the home channel.
6. remove nvs task to release 3k bytes memory.
2018-11-22 00:39:02 +08:00
Ivan Grokhotkov 3b3242cbae freertos: use xTaskQueueMutex to protect tick count
Having two different spinlocks is problematic due to possibly
different order in which the locks will be taken. Changing the order
would require significant restructuring of kernel code which is
undesirable.

An additional place where taking xTickCountMutex was needed was in
vApplicationSleep function. Not taking xTickCountMutex resulted in
other CPU sometimes possibly advancing tick count while light sleep
entry/exit was happening. Taking xTickCountMutex in addition to
xTaskQueueMutex has shown a problem that in different code paths,
these two spinlocks could be taken in different order, leading to
(unlikely, but possible) deadlocks.
2018-11-21 03:42:15 +00:00
Ivan Grokhotkov 96c2b34eb9 pm: prevent entering light sleep again immediately after wakeup
When light sleep is finished on one CPU, it is possible that the other
CPU will enter light sleep again very soon, before interrupts on the
first CPU get a chance to run. To avoid such situation, set a flag
for the other CPU to skip light sleep attempt.
2018-11-21 03:42:15 +00:00
Ivan Grokhotkov 6b3a8acdc3 pm: fix entering light sleep in single core mode
Tickless idle/light sleep procedure had a bug in single core mode.
Consider the flow of events:
1. Idle task runs and calls vApplicationIdleHook
2. This calls esp_vApplicationIdleHook, which calls esp_pm_impl_idle_hook, and pm lock for RTOS on the current core is released.
3. Then esp_vApplicationIdleHook calls esp_pm_impl_waiti, which checks that s_entered_light_sleep[core_id]==false and goes into waiti state.
4. Some interrupt happens, calls esp_pm_impl_isr_hook, which takes pm lock for RTOS. PM state goes back to CPU_FREQ_MAX.
5. Once the interrupt is over, vApplicationIdleHook returns, and Idle task continues to run, finally reaching the call to vApplicationSleep.
6. vApplicationSleep does not enter light sleep, because esp_pm_impl_isr_hook has already changed PM state from IDLE to CPU_FREQ_MAX.

This didn’t happen in dual core mode, because waiti state of one CPU was interrupted by CCOMPARE update interrupt from the other CPU, in which case PM lock for FreeRTOS was not taken.

Fix by inverting the meaning of the flag (for convenience) and only setting it to true when vApplicationSleep actually fails to enter light sleep.
2018-11-21 03:42:15 +00:00
Ivan Grokhotkov a10abd695b freertos: fix compilation warning in single core mode
When tickless idle is enabled
2018-11-21 03:42:15 +00:00
Ivan Grokhotkov 0f28a51996 spiffs: increase timeout in readdir test
Timeout of 15 seconds is not sufficient if SPIFFS partition needs to
be formatted, on some of the boards.
2018-11-21 03:42:15 +00:00
Ivan Grokhotkov 6681096e55 Merge branch 'bugfix/mdns_query_failed_after_init_v3.2' into 'release/v3.2'
Fixed: mdns query failed after init (Backport v3.2)

See merge request idf/esp-idf!3729
2018-11-21 11:41:34 +08:00
Jiang Jiang Jian 18b65dca26 Merge branch 'bugfix/btdm_controller_disable_v3.2' into 'release/v3.2'
Fix two bugs when disable bluetooth controller(backport v3.2)

See merge request idf/esp-idf!3716
2018-11-21 11:26:14 +08:00
Jiang Jiang Jian a398116b1c Merge branch 'bugfix/btdm_add_check_peer_addr_type_in_set_adv_params_v3.2' into 'release/v3.2'
Component/bt: add check peer addr type in set adv params (backport v3.2)

See merge request idf/esp-idf!3734
2018-11-20 20:02:37 +08:00
Tian Hao 331c7c7dc3 Fix two bugs when disable bluetooth controller
1. Fix the bug that disable controller suddenly cause crash when ble is working.
2. Fix the bug that when disable controller, it will cause wifi cannot RX, TX timeout, buffer lack and etc.
2018-11-20 09:01:57 +00:00
Jiang Jiang Jian 7bd9559e7e Merge branch 'bugfix/wifi_sta_sniffer_phy_config_bug_v3.2' into 'release/v3.2'
wifi: fix wifi sta and sniffer phy config bug (backport v3.2)

See merge request idf/esp-idf!3718
2018-11-20 14:20:29 +08:00
zhiweijian c59c40741b Component/bt: add check peer addr type in set adv params 2018-11-19 17:15:41 +08:00
morris 2885ec3831 ethernet: multi-call failure in esp_eth_init
Because of incomplete state machine, ethernet driver will broken if esp_eth_init is called twice.
Detailed information here: https://ezredmine.espressif.cn:8765/issues/27332
2018-11-19 14:55:43 +08:00
morris a7db0e2291 ethernetif: fix potential memory leak
1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.
2. free intr resource in esp_eth_deinit

Closes https://github.com/espressif/esp-idf/issues/2670
2018-11-19 14:55:43 +08:00
morris cb98f5a814 ethernet: fix some bugs in phy&mac driver
1. Original register mapping for LAN8720 has some registers that doesn't exist/support.
So just remove them, and fix the power and init function for LAN8720.
2. GPIO16 and GPIO17 is occupied by PSRAM, so only ETH_CLOCK_GPIO_IN mode is supported in that case if using PSRAM.
3. Fix bug of OTA failing with Ethernet
4. Fix bug of multicast with Ethernet
5. Fix potential memory leak
2018-11-19 14:55:43 +08:00
Jiang Jiang Jian 8725bce5bc Merge branch 'bugfix/btdm_errors_in_comment_v3.2' into 'release/v3.2'
components/bt: Some errors in comment(backport 3.2)

See merge request idf/esp-idf!3713
2018-11-19 14:36:45 +08:00
David Cermak 174b3b89e4 mdns: sending search packets also in probing and announcing state
mdns queries did not work properly when send imeadiately after set_hostname, which cuased reinit of pcb and therefore restarted probing, so search packets were blocked until probing finished
closes #2507, closes #2593
2018-11-19 04:38:04 +01:00
zhangyanjiao 8d9d8e27ca wifi: fix the bug that if station (sleep is enabled) and sniffer are enabled at the same time,
when disable sniffer, station will never enable phy and rf again.
2018-11-16 19:09:31 +08:00
baohongde b021bbdc80 components/bt: Some errors in comment 2018-11-16 15:27:28 +08:00
baohongde c9fe4fa13e components/bt: Put function in isr into iram(backport 3.2) 2018-11-16 07:19:51 +00:00
Jiang Jiang Jian e16f65f4e6 Merge branch 'bugfix/tw27096_fix_lwip_mbox_free_crash_v3.2' into 'release/v3.2'
fix the crash caused by sys_mbox_free (backport v3.2)

See merge request idf/esp-idf!3676
2018-11-15 10:31:46 +08:00
Jiang Jiang Jian fe0a5b41bf Merge branch 'bugfix/fix_memory_leak_for_v3.2' into 'release/v3.2'
Component/bt: fix memory leak in service change(backport v3.2)

See merge request idf/esp-idf!3685
2018-11-14 15:35:03 +08:00
zhiweijian 1f7c54ae85 Component/bt: fix memory leak in service change 2018-11-12 19:41:19 +08:00
Jiang Jiang Jian 049bd9fe0a Merge branch 'bugfix/mesh_start_stop_v3.2' into 'release/v3.2'
mesh: update libs (backport3.2)

See merge request idf/esp-idf!3648
2018-11-12 15:59:14 +08:00
Liu Zhi Fu 5f3b532c8d lwip: fix crash caused by sys_mbox_free
Fix lwip crashed bug caused by sys_mbox_free()
2018-11-11 12:17:36 +08:00
qiyuexia 841a6dcd9a mesh: update libs
1. fix ap_loss that occurs when the parent turns off the mesh function and becomes a normal WiFi with a different SSID.
2. add an event MESH_EVENT_NETWORK_STATE that contains information about whether there is a root in the current network.
3. modify the mechanism of mesh IE update.
4. fix a problem in the process of re-voting to select the root, the device that does not meet the conditions of being a root votes for itself.
5. fix an issue that occurs in esp_mesh_recv_toDS() when stopping the mesh.
6. when the user specifies a parent for the device, the device will set the authmode and password of its AP mode to the same value as the specified parent.
7. add two disconnected reason codes MESH_REASON_EMPTY_PASSWORD and MESH_REASON_PARENT_UNENCRYPTED.
2018-11-06 23:00:59 +08:00
Ivan Grokhotkov 761d44bd36 Merge branch 'bugfix/xts_compile_err' into 'master'
mbedtls: Fix compilation errors when CONFIG_MBEDTLS_HARDWARE_AES is disabled

See merge request idf/esp-idf!3506
2018-11-05 16:58:38 +08:00
Ivan Grokhotkov ada3bc3fb5 Merge branch 'bugfix/aes_sha_mpi_shared_regs' into 'master'
aes/sha/mpi: Bugfix a use of shared registers.

See merge request idf/esp-idf!3580
2018-11-05 16:31:03 +08:00
Ivan Grokhotkov 13046e7625 Merge branch 'bugfix/esp-tls-doc' into 'master'
esp-tls: Fix documentaion issue in esp_tls_conn_new_async API

See merge request idf/esp-idf!3545
2018-11-05 12:30:22 +08:00
Ivan Grokhotkov ee0dea3d0d Merge branch 'bugfix/esp_http_client_async_crash' into 'master'
esp_http_client: Fix crash in async mode

See merge request idf/esp-idf!3551
2018-11-05 12:30:04 +08:00
Konstantin Kondrashov 8bba348528 aes/sha/mpi: Bugfix a use of shared registers.
This commit resolves a blocking in esp_aes_block function.

Introduce:
The problem was in the fact that AES is switched off at the moment when he should give out the processed data. But because of the disabled, the operation can not be completed successfully, there is an infinite hang. The reason for this behavior is that the registers for controlling the inclusion of AES, SHA, MPI have shared registers and they were not protected from sharing.

Fix some related issue with shared using of AES SHA RSA accelerators.

Closes: https://github.com/espressif/esp-idf/issues/2295#issuecomment-432898137
2018-11-05 04:22:47 +00:00
Ivan Grokhotkov fb7ba1baa0 Merge branch 'bugfix/unit_test_adjtime' into 'master'
Resolve ""test for thread safety adjtime and gettimeofday functions" fails randomly"

Closes #37

See merge request idf/esp-idf!3613
2018-11-05 12:20:07 +08:00
He Yin Ling 242724bbe9 Merge branch 'test/fix_bug_of_scan_interval_and_windows' into 'master'
test: fix bug of scan interval and window

See merge request idf/esp-idf!3606
2018-11-05 11:00:58 +08:00
Jiang Jiang Jian 930da8fd31 Merge branch 'bugfix/iperf_bt_error_when_wifi_connect' into 'master'
components/bt: Point ACL RX buffer ptr to ACL RX buffer if ACL RX buffer ptr is null

See merge request idf/esp-idf!3536
2018-11-02 16:12:31 +08:00
Ivan Grokhotkov 7d465a5487 Merge branch 'bugfix/event_perf_test_psram' into 'master'
esp_event: lower test performance threshold for PSRAM config

Closes #34

See merge request idf/esp-idf!3603
2018-11-02 14:12:17 +08:00
Konstantin Kondrashov 84f1eb5eac newlib: Fix UT adjtime 2018-11-01 20:34:39 +08:00
baohongde f2309f1013 components/bt: Point ACL RX buffer ptr to ACL RX buffer if ACL RX buffer ptr is null
1. When WIFI task or other high priority task blocks the Bluetooth task, ACL RX buffer will use up, ACL RX buffer ptr will point to null and will never point to a valid adress. Causing errors in Bluetooth.
2. hcimsgs.h used whether flow control is on or off
2018-11-01 17:33:44 +08:00
Jiang Jiang Jian 12b2268ee5 Merge branch 'bugfix/btdm_sniff_anchor_point_calculation_error' into 'master'
bugfix/btdm_sniff_anchor_point_calculation_error

See merge request idf/esp-idf!3582
2018-11-01 15:58:00 +08:00
Jiang Jiang Jian a60a71ff07 Merge branch 'bugfix/btdm_name_buffer_allocation_size_differs' into 'master'
components/bt: Fix the different size of name buffer allocation size

See merge request idf/esp-idf!3587
2018-11-01 15:56:45 +08:00
Jiang Jiang Jian cac7b951a8 Merge branch 'bugfix/btdm_fix_get_attr_value_error' into 'master'
Component/bt: fix get attr value API error

See merge request idf/esp-idf!3583
2018-11-01 15:55:22 +08:00
Jiang Jiang Jian b601fcfde0 Merge branch 'bugfix/btdm_fix_ble_cannt_send_or_receive_packet_sometimes' into 'master'
Component/bt: fix ble cannot send or receive packet sometimes

See merge request idf/esp-idf!3585
2018-11-01 15:55:05 +08:00
Sagar Bijwe fbcc160675 mbedtls: Fix compilation errors when CONFIG_MBEDTLS_HARDWARE_AES is disabled 2018-11-01 12:08:45 +05:30
Ivan Grokhotkov d98d1ef1c2 Merge branch 'bugfix/bootloader_iram_overlap_check' into 'master'
bootloader: verify that loaded image does not overlap bootloader code

See merge request idf/esp-idf!3409
2018-11-01 13:56:43 +08:00
Ivan Grokhotkov d28c99d36c esp_event: lower test performance threshold for PSRAM config 2018-11-01 13:50:08 +08:00
Ivan Grokhotkov cd38970ef9 Merge branch 'bugfix/wl_version_update' into 'master'
Version update from V1 to V2 now done in correct way.

See merge request idf/esp-idf!3557
2018-11-01 12:50:49 +08:00
chensheng d336f1513f test: fix bug of scan interval and window 2018-11-01 11:54:52 +08:00
baohongde 373f1c121b component/bt: bugfix of error when entering sniff mode with attempt large than 0xFF 2018-10-31 16:16:49 +00:00
wangmengyang 159d4ac742 component/bt: bugfix for the error in calculation sniff anchor point which can result in supervision timeout after connection is brought into sniff mode 2018-10-31 16:16:49 +00:00
zhiweijian 1716d12547 Component/bt: fix ble cannot send or receive packet sometimes 2018-10-31 16:13:51 +00:00
Ivan Grokhotkov a4357aed91 Merge branch 'fix/spi_test_memory_layout' into 'master'
test: fix the unit test fail issue under single_core config

See merge request idf/esp-idf!3596
2018-10-31 21:37:56 +08:00
Jiang Jiang Jian dba29eeb2e Merge branch 'bugfix/btdm_change_default_CoD_of_BT_profile' into 'master'
components/bt: Set default Class of Device of BT profile

See merge request idf/esp-idf!3564
2018-10-31 20:51:15 +08:00
baohongde e19a352a2b components/bt: Fix the different size of name buffer allocation size
Close https://github.com/espressif/esp-idf/issues/2615
2018-10-31 17:39:31 +08:00
Jiang Jiang Jian 39c03558e8 Merge branch 'bugfix/btdm_add_attr_handle_for_ESP_GATTS_CONF_EVT' into 'master'
Component/bt: add attr_handle for ESP_GATTS_CONF_EVT

See merge request idf/esp-idf!3492
2018-10-31 17:20:47 +08:00
Michael (XIAO Xufeng) 4132834faa test: fix the unit test fail issue under single_core config
Introduced in 97e3542947.

The previous commit frees the IRAM part when single core, but doesn't
change the memory layout functions. The unit test mallocs IRAM memory
from the heap, accidently into the new-released region, which doesn't
match the memory layout function.

This commit update the memory layout function to fix this.
2018-10-31 17:04:32 +08:00
Angus Gratton e4369aaed4 Merge branch 'feature/mqtt_mutual_auth' into 'master'
MQTT: Added client cert ssl example per PR from GitHub

See merge request idf/esp-idf!3473
2018-10-31 07:06:58 +08:00
Jitin George 3551b84c3a esp_http_client: Fix crash in async mode
Closes https://github.com/espressif/esp-idf/issues/2624
2018-10-30 09:58:57 +00:00
Jiang Jiang Jian 97e3542947 Merge branch 'bugfix/release_some_memory_on_single_core_mode' into 'master'
release memory not used in single core mode

See merge request idf/esp-idf!2733
2018-10-30 15:53:31 +08:00