Commit graph

1423 commits

Author SHA1 Message Date
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
Ivan Grokhotkov bfeecd2b56 freertos: deprecate XT_CLOCK_FREQ
- freertos: add deprecated definition for XT_CLOCK_FREQ
- flash_ops: don't use XT_CLOCK_FREQ
- unity: don't use XT_CLOCK_FREQ
- hw_random: don't use XT_CLOCK_FREQ
- core_dump: don't use XT_CLOCK_FREQ
- app_trace: don't use XT_CLOCK_FREQ
- xtensa_init: init xt_tick_divisor
2017-10-18 14:19:19 +08:00
Ivan Grokhotkov df3c857a30 esp32: add power management hooks for WiFi library 2017-10-18 14:19:19 +08:00
Ivan Grokhotkov eb0c34e5c9 esp_timer: add support for frequency scaling 2017-10-18 14:19:18 +08:00
Ivan Grokhotkov 3f818f4862 pm: support for tracing using GPIOs 2017-10-18 14:19:18 +08:00
Ivan Grokhotkov 535695f0b9 freertos: add frequency switching hooks to ISR and idle task 2017-10-18 14:19:17 +08:00
Ivan Grokhotkov 42d51a4224 esp32: initialize PM at startup, add Kconfig options 2017-10-18 14:19:17 +08:00
Ivan Grokhotkov 68e1751b78 pm: initial implementation for ESP32 2017-10-18 14:19:16 +08:00
Ivan Grokhotkov 47e3c9dd4b pm: initial version of power management APIs 2017-10-18 14:19:16 +08:00
Ivan Grokhotkov 4798b7d775 unit tests: add test to dump esp_timer stats 2017-10-18 14:19:15 +08:00
Ivan Grokhotkov 3788b35f87 unit tests: more robust esp_timer test 2017-10-18 14:19:15 +08:00
Ivan Grokhotkov 37e9bc715c esp_clk.h: make public, add getters for RTC time, CPU/APB freq 2017-10-18 14:19:14 +08:00
Ivan Grokhotkov f13623d97d make esp_timer.h public 2017-10-18 12:31:38 +08:00
Ivan Grokhotkov 566f018996 crosscore_int: add support for FREQ_SWITCH event 2017-10-18 12:31:38 +08:00
Tian Hao 09862b5918 component/esp32 : update phy & rtc
RTC V230
add BT AGC saturation protection, replace RTC V229.

PHY V362
Power up print: "phy_version: 362.0, 61e8d92, Sep 8 2017, 18:48:13"
1. esp_init_data_v3.bin
modify TX target power
modify WIFI & BT RX gain table
2. modify phy_close_rf()
3. add phy_set_most_tpw()
4. 26M crystal work OK
5. noise_check_loop ok
2017-10-17 18:02:42 +08:00
Ivan Grokhotkov 7babc74fce Merge branch 'feature/reduce_min_num_of_wifi_static_tx_buffer' into 'master'
Reduce minimum number of WiFi static tx buffer

See merge request !1398
2017-10-17 17:40:14 +08:00
Angus Gratton 9c7477ef34 cxx: Add KConfig option for C++ exceptions, disable by default
Fixes https://github.com/espressif/esp-idf/issues/1072

(Additional 20KB is still used if C++ exception support is enabled in
menuconfig.)
2017-10-17 15:29:25 +08:00
Ivan Grokhotkov 6e7dd5962b Merge branch 'bugfix/add_mutex_for_dual_core_hooks' into 'master'
freertos/Add mutex for dual core hooks

See merge request !1406
2017-10-17 14:15:09 +08:00
Ivan Grokhotkov 08d6ca4f70 Merge branch 'bugfix/ets_timer_iram' into 'master'
wifi/bt coexistence: Fix disabled cache access race when writing to flash

See merge request !1409
2017-10-17 14:12:43 +08:00
Ivan Grokhotkov d3bb9de36a Merge branch 'feature/spiram_init_in_app' into 'master'
spiram: expose function to initialize SPI RAM cache

See merge request !1281
2017-10-17 04:56:35 +08:00
Ivan Grokhotkov b58e19f8a2 Merge branch 'bugfix/soc_component_rodata' into 'master'
soc: place constant data from rtc_clk.c into DRAM

See merge request !1321
2017-10-17 04:54:43 +08:00
Angus Gratton 094cf4d79d wifi/bt coexistence: Fix disabled cache access race when writing to flash
Moves the ets_timer_arm() / ets_timer_disarm() code paths to RAM

Overhead is 740 bytes of IRAM, 0 bytes DRAM

(For comparison: If all of esp_timer.c is moved to RAM, overhead is 1068 bytes IRAM and 480 bytes DRAM.)
2017-10-16 19:47:33 +08:00
Jiang Jiang Jian 99f2996779 Merge branch 'bugfix/tw15595_eth_got_ip_log_error' into 'master'
esp32/tcpipadapter: correct eth ip got event info

See merge request !1388
2017-10-16 17:30:14 +08:00
Darian Leung 7584f89278 esp32/Add mutex for dual core hooks
This commit adds critical sections for the dual core hooks
2017-10-16 11:47:38 +08:00
Ivan Grokhotkov 1da3204a7c spiram: expose function to initialize SPI RAM cache
Some frameworks based on ESP-IDF need to be able to decide whether to
initialize SPI RAM after the application has started. This change splits
out part of esp_spiram_init which manipulate cache MMU into a separate
function. Applications can disable cache, call esp_spiram_init_cache,
re-enable cache, and then call esp_spiram_init.
Disabling and re-enabling the cache can be achieved using functions
provided in esp_spi_flash.h.
2017-10-16 09:15:11 +08:00
He Yin Ling 3a271a4ae7 Merge branch 'bugfix/freertos_dual_core_hooks' into 'master'
bugfix/freertos_dual_core_hooks

See merge request !1399
2017-10-14 09:41:03 +08:00
Darian Leung 95d63137d1 bugfix/freertos_dual_core_hooks
This commit fixes bugs with the dual core changes to freeRTOS tick and idle hooks.
Interrupt watchdog now registers tick hooks to both cores.
API for cross core tick and idle hook registration were also added
2017-10-13 18:27:53 +08:00
XiaXiaotian c730f676c3 Reduce minimum number of WiFi static tx buffer
Calibrate tx power after sending five packets
2017-10-13 17:11:31 +08:00
Jiang Jiang Jian 713dee57f0 Merge branch 'feature/add_const_for_wifi_api' into 'master'
esp32: add const for some WiFi api

See merge request !1394
2017-10-13 17:08:29 +08:00
Liu Zhi Fu e04a0d66b8 esp32/tcpipadapter: correct eth ip got event info
1. Raise SYSTEM_EVENT_ETH_GOT_IP when eth got ip
2. Add default handler for SYSTEM_EVENT_ETH_GOT_IP
3. Minor change about ethernet kconfig
2017-10-13 15:56:51 +08:00
Jiang Jiang Jian 6ff5c32ae5 Merge branch 'feature/alloc_memories_of_wifi_and_lwip_in_spiram_first' into 'master'
Allocate some memories in SPIRAM first.

See merge request !1367
2017-10-13 15:47:27 +08:00
Liu Zhi Fu 0e586a4cdf esp32: add const for some WiFi api
Add const if the pointer parameter is const
2017-10-13 15:10:34 +08:00
XiaXiaotian 5df39cd4b6 Allocate some memories in SPIRAM first.
Try to allocate some WiFi and LWIP memories in SPIRAM first. If
    failed, try to allocate in internal RAM then.
2017-10-13 10:11:24 +08:00
Jiang Jiang Jian dbee895741 Merge branch 'bugfix/phy_init_remove_descriptions' into 'master'
phy init: remove descriptions of PHY init parameters

See merge request !1363
2017-10-12 19:00:10 +08:00
Jiang Jiang Jian 3f1198529f Merge branch 'bugfix/fail_to_connect_in_wps' into 'master'
WiFi :bug fix of fail to connect in wps

See merge request !1384
2017-10-12 17:39:29 +08:00
Angus Gratton 3a4bd7f16c Merge branch 'bugfix/wifi_tx_buffer_doc' into 'master'
wifi docs: Clarify WIFI_DYNAMIC_TX_BUFFER_NUM config item limit

See merge request !1375
2017-10-12 13:20:28 +08:00
Angus Gratton f3681e22de wifi docs: Clarify WIFI_DYNAMIC_TX_BUFFER_NUM config item limit
Setting WIFI_DYNAMIC_TX_BUFFER_NUM to zero is not possible.

Also edit some of the related config docs a little.
2017-10-12 15:53:53 +11:00
Deng Xin a99c89f6af bug fix of fail to connect in wps 2017-10-12 12:01:11 +08:00
Deng Xin a05867f673 Wifi: bugfix of fail to reconnect after reboot
fix the issue fail to reconnect after reboot
2017-10-11 17:58:36 +08:00
Jiang Jiang Jian 904d6c8f2b Merge branch 'feature/scan_optimize' into 'master'
wifi: scan optimize

See merge request !1334
2017-10-10 13:39:16 +08:00
Deng Xin d515494d1b wifi: optimize scan feature
1. add the threshold of match AP in fast scan
2. add blacklist feature
3. make sure would wrong if password didn't set
4. add scan example
2017-10-10 12:27:02 +08:00
Jiang Jiang Jian 3106ca1c1e Merge branch 'bugfix/btdm_ea_overloaded' into 'master'
component/bt: increase programming delay for event arbiter to allow for heavy workload

See merge request !1338
2017-10-10 12:26:25 +08:00
Ivan Grokhotkov fdc24eb118 phy init: remove descriptions of PHY init parameters 2017-10-09 14:40:08 +08:00
Daniel Campora 1c046f30a6 freertos: Make the tick/idle hooks dual core compatible
The way these hooks are implemented at the moment, once you register a tick or idle task hook, it is run by both cores, leading to intermittent crashes that are difficult to explain (and debug). One solution is to register the hook with the core that is currently running, which is what this patch attempts to do.

Merges https://github.com/espressif/esp-idf/pull/781
2017-10-09 13:04:20 +11:00
wangmengyang 2797966c47 component/bt: increase programming delay for event arbiter to allow for heavy workload 2017-09-30 18:12:45 +08:00
Jeroen Domburg b6a2bd1184 Revert "esp32: New Task Watchdog API"
This reverts commit 616baa239d.
2017-09-30 18:07:19 +08:00
Darian Leung 616baa239d esp32: New Task Watchdog API
Legacy API of task watchdog used the same function esp_task_wdt_feed() to add
and feed a task. This caused issues of implicitly adding a task to the wdt list
if the function was used in shared code.

The new API introduces init, adding, feeding, deleting, deinit functions. Tasks
must now be explicitly added to the task watchdog using their handles. Deletion
must also be explicit using task handles. This resolves the issue of implicit
task additions to the task watchdog due to shared code calling
esp_task_wdt_feed().

Task watchdog is now fully configurable at runtime by calling the init and
deinit functions.

Also added functions to get the handles of idle tasks of the other core. This
helps when adding idle tasks to the watchdog at run time.

Configuring the task watchdog using menu config is still available, however
menu config will only result in calling the init and add functions for idle
tasks shortly after the scheduler starts.

Menu config also allows for using legacy behavior, however the legacy behavior
willcall the new API functions but with slight variations to make them legacy
compatible.

Documentation and example have also been updated

gcov_rtio.c headers updated to prevent error of freertos header files being
included in the wrong order.

Resolves issue TW#13265
2017-09-29 23:10:55 +08:00
Darian Leung ae9041ab71 esp32: Fix task watchdog timer triggering issues TW#14794
The two task watchdog timer bugs are as follows...
1) If only a single task existed on the wdt task list, and esp_task_wdt_feed()
was only called once, the watchdog triggers but fails to print task name
2) If a single task already exists on the task wdt list, and another task calls
esp_task_wdt_feed() once, the watchdog fails to trigger

Problem stemmed from the loop responsible for resetting the watchdog timer
having incorrect loop parameters. The loop failed to traverse the full length
of the task wdt list
2017-09-29 22:12:58 +08:00
Jeroen Domburg 740f8a79f0 Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
Ivan Grokhotkov 73e8afc5b9 soc: place constant data from rtc_clk.c into DRAM
In release mode, switches in rtc_clk_bbpll_set would be converted to
jump tables. These tables would be placed into .rodata, which caused
rtc_clk_cpu_freq_set to be unusable while cache is disabled. This
manifested itself in crashes when exiting from light sleep:

https://esp32.com/posting.php?mode=reply&f=13&t=3089#pr14590
2017-09-26 17:08:49 +08:00
Ivan Grokhotkov 7d436c9a44 Merge branch 'bugfix/timestamp' into 'master'
fix(global, log): correct the CCOUNT register when switching CPU clock during boot 2nd and before scheduler.

See merge request !1296
2017-09-26 16:15:42 +08:00
michael 9d9e771933 fix(global, log): fix esp_log(_early)_timestamp readings after startup by correct the CCOUNT register when switching CPU clock.
TW#13332, Closes #700
2017-09-26 15:18:17 +08:00
Liu Zhi Fu 762f8da078 esp32: support wifi country code
1. Add completed support for WiFi country code
2. Modify esp_wifi_set_country API
2017-09-26 13:36:53 +08:00
Ivan Grokhotkov fd02668d8b Merge branch 'feature/record_more_info_of_scanned_ap' into 'master'
Record more information of scanned AP

See merge request !1289
2017-09-26 10:13:48 +08:00
Ivan Grokhotkov 7bfbc5bf7c Merge branch 'bugfix/light_sleep' into 'master'
Light sleep fix

See merge request !1303
2017-09-22 16:37:59 +08:00
XiaXiaotian 98dfb8c0b9 Record more information of scanned AP 2017-09-22 15:43:33 +08:00
Ivan Grokhotkov 6b61c6d39f esp32: exclude DPORT-related code in single core mode 2017-09-22 12:07:05 +08:00
Ivan Grokhotkov 3f761e1a83 light sleep: make sure code to be placed into IRAM is not inlined 2017-09-22 11:41:30 +08:00
Deng Xin ee25caf4b2 WiFi: optimize scan feature
1. Add all channel scan feature
2. Add sort matched SSID by authmode feature
2017-09-21 14:28:49 +08:00
Alexey Gerenkov b09f4acb27 Added proper handling of apptrace and pthread initialization errors 2017-09-14 20:47:43 +02:00
krzychb a1ebeed303 Changed initialization sequence of application tracing component on APP CPU so it follows completion of initialization of the same component on PRO CPU. Previously, because of missing locking mechanism, both components were printing logs to UART at the same time. As results logs contained only corrupted characters / were not legible at all. Internal tracking: esp-idf/openocd-esp32, Issue 15 2017-09-14 20:47:43 +02:00
Jiang Jiang Jian 5aa52709c2 Merge branch 'bugfix/fix_some_wifi_lib_bugs' into 'master'
Fix some wifi lib bugs

See merge request !1255
2017-09-14 20:39:02 +08:00
Jiang Jiang Jian c74d944edf Merge branch 'feature/refractor_smartconfig' into 'master'
Refractor smartconfig

See merge request !1253
2017-09-14 20:38:30 +08:00
Jeroen Domburg 0460069582 Merge branch 'bugfix/panic_dport_no_mutex' into 'master'
Panic: stop dport access handler without trying to use a lock

See merge request !1244
2017-09-14 18:07:06 +08:00
XiaXiaotian 6bfbe6e4ed Fix some wifi lib bugs
1. add adc2 coexistence

2. change NOW() to WDEV_NOW()

3. call ets_timer_done() before calling ets_timer_setfn()

4. fix the bug that api lock is not unlocked when call esp_wifi_stop()
   twice

5. more hmac tx buffer limit from 32 to 64.
2017-09-14 15:19:46 +08:00
Wangjialin 2fceec4d85 feature(I2S-ADC): add ADC mode for I2S.
1. Support built-in ADC for I2S.
2. Modify code of ADC, made no change to the original APIs.
3. Add APIs in I2S:
esp_err_t i2s_set_adc_mode(adc_unit_t adc_unit, adc1_channel_t adc_channel);
4. Add I2S ADC/DAC example code.
5. add old-fashion definition to make it more compatible
6. replase spi_flash_ APIs with esp_partition_ APIs
7. add example of generating audio table from wav
8. change example sound
2017-09-14 13:24:08 +08:00
Jeroen Domburg 6d95934a3c Make 80MHz PSRAM work as well, add testcase for weirdness reported on esp32 forums, clean up unused define in psram code 2017-09-14 10:47:44 +08:00
Jeroen Domburg 875ae6a134 Add option to allocate external RAM using heap_alloc_caps 2017-09-14 10:47:44 +08:00
Jiang Jiang Jian 33a4a6a510 Merge branch 'feature/add_espnow' into 'master'
add ESPNOW feature

See merge request !1061
2017-09-13 20:32:53 +08:00
XiaXiaotian 6753f6cb59 Refractor smartconfig
Move code of receiving smartconfig packets and getting password to
    wifi lib. Open source code of sending smartconfig ACK to cellphone
    in IDF.
2017-09-13 16:55:30 +08:00
Jiang Jiang Jian f1e3b0df02 Merge branch 'feature/adv_scan_simultaneously' into 'master'
component/bt : support adv & scan simultaneously

See merge request !1209
2017-09-13 11:50:57 +08:00
Jeroen Domburg 9c56d9e75e Make sure functions that are in ROM in the non-external-ram-workaround version, are in RAM (and not in flash) in the ext-ram workaround version. 2017-09-13 10:36:56 +08:00
Ivan Grokhotkov b6d82eeceb Merge branch 'feature/gcov_over_apptrace' into 'master'
esp32: Adds gcov over JTAG feature

See merge request !1117
2017-09-12 18:54:26 +08:00
Tian Hao 00a7cdbb0b component/bt : support adv & scan simultaneously
1. Occupy conn[9] for adv. The max connection number of bluetooth controller decrease to 9. (Previously, it is 10)
2. modify the enum of setting BLE TX power corresponding to connection's.
3. fix libbtdm_app.a cwitch jump table
2017-09-12 16:10:30 +08:00
XiaXiaotian e4ba31a8b9 add ESPNOW feature
ESPNOW is a kind of WiFi communication bettween WiFi devices, no
    matter they are connected to each other or not. Once two WiFi
    devices are paired, they can send data to or receive data from
    each other. The data is transmitted in action frame which can
    be encrypted with CCMP method. ESPNOW also support mutilcast frame
    transmitting.
2017-09-12 12:12:13 +08:00
Jeroen Domburg b3fd494e71 Panic: stop dport access handler without trying to use a lock 2017-09-11 17:24:22 +08:00
Ivan Grokhotkov 33cb16fd2a esp32: fix cache error interrupt handler
Cache error interrupt would read DPORT registers, which caused DPORT
access protection to kick in. Disable DPORT protection before doing the
reads.
2017-09-08 09:59:09 +08:00
Alexey Gerenkov 891f0db31d esp32: Adds gcov over JTAG feature
Implements function to dump GCOV data to host via JTAG.
The following functionality was added:
 - Host file I/O
 - GCOV runtime I/O stubs
 - GCOV example
2017-09-07 18:13:16 +03:00
Ivan Grokhotkov 5425d8569c Merge branch 'feature/pthread_api' into 'master'
esp32: pthread API

See merge request !1146
2017-09-07 17:49:42 +08:00
Ivan Grokhotkov 40df6546c0 Merge branch 'feature/multi_heap_poisoning' into 'master'
Heap tracing & poisoning features

See merge request !749
2017-09-07 17:47:51 +08:00
Ivan Grokhotkov b9dfb437ab Merge branch 'bugfix/intr_free' into 'master'
fix(intr): fix the logic for allocating and freeing interrupts.

See merge request !1124
2017-09-07 17:45:18 +08:00
Angus Gratton ec498ad86d libgcc: Place assembly functions (including __xtensa_libgcc_window_spill) in IRAM 2017-09-07 16:32:05 +10:00
Angus Gratton 5c417963eb multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +10:00
Liu Zhi Fu a568ad2c9d esp32: update wifi lib for a bunch of small feature and bugfix
1. Update RTC V229: add BT AGC saturation protection
2. Update PHY V359: (1). esp_init_data_v2.bin -- modify WIFI and BT RX gain table Setting
                    (2). modify phy_close_rf()
                    (3). noisefloor add limit and no print
3. WiFi supports modem sleep dynamic frequency switch
4. Fix disabling AMPDU cause esp_wifi_init fail issue
5. Fix sniffer mode cause WiFi can't connect issue
6. Optimize an internal rx buffer full issue
7. Rollback the internal wifi init flag when wifi init fail
2017-09-07 11:01:12 +08:00
Angus Gratton 4809c70899 Merge branch 'feature/register_heaps_runtime' into 'master'
heap: Support adding new heap regions at runtime

See merge request !1159
2017-09-07 10:18:21 +08:00
michael 73ba29e6df refactor(intr): remove useless tags in the debug log. 2017-09-06 15:20:04 +08:00
michael c82e51cf79 fix(intr): always assign the same intr to a same source, disable the source only when all the handlers disabled.
also document handlers sharing a same source.

TW#13454, https://github.com/nodemcu/nodemcu-firmware/issues/1874

Breaking change: handles assigned to a same source should have the same flag now.
2017-09-06 15:20:01 +08:00
Alexey Gerenkov 5094965e98 According to comments 2017-09-06 10:30:23 +08:00
Alexey Gerenkov 0b09c7006d pthread: Initial version of thread API 2017-09-06 10:30:23 +08:00
Jeroen Domburg 604308f4ab Merge branch 'bugfix/soft_reboot_psram' into 'master'
Fix rebooting when external RAM is active

See merge request !1207
2017-09-05 15:43:30 +08:00
Angus Gratton 74d5f85c53 Merge branch 'feature/build_warn_undefined_vars' into 'master'
Add --warn-undefined-variables to MAKEFLAGS (github #138)

See merge request !1214
2017-09-05 15:39:48 +08:00
Angus Gratton 8670844acf build system: Restore ifdef/ifndef in Makefiles, clean up examples build 2017-09-05 16:11:03 +10:00
Deomid Ryabkov 9903ea1c11 Add --warn-undefined-variables to MAKEFLAGS
Fix warnings where undefined vars are used.

Make Kconfig emit "FOO=" for unset bool options
To ensure make variables are always defined, even if empty.

When writing auto.conf, include symbols disabled by dependency to make sure all make variables are always defined.

Fixes espressif/esp-idf#137

Cherry-picked from https://github.com/espressif/esp-idf/pull/138
2017-09-05 16:10:46 +10:00
Angus Gratton 5361c08989 heap: Support adding new heap regions at runtime
To facilitate this, the list of registered heap regions is now a linked list
(allowing entries to be appended at runtime.)
2017-09-05 14:07:02 +10:00
Ivan Grokhotkov 8433fed7f4 Merge branch 'bugfix/core_dump_loop' into 'master'
esp32: Fixes infinite loop caused by exception during core dumping

See merge request !1210
2017-09-05 11:40:31 +08:00
Ivan Grokhotkov c007213fed Merge branch 'bugfix/deep_sleep_wakeup_stub' into 'master'
deep sleep: don't use protected DPORT access in wake stub

See merge request !1194
2017-09-05 11:22:52 +08:00
Alexey Gerenkov fb8b0c534a esp32: Fixes infinite loop caused by exception during core dumping 2017-09-05 11:15:27 +08:00
Jeroen Domburg 0e74ec67be Fix rebooting when PSRAM is active 2017-09-04 19:00:47 +08:00
Angus Gratton a19aaf2072 esp32: Update wifi lib to use new spinlock implementation 2017-09-04 19:11:51 +10:00
Jeroen Domburg 34372a091c Add initial SPI RAM support. This adds support for an ESP-PSRAM32 chip connected to the default flash pins and GPIO 16 and 17. The RAM is mapped to address 0x3F800000, but otherwise ignored by esp-idf as of yet. 2017-09-04 12:05:49 +08:00
Ivan Grokhotkov b9ff771e2c deep sleep: don't use protected DPORT access in wake stub 2017-09-01 18:35:42 +08:00
Ivan Grokhotkov 5666fc0a56 Merge branch 'feature/esp_timer_improvements' into 'master'
esp_timer improvements

See merge request !1172
2017-09-01 16:14:01 +08:00
Ivan Grokhotkov f31efb697c newlib: rename esp_setup_time_syscalls to esp_set_time_from_rtc
This function no longer sets up syscalls, and new name reflects its
purpose better.
2017-09-01 10:36:14 +08:00
Ivan Grokhotkov d2acf1ce77 sleep: add light sleep, factor out APIs common for deep/light sleep 2017-09-01 10:36:14 +08:00
Ivan Grokhotkov 65b046f17f dport access: introduce pause/resume instead of deinit 2017-09-01 10:36:14 +08:00
Ivan Grokhotkov 06af8cd086 esp_timer: return signed timestamp (int64_t)
Since timestamps are 64-bit, loosing one bit of range due to sign does
not present an issue, however for applications doing calculations on
timestamps, signed return type is more convenient.
2017-09-01 10:34:36 +08:00
Ivan Grokhotkov c5632d3012 esp32: use ref_clock in esp_timer and delay tests 2017-09-01 10:34:36 +08:00
Ivan Grokhotkov 1af6384349 esp_timer: lock-free implementation of esp_timer_get_time
The implementation of esp_timer_get_time used a critical section, which
resulted in a call time of ~1.8us. To make esp_timer_get_time more
useable as a high-resolution time source, this change replaces the lock
with polling. Call time is reduced to ~0.7us.
2017-09-01 10:34:36 +08:00
Ivan Grokhotkov d4e950d311 Merge branch 'feature/cxx_exceptions' into 'master'
Partial support for C++ exceptions

See merge request !930
2017-09-01 00:27:41 +08:00
Geza Husi eb8bd937c6 deep_sleep: RTC-GPIO pin calculation incorrect
Merges https://github.com/espressif/esp-idf/pull/822
2017-08-30 17:55:00 +10:00
Lacy Rhoades c61b3e89f1 Typo fixes
Merges https://github.com/espressif/esp-idf/pull/831
2017-08-30 17:55:00 +10:00
Deomid Ryabkov 8c1acb0363 Provide a default for CONFIG_BT_RESERVE_DRAM
...when BT is not built

Merges https://github.com/espressif/esp-idf/pull/910
2017-08-30 17:55:00 +10:00
Ivan Grokhotkov a25eb825e1 Merge branch 'bugfix/dport_protect_crypto' into 'master'
add protection for crypto registers in DPORT

See merge request !928
2017-08-30 11:45:35 +08:00
Ivan Grokhotkov 547ef83020 Merge branch 'feature/disable_some_perip_clk_when_cpu_start' into 'master'
Disable some peripheral clocks when cpu starts

See merge request !1089
2017-08-30 11:43:38 +08:00
Angus Gratton 1e22bcdfde esp32: Add KConfig option to disable ROM Console fallback on first boot 2017-08-29 14:52:00 +10:00
XiaXiaotian 4776f73ca4 Disable some peripheral clocks when cpu starts
All peripheral clocks are default enabled after chip is powered on.
    When CPU starts, if reset reason is CPU reset, disable those clocks
    that are not enabled before reset. Otherwise, disable all those
    useless clocks.
    These peripheral clocks must be enabled when the peripherals are
    initialized and disabled when they are deinitialized.
2017-08-29 11:18:42 +08:00
Ivan Grokhotkov 82763a02af Merge branch 'feature/ets_timer' into 'master'
esp_timer: add high-resolution timer api

See merge request !1090
2017-08-28 16:38:11 +08:00
Jeroen Domburg a589411a3c Place uart_tx_wait_idle in IRAM 2017-08-28 11:35:27 +08:00
Ivan Grokhotkov d8b66e5088 soc: release interrupts which are not reserved by timers any more 2017-08-28 11:35:27 +08:00
Ivan Grokhotkov 857a29872d esp_timer: add high resolution software timer API 2017-08-28 11:35:26 +08:00
Jeroen Domburg 3e4627479b Place uart_tx_wait_idle in IRAM 2017-08-25 17:46:28 +08:00
Angus Gratton 703d143619 hwcrypto: Fix bug with concurrent SHA access
If two different types of SHA hashes were active in the hardware
concurrently, a race condition meant the SHA unit could be incorrectly
reset leading to all-zero results.
2017-08-25 16:08:03 +10:00
Angus Gratton afb6119504 dport access: Fix WDT bug (permanent locking) in non-pinned tasks
If scheduler switches cores in narrow window during esp_dport_access_stall_other_cpu_start(), could cause the stall
interrupt to occur on the running CPU - halting the CPU until WDT cleans up.

Related to https://github.com/espressif/esp-idf/issues/630
2017-08-25 16:08:03 +10:00
Angus Gratton 50e0a54630 esp32 hwcrypto: Use spinlock instead of lock to protect AES
More than doubles performance of mbedTLS AES self-tests.
2017-08-25 16:08:03 +10:00
Angus Gratton 2624e10055 esp32 hwcrypto: Use AES registers directly 2017-08-25 16:08:03 +10:00
Angus Gratton e256fb6d96 hwcrypto: Use DPORT-safe accesses with AES 2017-08-25 16:08:03 +10:00
Angus Gratton d0c300c52d hwcrypto: SHA acceleration using safe DPORT reads 2017-08-25 16:08:03 +10:00
Angus Gratton cb31222e8b dport access: Add _DPORT_REG_SET_BIT & _DPORT_REG_CLR_BIT 2017-08-25 16:08:02 +10:00
Angus Gratton dc8c33892e dport access: Fix nested calls to DPORT_STALL_OTHER_CPU_START() 2017-08-25 16:08:02 +10:00
Wu Jian Gang 791daea835 Merge branch 'bugfix/xtal_freq_40' into 'master'
esp32: by default, set 40MHz crystal frequency

See merge request !1140
2017-08-24 20:40:22 +08:00
Ivan Grokhotkov 0ead095512 Merge branch 'bugfix/dport_stall_in_esp32_component' into 'master'
Also do dport stalling in esp32 component

See merge request !1141
2017-08-24 14:35:16 +08:00
Ivan Grokhotkov 327f0b6225 Merge branch 'bugfix/menuconfig_phy' into 'master'
component/esp32 : move Phy out of Wifi section

See merge request !1145
2017-08-24 14:34:56 +08:00
Jiang Jiang Jian d42208ffe8 Merge branch 'bugfix/ampdu_default_wifi_settings' into 'master'
wifi: Fix compilation error in WIFI_INIT_CONFIG_DEFAULT() if AMPDU disabled

See merge request !1139
2017-08-24 11:02:54 +08:00
Wang Jia Lin f1ecffb46c Merge branch 'bugfix/touch_pad_driver' into 'master'
driver(touch): fix bug and add more features

See merge request !1056
2017-08-23 19:12:39 +08:00
Tian Hao 08221589fc component/esp32 : move Phy outof Wifi section
1. move Phy out of Wifi section
2. lowercase the Ethernet and Phy from 2nd letter.
2017-08-23 17:51:31 +08:00
Jeroen Domburg 123966deea Also do dport stalling in esp32 component 2017-08-23 16:43:57 +08:00
Ivan Grokhotkov 9a8c0392f5 esp32: by default, set 40MHz crystal frequency 2017-08-23 16:33:26 +08:00
Angus Gratton 83a3241341 wifi: Fix compilation error in WIFI_INIT_CONFIG_DEFAULT() if AMPDU disabled 2017-08-23 09:33:47 +10:00
Wangjialin 842caaab21 driver(touch): fix bug and add more features
1. add sens_struct.h
2. add definition of RTCCNTL and RTCIO
3. modify touch pad examples
4. update example code.
5. add comments add option in menuconfig
6. fix issue that pad index 8 and 9 are mismatched
7. add touch_pad_read_filtered() api to get value filtered by iir filter
8. modify touch pad isr func
9. Make the items in perihperal.ld in the sequence of address
10. delete Kconfig for touch pad
11. add touchpad filter APIs to adjust the filter
12. add touch_pad into index.rst
13. add touch_pad in Doxyfile
14. add touch_pad.rst
2017-08-22 21:21:39 +08:00
Ivan Grokhotkov fb43948413 Update several Kconfig files to make help texts compatible with ReST 2017-08-22 14:34:19 +08:00
Deng Xin d739e6bf05 WPA2:Fix the issue memory leak when run wifi enterprise
fix the issue memory leak when run wpa2
2017-08-22 10:49:31 +08:00
Jiang Jiang Jian fc85cb683d Merge branch 'feature/wifi_and_ip_event_process_refactor' into 'master'
Feature/wifi and ip event process refactor

See merge request !986
2017-08-21 19:49:30 +08:00
Ivan Grokhotkov 489c523870 vfs: support for blocking reads, more newline conversion options
Previously VFS driver for UART could only use simple non-blocking
functions to read from and write to the UART. UART driver provides more
complex blocking and interrupt-driven functions, which can be used
instead.
This commit adds optional support for using UART driver's functions.

Also added is a more flexible mechanism for configuring newline
conversion rules on input and output.

This commit also fixes a bug that all UARTs shared one static variable
used as a character buffer in newline conversion code. This variable is
changed to be per-UART.
2017-08-21 15:58:28 +08:00
Liu Zhi Fu b45433110f tcpip_adapter/lwip: optimize wifi/ip event 2017-08-21 14:36:44 +08:00
Kedar Sovani 4c1c62a453 wifi: refactor code to match ethernet's init function structure 2017-08-18 08:33:02 +05:30
Kedar Sovani 8348a71847 ethernet: remove CONFIG_ETHERNET
1. Hello World application shows no footprint difference before and
after this change
2. examples/ethernet/ethernet application compiles properly (can't
test with my board)
2017-08-18 08:31:43 +05:30
Kedar Sovani 6405d6f874 kconfig: Add an option for skipping binary blobs 2017-08-16 15:55:42 +05:30
Kedar Sovani ba8cd58b08 kconfig: Remove Wi-Fi on/off as a menuconfig option
This is no longer required since the functions automatically get
pulled in based on the usage. A quick summary of footprint
comparisions before and after these set of patches is shown below:

Hello-World: (simplified for readability)
 old Total image size:~ 104902 bytes (.bin may be padded larger)
 old Total image size:~ 105254 bytes (.bin may be padded larger)
 Per-archive contributions to ELF file:
             Archive File DRAM .data & .bss   IRAM Flash code & rodata   Total
 old              libesp32.a       1973    177   4445       3939     2267   12801
 new              libesp32.a       1973    185   4473       3939     2267   12837

 new             libnvs_flash.a          0     92      0        274        8     374
 new             libstdc++.a          0      0      0         24        0      24

For some reason, nvs_flash.a (~400bytes) gets pulled in (particularly
the nvs_flash_init() function).

Power-Save: (simplified for readability)
 old Total image size:~ 421347 bytes (.bin may be padded larger)
 old Total image size:~ 421235 bytes (.bin may be padded larger)

 old      libtcpip_adapter.a          0     81      0       1947      115       2143
 new      libtcpip_adapter.a          0     69      0       1897      115       2081

The size actually shrinks a bit, since the AP interface function
doesn't get pulled in.
2017-08-16 15:55:28 +05:30
Kedar Sovani a24130b390 tcpip_adapter: Decompose tcpip_adapter_start() into interface specification options
Since only the used interface's start function gets called, it pulls
in only the functions that are required in the current application,
thereby saving footprint.
2017-08-16 15:54:29 +05:30
Kedar Sovani 159e7e81b4 esp32: Make 'restart' function independent of Wi-Fi
Restart being a lower-layer system-level function, needn't depend on
the higher level Wi-Fi libraries.

This also enables us to get rid of one more WIFI_ENABLED ifdef check
2017-08-16 15:54:28 +05:30
Kedar Sovani a41b1a9d1f esp32: Register event handlers on the esp_wifi_init() call 2017-08-16 15:54:28 +05:30
Kedar Sovani 55a6aca355 wifi: Map esp_wifi_init() to esp_wifi_init_internal()
Follow-on patches will include additional functionality in
esp_wifi_init()
2017-08-16 15:54:28 +05:30
Kedar Sovani 8063b93497 wifi_lib: Update to the change in the wifi_lib repository 2017-08-16 15:54:13 +05:30
Deng Xin 57bc38d867 Add the fast crypto function in supplicant
optimize the speed when do wifi connect
2017-08-09 21:36:13 +08:00
XiaXiaotian 1c4f7f2081 add get and set wifi maximum transmit power API 2017-07-28 15:06:52 +08:00
Liu Zhi Fu c99c5d13e6 esp32: add menuconfig options to configure BA window
Make AMPDU Block Ack Window configurable in menuconfig because we need to configure it
in some special cases, such as iperf test etc
2017-07-25 13:11:38 +08:00
Ivan Grokhotkov 292c2abd3b Merge branch 'bugfix/init_nvs_in_bluetooth' into 'master'
bt: call nvs_flash_init in examples, show error if NVS is not initialized

See merge request !1003
2017-07-20 14:25:49 +08:00
Angus Gratton 105c4b7386 Merge branch 'feature/esptool_image_padding' into 'master'
esptool: Optimise app image size by using RAM-loaded data for padding

See merge request !1017
2017-07-19 15:52:22 +08:00
Angus Gratton 2d9770fd00 linker script: Add some comments about significance of 0x18 byte offset 2017-07-19 17:38:05 +10:00
Angus Gratton c230e4280c linker scripts: Limit DROM/IROM section lengths correctly 2017-07-19 16:33:48 +10:00
Angus Gratton d92c541b1a esptool: Optimise generated image size by using RAM-loaded data for padding
Can save almost 128KB from some images.
2017-07-19 16:24:17 +10:00
Angus Gratton d664e32394 build system: Use component.mk for all components, refactor bootloader build
For config-only components, component.mk should now contain "COMPONENT_CONFIG_ONLY := 1"

Also refactored some of the generation of linker paths, library list. This required cleaning up the way the bootloader
project works, it's now mostly independent from the parent.
2017-07-19 09:10:48 +10:00
Ivan Grokhotkov 0ae916d555 Merge branch 'feature/high_level_interrupts' into 'master'
Break out high-level interrupts so a component can override them

See merge request !675
2017-07-18 10:42:31 +08:00
Angus Gratton 4029ed1df4 Merge branch 'bugfix/rom_gpio_typo' into 'master'
bugfix(typo): fix typo in rom/gpio.h

See merge request !1009
2017-07-18 06:53:30 +08:00
Ivan Grokhotkov 979fce0df5 bt: call nvs_flash_init in examples, show error if NVS is not initialized
NVS is used to store PHY calibration data, WiFi configuration, and BT
configuration. Previously BT examples did not call nvs_flash_init,
relying on the fact that it is called during PHY init. However PHY init
did not handle possible NVS initialization errors.

This change moves PHY init procedure into the application, and adds
diagnostic messages to BT config management routines if NVS is not
initialized.
2017-07-17 21:29:50 +08:00
Wangjialin 10340d718f bugfix(typo): fix typo in rom/gpio.h 2017-07-17 15:41:02 +08:00
Angus Gratton e50870c2dc Merge branch 'bugfix/bootloader_stack_smash' into 'master'
Fix crashes when >approx 185KB of DRAM is statically allocated

See merge request !983
2017-07-17 14:11:35 +08:00
Angus Gratton f824829a13 Merge branch 'bugfix/dont_link_unused_data_sections' into 'master'
ld: Save RAM by removing unused .data sections at link time

See merge request !985
2017-07-17 14:10:12 +08:00
Jiang Jiang Jian fc4d3df890 Merge branch 'bugfix/tw13744_make_low_rate_work' into 'master'
esp32: update wifi lib to make low rate work

See merge request !965
2017-07-13 14:26:02 +08:00
Ivan Grokhotkov 7fc25f18d2 Merge branch 'feature/enable_brownout_detector' into 'master'
Enable brownout detector

See merge request !811
2017-07-13 11:40:37 +08:00
Angus Gratton d8d2933bde Merge branch 'bugfix/gdbstub_handler_noreturn' into 'master'
gdbstub: Mark the panic handler entry as noreturn

See merge request !975
2017-07-12 17:23:59 +08:00
Angus Gratton cfbb1a652b Merge branch 'doc/esp_random' into 'master'
esp_random: Add some documentation about using before RF subsystem is on

See merge request !976
2017-07-12 16:18:43 +08:00
Angus Gratton 99fe61716c startup: Add assertion checks around various initialisation sequences
These may fail if close to 192KB of static RAM is allocated (remaining early heap RAM is too small.)
2017-07-12 13:06:56 +08:00
Angus Gratton 2b0f623259 bootloader/early boot: Error out if >192KB of static DRAM is allocated (temporary fix)
Currently the last 128KB of DRAM is reserved for the bootloader & early boot stacks. This means if >192KB of static DRAM
is allocated, the only available heap is this region - which is disabled until the scheduler starts. As a result, you
get either heap corruption on early boot if the static data overlaps startup heap (leading to very weird errors), or
FreeRTOS will fail to start when it can't malloc() anything.

Long term fix is to move the stacks & bootloader data to the very end of RAM, and only reserve that part for early
boot. This is a little fiddly because of also wanting to make sure this memory is not preemptively fragmented when it
gets reintroduced to the heap. This will become more important if/when we have more static allocation options in the
future.

For now, these errors make it clear why the boot has failed.

Ref TW13909
2017-07-12 13:06:56 +08:00
Angus Gratton 187b5fb888 ld: Remove unused .data sections at link time
Reduces static RAM, code size.
2017-07-12 13:05:54 +08:00
Angus Gratton 3bb90bab97 esp_random: Add some documentation about using before RF subsystem is on 2017-07-11 14:27:20 +08:00
Angus Gratton c049cd55a6 gdbstub: Mark the panic handler entry as noreturn
Fixes a warning in panic.c when this panic mode is enabled.
2017-07-11 10:18:08 +08:00
Angus Gratton 71c70cb15c heap: Refactor heap regions/capabilities out of FreeRTOS
Remove tagged heap API, rename caps_xxx to heap_caps_xxx

Also includes additional heap_caps_xxx inspection functions.
2017-07-10 17:46:03 +08:00
Angus Gratton 5ee49fd311 heap: Add new multi_heap heap implementation to replace FreeRTOS-based tagged heaps 2017-07-10 17:46:03 +08:00
Ivan Grokhotkov 01b185977c brownout detector: enable by default
Because of errata related to BOD reset function, brownout is handled as follows:

- attach an ISR to brownout interrupt
- when ISR happens, print a message and do a software restart
- esp_restart_nonos enables RTC watchdog, so if restart fails,
  there will be  one more attempt to restart (using the RTC
  watchdog)
2017-07-10 17:25:55 +08:00
Ivan Grokhotkov 780569c04a esp32: fix RTC watchdog configuration in esp_restart
RTC watchdog didn’t have any actions configured for any of the stages.
This change configures it to use SW_SYSTEM_RESET at stage 0 and a
full reset at stage 1. The timeout is now calculated based on
RTC_SLOW_CLK frequency.
2017-07-10 17:21:49 +08:00
Liu Zhi Fu e1f13eda49 esp32: update wifi lib to make low rate work
Make low rate work
2017-07-07 22:05:54 +08:00
Jeroen Domburg d3290479b2 Merge panic and dport high level interrupt code to both use int level 4 2017-07-07 12:51:33 +08:00
Jeroen Domburg 1d748db209 Break out high-level interrupts so a component can override them 2017-07-07 12:51:33 +08:00
Ivan Grokhotkov a054ced740 esp_chip_info: populate ‘model’ field 2017-07-06 11:01:40 +08:00
Ivan Grokhotkov ef63811e6d phy_init: fix log level for "PHY data partition validated" message 2017-07-05 11:29:53 +08:00
Ivan Grokhotkov 0837b3b743 Merge branch 'doc/wifi_set_vendor_ie' into 'master'
Document the WiFi Vendor-Specific Information Element API

See merge request !933
2017-06-30 16:37:18 +08:00
Angus Gratton 9297edaf60 ipc task: Allow configuration of IPC task stack size
Fixes regression in 3fe0022ef
2017-06-30 15:04:19 +10:00
Angus Gratton 5c925bf96e esp_wifi.h: Document the Vendor-Specific Information Element functions 2017-06-29 17:29:23 +10:00
Angus Gratton b3603ccf58 esp_wifi header: Fix typo 2017-06-29 17:19:17 +10:00
Angus Gratton 3fe0022efa stack sizes: Revert stack size increases added in 8d43859
Set min stack size to 2048 if AppTrace support is enabled, 512 bytes otherwise.
2017-06-29 14:57:13 +10:00
Angus Gratton 415a7d742a dport_access: Fix spurious warning in unicore mode, refactor 2017-06-29 13:57:13 +10:00
Ivan Grokhotkov 9b955f4c9f Merge branch 'feature/sysview_via_apptrace' into 'master'
sysview via apptrace

See merge request !708
2017-06-29 08:40:13 +08:00
Jan Mrázek f698a1b2d3 Add missing support for C++ exceptions
Specifying -fexceptions for the compiler is not enough.

- add necessary zero padding after .eh_frame section
- link .gcc_except_table_table in a way flash script does not complain
- call __registrer_frame_info before global constructors

Kudos jcmvbkbc for the necessary help.
2017-06-28 13:53:42 +08:00
Alexey Gerenkov 8d43859b6a esp32: SEGGER SystemView Tracing Support
Implements support for system level traces compatible with SEGGER
SystemView tool on top of ESP32 application tracing module.
That kind of traces can help to analyse program's behaviour.
SystemView can show timeline of tasks/ISRs execution, context switches,
statistics related to the CPUs' load distribution etc.

Also this commit adds useful feature to ESP32 application tracing module:
 - Trace data buffering is implemented to handle temporary peaks of events load
2017-06-27 20:52:43 +03:00
Ivan Grokhotkov 3f8f618df5 Merge branch 'feature/lwip_expose_more_config' into 'master'
lwip: Expose more config in IDF menuconfig

See merge request !909
2017-06-27 12:53:42 +08:00
Ivan Grokhotkov aeeb6cff17 Merge branch 'test/add_dual_core_dport_access_unit_test_case' into 'master'
test: add UT case for accessing dport and apb at the same time

See merge request !910
2017-06-27 12:47:37 +08:00
Liu Zhi Fu a7ef510551 esp32: update wifi lib to fix a sniffer issue
Fix sniffer only receives the first MDPU in AMPDU when the AMPDU is not for our station/soft-AP
2017-06-24 10:45:20 +08:00
He Yin Ling 7c6208c9e0 test: add UT case for dual dport and apb access 2017-06-23 16:15:57 +08:00
Jiang Jiang Jian 1480251aa7 Merge branch 'bugfix/spiflash_rom_symbols' into 'master'
spiflash rom: Add symbols accidentally removed in refactor

See merge request !804
2017-06-23 15:24:04 +08:00
Angus Gratton 8aa09aea10 event handler: Add debug event handler for confirmed IPv6 LL address 2017-06-23 16:15:16 +10:00