Commit graph

1724 commits

Author SHA1 Message Date
Jiang Jiang Jian c960bcb5e6 Merge branch 'bugfix/coex_lc_protect' into 'master'
component/esp32 : fix coexist lc protect cause memory corrupted

See merge request idf/esp-idf!4265
2019-02-20 02:11:37 +08:00
Tian Hao 64b7b0f94c Reduce part of IRAM consumption in wifi libnet80211.a
It might be a little effect of WIFI max TX throughput if the limitation is cache hit rate
2019-02-19 15:43:56 +08:00
Angus Gratton 5b182eefc1 Merge branch 'bugfix/spiram_linker_wildcards' into 'master'
newlib: Provide library name for ROM libc object files linked as PSRAM workarounds

See merge request idf/esp-idf!4152
2019-02-19 13:28:10 +08:00
Ivan Grokhotkov dc133f9fc4 Revert "Merge branch 'bugfix/external_rtc_start_fail' into 'master'"
This reverts merge request !2441
2019-02-19 12:39:47 +08:00
Tian Hao 2cf4c02be9 component/esp32 : fix coexist lc protect cause memory corrupted
The bug will cause memory corrupted (the largest range is from 0x3ffc0000 ~ 0x3ffc8000),
some strange error will happen, like IllegalInstruction, LoadProhibited and .etc.
2019-02-19 03:28:47 +00:00
Angus Gratton 6538acc94f Merge branch 'bugfix/wdt_compability_app_with_old_bootloader' into 'master'
esp32: Fix wdt settings in esp_restart_noos

See merge request idf/esp-idf!4098
2019-02-19 10:42:33 +08:00
Jiang Jiang Jian 2ce401c664 Merge branch 'bugfix/btdm_crash_when_inquiry_cancel' into 'master'
Bugfix/btdm crash when inquiry cancel

See merge request idf/esp-idf!4142
2019-02-16 16:27:49 +08:00
Jiang Jiang Jian 2c7f603a83 Merge branch 'bugfix/fix_some_wifi_bugs_0131' into 'master'
esp32: fix some wifi bugs

See merge request idf/esp-idf!4216
2019-02-15 12:14:41 +08:00
Konstantin Kondrashov e916cf52a3 bootloader: Add support of anti-rollback
Added:
* set a secure version in app/bootloader.
* description anti-rollback to ota part
* emulate the secure_version write and read operations
* efuse_em partition.
* a description about a rollback for native_ota_example.

Closes: TW26335
2019-02-14 18:51:43 +08:00
maojianxin 0676941332 soc/rtc: fix RTC_TOUCH_TRIG_EN or RTC_ULP_TRIG_EN should keep RTC_PERIPH power on 2019-02-13 10:30:37 +08:00
aleks 10fe158f67 coredump: improvements refactoring
Move existing core dump files into espcoredump component folder
Add KConfig, linker.lf, make and CMakeList.txt for new component
Existing functionality separated into core_dump_common, core_dump_flash, core_dump_uart
Update test_core_dump.c and make files to link it as unit test
Update according to review:
Move target and RTOS related functionality into separated file (core_dump_port.c).
2019-02-12 10:22:33 +00:00
Roland Dobai 80cb4a1a18 tools: Don't use backslashes in Kconfigs and ignore long lines to avoid errors
Closes https://github.com/espressif/esp-idf/issues/3012
2019-02-01 11:33:41 +01:00
Liu Zhi Fu de79835251 esp32: fix some WiFi bugs
Fix following WiFi bugs:
1. Fix a crash bug which is caused by WiFi static TX buffer alloc/free.
2. Fix the bug that iphone fails to connect to ESP32 AP by enabling AP BAR receiving.
3. Fix the bug that ESP32 station fails to connect some APs, such as Xiaomi hotspot etc,
   after reset.
2019-02-01 11:51:05 +08:00
qiyuexia 02d3170cce mesh: modify to malloc routing table 2019-01-31 17:46:11 +08:00
baohongde 27235e023f components/bt: Fix crash when inquiry stop 2019-01-31 11:47:41 +08:00
Jiang Jiang Jian a0416e9351 Merge branch 'bugfix/tw28445_wps_thread_safe' into 'master'
Bugfix/tw28445 wps thread safe

See merge request idf/esp-idf!4175
2019-01-30 17:50:25 +08:00
Ivan Grokhotkov 024c568c73 Merge branch 'bugfix/cmake_stack_protector' into 'master'
esp32: disable stack protector for startup code (CMake)

See merge request idf/esp-idf!4198
2019-01-30 16:28:40 +08:00
Roland Dobai 37126d3451 Correct Kconfigs according to the coding style 2019-01-29 13:37:01 +01:00
Ivan Grokhotkov 70b14bf615 esp32: disable stack protector for startup code (CMake)
Files where stack protector is initialized should not be compiled with
stack protector enabled. This was done for Make but missing for CMake.

Fixes https://github.com/espressif/esp-idf/issues/2990.
2019-01-29 17:41:00 +08:00
Liu Zhi Fu fd57c4ee67 esp32: fix WPS thread-safe
Fix WPS thread-safe bug
2019-01-29 17:30:21 +08:00
XiaXiaotian a2cec1f636 esp32: update libphy.a to fix interrupt watchdog when WiFi and BT run at
the same time and both enable modem sleep
2019-01-29 10:55:45 +08:00
Ivan Grokhotkov 44b97b7fe7 Merge branch 'bugfix/backtrace_from_interrupts' into 'master'
Make backtrace work across interrupts

See merge request idf/esp-idf!4084
2019-01-28 16:40:12 +08:00
Darian Leung 96af064209 freertos: Make backtrace work across interrupts
This commit adds the ability for backtracing to trace from the itnerrupt to the
task stack, and across nested interrupts. Test cases have also been added.
2019-01-28 14:34:26 +08:00
Jiang Jiang Jian 9896f45c79 Merge branch 'mesh/bugfix_0124' into 'master'
mesh: udpate libs

See merge request idf/esp-idf!4155
2019-01-28 14:06:00 +08:00
qiyueixa 8c675a52a7 mesh: udpate libs
1. during parent selection, when scanning a MAP without ext-assoc IE, it will be handled as it has the same router BSSID as itself.
2. for MAP, when its client leaves, always post SYSTEM_EVENT_AP_STADISCONNECTED to mesh layer regardless of whether the client has passed the encrypted authentication or not.
2019-01-24 15:15:09 +08:00
Ivan Grokhotkov 2eabed161a Merge branch 'feature/merge_multiple_github_prs' into 'master'
Multiple Github PRs

See merge request idf/esp-idf!4146
2019-01-24 15:14:47 +08:00
Jiang Jiang Jian 2dadc7d549 Merge branch 'bugfix/sha_ownership' into 'master'
hwcrypto sha: Allow SHA contexts to be shared between tasks

See merge request idf/esp-idf!4010
2019-01-24 14:07:23 +08:00
Angus Gratton 7f307423c1 newlib: Provide library name for ROM libc object files linked as PSRAM workarounds
Works around bug reported on forums where any source file ending in *lock.c or *creat.c
was being linked to IRAM.

https://esp32.com/viewtopic.php?f=13&t=8909&p=37362#p37362

Also moves all related functionality to newlib component.
2019-01-24 11:30:05 +08:00
Michael Reutman 02da4154a1 Add static qualifier to s_light_sleep_wakeup variable to prevent it from being global.
Closes https://github.com/espressif/esp-idf/pull/2793
2019-01-23 16:47:23 +05:30
Angus Gratton f141b29328 hwcrypto sha: Use spinlocks instead of semaphores for small state changes
Significant performance improvement and smaller RAM footprint.
2019-01-23 04:59:44 +00:00
Angus Gratton f3277cf2dc hwcrypto sha: Allow SHA contexts to be shared between tasks
Previously, hardware SHA engine "locks" were mutex semaphores. This meant that the task which
started a particular SHA session (in hardware) needed to finalise that session, or an invalid
FreeRTOS state was created.

Replace with binary semaphore which can be shared between tasks.

Includes a unit test, but unit test doesn't crash even without this fix
(some other unknown condition is required).
2019-01-23 04:59:44 +00:00
XiaXiaotian f3b72ef6aa 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:11:05 +08:00
Tian Hao 423fbf0006 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. disable/enable agc to mac deinit/init
2019-01-16 22:41:17 +08:00
Jiang Jiang Jian 83447cae90 Merge branch 'mesh/cs_root_conflict' into 'master'
detect and fix root conflicts when router BSSID is not set

See merge request idf/esp-idf!3869
2019-01-16 21:16:56 +08:00
Wang Jia Lin a62cbfec9a Merge branch 'bugfix/fix_psram_eid' into 'master'
bugfix(psram): fix psram size acquisition method, support esp32-pico chips

See merge request idf/esp-idf!3750
2019-01-15 17:44:51 +08:00
qiyuexia a05fdd9c10 mesh: update libs
1. detect and fix root conflicts when router BSSID is not set.
2. when root can not connect to the router due to NO_MORE_STAS(reason code:5), root will stop re-connection and perform MESH_NWK_LOOK_FOR_NETWORK.
3. wifi: fix the disconnection caused by receiving a deauth frame from non-parent node during scanning.
4. fix routing table redundant issue.
5. modify the max routes limitation from 300 to 1000.
6. wifi: fix ap does not deauth sta which has not completed the 4-way handshake.
2019-01-15 14:26:05 +08:00
Liu Zhi Fu 4b234b0805 esp32: fix the incorrect tx complete state issue 2019-01-12 09:39:59 +08:00
Liu Zhi Fu 85f018edbc 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 16:31:01 +08:00
Konstantin Kondrashov 82c5e648ad esp32: Fix wdt settings in esp_restart_noos
Fixed compatibility the new apps with the old bootloaders.

Closes: https://github.com/espressif/esp-idf/issues/2927
2019-01-10 20:22:26 +08:00
He Yin Ling 7c59207351 test: add test to check wifi conneciton between sta and softap 2019-01-10 09:51:17 +00:00
Jiang Jiang Jian 097597b978 Merge branch 'bugfix/wifi_defragmentation_only_for_data_frame' into 'master'
esp32: do defragmentation only for data and management frame

See merge request idf/esp-idf!4072
2019-01-09 15:54:05 +08:00
chenjianqiang bd8733f74f feature(psram): add psram support for esp32-pico chip
1. esp32-pico use standard spi driver to access psram
2. for esp32-pico, flash and psram share the clock
3. for esp32-pico, psram cs io can be overwrite via menuconfig
2019-01-09 10:49:07 +08:00
Ivan Grokhotkov 456efd3d57 Merge branch 'bugfix/timer_delete_dispatch_race' into 'master'
esp_timer: fix race between deleting the timer and executing the callback

See merge request idf/esp-idf!3992
2019-01-08 14:06:46 +08:00
XiaXiaotian 1a492f0715 esp32: do defragmentation only for data and management frame
Check frame type before defragmentation. Only data and management frame can do
    defragmentation.
2019-01-07 20:38:16 +08:00
zhangyanjiao 2d5e9d765f wifi: fix the bug that STA can scan the channel out of the country regdomain range 2019-01-03 17:55:06 +08:00
Ivan Grokhotkov 227f8daef3 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-03 07:14:53 +00:00
Angus Gratton 4a42827c4a esp32: esp_attr.h should include sdkconfig.h
Reported on forum https://esp32.com/viewtopic.php?f=13&t=8669#p36395
2019-01-02 17:04:53 +11:00
XiaXiaotian 36c956070b 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.
2018-12-28 17:09:45 +08:00
qiyueixa e3833999ea mesh: update libs
1. when no parent is found, send probe request via broadcast.
2. fix memory leak caused by the remove announcement being sent is not released when esp_mesh_stop() is called.
3. fix modify IE encrypt after mesh is started.
4. ignore esp_mesh_connect() if mesh automatic reconnection is enabled.
5. fix reason is cleared before vote is done.
2018-12-26 16:10:55 +08:00
Jiang Jiang Jian 1f794cfff1 Merge branch 'mesh/bugfix_v3.3' into 'master'
wifi: fix STAs can not detect disconnection from AP when encrypt transmission is used

See merge request idf/esp-idf!3907
2018-12-21 17:27:11 +08:00
Ivan Grokhotkov 75ef4b2242 Merge branch 'bugfix/ext_ram_bss_align' into 'master'
Fix crash if ext_ram_bss is unaligned length

See merge request idf/esp-idf!4000
2018-12-21 12:06:58 +08:00
Angus Gratton 78487123bf Merge branch 'feature/cut_len_for_header_struct' into 'master'
build: Add trimming PROJECT_VER and PROJECT_NAME vars

See merge request idf/esp-idf!3927
2018-12-21 07:45:22 +08:00
qiyueixa ed8c5a18cb mesh: update libs
1. fix STAs can not detect disconnection from AP when encrypt transmission is used.
2. fix can not find hidden APs.
3. for root, modify the active scan time to 120ms.
4. remove all rc when clear parent Wi-Fi configuration.
5. fix error in checking Wi-Fi commit ID.
2018-12-20 12:11:30 +08:00
Angus Gratton e1a1c7f17c 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-20 01:40:05 +00:00
Angus Gratton db243d092c linker external bss: Align end of ext bss to word boundary
TW27954
2018-12-20 01:40:05 +00:00
Jiang Jiang Jian 14d7a63459 Merge branch 'bugfix/wifi_rx_fail' into 'master'
wifi: fix wifi rx fails

See merge request idf/esp-idf!3976
2018-12-19 19:12:36 +08:00
Angus Gratton d453cce1b3 Merge branch 'bugfix/individual_custom_sections' into 'master'
linker: When using section type attributes, create unique sections

See merge request idf/esp-idf!3920
2018-12-19 15:18:26 +08:00
Angus Gratton ad200227d2 Merge branch 'feature/add_rollback_flags' into 'master'
bootloader/app_update: Add a support of an app rollback.

See merge request idf/esp-idf!3547
2018-12-19 14:28:11 +08:00
Angus Gratton 769bd4a4af linker: When using section type attributes, create unique sections
* Prevents section type conflict errors if (say) const & non-const data
  is put into the same section (ie with DRAM_ATTR)

* Allows linker --gc-sections to remove unused custom sections
2018-12-19 04:42:04 +00:00
qiyueixa 2b83460814 wifi: fix wifi rx fails
1. add MAC reset.
2. update libphy.a from 4000 to 4006.
2018-12-18 23:39:54 +08:00
Konstantin Kondrashov 51133083f6 app_update: Add EXCLUDE option
Added two options for PROJECT_NAME and PROJECT_VER variables to exclude them from the firmware image.

Closes: https://github.com/espressif/esp-idf/issues/2803
2018-12-18 15:58:47 +08:00
kooho e22c0cce45 driver(timer_group): fixed bug that init hw_timer caused cresh after system soft reset
closes https://github.com/espressif/esp-idf/issues/2756
2018-12-18 13:10:15 +08:00
Liu Zhi Fu b3380b79d1 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:33:31 +08:00
Jiang Jiang Jian 6cb37ecc57 Merge branch 'bugfix/btdm_modem_sleep_cowork_with_DFS' into 'master'
bugfix/btdm_modem_sleep_cowork_with_DFS

See merge request idf/esp-idf!3797
2018-12-14 14:03:56 +08:00
Jiang Jiang Jian d75ab3208f Merge branch 'test/add_case_to_detect_ds2ds_issue' into 'master'
test: add case to detect ds2ds issue

See merge request idf/esp-idf!3834
2018-12-13 14:49:30 +08:00
wangmengyang 59f34461d7 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-11 16:49:01 +08:00
Konstantin Kondrashov dde1fd9b94 bootloader: Add support flags for rollback app
Added
* Set actual ota_seq if both ota are init or incorrect.
* Description of rollback
* UT tests

Closes TW15459
2018-12-11 11:54:21 +08:00
Anton Maklakov 81bf07ed4d test: Fix some unused identifier warnings 2018-12-10 12:34:16 +08:00
Ivan Grokhotkov 04c511c9b5 panic: dump some instruction memory on IllegalInstruction exception 2018-12-07 16:50:00 +08:00
Konstantin Kondrashov d4cb14bc65 app_update: Fix esp_app_desc unused var for Cmake 2018-12-07 12:04:40 +08:00
Jiang Jiang Jian eb27686416 Merge branch 'bugfix/btdm_bugs_caused_by_coex' into 'master'
component/bt and esp32:  fix two bluetooth bugs that caused by coexist module

See merge request idf/esp-idf!3860
2018-12-05 14:17:14 +08:00
Tian Hao a9429ee5da 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:41:43 +08:00
Konstantin Kondrashov 3b9cb25fe1 esp32: Add firmware version to app
Added a new structure esp_app_desc_t. It has info about firmware:
version, secure_version, project_name, time/date build and IDF version.
Added the ability to add a custom structure with a description of the firmware.

The esp_app_desc_t is located in fixed place in start of ROM secotor. It is located after structures esp_image_header_t and esp_image_segment_header_t.

app_version is filed from PROJECT_VER variable (if set in custom make file) or PROJECT_PATH/version.txt or git repo (git describe).

Add API to get app_desc from partition.
2018-12-03 16:52:04 +08:00
Jiang Jiang Jian e07c5a22f2 Merge branch 'doc/RF_calibration' into 'master'
doc: add documentation for RF calibration

See merge request idf/esp-idf!3828
2018-11-30 21:50:29 +08:00
Xia Xiaotian 59761b0fcb doc: add documentation for RF calibration
Add an API to erase phy namespace of NVS
2018-11-30 16:26:56 +08:00
zhangyanjiao e621e0af8b wifi: add code for setting wifi log level and module 2018-11-30 15:24:22 +08:00
He Yin Ling 582e89eca3 test: add test case to receive ds2ds packet 2018-11-29 23:06:16 +08:00
Jiang Jiang Jian a134141320 Merge branch 'mesh/feature_channel_switch' into 'master'
mesh: add channel switch function

See merge request idf/esp-idf!3772
2018-11-28 20:11:38 +08:00
chenjianqiang a0beff99d2 bugfix(psram): fix psram size acquisition method
1. Use BIT[7:5] of EID to determine psram size
2. Add ID support for 16Mbit psram
3. Remove module reset on SPI1
4. Confirmed with the vendor that only the old 32Mbit psram need special clock timing. For other psram chips, we should use standard QPI mode.
2018-11-28 17:05:37 +08:00
qiyuexia 1692896e5e mesh: add channel switch function
1. add network channel switch function.
   - users can obtain the new channel through the event MESH_EVENT_CHANNEL_SWITCH.
   - the entire network will be moved to the same channel as the router without user intervention.
   - if no router is in the network, users can call esp_mesh_switch_channel() on the root side to
     move the entire network to their desired channel.
2. support not configuring the network channel.
3. support not configuring the router BSSID even if the router is hidden.
4. add allow_channel_switch to mesh configuration.
   - if the channel is not specified, this value will be ignored.
   - if the channel is specified and this value is set, when "fail" (mesh_attempts_t) times of parent selection
     or look for networks are reached, device will change to perform a full channel scan for networks that could join.
   - if the channel is specified and this value is set to 0, when a root is not elected, channel switch is not allowed.
     but when a root appears, the root performs a full channel scan during the process of connecting to the router,
     so even allow_channel_switch is set to 0, the root may still switch channel and eventually the entire network
    changes channel.
5. add allow_router_switch to mesh router configuration.
   - if the BSSID of router is not specified, this value will be ignored.
   - if the BSSID of router is specified and this value is set, when the router of this specified BSSID fails to be found
     after "fail" (mesh_attempts_t) times, the entire network is allowed to switch to another router with the same SSID.
6. modify the root to perform a full channel scan when esp_wifi_connect().
7. support handling beacon without DS Paramter Set.
2018-11-27 23:36:01 +08:00
Renz Christian Bagaporo 37d30c7a6e cmake: separate app from idf lib project
mbedtls: import mbedtls using unmodified cmake file
2018-11-27 13:59:24 +08:00
Ivan Grokhotkov 5aa7abb216 Merge branch 'bugfix/spiram_80m_clk_config' into 'master'
clk: fix regression in clock setting for SPIRAM with 80MHz config

See merge request idf/esp-idf!3724
2018-11-25 22:25:19 +08:00
Liu Zhi Fu f874b52f0a 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-23 05:41:41 +00:00
qiyueixa 6c3b5ae5a1 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-21 19:13:41 +08:00
Jiang Jiang Jian e7f9e3f6f6 Merge branch 'bugfix/add_connected_event_after_softap_finish_4_way' into 'master'
wifi: add connected event after softap finish 4 way

See merge request idf/esp-idf!3661
2018-11-20 20:04:12 +08:00
Ivan Grokhotkov 8027adaf81 esp32, mbedtls: check component name when enabling test flags
Otherwise flags get enabled even when building tests for other components.
2018-11-20 01:27:24 +08:00
Mahavir Jain 62efef0444 test: spiram: fix and enable test cases for default configuration 2018-11-19 22:40:14 +05:30
Ivan Grokhotkov 00a13bd8d3 Merge branch 'bugfix/init_memctl' into 'master'
bootloader, esp32: add workaround for Tensilica erratum 572

See merge request idf/esp-idf!3605
2018-11-19 18:36:47 +08:00
Ivan Grokhotkov a46b884a14 Merge branch 'feature/unit_test_example' into 'master'
Move Unity into components, add unit test example

See merge request idf/esp-idf!3562
2018-11-19 18:35:54 +08:00
Angus Gratton 8915f48208 Merge branch 'feature/linker_script_generator' into 'master'
Linker script generator

See merge request idf/esp-idf!2286
2018-11-19 12:43:27 +08:00
Ivan Grokhotkov 964f5a91f7 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.
2018-11-19 04:39:35 +00:00
Ivan Grokhotkov 6091021e83 unity: separate common and IDF specific functionality
New unity component can be used for testing other applications.
Upstream version of Unity is included as a submodule.
Utilities specific to ESP-IDF unit tests (partitions, leak checking
setup/teardown functions, etc) are kept only in unit-test-app.
Kconfig options are added to allow disabling certain Unity features.
2018-11-19 12:36:31 +08:00
Ivan Grokhotkov 5fb3d59a92 esp32: fix typos in rom/uart.h 2018-11-19 12:36:31 +08:00
Deng Xin 5b4e3da759 wifi: add connected event after softap finish 4 way
Background

Softap will send connected event after receive assoc request as before, however, STA didn't connect to softAP if need security. As our mesh design, it will send data packet after receive connected event, so change the current behavior, softAP will send connected event if have encryption
2018-11-19 11:24:42 +08:00
Jiang Jiang Jian 26bcb7f2cf Merge branch 'bugfix/wifi_sta_sniffer_phy_config_bug' into 'master'
wifi: fix wifi sta and sniffer phy config bug

See merge request idf/esp-idf!3566
2018-11-19 10:11:23 +08:00
Mahavir Jain e3956787f6 clk: fix regression in clock setting for SPIRAM with 80MHz config
Support for HSPI to output clock for 4M SPIRAM introduced regression
in clock configuration affecting SPIRAM access with 80MHz clock. This
commit fixes the issue.
2018-11-17 00:08:20 +05:30
Ivan Grokhotkov 96f152341a esp_timer: improve unit test robustness
1. call esp_timer_get_time and ref_clock_get in the same order on
   start and in the loop

2. disable interrupts when calculating delta between ref_clock
   and esp_timer

3. ensure both functions are in cache before calculating the delta
2018-11-16 12:00:39 +00:00
zhangyanjiao 8be8ea2488 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.

Closes: https://github.com/espressif/esp-idf/issues/2545
2018-11-16 11:16:37 +00:00
Renz Bagaporo 63411fc556 tools: implement linker script generation 2018-11-16 12:42:02 +08:00
Ivan Grokhotkov 7b86247428 unit-test: use TEST_GROUPS to filter tests for psram_vspi and psram_hspi 2018-11-15 12:27:05 +00:00
Alexey Gerenkov 76e02cadcc esp32: Adds support for core dump format version 2018-11-15 06:13:48 +00:00
Alexey Gerenkov 181a40ae30 esp32: Adds menuconfig option for max tasks number in core dump 2018-11-15 06:13:48 +00:00
Alexey Gerenkov 30e766ee6b esp32: Core dump API to retrieve current core data layout in flash 2018-11-15 06:13:48 +00:00
Alexey Gerenkov a55cc99f50 esp32: Replaces magic numbers with CRC for core dump in flash 2018-11-15 06:13:48 +00:00
Ivan Grokhotkov 7efb3926c5 Merge branch 'feature/build_system_multi_target' into 'master'
build system: support for multiple targets (CMake only)

See merge request idf/esp-idf!3499
2018-11-12 15:30:36 +08:00
Ivan Grokhotkov ccfa134533 build system: support for multiple targets 2018-11-11 21:46:02 +08:00
zwj baf57b9702 component/bt: add vendor hci cmd 2018-11-09 14:39:04 +08:00
Jiang Jiang Jian 05838641ff Merge branch 'bugfix/mesh_start_stop' into 'master'
mesh: update libs

See merge request idf/esp-idf!3569
2018-11-07 14:29:27 +08:00
qiyuexia 2d34a93dc4 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 22:55:48 +08:00
Ivan Grokhotkov 621e316725 Merge branch 'feat/psram_support_hspi' into 'master'
esp32: support to use hspi to output clock for 4M psram

See merge request idf/esp-idf!3377
2018-11-06 20:34:41 +08:00
Jiang Jiang Jian 17c70a4a32 Merge branch 'bugfix/wifi_do_not_load_phy_data_if_fail_to_open_nvs' into 'master'
esp32: do not try to load PHY data if fail to open NVS

See merge request idf/esp-idf!3538
2018-11-06 18:01:58 +08:00
Ivan Grokhotkov 28f1e1597b Merge branch 'bugfix/tickless_idle_single_core' into 'master'
freertos, pm: fix tickless idle not entered in single core mode

See merge request idf/esp-idf!3584
2018-11-06 12:15:03 +08:00
morris b6d7675e60 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

Closes https://github.com/espressif/esp-idf/issues/2564
Closes https://github.com/espressif/esp-idf/issues/2620
Closes https://github.com/espressif/esp-idf/issues/2657
2018-11-06 11:07:22 +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
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 0716e65955 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-05 12:18:29 +08:00
Ivan Grokhotkov 22dd3103bd 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-05 12:18:29 +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
Sagar Bijwe fbcc160675 mbedtls: Fix compilation errors when CONFIG_MBEDTLS_HARDWARE_AES is disabled 2018-11-01 12:08:45 +05:30
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
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
Deng Xin b8784a1863 wifi: bugfix of assert when do wps with mikrotik
Problem Decribe

The problem happenned when do wps with a mikrotik router
1. router always want to do connect with 32 without EAP-WSC step
2. after 4 way timeour, 32 crash

Root Cause

The reason why can not start EAP-WSC step is router's check method is RSN > WPA > WPS, when it found there include RSN and WPS in assoc, it will choice do 4 way rather than WPS
The reason of second problem is 32's EAPOL start timer didn't stop and send EAPOL start to a null pointer

Soultion
1. remove RSN and WPA ie when do WPS step
2. check mac address's pointer before send EAPOL start

closes: https://github.com/espressif/esp-idf/issues/2382
2018-10-29 13:29:41 +00:00
Michael (XIAO Xufeng) ff346f92af psram: add test for 4M psram 2018-10-29 20:26:30 +08:00
Michael (XIAO Xufeng) 20a666fe03 esp32: support to use hspi to output clock for 4MB PSRAM
Resolves https://github.com/espressif/esp-idf/issues/2128.
2018-10-29 20:22:44 +08:00
Michael (XIAO Xufeng) 9b5d0f3322 spi: shown owner of spi host explicitly 2018-10-29 20:22:44 +08:00
XiaXiaotian 901e2af793 esp32: do not try to load PHY data if fail to open NVS 2018-10-29 02:24:58 +00:00
Renz Christian Bagaporo 5a83347bec event: Implement event loop library 2018-10-26 13:14:19 +08:00
Angus Gratton cdb10ec5ad Merge branch 'bugfix/rename_http_server' into 'master'
Rename http_server component to esp_http_server

See merge request idf/esp-idf!3553
2018-10-26 12:59:38 +08:00
Angus Gratton 705d184af2 Merge branch 'bugfix/missing_header_file' into 'master'
esp32: Add missing header file in esp_task.h

See merge request idf/esp-idf!3353
2018-10-26 12:19:50 +08:00
Liu Zhi Fu 8404b2546d esp32: fix some wifi bugs
Fix following WiFi bugs:
1. Fix the bug that MIC verification fails on soft-AP mode
2. Modify mesh root to have same behavior as normal WiFi STA in state change
3. Fix the bug that sniffer can't catch control packets
4. Fix crash bug in soft-AP mode
5. Fix ACM(Admission Control Management) bug
2018-10-25 16:47:57 +08:00
Anurag Kar 2af9d7e0ed HTTP Server : Added esp_ prefix to http_server component files 2018-10-24 17:32:20 +05:30
Jiang Jiang Jian 0de637cf9e Merge branch 'bugfix/tw26711_fix_wifi_memory' into 'master'
esp32: fix wifi memory leak

See merge request idf/esp-idf!3523
2018-10-22 21:20:14 +08:00
Angus Gratton 38bd836d05 Merge branch 'feature/cmake-unit-test' into 'master'
cmake: add unit tests build support

See merge request idf/esp-idf!3003
2018-10-22 16:29:15 +08:00
Liu Zhi Fu 20217c7dfe esp32: fix wifi memory leak
Fix a WiFi memory leak bug
2018-10-21 20:37:08 +08:00
Anton Maklakov ef84773689 intr: fix a type mismatch warning 2018-10-21 15:11:45 +08:00
Renz Bagaporo cc774111bf cmake: Add support for test build 2018-10-20 12:07:24 +08:00
Ivan Grokhotkov 3e65ce3e93 Merge branch 'bugfix/unit_tests_tcpip_adapter' into 'master'
unit tests: Only initialise tcpip_adapter() when needed by the test

See merge request idf/esp-idf!3364
2018-10-19 12:33:09 +08:00
Ivan Grokhotkov c76f71cd5f Merge branch 'bugfix/move_ringbuf_lib_to_iram' into 'master'
esp_ringbuf: fix default placement from flash to IRAM

See merge request idf/esp-idf!3452
2018-10-18 22:57:46 +08:00
Ivan Grokhotkov efa43df039 Merge branch 'bugfix/fix_random_failure_with_ota_updates' into 'master'
app_update: fix intermittent failure with firmware updates

See merge request idf/esp-idf!3401
2018-10-18 22:32:33 +08:00
Mahavir Jain b3aff63db4 app_update: fix intermittent failure with firmware updates
Routine `spi_flash_cache2phys` sometimes return incorrect value,
resulting in failure in getting currently running ota partition.
This in turn aborts firmware update process.This issue was more
prominent with SPIRAM enabled cases.

Fix ensures proper cache guards during `spi_flash_cache2phys`, and
also for few other similar APIs.

In addition, `esp_ota_get_running_partition` has also been optimized
to save currently running partition for subsequent invocations.

Fixes https://github.com/espressif/esp-idf/issues/2451
2018-10-18 04:38:31 +00:00
Mahavir Jain 49130c6b34 esp_ringbuf: fix default placement from flash to IRAM
In earlier change this component was decoupled from freertos and hence
regression was introduced which changed default placement to flash. Some
device drivers make use of ringbuffer while flash cache is being disabled
and hence default placement should instead be internal memory.

Closes: https://github.com/espressif/esp-idf/issues/2517
2018-10-17 23:34:07 -05:00
Tian Hao 6934a739d7 coexist : fix coexist bugs related to coex hw blocking
1. fix some bugs by previous coex hw blocking bugfix,
   such like, rwble.c (64, 0) line 222
2. fix bug that ble scan performance is very low when software coexist
   is working.
3. update libcoexist version to v1.1.0
2018-10-18 11:49:10 +08:00
Ivan Grokhotkov 18684f53ee Merge branch 'bugfix/uart_wait_idle' into 'master'
uart: fix uart_tx_wait_idle to wait for fifo empty

See merge request idf/esp-idf!3489
2018-10-18 11:25:59 +08:00
Angus Gratton 159ff6e08e unit tests: Only initialise tcpip_adapter() when needed by the test
Prevents unexpected memory allocations when running tests which
don't require tcpip_adapter.
2018-10-17 22:53:46 +00:00
qiyueixa 71b5dcfd73 mesh: fix a bug in generating ESP-SSID IE
1. wifi: if Wi-Fi is not scanning, ignore beacons from different channels.
2018-10-17 17:52:29 +08:00
Liu Zhi Fu 1afb8001dd esp32: fix WiFi timer inaccurate bug
Fix the bug that WiFi timer is not accurate when sleep is on
2018-10-17 09:47:25 +08:00
Ivan Grokhotkov 508fb79a26 uart: fix uart_tx_wait_idle to wait for fifo empty
In some cases, when data was just written into UART FIFO, transmitter
state could be still zero while the FIFO did contain some data.
This resulted in uart_tx_wait_idle occasionally returning before all
the data was sent out.
Fix by checking both UART transmitter state and TX FIFO count.
2018-10-15 20:08:16 +08:00
Jeroen Domburg a78fd2b13c Merge branch 'feature/64mb_psram_support_base' into 'master'
Feature/64mb psram support base

See merge request idf/esp-idf!2887
2018-10-15 15:54:10 +08:00
Jeroen Domburg 81e35a142a Spiram: Add option to reserve MMU banks; add himem API to make use of those banks 2018-10-15 14:32:58 +08:00
Jiang Jiang Jian 1a743ad66d Merge branch 'bugfix/several_bugfix_about_ba_session_setup' into 'master'
esp32: several fixes/optimizations about BlockAck(BA) setup

See merge request idf/esp-idf!3374
2018-10-11 11:28:20 +08:00