Commit graph

926 commits

Author SHA1 Message Date
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 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
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