Commit graph

1423 commits

Author SHA1 Message Date
Xia Xiaotian 7f8811ea14 add Channel State Information(CSI) support 2018-05-20 19:25:25 +08:00
qiyueixa bb9e73c864 mesh: update libs
1. use pbkdf2_sha1() to encrypted mesh ie key.
2. fix esp_mesh_waive_root().
3. fix esp_mesh_stop().
4. fix xon issues.
2018-05-20 15:28:38 +08:00
Jiang Jiang Jian 1f7b41e206 Merge branch 'feature/add_event_SYSTEM_EVENT_AP_STAIPASSIGNED' into 'master'
add event SYSTEM_EVENT_AP_STAIPASSIGNED

See merge request idf/esp-idf!2202
2018-05-19 17:04:24 +08:00
wangmengyang 22e21b38f7 component/bt: implement bluetooth modem sleep mode, one mode for BLE only and another for dual mode bluetooth
1. provide options for bluetooth low power mode
2. provide two options for bluetooth low power clock: main XTAL and external 32kHz XTAL
3. provide function and callbacks to control bluetooth low power mode, including enable/disable sleep, software wakeup request, low power clock settings, check power state, etc
4. modify vhci API vhci_host_send_packet to use blocking mode
5. note that DFS and bluetooth modem sleep can not be used together currently.
2018-05-19 15:37:26 +08:00
zhangyanjiao 3f031cdd9d add event SYSTEM_EVENT_AP_STAIPASSIGNED 2018-05-19 13:14:12 +08:00
Alexey Gerenkov c1b6a37bb1 esp32: Adds GCOV debug stubs support
Adds the following functionality
 - Debug stubs infrastructure
 - Stub for retrieveing GCOV data without user source code modification
2018-05-18 16:16:03 +03:00
kooho ef39c09bc1 driver: reset communication peripherals when the cpu starts. 2018-05-18 14:41:58 +08:00
Deng Xin 8b389419ab (wifi): Add more information about wifi config
1. Update libphy.a to v3900
2. Update librtc.a to v238
3. add scan_method, sort_method and threshold when invoke esp_wifi_get_config()
4. add rssi of each STA in softAP list
5. add country information in scan result
6. add noise floor in rx pkt

Closes https://github.com/espressif/esp-idf/issues/1095
Closes https://github.com/espressif/esp-idf/issues/1723
Closes https://github.com/espressif/esp-idf/issues/1483
2018-05-18 11:55:55 +08:00
Ivan Grokhotkov 028fbb58e8 freertos,esp32: automatic light sleep support 2018-05-18 03:14:46 +00:00
Liu Zhi Fu 4e9ea81208 esp32: support to create wifi task on any core
Support to create WiFi task on any core.
Closes https://github.com/espressif/esp-idf/issues/968
2018-05-17 22:04:08 +08:00
Deng Xin 54d9a392e4 wifi: add set factory information feature by customer in wps 2018-05-17 16:45:53 +08:00
Alex Lisitsyn 44b1bc0ab9 esp32: Add .noinit and .rtc_noinit sections to the linker script
Added .rtc_noinit and .noinit section definitions into linker file /esp32/ld/esp32.common.ld.
The macro __NOINIT_ATTR, RTC_NOINIT_ATTR declared in esp32/esp_attr.h file.
Added unit test file to test added behavior for noinit variables and its attributes.
Added documentation changes for new added attributes.
Make some corrections after code review:
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
The linker file has been corrected to place noinit section before bss_start to make it safer.
Documentation file has been modified to clarify reset behavior of allocated data .
Corrected typos in test_noinit.c and removed assertion of noinit variable to avoid possible issues with ROM boot loader memory allocation.
Update test_noinit.c file to address RTCWDT_RTC_RESET reset reason instead of POWERON_RESET.
Test optimized to pass automated unit testing.
esp32: Add .noinit and .rtc_noinit sections to the linker script
Update of general-notes.rst documentation to fomat examples as code and attributes as identifiers.
Test test_noinit.c corrected to pass automated testing (support ofTEST_CASE_MULTIPLE_STAGES())

https://ezredmine.espressif.cn:8765/issues/15878
2018-05-16 17:33:37 +05:00
XiaXiaotian 40efc36849 Fix a few WiFi bugs
1. remove rc when ap not found

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

2. allocate mimo packet to internal memory

3. use FRC2 timer instead of WDEV_NOW() for modem sleep to calculate
   TBTT time.

   It fixes the bug that TBTT will be incorrect if beacon is lost.
2018-05-16 18:50:28 +08:00
Jiang Jiang Jian c54a679a41 Merge branch 'bugfix/fix_interrupt_list_insert_issue' into 'master'
esp32: fix interrupt list insert issue

See merge request idf/esp-idf!2391
2018-05-16 18:18:58 +08:00
Liu Zhi Fu 846b848bfc esp32/docs: fully support esp_wifi_80211_tx
Closes https://github.com/espressif/esp-idf/issues/1256
Closes https://github.com/espressif/esp-idf/issues/1332
2018-05-16 13:37:54 +08:00
Angus Gratton d1066e9d7f Merge branch 'feature/dport_access' into 'master'
soc: Dport access with pre-read register APB

See merge request idf/esp-idf!2257
2018-05-15 15:32:28 +08:00
Angus Gratton 662fe55996 Merge branch 'bugfix/select_rtc_slow_clk' into 'master'
esp32/clk: Fix starting rtc oscillator if it bad

See merge request idf/esp-idf!2215
2018-05-15 12:57:22 +08:00
Konstantin Kondrashov 9ad0760b9d esp32/clk:Fix starting rtc oscillator if it is bad
If the RTC crystal is bad or has no matched capacitance, then you do not need to start such the crystal. It is necessary to determine this case, output an error (about impossibility to start from the oscillator) and start from the internal RC of the chain.

Reduced the default value of the number of bootstrap cycles. Because we can oscillating the oscillator which then stops. (in Kconfig). Changed from 100 to 5.

The number of calibration cycles has been increased. It is the main criterion for estimating the launch of an oscillator. A large increase leads to an increase in the load time, as well as the stability of recognition of this case. (in Kconfig).
Changed from 1024 to 3000.
2018-05-15 08:59:15 +05:00
Jiang Jiang Jian 97a228e6ab Merge branch 'bugfix/rename_clk_rst_bits_for_spi' into 'master'
rename clock enable and reset bits for SPI modules

See merge request idf/esp-idf!2293
2018-05-15 09:49:56 +08:00
Konstantin Kondrashov 8f80cc733d soc: Change DPORT access
When two CPUs read the area of the DPORT and the area of the APB, the result is corrupted for the CPU that read the APB area.
And another CPU has valid data.

The method of eliminating this error.
Before reading the registers of the DPORT, make a preliminary reading of the APB register.
In this case, the joint access of the two CPUs to the registers of the APB and the DPORT is successful.
2018-05-14 17:54:57 +05:00
jack c384fa2492 rename clock enable and reset bits for SPI modules
1.The names of clock enable and reset bits do not match with TRM, just rename them.
2018-05-14 16:45:03 +08:00
XiaXiaotian 57297cf7b7 add sniffer control packet support 2018-05-14 14:16:03 +08:00
Liu Zhi Fu 1c81e4be60 esp32: fix interrupt list insert issue
If the allocated interrupt list is not empty and the new item will be inserted
as the header of the list, insert_vector_desc() causes crash because pre is
null. This commit fix this issue.
2018-05-14 14:13:08 +08:00
He Yin Ling adc3315677 Merge branch 'test/add_unit_test_jobs' into 'master'
ci: increase number of unit test jobs, temporarily disable light sleep test for short durations

See merge request idf/esp-idf!2386
2018-05-14 14:06:05 +08:00
Angus Gratton 6817088ce4 Merge branch 'feature/mbedtls_2_9_0' into 'master'
Re-add mbedTLS as a submodule, update to 2.9.0

See merge request idf/esp-idf!2367
2018-05-14 09:15:44 +08:00
Ivan Grokhotkov 1b7ed6455b esp32/test: temporarily disable test for light sleep duration
Until the issue in CI is debugged
2018-05-11 18:15:58 +08:00
Jiang Jiang Jian a5f36ec2d5 Merge branch 'feature/wifi_refactor_smartconfig' into 'master'
refactor smartconfig

See merge request idf/esp-idf!2205
2018-05-11 16:23:22 +08:00
Ivan Grokhotkov 827772df69 Merge branch 'bugfix/light_sleep_wdt_fix' into 'master'
Fix occasional WDT reset in light sleep test

See merge request idf/esp-idf!2374
2018-05-11 14:55:51 +08:00
XiaXiaotian 0033c3ef3a refactor smartconfig
move wifi part to wifi lib and lwip part to idf
2018-05-11 14:49:35 +08:00
zhangyanjiao be76260d81 wifi: fix some potential thread safe issue
change some API function to throw event:

esp_wifi_deauth_sta
esp_wifi_get_country
esp_wifi_ap_get_sta_list
esp_wifi_sta_get_ap_info
esp_wifi_stop
esp_wifi_get_channel
esp_wifi_get_protocol
esp_wifi_get_bandwidth
2018-05-10 16:24:43 +08:00
Ivan Grokhotkov dbc919eff5 mbedtls: update usage of mbedtls_aes_encrypt/decrypt 2018-05-09 23:15:28 +08:00
Ivan Grokhotkov 8c307a5720 sleep: fix deadlock in esp_timer_impl_advance after light sleep
When light sleep is started, the other CPU gets halted using DPORT
stall mechanism. This can happen while it is inside an esp_timer
critical section, which may lead to a deadlock. This change adds
functions to take and release esp_timer lock before entering
DPORT critical section, preventing the deadlock.
2018-05-09 22:52:50 +08:00
Ivan Grokhotkov 296b280801 esp_timer: fix esp_timer_impl_advance not triggering expired timers 2018-05-09 22:52:41 +08:00
Jiang Jiang Jian b9aee83d9b Merge branch 'feature/put_supplicant_source_code_from_VNC_to_IDF' into 'master'
wpa_supplicant: move part of codes to IDF

See merge request idf/esp-idf!2272
2018-05-09 15:19:37 +08:00
Deng Xin b00d256d5b wpa_supplicant:move part of codes to IDF 2018-05-09 10:44:35 +08:00
Angus Gratton bb1f3ae264 Merge branch 'feature/psram_configure_in_runtime' into 'master'
feature(psram): update psram and flash SPI frequency in runtime

See merge request idf/esp-idf!1776
2018-05-08 15:23:47 +08:00
Tian Hao 8cd9deed5c component/esp32 : improve wifi and bluetooth coexistence performance
1. update coexistence and wifi libraries. Coexist version update to
v0.9.2
2. Cancel the restriction of use AMPDU when SW_COEXIST_ENABLE is y.
2018-05-07 19:55:41 +08:00
Liu Zhi Fu a9dfa06125 esp32: fix two wifi bugs
1. Fix the bug that WiFi receives duplicate MPDU
2. Deauth the station if soft-AP already has max WiFi connections
2018-05-06 17:29:06 +08:00
Jiang Jiang Jian 25440cbc23 Merge branch 'bugfix/tw12351_wifi_lock_op' into 'master'
esp32: optimize wifi lock

See merge request idf/esp-idf!2345
2018-05-04 19:27:14 +08:00
Liu Zhi Fu 017f109f6e esp32: optimize wifi lock
Replace portENTER_CRITICAL/portEXIT_CRITICAL with semaphore lock if
the protected resource is only accessed by different tasks
2018-05-04 10:36:04 +08:00
Liu Zhi Fu 402dee17a1 esp32: fix potential PHY calibration bug
1. Add error log if failed to store calibration version/mac/data
2. Change the NVS calibration version/mac/data store sequence
3. Pass the init_data instead of NULL to esp_phy_rf_init() in esp_phy_load_cal_and_init()
2018-05-03 15:48:14 +08:00
Jiang Jiang Jian 444d6606e7 Merge branch 'bugfix/mark_auto_connect_api_as_obsolete' into 'master'
esp32: mark WiFi auto connect API as deprecated

See merge request idf/esp-idf!1970
2018-05-03 10:40:27 +08:00
Angus Gratton ec536b3961 Merge branch 'bugfix/wifi_log_level' into 'master'
wifi: Set default wifi library log level based on sdkconfig

See merge request idf/esp-idf!2334
2018-05-03 10:21:19 +08:00
Ivan Grokhotkov 0d65f3b7f9 Merge branch 'bugfix/light_sleep_fixes' into 'master'
light sleep fixes

See merge request idf/esp-idf!2242
2018-05-02 20:09:36 +08:00
Angus Gratton b9126e69bc wifi: Set default wifi library log level based on sdkconfig
Has to be set at runtime, due to precompiled wifi libraries.

Prompted by discussion on forum: https://esp32.com/viewtopic.php?f=2&t=5570&p=24216#p24216
2018-05-02 15:11:21 +10:00
Liu Zhi Fu c23915939d esp32: mark WiFi auto connect API as obsolete
Mark esp_wifi_set/get_auto_connect as obsolete
2018-05-02 09:54:31 +08:00
Angus Gratton 858b95a924 cmake: Add build system tests 2018-04-30 09:59:20 +10:00
Angus Gratton 1cb5712463 cmake: Add component dependency support
Components should set the COMPONENT_REQUIRES & COMPONENT_PRIVATE_REQUIRES variables to define their
requirements.
2018-04-30 09:59:20 +10:00
Angus Gratton b57843b66a cmake: Linker scripts need to account for .c.obj extension as well as .o 2018-04-30 09:59:20 +10:00
Angus Gratton 12be399762 cmake: Add link-time dependencies for linker script files
Requires some hackery around limitations in CMake's LINK_DEPENDS
2018-04-30 09:59:20 +10:00
Angus Gratton bc1693aae3 cmake: Fix SPIRAM options 2018-04-30 09:59:20 +10:00
Angus Gratton 88df8fd293 cmake: Use cmake_lint project, tidy up all CMake source files 2018-04-30 09:59:20 +10:00
Angus Gratton efb5928934 idf.py build & flash tool
Generate flasher args files & .json project info file as part of cmake build
2018-04-30 09:59:20 +10:00
Angus Gratton cb99531d15 cmake: Generate PHY init data partition as part of the build 2018-04-30 09:59:20 +10:00
Angus Gratton 4f1a856dbf cmake: Remove defaults for COMPONENT_SRCDIRS, COMPONENT_SRCS, COMPONENT_ADD_INCLUDEDIRS
* Philosophical: "explicit is better than implicit".
* Practical: Allows useful errors if invalid directories given in components as the defaults aren't
  always used. Also trims the -I path from a number of components that have no actual include
  directory.
* Simplifies knowing which components will be header-only and which won't
2018-04-30 09:59:20 +10:00
Angus Gratton ce6748873d cmake: Add embedding files in components support
Add subscribe_publish AWS example and fixes to allow it to build.
2018-04-30 09:59:20 +10:00
Angus Gratton c671a0c3eb build system: Initial cmake support, work in progress 2018-04-30 09:59:20 +10:00
Liu Zhi Fu ed46976f41 esp32/bt/driver: support static allocation of FreeRTOS queues used by ISR routine
Support static allocation of FreeRTOS queues used by ISR routine in WiFi/BT/esp_timer/driver etc
2018-04-27 15:02:30 +08:00
qiyueixa ebd1849e18 mesh: add fix root function 2018-04-26 21:15:35 +08:00
Ivan Grokhotkov 94250e42a0 sleep: optimize light sleep wakeup latency 2018-04-26 19:36:47 +08:00
Ivan Grokhotkov 487210221b esp_timer: add internal function to adjust time 2018-04-26 18:52:45 +08:00
Ivan Grokhotkov 4ba19abeb6 esp_timer: add a function to get next alarm time 2018-04-26 14:39:54 +08:00
Jiang Jiang Jian 37513cd738 Merge branch 'feature/wifi_add_wifi_event_mask' into 'master'
add WiFi event mask API

See merge request idf/esp-idf!2072
2018-04-26 14:27:42 +08:00
Jiang Jiang Jian 9b9eb7e724 Merge branch 'bugfix/fix_some_wifi_phy_mode_bugs' into 'master'
esp32: fix some wifi phy mode bugs

See merge request idf/esp-idf!2294
2018-04-26 10:27:32 +08:00
Angus Gratton d9cbfe42f9 Merge branch 'bugfix/log_macro_statements' into 'master'
log: Make ESP_LOGx macros into single statements

See merge request idf/esp-idf!2275
2018-04-26 08:05:49 +08:00
Angus Gratton 2f318d16fa log: Make ESP_LOGx macros into single statements
Requires a semicolon after any use (previously this was optional due to trailing } after expansion)

Closes https://github.com/espressif/esp-idf/issues/1757
2018-04-26 09:08:07 +10:00
Liu Zhi Fu f5ae421e14 esp32: fix some wifi phy mode bugs
Fix several WiFi phy mode bugs
2018-04-25 20:32:18 +08:00
XiaXiaotian 364c15b9f8 add WiFi event mask API 2018-04-25 19:25:43 +08:00
Liu Zhi Fu 2461a780aa more 2018-04-23 19:09:46 +08:00
Deng Xin aab573746e Bug fix of authmode change event peg core in wep mode
auth mode change event will report continous in wep mode due to wrong original auth record

close github issue https://github.com/espressif/esp-idf/issues/1804
2018-04-23 14:25:36 +08:00
Jiang Jiang Jian e37ceaed32 Merge branch 'bugfix/tw18453_fix_ap_eapol_retry_bug' into 'master'
esp32: fix soft-AP eapol retry issue

See merge request idf/esp-idf!2264
2018-04-22 16:37:24 +08:00
Liu Zhi Fu db5f927087 esp32: fix the bug that soft-AP fails to retry eapol
Fix the issue that soft-AP fails to retry eapol frame when multiple
stations connects it at the same time.

More
2018-04-22 10:19:31 +08:00
Wangjialin b1dcb52fec feature(psram): configure flash and psram speed during runtime
1. Bootloader reads SPI configuration from bin header, so that the burning configuration can be different with compiling configuration.
2. Psram mode init will overwrite original flash speed mode, so that users can change psram and flash speed after OTA.
3. Flash read mode(QIO/DIO…) will not be changed in app bin. It is decided by bootloader, OTA can not change this mode.
4. Add read flash ID function, and save flash ID in g_rom_flashchip
5. Set drive ability for all related GPIOs
6. Check raise VDDSDIO voltage in 80Mhz mode
7. Add check flash ID and update settings in bootloader
8. Read flash ID once and keep in global variable
9. Read flash image header once and reuse the result

Tested cases:
1. Test new and old version of bootloader
boot Flash 20M —> app Flash 80M + Psram 80M
boot Flash 40M —> app Flash 80M + Psram 80M
boot Flash 80M —> app Flash 80M + Psram 80M
boot Flash 20M —> app Flash 80M + Psram 40M
boot Flash 40M —> app Flash 80M + Psram 40M
boot Flash 80M —> app Flash 80M + Psram 40M
boot Flash 20M —> app Flash 40M + Psram 40M
boot Flash 40M —> app Flash 40M + Psram 40M
boot Flash 80M —> app Flash 40M + Psram 40M
2. Working after esp_restart reboot.
2018-04-20 20:51:44 +08:00
Mahavir Jain 441b4a9742 esp32: fix few components with dependency on networking stack
* Move smartconfig to its component directory, it should be possible to override
  this as whole component
* Fix few header includes related to lwIP networking stack

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-04-19 18:28:55 +05:30
Ivan Grokhotkov 2d598d6fb7 esp_timer: use _ISR version of port{ENTER,EXIT}_CRITICAL from ISR 2018-04-19 18:28:55 +05:30
Ivan Grokhotkov f65870566a crosscore_int: use _ISR version of portENTER/EXIT_CRITICAL in ISR 2018-04-19 18:28:55 +05:30
qiyueixa 899f2fa1ed mesh: update mesh libs
1. fix issues on sending beacon caused by too much tx retries on other packets.
2. modify not to scan if rc exists when connect.
3. modify scan dwell time to default 120ms fo root.
2018-04-17 11:49:54 +00:00
qiyueixa 92fd4c42e1 mesh: update mesh libs
1. fix a bug in initliazing map beacon interval.
2. fix not send MESH_EVENT_ROUTING_TABLE_REMOVE when MESH_NWK_CHILD_DISCONNECTED.
3. fix a bug in returning roots ie len.
2018-04-13 11:52:31 +08:00
Ivan Grokhotkov bdadd95dd7 Merge branch 'feature/wwrite_string_for_idf' into 'master'
Enable -Wwrite-strings when compiling IDF's own C files

See merge request idf/esp-idf!2193
2018-04-11 14:59:08 +08:00
Ivan Grokhotkov 907fc1167a gpio: add special GPIO signal values 2018-04-11 11:06:50 +08:00
Ivan Grokhotkov 2522c1b2f9 Merge branch 'bugfix/rtc_clk_fixes' into 'master'
Power management and RTC fixes

See merge request idf/esp-idf!2131
2018-04-10 18:17:02 +08:00
Roland Dobai 744c2dcdd9 Resolve problems found by enabling -Wwrite-strings compilation flag 2018-04-10 08:53:43 +02:00
Angus Gratton 2bfef060ba Merge branch 'bugfix/small_fixes_from_github' into 'master'
Bugfix/small fixes from github

See merge request idf/esp-idf!2200
2018-04-10 09:19:19 +08:00
Angus Gratton 58ed6cc9af Merge branch 'bugfix/wifi_ps_modem' into 'master'
wifi: Add WIFI_PS_MODEM for backwards compatibility with V3.0 API

See merge request idf/esp-idf!2203
2018-04-10 09:18:53 +08:00
Angus Gratton 97a382077f wifi: Add WIFI_PS_MODEM for backwards compatibility with V3.0 API 2018-04-09 16:55:38 +10:00
Tian Hao 1bde34c1f1 component/esp32 : remove pm gpio dbg 2018-04-09 14:33:48 +08:00
Anton Maklakov 046ff2e628 Make error codes looks like literals in the code of them (easy for searching). Minor fixes, typos 2018-04-09 13:54:18 +10:00
Mixerito 9f39411e80 esp32: get_chip_info_esp32() return correct model number
out_info->model was zeroed by memset

Merges https://github.com/espressif/esp-idf/pull/1760
2018-04-09 12:28:23 +10:00
Fredrik 97c6a94a03 Bugfix GPIO_DIS_OUTPUT to work with pin 32 and up
Merges https://github.com/espressif/esp-idf/pull/1796
2018-04-09 12:28:23 +10:00
Xia Xiaotian e727582180 Fix two WiFi and LWIP typos
1. close github issue: https://github.com/espressif/esp-idf/issues/1792
    2. close github issue: https://github.com/espressif/esp-idf/issues/1781
2018-04-05 11:46:42 +08:00
qiyueixa 2984cdbbe3 add mesh feature 2018-04-04 22:57:45 +08:00
Tian Hao 58e7464dc0 component/esp32 : clear some minor thingsw about PM and coexistence 2018-04-03 20:13:49 +08:00
Ivan Grokhotkov 139d49894c Merge branch 'feature/deactivate_wakeup_trigger' into 'master'
esp32: Add deactivation of wake up trigger for different sources

See merge request idf/esp-idf!2079
2018-04-03 15:19:10 +08:00
island 9b7454de0c support wifi&bt coexist (v0.9.1)
1. refactor wifi modem sleep
2. refactor wifi and bt phy enable/diable coexistence
3. support wifi&bt coexist (v0.9.1)
3. add coex pause resume
4. fix bt library interrupt reaction slowly
5. make a2dp more smooth when coex
6. add coexist preference option
7. Make CI do not check libcoexist.a printf/ets_printf
8. disable Wifi RX AMPDU when software coexistence enable && update wifi lib
9. bluetooth call modem sleep api
2018-04-02 13:44:48 +08:00
Jiang Jiang Jian 21099c10f4 Merge branch 'feature/support_enrollee_feature_in_APSTA_mode' into 'master'
feature/support WPS enrollee in APSTA mode

See merge request idf/esp-idf!2120
2018-03-30 16:14:43 +08:00
Alex Lisitsyn cffab50ac3 esp32: Deactivate wakeup trigger after first wakeup
The files updated according to code review discussions.
In the sleep_modes.c removed immidiate disable of ULP  mode and leave just trigger deactivation.
The esp_sleep.h is updated to have the same defines for source as esp_sleep_wakeup_cause_t.
Updated documentation in sleep_modes.rst file to include cross references and address esp_sleep_wakeup_cause_t type.
The get_time_ms() is updated to explicitly use fabs(dt) instead of abs(dt) in  test_sleep.c.
Some other minor changes in test_sleep.c unit test.

(TW#18952)
Closes https://github.com/espressif/esp-idf/issues/1677
2018-03-29 11:24:59 +05:00
Roland Dobai 7c4b3d50f8 Make error codes globally unique 2018-03-27 08:12:54 +02:00
Ivan Grokhotkov 2e7613b656 Merge branch 'feature/use_esp_err_to_name' into 'master'
Use esp_err_to_name in examples & optionally disable it in Kconfig

See merge request idf/esp-idf!2013
2018-03-27 11:50:21 +08:00
Ivan Grokhotkov db44a719fb pm: add unit test for configuration changes 2018-03-27 11:20:55 +08:00
Ivan Grokhotkov 94014a9a51 pm: handle the case of 2MHz frequency
It is not possible to generate 1 MHz REF_TICK from 2 MHz APB clock
(this is a limitation of REF_TICK divider circuit). Since switching
REF_TICK frequency is something we would like to avoid (to maintain
UART output even with DFS), 2 MHz frequency has been marked as
unsupported.
2018-03-27 11:20:55 +08:00
Ivan Grokhotkov 839c665c92 pm: fix initialisation only done in dual core mode
Introduced in 9377d4ac. Accidentally put the new code block under an
2018-03-27 11:20:54 +08:00
Ivan Grokhotkov fe5d294f6c pm: handle changes to the PM_MODE_ACTIVE frequency
The issue would manifest itself in cases when switching from PM
configuration like {active=160MHz, idle=80MHz} to {active=80MHz,
idle=80Mhz}. After the configuration was changed, PM logic would
think that current frequency was 80MHz and would not do any further
switching. In fact, frequency was still 160MHz.
2018-03-27 11:20:54 +08:00
Ivan Grokhotkov 1517aeda6c pm: fix calculation of maximum of two frequencies
The old code calculated MAX() of two enum values, but CPU frequency
enum values are not ordered (2MHz goes after 240MHz). This caused
incorrect configuration to be set.
2018-03-27 11:20:53 +08:00
Deng Xin 6c3bdd45cf feature/support WPS enrollee in APSTA mode
Add the feature WPS enrollee in APSTA mode

close github issue: https://github.com/espressif/esp-idf/issues/1608
2018-03-23 15:41:59 +08:00
Ivan Grokhotkov 27bf18ad6b Merge branch 'test/wifi_stop_deinit' into 'master'
test(wifi): add test for wifi stop and deinit.

See merge request idf/esp-idf!2022
2018-03-23 13:45:20 +08:00
Ivan Grokhotkov 887b6e2925 Merge branch 'bugfix/rtc_clk_32k_bootstrap' into 'master'
bugfix/rtc_clk_32k_bootstrap: Fix starting 32k RTC

See merge request idf/esp-idf!2085
2018-03-21 18:38:49 +08:00
Konstantin Kondrashov f7df532ec0 bugfix/rtc_clk_32k_bootstrap: Fix starting 32k RTC
1. External 32kHz crystal is started for too long or it may not start at all. It is often observed at the first start.
2. At the first start, it is possible that the crystal did not start. And the recorded period was recorded as 0. Which led to a division error by zero during the transition to the deep sleep mode (Maybe somewhere else).
3. Added a unit test to test a new method of oscillation an external crystal.
4. Added a new method of oscillating of an external crystal. The legs of the crystal are fed with a 32 kHz frequency.

The new method eliminates these errors.

Added unit test: `\esp-idf\components\soc\esp32\test\test_rtc_clk.c`: `make TEST_COMPONENTS=soc`
- 8 Test starting external RTC crystal. Will pass.

`Bootstrap cycles for external 32kHz crystal` - is specified in the file Kconfig by default 100.

QA tested a new method of oscillation the crystal on 25 boards. The supply of square waves on the crystal showed a 100% result in contrast to the previous method of launching the crystal. After the tests, the old method was deleted.

Closes TW19143
2018-03-21 13:27:56 +05:00
Jiang Jiang Jian 8478823039 Merge branch 'bugfix/dfs_rtc_fixes' into 'master'
DFS related fixes

See merge request idf/esp-idf!2102
2018-03-21 12:02:48 +08:00
Ivan Grokhotkov 7167ad45ab pm: improve debug output from esp_pm_dump_locks
- separate mode stats from lock stats by an extra comment line
- add CPU frequency column to the mode stats
- don’t print a row for light sleep if light sleep is not enabled
2018-03-20 18:08:19 +08:00
Ivan Grokhotkov 9377d4acd4 pm: fix incorrect configuration at startup
s_cpu_freq_by_mode array was statically initialised with 80MHz CPU
frequency in CPU_MAX and APB_MAX modes, but sdkconfig setting for the
CPU frequency could have been different. For the case of 240MHz CPU
frequency, this would cause a frequency switch between 240MHz and
80MHz to happen, even though such switch is not supported in the fast
path switching functions used by the DFS implementation.

This fixes the issue by moving initialisation into esp_pm_impl_init,
which is called at startup before the first mode switch can happen.

Fixes https://github.com/espressif/esp-idf/issues/1729.
2018-03-20 18:06:58 +08:00
Liu Zhi Fu 21c0b59315 esp32: optimize WiFi TX
1. Optimize TX retry counter
2. Optimize TX timeout
2018-03-20 15:24:32 +08:00
Alex Lisitsyn 1e9bb5bb7c esp32: Deactivate wakeup trigger after first wakeup
The files updated according to code review discussions.
In the sleep_modes.c removed immidiate disable of ULP  mode and leave just trigger deactivation.
The esp_sleep.h is updated to have the same defines for source as esp_sleep_wakeup_cause_t.
Updated documentation in sleep_modes.rst file to include cross references.
Some minor changes in test_sleep.c unit test.

(TW#18952)
Closes https://github.com/espressif/esp-idf/issues/1677
2018-03-20 12:23:32 +05:00
Jiang Jiang Jian 45eb556ddf Merge branch 'bugfix/wpa2_assert_when_use_sha256_signature' into 'master'
bugfix of wpa2 assert when use sha256 do signature

See merge request idf/esp-idf!2089
2018-03-20 15:19:55 +08:00
Deng Xin bc97b0f380 bugfix of wpa2 assert when use sha256 do signature
The order of wpa2_crypto_funcs_t structure mismatch between IDF and wifi libray

close github issue https://github.com/espressif/esp-idf/issues/1297
2018-03-20 11:08:20 +08:00
Liu Zhi Fu 078cd81f10 esp32: Fix wifi stop never return issue
Fix esp_wifi_stop() never return issue
2018-03-19 21:16:29 +08:00
michael c2a68ae0d3 test(wifi): add test for wifi stop and deinit. 2018-03-19 08:23:52 +00:00
Alex Lisitsyn ce09cfd99b esp32: Deactivate wakeup trigger after first wakeup
Added function esp_sleep_disable_wakeup_source() to deactivate wakeup trigger for selected source.
Updated documentation for this function in sleep_modes.rst file.
Updated unit test to check this functionality for light sleep.
The test_sleep.c unit test is updated to add reliability for unit testing.

(TW#18952)
Closes https://github.com/espressif/esp-idf/issues/1677
2018-03-16 18:49:24 +05:00
Alex Lisitsyn 2d90da0817 esp32: Deactivate wakeup trigger after first wakeup
The timer wakeup function once activated cannot be disabled later using existing api. If user wants to use different wakeup sources after first sleep but it does not work. This change disables timer wakeup trigger in configuration that will be set into appropriate RTC registers in esp_light_sleep_start() function.

Added function esp_sleep_disable_wakeup_source() to deactivate wakeup trigger for selected source.
Updated documentation for this function in sleep_modes.rst file to pass make html.
Updated unit test to check this functionality for light sleep.
The test_sleep.c unit test is updated to add reliability for auto unit testing.

(TW#18952)
Closes https://github.com/espressif/esp-idf/issues/1677
2018-03-16 18:22:02 +05:00
Liu Zhi Fu 8f61716647 esp32: Fix esp_wifi_stop never returns issue
esp_wifi_stop may never return when run esp_wifi_start/stop repeatly.
2018-03-15 11:25:13 +08:00
Ivan Grokhotkov 36098f3cac Merge branch 'bugfix/make_MEMMAP_SMP_config_dependent' into 'master'
bugfix/remove MEMMAP_SMP config

See merge request idf/esp-idf!1988
2018-03-14 13:02:55 +08:00
Roland Dobai f891eac827 ESP32: Optionally disable lookup-tables for esp_err_to_name 2018-03-13 14:26:54 +01:00
Deng Xin 768d6e09ab Bugfix of wpa2 task assert when suddenly disconnect 2018-03-12 21:41:24 +08:00
Tian Hao 127d213b29 component/esp32: fix esp_timer bug
1. fix the bug that cause esp_timer_get_time is not accuracy(the max margin may be 106s).
2. fix the bug that causes esp timer come too early.
2018-02-28 10:49:45 +08:00
Darian Leung 33aee51727 bugfix/remove MEMMAP_SMP config
This commit removes the MEMMAP_SMP config option.
Dependencies on this config will now depend on !FREERTOS_UNICORE
2018-02-27 17:56:44 +08:00
Ivan Grokhotkov d1559732b0 Merge branch 'feature/ignore_no_psram' into 'master'
Add option to continue running (with less ram) if psram is enabled but not detected

See merge request idf/esp-idf!1911
2018-02-26 20:33:28 +08:00
Ivan Grokhotkov a9ae4e2696 Merge branch 'bugfix/config_minor_missing_deps' into 'master'
Kconfig: esp32/freertos: add some missing dependencies

See merge request idf/esp-idf!1966
2018-02-26 05:57:27 +08:00
Mahavir Jain bf31afd2c3 Kconfig: esp32/freertos: add some missing dependencies
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2018-02-21 12:31:10 +05:30
Daniël van Eeden bd0b3a7d6b Fix esp_sleep_wakeup_cause_t docs. Merges https://github.com/espressif/esp-idf/pull/1634
value and description didn't match
2018-02-20 20:22:14 +01:00
Roland Dobai 4322e31c98 Make it easier to look up error messages
tools/gen_esp_err_to_name.py generates
components/esp32/esp_err_to_name.c for lookup of the error codes from
all of the IDF project and easily identify all codes in one place
2018-02-15 14:19:03 +01:00
Jeroen Domburg dc864c4108 Add option to continue running (with less ram) if psram is enabled but not detected 2018-02-12 13:44:11 +08:00
Ivan Grokhotkov a5f9563ef7 esp32: increase default event task stack size by 256 bytes
At debug log level, default event task stack size was not sufficient,
the stack was overflown by 232 bytes when WiFi connection happened.
2018-02-11 13:06:01 +08:00
Ivan Grokhotkov 417ef19084 Merge branch 'feature/tls_support' into 'master'
FreeRTOS TLS support

See merge request idf/esp-idf!1902
2018-02-09 12:34:20 +08:00
Alexey Gerenkov f8c42369f1 freertos: Adds C11 TLS support 2018-02-07 18:46:57 +03:00
Liu Zhi Fu 5497c5ed9a esp32: fix esp_wifi_deinit causes assert
Update wifi lib to fix esp_wifi_deinit causes system assert issue
2018-02-06 13:01:51 +00:00
Ivan Grokhotkov 8173d42581 Merge branch 'feature/partition_table_md5' into 'master'
Partition table md5 check

See merge request idf/esp-idf!1891
2018-02-05 20:58:52 +08:00
Roland Dobai cf7a4cc650 Protect partition table by MD5 checksum 2018-02-05 11:36:03 +01:00
wangmengyang a31d07ba25 move rodata segment of libphy.a to dram
1. rodata segment of libphy.a(about 1200B) can be accessed by ISRs, so put it into DRAM
2018-02-02 13:00:11 +08:00
Jiang Jiang Jian 17f01eb718 Merge branch 'feature/wifi_throughput_optimization' into 'master'
lwip/esp32/examples: wifi throughput optimization

See merge request idf/esp-idf!1861
2018-01-31 15:44:43 +08:00
Liu Zhi Fu 2242bf9b37 lwip/esp32/examples: wifi throughput optimizations
1. Put some lwip udp rx/tx relating functions to IRAM
2. Put some wifi rx/tx relating functions to IRAMa
3. Reduce wifi dynamic malloc from 4 to 1 for each ebuf
4. Update iperf example accordingly
5. Update libphy.a to v383
2018-01-30 16:27:49 +08:00
Angus Gratton 1249659931 Merge branch 'bugfix/system_restore_duplicate' into 'master'
esp32: remove duplicate definition of system_restore

See merge request idf/esp-idf!1864
2018-01-29 14:02:02 +08:00
Ivan Grokhotkov 1979235df2 esp32: remove duplicate definition of system_restore
Fixes https://github.com/espressif/esp-idf/issues/1520.
2018-01-28 19:26:37 +08:00
wangmengyang 95af1c22b5 components/phy: add IRAM_ATTR attribute to the two APIs used in phy calibration
1. the two APIs used in phy calibration are called in bluetooth baseband ISR, so locate the them in IRAM
2018-01-26 17:12:59 +08:00
XiaXiaotian 1bc87e972b Added two functions in PHY API for disable interrupts and add rfcal data checking to PHY 2018-01-25 17:58:14 +08:00
Jiang Jiang Jian c73ea7a804 Merge branch 'bugfix/wifi_fix_sniffer_rx_misc_data_assert' into 'master'
Fix the bug that in sniffer mode it asserts when receive misc data at first

See merge request !1837
2018-01-25 14:09:46 +08:00
XiaXiaotian cdd7a87674 Fix the bug that in sniffer mode it asserts when receive misc data at first
close github issue#1037 WiFi Promiscuous filter breaks w/
WIFI_PROMIS_FILTER_MASK_ALL and issue#1404
esp_wifi_set_promiscuous_filter set WIFI_PROMIS_FILTER_MASK_ALL error
2018-01-24 16:06:53 +08:00
michael fcfcab7678 feat(attr): add new macro DMA_ATTR and WORD_ALIGNED_ATTR to help dma buffer declaration. 2018-01-24 11:28:14 +08:00
Jack 624828ce83 Dump the frame of the other core when interrupt watchdog happens 2018-01-18 23:10:29 +00:00
Angus Gratton f620a3c4f3 Merge branch 'bugfix/int_wdt_in_ocd_mode' into 'master'
panic: prevent INT WDT from re-triggering in OCD mode

See merge request !1764
2018-01-16 15:07:26 +08:00
Ivan Grokhotkov 2ddee72996 Merge branch 'feature/toolchain-80-g6c4433a' into 'master'
Toolchain: Update to version 1.22.0-80-g6c4433a

See merge request !1771
2018-01-11 21:44:42 +08:00
Angus Gratton 38e15e6241 build: Remove explict -lstdc++-psram-workaround
This is now handled internally to the toolchain.
2018-01-11 10:32:02 +11:00
Jiang Jiang Jian 16391c2748 Merge branch 'bugfix/full_calibration_will_not_use_init_data' into 'master'
Fix bug that when we do full calibration init data bin is not used

See merge request !1746
2018-01-10 17:01:53 +08:00
Jack 11c0daef62 Fix bug that when we do full calibration init data bin is not used 2018-01-09 15:31:34 +08:00
Ivan Grokhotkov 8e8cb1a139 panic: prevent INT WDT from re-triggering in OCD mode
When INT WDT fires, panicHandler is invoked. In OCD mode, panicHandler
sets a breakpoint on the PC from the exception frame and returns.
However in case of INT WDT, interrupt flag is still set in TIMERG1
peripheral, which causes INT WDT to trigger again. This causes an
endless stream of "Core  0 panic'ed (Interrupt wdt timeout on CPU1)"
messages. OpenOCD also gets terribly confused at this point.

Disable watchdogs when exiting panic handler in OCD mode.
Clear TIMERG1 WDT interrupt flag to prevent re-entry into panic handler.
2018-01-09 01:46:24 +08:00
Jiang Jiang Jian 4d4c055a1a Merge branch 'bugfix/recompile_with_new_psram_toolchain' into 'master'
recompile wifi lib with new toolchain 1.22.0-78-g4b87650

See merge request !1730
2018-01-05 16:40:30 +08:00
Angus Gratton eb659e401d Merge branch 'feature/esp_intr_set_in_iram' into 'master'
Add esp_intr_set_in_iram (Github PR)

See merge request !1629
2018-01-04 06:04:05 +08:00
XiaXiaotian 3fd421ab01 recompile wifi lib with new toolchain 1.22.0-78-g4b87650 2018-01-02 14:23:37 +08:00
Ivan Grokhotkov 98dff491c8 Merge branch 'bugfix/static_mem_workaround' into 'master'
esp32: Change 192KB runtime static limit workaround to a 176KB link time workaround

See merge request !1704
2017-12-28 18:52:47 +08:00
Jiang Jiang Jian 8051ac469a Merge branch 'cherry-pick-4837f939-2' into 'master'
esp_timer:fix three bugs about timer get and timer alarm where overflow is not correct

See merge request !1695
2017-12-27 11:43:52 +08:00
Angus Gratton f8580ea98f esp32: Change 192KB runtime static limit workaround to a 176KB link time workaround
Turns out some app memory around 0x3ffdc000 is also used by APP CPU.

This is a workaround until code to remove the 176KB limit is committed.
2017-12-27 11:59:54 +11:00
Ivan Grokhotkov 6c2562ceb4 Merge branch 'bugfix/spiram_fails_after_esp_restart' into 'master'
Make psram function after an esp_restart as well.

See merge request !1694
2017-12-21 13:40:10 +08:00
Jack 0a1f81dc01 esp_timer:fix three bugs about timer get and timer alarm where overflow is not correct 2017-12-19 20:05:55 +08:00
Jeroen Domburg 569bfad2e3 Fix the clock subsystem so it doesn't undo the weird condition spiram_psram.c jams the enable/reset bits of SPI3 in when 80MHz mode is selected anymore 2017-12-19 19:12:58 +08:00
Jiang Jiang Jian 956133387d Merge branch 'bugfix/fix_some_wifi_bug' into 'master'
Fix some wifi bugs

See merge request !1680
2017-12-19 17:31:44 +08:00
Ivan Grokhotkov f8bda324ec Merge branch 'bugfix/bootloader_v10_backwards_compat' into 'master'
esp32: Fix backwards compatibility for pre-v2.1 bootloaders

See merge request !1673
2017-12-18 17:20:08 +08:00
Angus Gratton c69af42b96 esp32: Fix backwards compatibility for pre-v2.1 bootloaders
Older bootloaders don't set RTC_XTAL_FREQ_REG or call rtc_clk_init(),
app needs to pick this up.

Reported at
https://esp32.com/viewtopic.php?f=2&t=3939&p=17836
2017-12-18 13:45:57 +11:00
XiaXiaotian 1e1db75aaa Fix some wifi bugs
1. change first scanning channel to adjust different country code.

2. fix a bug that system crashes when station disconnects from AP.
2017-12-15 18:17:17 +08:00
Angus Gratton ea2afa83a8 log: Remove non-static TAG variables 2017-12-15 10:59:48 +11:00
Ivan Grokhotkov 1b619c0ec8 Merge branch 'bugfix/uart1_console' into 'master'
Fixes for console output on UART1

See merge request !1649
2017-12-14 13:36:34 +08:00
Ivan Grokhotkov bee1afaf6d time: rename time source option from FRC to "high-resolution timer"
libc time function now rely on esp_timer_get_time as the source of
high-resolution time, rather than FRC1 timer. Internally, on the ESP32
esp_timer implementation uses FRC2 timer.

- Change help text and labels in Kconfig to use "high-resolution timer"
  instead of FRC1. Keep existing Kconfig option name to be backwards
  compatible.
- Change references to "FRC1" in the source code to "FRC".
2017-12-11 12:37:08 +08:00
Ivan Grokhotkov a705221492 esp32: fix incorrect clock enable bit name for UART0
Closes https://github.com/espressif/esp-idf/issues/1301
2017-12-08 13:14:36 +08:00
Deomid Ryabkov e3282a0cac Add esp_intr_set_in_iram
A function to change "in IRAM" status for an existing interrupt handle, without going through free/allocate of the interrupt.
mOS HW timer implementation requires this to make HW timers safe to re-set from an IRAM ISR.
2017-12-08 05:46:34 +03:00
Mahavir Jain 2efef48e3e docs: fix i2s code snippet for interrupt flags setting
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2017-12-06 12:05:11 +05:30
Ivan Grokhotkov f58c5b21ec watchdog: increase default INT WDT interval if SPIRAM is used
Running heap_caps_check_integrity for 4MB of PSRAM can take longer than
the default WDT interval, 300ms.
2017-12-01 20:10:26 +08:00
Ivan Grokhotkov 15b6b64c99 watchdog: enable INT WDT unit test 2017-12-01 20:10:26 +08:00
Ivan Grokhotkov bd1d631134 watchdogs: make sure timer group peripherals are enabled 2017-12-01 20:10:26 +08:00
Jiang Jiang Jian 96cd6f8626 Merge branch 'bugfix/update_libstdcxx_psram' into 'master'
libstdc++: update the library built with PSRAM workaround

See merge request !1588
2017-12-01 19:34:29 +08:00
XiaXiaotian aaa17b8740 Fix some wifi lib bugs
1. Add a hide API for station to receive and process probe request
frame.

    2. Fix an issue that wifi/bt coexistence crashes in PSRAM version.

    3. Fix an issue that the API for clearing vendor ie can not work.

    4. Fix an issue that wifi stop and reboot leads watchdog.
2017-12-01 15:00:49 +08:00
Ivan Grokhotkov f0547d58e4 esp_timer: add documentation, expose profiling option in Kconfig 2017-11-29 11:44:46 +08:00
Ivan Grokhotkov 6e7eb3c776 esp_timer: fix for the case when timer is deleted in callback
Timer callback can delete the timer. If CONFIG_ESP_TIMER_PROFILING was
enabled, this caused an access to invalid (freed) memory.
This fix adds a pointer to track the timer while executing the callback.
This is needed so that we can check if callback deletes the timer,
in which case we won't try updating profiling counters for this timer
after the callback is done.
2017-11-29 11:44:46 +08:00
zhangyanjiao 768bbcd8aa fix buffer overflow in ipc.c 2017-11-27 18:47:40 +08:00
Darian Leung 4c13b2f391 docs/ipc documentation
This commit updates doxygen comments in the IPC header files and adds an rst
docs page.
2017-11-24 15:31:28 +08:00
Jiang Jiang Jian 082f5716c6 Merge branch 'feature/enable_disable_ampdu_rx_tx_independently' into 'master'
Feature/enable disable ampdu rx tx independently

See merge request !1560
2017-11-23 22:22:43 +08:00
Ivan Grokhotkov 983ec73413 libstdc++: update the library built with PSRAM workaround 2017-11-23 15:34:23 +08:00
Ivan Grokhotkov b669b415e6 Merge branch 'feature/cxx_exceptions_emg_pool' into 'master'
esp32: Adds C++ exceptions emergency pool size menuconfig option

See merge request !1561
2017-11-23 13:02:49 +08:00
Alexey Gerenkov 7df96718a2 esp32: Adds C++ exceptions emergency pool size menuconfig option 2017-11-23 06:14:11 +03:00
Liu Zhi Fu 3f6a8f1430 esp32: add options to disable/enable TX/RX AMPDU independently
Make menuconfig can disable/enable TX/RX AMPDU independently
2017-11-23 09:42:31 +08:00
Ivan Grokhotkov 6e1453e864 Merge branch 'feature/bot' into 'master'
CI: support customize test with @bot

See merge request !1502
2017-11-21 18:43:56 +08:00
Angus Gratton 93c75b4978 Merge branch 'bugfix/update_BOD_voltages' into 'master'
esp32/Update brownout voltages

See merge request !1520
2017-11-21 05:37:55 +08:00
Angus Gratton 4395f7c94e Merge branch 'feature/spi_flash_lock_recursive' into 'master'
spi_flash: Expose recursive op_lock for atomic multi-part flash operations

See merge request !1556
2017-11-20 13:24:41 +08:00
Angus Gratton 7a924bd85a spi_flash: Expose an accessor the current SPI flash guard functions
Change places which uses g_flash_guard_default_ops to use this. Probably exact same data, but a bit
cleaner.
2017-11-20 15:54:31 +11:00
Darian Leung 91ccf588d1 esp32/Update brownout voltages
This commit updates the voltages of each brownout level in Kconfig.
Note that there is some variation of brownout voltage between each chip.
2017-11-20 12:26:13 +08:00
Ivan Grokhotkov 148130066f Merge branch 'feature/esp32_stack_protector' into 'master'
esp32: Adds Stack Smashing Protection Feature

See merge request !1537
2017-11-20 10:16:15 +08:00
Alexey Gerenkov 692a890232 esp32: Adds Stack Smashing Protection Feature
These changes add posibility to enable GCC stack protector via menuconfig
for all source files in project.
2017-11-17 12:08:36 +03:00
He Yin Ling 0c40b2ec9d test: collect performance for esp-timer / spinlock 2017-11-16 17:48:48 +08:00
Jiang Jiang Jian 88e1a374a0 Merge branch 'bugfix/fix_airkiss_macro_typo' into 'master'
Fix an airkiss macro error

See merge request !1532
2017-11-16 17:25:45 +08:00
XiaXiaotian eef595501c Fix an airkiss macro error 2017-11-15 21:44:12 +08:00
Angus Gratton b83792f504 Merge branch 'doc/esp_wifi_types' into 'master'
docs: Add esp_wifi_types.h items to wifi API reference

See merge request !1320
2017-11-15 15:03:02 +08:00
Angus Gratton c40dc36814 docs: Remove internal header esp_wifi_crypto_types.h from documentation 2017-11-15 17:40:38 +11:00
Angus Gratton beba74ff61 docs: Add esp_wifi_types.h descriptions 2017-11-15 17:40:38 +11:00
Liu Zhi Fu 3554d190ff esp32: update wifi lib to fix some wifi bugs
1. Fix resend eapol cause crash issue
2. Don't asser the system when the channel is in 14
2017-11-14 20:45:33 +08:00
Liu Zhi Fu 48ca949fd4 lwip: fix socket close crash issue
When lwip_close free the socket resource (netconn etc), any work
related to these resource (netconn etc) must be aborted.
2017-11-13 06:00:52 +00:00
He Yin Ling e64b9ecaf4 Merge branch 'bugfix/ut_only_test_app_core_sleep_on_dual_core' into 'master'
test: only test app core sleep on dual core

See merge request !1517
2017-11-13 13:35:07 +08:00
Jiang Jiang Jian 004c391591 Merge branch 'feature/adjust_task_stack_size_according_to_nano' into 'master'
esp32/lwip: adjust task stack size according 'nano' print

See merge request !1510
2017-11-13 11:18:20 +08:00
Angus Gratton 36692dbac7 docs: Add esp_wifi_types.h items to wifi API reference
Previously only items defined esp_wifi.h in esp_wifi_crypto_types.h
were including in documentation reference.
2017-11-10 11:00:44 -08:00
He Yin Ling be405d69d8 test: ut only test app core reset on dual core 2017-11-10 17:53:59 +08:00
Jiang Jiang Jian b8694eeeb9 Merge branch 'bugfix/tw16339_sta_cant_connect_ap_in_channel_14' into 'master'
Bugfix/tw16339 sta cant connect ap in channel 14

See merge request !1514
2017-11-10 15:31:19 +08:00
He Yin Ling b1d13ded1a test: only test app core sleep on dual core 2017-11-10 13:26:11 +08:00
Ivan Grokhotkov 7632c6a80c Merge branch 'test/UT_reset_check' into 'master'
Test/ut reset check

See merge request !1086
2017-11-10 11:30:46 +08:00
Ivan Grokhotkov 3eedf3ed18 Merge branch 'bugfix/to_docs_from_github' into 'master'
Documentation bugfixes from the github

See merge request !1501
2017-11-10 11:13:25 +08:00
Ivan Grokhotkov d1f6030921 Merge branch 'bugfix/from_github' into 'master'
Bug fixes from Github

See merge request !1487
2017-11-10 11:13:04 +08:00
Liu Zhi Fu 2041ba9add esp32: fix station can't connect esp32 softap in channel 14
Channel 14 only supports HT20 while ESP32 softap channel 14 is HT40, fix it.
2017-11-10 10:55:08 +08:00
Liu Zhi Fu 710055025e esp32/lwip: adjust task stack size according 'nano' print
1. Adjust tcpip/main/event/timer task stack size according 'nano' print
2. If 'nano' print is disabled the task stack size reduces 512 bytes
2017-11-09 10:09:42 +08:00
Jiang Jiang Jian 793ea56204 Merge branch 'bugfix/fail_to_scan_all_matched_ap' into 'master'
Wifi: bugfix/fail_to_scan_all_matched_ap

See merge request !1493
2017-11-08 17:39:29 +08:00
Seppe Stas a106dc183d Clean up documentation of esp_wifi_set_country
Signed-off-by: krzychb
2017-11-07 20:26:22 +01:00
houchenyao f80824a2d8 test: support test for UT cases expect to reset 2017-11-07 12:19:39 +08:00
Ivan Grokhotkov 1613044aef Merge branch 'bugfix/restart_reconfigure_flash_pins' into 'master'
esp32: reconfigure SPI flash pins in esp_restart

See merge request !1492
2017-11-07 12:08:52 +08:00
Ivan Grokhotkov a45e9c806d Merge branch 'bugfix/new_task_watchdog_API_false_trigger' into 'master'
feat/New Task Watchdog API

See merge request !1380
2017-11-07 10:43:56 +08:00
Deng Xin 092e99c05d Wifi: bugfix/fail_to_scan_all_matched_ap
fail to scan all matched ap in fast scan mode
2017-11-06 21:31:45 +08:00
Ivan Grokhotkov 5f6be9b4ce esp32: reconfigure SPI flash pins in esp_restart 2017-11-06 16:44:26 +08:00
Jiang Jiang Jian abacf8d2a0 Merge branch 'bugfix/rtc_and_restart_fixes' into 'master'
rtc_clk and esp_restart fixes

See merge request !1458
2017-11-04 01:34:38 +08:00
Liu Zhi Fu 13621852dd esp32: add wifi lib which is compiled with psram gcc
Add psram wifi lib because it doesn't impact the WiFi throughput once the psram is not enabled in IDF menuconfig
2017-11-03 23:02:35 +08:00
Frederik Merz 20ccec1061 Disable all UART CLKs that are not console 2017-11-03 19:03:00 +08:00
jeanleflambeur 8712fd3ccf Update esp_err.h
Renamed the internal rc to __err_rc to avoid clashes with local variables.
This code would not do the expected thing with the original ESP_ERROR_CHECK macro:

esp_err_t my_func(esp_err_t x)
{
  assert(x == 23);
}

esp_err_t rc = 23; //some value that is important fo the user
ESP_ERROR_CHECK(my_func(rc));

The macro will expand to:
esp_err_t rc = (my_func(rc));

And the code will assert, as my_func will receive a random value - whatever is in the internal macro rc temp variable. This is due to the C weirdness of allowing this code:

int x = x; //x has a random value.
2017-11-03 16:45:28 +08:00
Wangjialin cea7dfbe90 psram: improve clock signal generation, increase drive strength
Also check the chip type when initializing.
2017-11-03 16:30:10 +08:00
Ivan Grokhotkov a02b30ccda efuse: add package definitions for PICOD2/D4 2017-11-03 15:49:10 +08:00
Ivan Grokhotkov fb9c106bcb soc/rtc: add function to get/set VDDSDIO configuration
Also consider case of VDDSDIO force powered on in rtc_sleep.
2017-11-03 15:49:09 +08:00
Darian Leung 9d63e1da4a New Task Watchdog API (Revert of Revert)
This commit reverts the revert on the new task watchdog API. It also
fixes the following bug which caused the reversion.

- sdkconfig TASK_WDT_TIMEOUT_S has been reverted from the unit of ms back to the
unit of seconds. Fixes bug where projects using the new API without rebuilding sdkconfig
would cause the old default value of 5 to be interpreted in ms.

This commit also adds the following features to the task watchdog

- Updated idle hook registration to be compatible with dual core hooks

- Updated dual core hooks to support deregistration for cpu

- Legacy mode has been removed and esp_task_wdt_feed() is now replaced by
  esp_task_wdt_reset().  esp_task_wdt_feed() is deprecated

- Idle hooks to reset are now registered/deregistered when the idle tasks are
  added/deleted from the Task Watchdog instead of at Task Watchdog init/deinit

- Updated example
2017-11-02 16:47:51 +08:00
XiaXiaotian 27b52dfd18 fix some phy bugs
1. V366, fix a problem which initialize current can reach 800mA.

    2. V365, fix a problem for pll_cap tracking in Coexist (BT & WIFI)
       mode. The problem will make Coexist (BT & WIFI) WIFI AP mode TX
       Fail in high temperature(>70).

    3. V364, fix a bug of BT and Wifi coexist (hung in function of
       force_wifi_mode())
2017-11-02 15:53:17 +08:00
XiaXiaotian 42cefc173f refractor WiFi clock setting
Do not set WiFi clock in PHY initializing function, move it to WiFi
   start/stop function.
2017-11-02 15:24:21 +08:00
wangmengyang bd6394db92 component/bt: clean up WIFI_CLK_EN_REG settings for Bluetooth
1. move settings of WIFI_CLK_EN_REG for bluetooth into controller init/deinit APIs
2. modify the bit mask used in phy_rf init/deinit to use WIFI-BT shared bits
2017-11-02 15:24:21 +08:00
XiaXiaotian 50b6912bf8 Increase maximum number of WiFi dynamic transmitting buffer 2017-10-31 15:18:20 +08:00
XiaXiaotian 87d3986b87 Fix the return value of esp_now_send() 2017-10-31 15:18:20 +08:00
Deng Xin ccfbecd25f Wifi: bugfix of get wrong ap information in all channel scan
fix the issue get wrong ap information in all channel scan
2017-10-31 11:35:11 +08:00
Liu Zhi Fu 1195ced75c esp32: reduce default wifi static tx buffer
Modify the the default WiFi static tx buffer from 32 to 16
2017-10-28 12:15:40 +08:00
Ivan Grokhotkov eb5752c635 esp_restart: fix possible race while stalling other CPU, enable WDT early
Previously esp_restart would stall the other CPU before enabling RTC_WDT.
If the other CPU was executing an s32c1i instruction, the lock signal
from CPU to the arbiter would still be held after CPU was stalled. If
the CPU running esp_restart would then try to access the same locked
memory pool, it would be stuck, because lock signal would never be
released.

With this change, esp_restart resets the other CPU before stalling it.
Ideally, we would want to reset the CPU and keep it in reset, but the
hardware doesn't have such feature for PRO_CPU (it is possible to hold
APP_CPU in reset using DPORT register). Given that ROM code will not use
s32c1i in the first few hundred cycles, doing reset and then stall seems
to be safe.

In addition to than, RTC_WDT initialization is moved to the beginning of
the function, to prevent possible lock-up if CPU stalling still has any
issue.
2017-10-26 19:53:53 +08:00
Angus Gratton 2c2e7f6303 Merge branch 'bugfix/optmize_ipv6_event' into 'master'
bugfix: add netif info in event message when got ipv6 address

See merge request !959
2017-10-23 17:00:10 +08:00
Tian Zhong Xing 55e95b04bd bugfix: add netif info in event message when got ipv6 address 2017-10-23 13:50:43 +08:00
Ivan Grokhotkov 59b7d98fec Merge branch 'feature/dfs' into 'master'
Dynamic frequency scaling

See merge request !1189
2017-10-22 12:34:11 +08:00
Ivan Grokhotkov b6f37bda97 Merge branch 'feature/i2s_built_in_adc' into 'master'
feature(I2S-ADC): add ADC mode for I2S.

See merge request !1077
2017-10-20 15:52:56 +08:00
Ivan Grokhotkov 90bbcbcdc0 unit tests: fix warnings, build with -Werror
- libsodium: silence warnings
- unit tests: fix warnings
- spiram: fix warnings
- ringbuf test: enable by default, reduce delays
2017-10-19 21:35:23 +08:00
Ivan Grokhotkov ae7404972c sleep: don't power down VDD_SDIO in light sleep if SPIRAM is enabled 2017-10-19 21:35:23 +08:00
Ivan Grokhotkov d55ddfe56d update libstdc++.a built with pSRAM workaround 2017-10-19 21:35:22 +08:00
Ivan Grokhotkov cc67500d3e unit test: adapt tests to single core configuration 2017-10-19 21:35:21 +08:00
He Yin Ling 1fc2ac8b09 unit-test: esp timer use same name as ets timer
We will use case name to select test cases in UT jobs.
Same case name is not allowed.
2017-10-19 21:35:21 +08:00
Ivan Grokhotkov 8e01b4aef8 Merge branch 'docs/esp32_hooks' into 'master'
docs/Added documentation about esp32 hooks

See merge request !1417
2017-10-19 12:32:36 +08:00
Ivan Grokhotkov 54d2dc7681 Merge branch 'bugfix/fix_some_wifi_bugs' into 'master'
esp32: fix some wifi bugs

See merge request !1414
2017-10-18 16:20:09 +08:00
Darian Leung 461f8da704 docs/Added documentation about esp32 hooks
This commit adds documentation about the esp32 Idle and Tick Hooks
2017-10-18 15:19:35 +08:00
Angus Gratton 78f70d4e79 Merge branch 'bugfix/cxx_exceptions' into 'master'
Full C++ Exception Support option (& reclaim memory when exceptions disabled)

See merge request !1353
2017-10-18 15:08:10 +08:00
Deng Xin 80b14fc77f esp32: fix some wifi bugs
1. Fix WiFi timer enable twice issue
2. Fix a softAP compatibility issue
3. Fix ebuf alloc counter issue
4. remove nvs_flash_init() in esp_wifi_init()
5. Fix scan only find few APs after set bssid
6. Fix can not connect to hidden SoftAP
7. Remove group key entry before connecting ot AP
2017-10-18 14:53:19 +08:00
Ivan Grokhotkov fba9678c56 uart: add support for REF_TICK 2017-10-18 14:19:20 +08:00