Commit graph

1722 commits

Author SHA1 Message Date
Wangjialin 315aa1fcd8 Fix uart tx function block issue
To enable tx empty interrupt each time the tx ringbuffer get filled, so that tx function will not block if tx data length is larger than tx ringbuffer size.
Reported from customer of Audio team.
2017-04-12 16:57:37 +08:00
Ivan Grokhotkov 935552427c Merge branch 'bugfix/uart_rmt_fixes' into 'master'
Fixes for UART and RMT drivers

- Add const qualifier for config and tx data in RMT (https://github.com/espressif/esp-idf/pull/495)
- Fix rmt_set_tx_thr_intr_en(): check evt_thresh only in enable path (https://github.com/espressif/esp-idf/pull/492)
- Fix impossible check in uart_set_line_inverse (https://github.com/espressif/esp-idf/pull/489)

See merge request !648
2017-04-12 10:39:22 +08:00
Ivan Grokhotkov 9edab21385 Merge branch 'feature/rtc_clk_impl' into 'master'
Introduce soc component, add source of rtc_clk and rtc_pm libraries

This MR adds parts of the RTC library source code (initialization, clock selection functions, sleep functions). WiFi-related power management functions are kept inside the precompiled library. Most of RTC library APIs have been renamed.

Default CPU frequency option in Kconfig is set to 160MHz, pending qualification of 240MHz mode at high temperatures.

Register header files are moved into the new soc component, which will contain chip-specific header files and low-level non-RTOS-aware APIs (such as rtc_ APIs). Some of the files from ESP32 component were also moved: cpu_util.c, brownout.c, and the corresponding header files. Further refactoring of ESP32 component into more meaningful layers (chip-specific low level functions; chip-specific RTOS aware functions; framework-specific RTOS-related functions) will be done in future MRs.

See merge request !633
2017-04-12 10:38:23 +08:00
Ivan Grokhotkov 90e740eb5f esp32: update libraries
This removes librtc_{clk,pm}.a and updates librtc.a to use the new
functions defined in ESP-IDF source code.
2017-04-11 20:20:35 +08:00
Ivan Grokhotkov 1132ef7554 Merge branch 'bugfix/flash_busy_check_Wait_SPI_Idle' into 'master'
Bugfix/flash busy check wait spi idle

This branch moves some ROM SPI flash driver to IDF to fix bug in Wait_SPI_Idle() function.
Also it applies code style rules of IDF to integrated ROM driver sources.

See merge request !584
2017-04-11 20:09:06 +08:00
devsaurus ae94fe04ef components/driver/rmt: Add const qualifier for config and tx data. 2017-04-11 18:55:56 +08:00
devsaurus cc164b0dc3 fix rmt_set_tx_thr_intr_en(): check evt_thresh only in enable path 2017-04-11 18:55:56 +08:00
shinyquagsire23 8e89a136e1 Fix impossible check in uart_set_line_inverse 2017-04-11 18:55:56 +08:00
Ivan Grokhotkov 7ee8ee8b7e soc: add source code of rtc_clk, rtc_pm 2017-04-11 15:45:54 +08:00
Ivan Grokhotkov 9ff446e6f9 soc: convert line endings to unix 2017-04-11 15:44:22 +08:00
island a4f3312d9d bt component: optimize scan feature
1. Add advertising data length and scan response length in scan result
2. Add scan continuously feature
3. Fix non connectable adv topology error
4. Increase BTC queue size
2017-04-11 14:20:20 +08:00
Ivan Grokhotkov d6dbf15a1f soc: move header files into soc component 2017-04-11 14:06:40 +08:00
Ivan Grokhotkov 724673be83 soc: add apb_ctrl, struct headers for rtc_cntl and rtc_io 2017-04-11 14:06:40 +08:00
Alexey Gerenkov 0860f46220 spi_flash: Fixed bug in SPI flash ROM driver to work with embedded flash chip
1) fixed SPI_read_status: added check for flash busy flag in matrix mode
2) fixed SPI_page_program: enable write before writing data to SPI FIFO
3) SPI flash ROM funcs replacement is controlled via menuconfig option
2017-04-11 10:51:19 +08:00
Ivan Grokhotkov e9913a11c1 Merge branch 'test/reboot_between_unit_test_cases' into 'release/v2.0'
CI: add reset between running each unit test cases

Unit test is designed to detect bug **within** each test case. Therefore we'll reset between each case to provide a clean context. We will later add stress cases to run unit test cases together to detect potential bugs.

See merge request !636
2017-04-10 12:59:49 +08:00
Ivan Grokhotkov 801b87b48a Merge branch 'bugfix/cross_core_int_init_single_core' into 'master'
esp32: initialize cross-core interrupt in single core mode

The software interrupt originally used as the cross-core interrupt is
now also used to yield from a FreeRTOS critical section; therefore it
must be initialized for single core mode as well.

Fixes https://github.com/espressif/esp-idf/issues/496

See merge request !640
2017-04-10 12:19:10 +08:00
Ivan Grokhotkov aa817a1475 Merge branch 'bugfix/esp_error_check_release_builds' into 'master'
fix warnings generated by ESP_ERROR_CHECK(variable) in release builds

This uses the same pattern as “assert” in release builds to silence the
warning. At the same time, we make sure that if a statement is wrapped
into ESP_ERROR_CHECK, it is executed in release build as well.

Fixes https://github.com/espressif/esp-idf/issues/497

See merge request !641
2017-04-10 12:18:47 +08:00
Ivan Grokhotkov 05e6fba6c3 Merge branch 'feature/mdns_afl_fuzz' into 'master'
Feature/mdns afl fuzz

Implement AFL Fuzz for testing MDNS parser stability

See merge request !632
2017-04-10 11:55:31 +08:00
Ivan Grokhotkov 275b574ace fix warnings generated by ESP_ERROR_CHECK(variable) in release builds
This uses the same pattern as “assert” in release builds to silence the
warning. At the same time, we make sure that if a statement is wrapped
into ESP_ERROR_CHECK, it is executed in release build as well.
2017-04-07 15:24:58 +08:00
Ivan Grokhotkov 85e709705b Merge branch 'bugfix/btdm_task_priority' into 'master'
component/bt : modify bluetooth task priority

modify bluetooth task priority to lower than IPC task priority.

See merge request !631
2017-04-07 14:56:31 +08:00
Ivan Grokhotkov 8915c18f8a esp32: initialize cross-core interrupt in single core mode
The software interrupt originally used as the cross-core interrupt is
now also used to yield from a FreeRTOS critical section; therefore it
must be initialized for single core mode as well.

Fixes https://github.com/espressif/esp-idf/issues/496
2017-04-07 14:48:08 +08:00
Ivan Grokhotkov fd0539b4ba Merge branch 'feature/panic_wdt' into 'master'
esp32: RWDT is used to reboot system in case of panic handler crash

This branch uses RWDT to reboot system in case of panic handler crash.

See merge request !625
2017-04-07 12:14:30 +08:00
Ivan Grokhotkov 42d819e796 Merge branch 'feature/btdm_uart_hci' into 'master'
Feature/btdm uart hci

    1. support UART HCI, devolper need not to make a bridge between VHCI and UART.
    2. fix bug of rand/srand called in ISR.
    3. fix bug of BLE rx packets may cause assert.

See merge request !626
2017-04-07 12:13:42 +08:00
Alexey Gerenkov c142b9b9e5 esp32: RWDT is used to reboot system in case of panic handler crash
also fixes TG1WDG protection bug in panic handler
2017-04-07 02:34:29 +03:00
Tian Hao d90a35af19 component/bt : modify bluetooth config style 2017-04-06 11:35:53 +08:00
Ivan Grokhotkov f9fba35d1d Merge branch 'bugfix/btdm_alarm' into 'master'
component/bt : modify alarm APIs to be safely accessible from multiple tasks

Improve the osi_alarm module to make the alarm APIs become thread safe.

See merge request !570
2017-04-06 07:46:01 +08:00
Tian Hao 95d691afdb component/bt : support UART HCI and fix some bugs
1. support UART HCI, devolper need not to make a bridge between VHCI and UART.
2. fix bug of rand/srand called in ISR.
3. fix bug of BLE rx packets may cause assert.
2017-04-05 21:23:43 +08:00
Tian Hao f5ebeb4c4d component/bt : add uart(1/2) as HCI IO directly 2017-04-05 21:23:42 +08:00
Tian Hao e384c7c014 component/bt : modify alarm APIs to be safely accessible from multiple tasks 2017-04-05 17:34:26 +08:00
me-no-dev 4c2622755d Add AFL fuzz test 2017-04-05 09:23:09 +03:00
Angus Gratton 0b57054ed3 freertos tests: Extend preemption test cases to cross-core wakeup 2017-04-04 10:10:08 +10:00
Angus Gratton bdbeaf97d6 freertos tests: Fix accidental "0 delay" in event group tests
Was a slight race condition where tasks on other CPU may not have finished waking up on BIT_CALL when the unity task
polled the event group state.
2017-04-04 10:10:08 +10:00
Angus Gratton 45581dbaca freertos: Delay context switch from queue/task APIs until exiting critical section
Closes #374: https://github.com/espressif/esp-idf/issues/374
2017-04-04 10:10:08 +10:00
me-no-dev 99d39909c4 implement fixes for issues found while fuzz testing 2017-04-03 16:45:59 +03:00
Jiang Jiang Jian fc15d72038 Merge branch 'feature/implement_lwip_critical_protect_with_mutex' into 'master'
lwip: implement lwip critical session with mutex

Currently lwip critical session is based on interrupt, now replace it with mutex

See merge request !595
2017-04-01 17:27:20 +08:00
Tian Hao ecb75b69fd component/bt : modify bluetooth task priority 2017-04-01 17:17:57 +08:00
Liu Zhi Fu 68e27f8188 optimize tcpip adapter layer 2017-04-01 16:41:51 +08:00
Liu Zhi Fu 778a475136 lwip: implement lwip critical session with mutex
Currently lwip critical session is based on interrupt, now replace it with mutex
2017-04-01 16:24:58 +08:00
Jiang Jiang Jian 74d0edec0f Merge branch 'feature/tw10169_optimize_dhcp_renew_rebind_timer' into 'master'
lwip: optimize dhcp renew/rebind timer

This MR is used to replace MR581 since MR581 use a bad branch name.

See merge request !585
2017-04-01 16:04:13 +08:00
Ivan Grokhotkov 47b8f78cb0 Merge branch 'bugfix/flash_op_deadlock' into 'master'
spi_flash: fix race condition in s_flash_op_complete access

Flash operation complete flag was cleared by the CPU initiating flash operation. If the other core was running an ISR, then IPC task could be late to enter the loop to check `s_flash_op_complete` by the time next flash operation started. This would cause a deadlock, as the IPC task would still be waiting for `s_flash_op_complete` to be set (which was already cleared by the next flash operation), while the flash operation task would be blocked waiting for IPC task to set `s_flash_op_can_start`.

If the flag is cleared on the CPU waiting on this flag, then the race condition can not happen.

See merge request !615
2017-03-31 16:02:26 +08:00
Jeroen Domburg a4acf7b67b Merge branch 'bugfix/spi_timing_issues' into 'master'
Fix timing adjustment needed for higher speeds of SPI master bus.

Ref https://github.com/espressif/esp-idf/issues/363 . It was found out the master SPI driver didn't exactly calculate the delay compensation needed, breaking 20 and 26MHz full-duplex mode. This fixes these use cases. We also found out 40MHz full-duplex routed over the GPIO matrix does not work because of a hardware quirk; this MR adds a check/error for that case until we find a workaround.

See merge request !547
2017-03-31 10:44:37 +08:00
XiaXiaotian 4f89cc73e6 Add WiFi static and dynamic tx buffer choice
If static tx buffer is selected, WiFi tx buffers are allocated when WiFi is initialized and released

    when WiFi is de-initialized. If dynamic tx buffer is selected, WiFi tx buffer is allocated when tx

    data is delivered from LWIP to WiFi and released when tx data is sent out by WiFi.

    The size of each static tx buffers is fixed to about 1.6KB and the size of dynamic tx buffers is

    depend on the length of the data delivered from LWIP.

    If PSRAM is enabled, "STATIC" should be selected to guarantee enough WiFi tx buffers.

    If PSRAM is disabled, "DYNAMIC" should be selected to improve the utilization of RAM.
2017-03-30 21:25:44 +08:00
Jiang Jiang Jian 73612b004f Merge branch 'feature/add_scan_time_config' into 'master'
wifi scan: add wifi scan type and time config



See merge request !586
2017-03-30 20:56:30 +08:00
XiaXiaotian c690447dd9 wifi scan: add wifi scan type and time config 2017-03-30 20:36:52 +08:00
Ivan Grokhotkov 39c376f0c3 Merge branch 'bugfix/cpu1_isr_stack_location' into 'master'
Fix finding location of ISR stack space for CPU1

Up to now, the CPU1 interrupts erroneously used the area *after* the ISR stack region, leading to bugs in BT Classic. This fixes that.

See merge request !618
2017-03-29 12:05:31 +08:00
Angus Gratton 6ba469e7a4 Merge branch 'feature/mdns_dnssd_metaquery' into 'master'
mdns: add simple dns-sd meta query support

Merges PR #340 https://github.com/espressif/esp-idf/pull/340

See merge request !619
2017-03-29 09:29:31 +08:00
negativekelvin 96e8a3c725 mdns: add simple dns-sd meta query support
tabs to spaces

match domain
2017-03-29 11:48:19 +11:00
Jeroen Domburg 0e39b77d4e Fix finding location of ISR stack space for CPU1 2017-03-28 15:50:10 +08:00
Jeroen Domburg 76295c7a13 Fix timing adjustment needed for higher speeds of SPI master bus. 2017-03-28 11:31:59 +08:00
Ivan Grokhotkov 92436021ab spi_flash: fix race condition in s_flash_op_complete access
Flash operation complete flag was cleared by the core initiating flash
operation. If the other core was running an ISR, then IPC task could
be late to enter the loop to check s_flash_op_complete by the time next
flash operation started. If the flag is cleared on the CPU waiting on
this flag, then the race condition can not happen.
2017-03-28 01:34:17 +08:00