Commit graph

2011 commits

Author SHA1 Message Date
Yulong c31953a005 component/bt:Fixted the bug of HCI comment timeout error.
1. remove the SMP_INCLUDED == TRUE insite the btm_find_dev_by_handle function.
2. change the Kconfig with BT_ACL_CONNECTIONS
2017-04-26 04:23:45 -04:00
island a3717515a2 component/bt: Fix memory leakage, connection fail bugs
- Fix memory leakage while deregisting gatt app
- Fix Android connection failed problem
- Fix service_uuid_len error in adv data
2017-04-26 16:07:56 +08:00
Dmitry Yakovlev baeab37560 Debug info removed. 2017-04-26 10:31:05 +03:00
Yulong 891257b4dd component/bt:Change the bt Kconfig BT_ACL_CONNECTIONS from int to choice. 2017-04-26 02:28:34 -04:00
Ivan Grokhotkov 0fe765a977 Merge branch 'feature/32k_xtal' into 'master'
add support for 32k XTAL as RTC_SLOW_CLK source

- RTC_CNTL_SLOWCLK_FREQ define is removed; rtc_clk_slow_freq_get_hz
  function can be used instead to get an approximate RTC_SLOW_CLK
  frequency

- Clock calibration is performed at startup. The value is saved and used
  for timekeeping and when entering deep sleep.

- When using the 32k XTAL, startup code will wait for the oscillator to
  start up. This can be possibly optimized by starting a separate task
  to wait for oscillator startup, and performing clock switch in that
  task.

- Fix a bug that 32k XTAL would be disabled in rtc_clk_init.

- Fix a rounding error in rtc_clk_cal, which caused systematic frequency
  error.

- Fix an overflow bug which caused rtc_clk_cal to timeout early if the
  slow_clk_cycles argument would exceed certain value

- Improve 32k XTAL oscillator startup time by introducing bootstrapping
  code, which uses internal pullup/pulldown resistors on 32K_N/32K_P
  pins to set better initial conditions for the oscillator.

Ref TW11683.

Ref https://esp32.com/viewtopic.php?f=13&t=1570

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

See merge request !696
2017-04-26 14:01:59 +08:00
Dmitry Yakovlev 00aa73c6cf Restart sequence requires set up for app cpu. 2017-04-26 07:47:37 +03:00
Ivan Grokhotkov 6353bc40d7 Add support for 32k XTAL as RTC_SLOW_CLK source
- RTC_CNTL_SLOWCLK_FREQ define is removed; rtc_clk_slow_freq_get_hz
  function can be used instead to get an approximate RTC_SLOW_CLK
  frequency

- Clock calibration is performed at startup. The value is saved and used
  for timekeeping and when entering deep sleep.

- When using the 32k XTAL, startup code will wait for the oscillator to
  start up. This can be possibly optimized by starting a separate task
  to wait for oscillator startup, and performing clock switch in that
  task.

- Fix a bug that 32k XTAL would be disabled in rtc_clk_init.

- Fix a rounding error in rtc_clk_cal, which caused systematic frequency
  error.

- Fix an overflow bug which caused rtc_clk_cal to timeout early if the
  slow_clk_cycles argument would exceed certain value

- Improve 32k XTAL oscillator startup time by introducing bootstrapping
  code, which uses internal pullup/pulldown resistors on 32K_N/32K_P
  pins to set better initial conditions for the oscillator.
2017-04-26 12:43:22 +08:00
Angus Gratton 66726ec166 freertos: Enable vTaskSuspend()/vTaskResume() API
Adds relevant unit tests.

TW11878
2017-04-26 12:50:20 +10:00
Yulong 572e320795 component/bt:change the kconfig.
1.change the rowdata to rodata;
2.change BT_ACL_CONNECTIONS to Maximum BT/BLE connection count.
3. change the comments of bt_target.h:505 from 40 to 5.
2017-04-25 22:47:16 -04:00
Angus Gratton 08cfcbb6ea bootloader: Add some debug logging around OTA selection 2017-04-26 11:23:35 +10:00
Angus Gratton e2479b46f7 secure boot: Fix bootloader image verification failure
* Failure prevented secure boot from enabling.
* Also adds unit test cases for esp_image_basic_verify()

Ref https://esp32.com/viewtopic.php?f=2&t=1602
TW11878
2017-04-26 11:23:35 +10:00
Yulong a4d9aadeca component/bt:Merge the new master to this branch 2017-04-25 08:14:54 -04:00
Yulong 09f69fe9ea Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf 2017-04-25 07:58:24 -04:00
Ivan Grokhotkov b540322dc1 Merge branch 'feature/wear_levelling' into 'master'
wear levelling

This MR adds wear levelling component. It presents an interface similar to the interface of spi_flash and esp_partition. Inside, it stores data inside a partition to in a way that reduces worst case number of erase cycles for any given sector.

Also included are APIs similar to the ones provided for SDMMC to mount FAT filesystem on top of the wear levelling partition. A simple example shows how this API can be used.

Ref TW10338.

See merge request !567
2017-04-25 19:46:11 +08:00
Jeroen Domburg aaeb2bd110 Assert when a new task is started on a nonexisting CPU 2017-04-25 17:47:25 +08:00
Ivan Grokhotkov 8d6a03820a lwip: fix error when building on OS X, only build ppp if enabled
- reorder directories listed in COMPONENT_SRCDIRS so that
  subdirectories precede parent directories

- don’t include PPP source directories if PPP support is not enabled
2017-04-25 17:22:09 +08:00
Yulong 5544f98add component/bt:separate the SMP, GATT module set the macro output the function.
1. close classic bt, can save 233k code size;
2. close smp module, can save 136k code size;
3. close gattc module, can save 24k code size;
4. close gatts module, can save 16k code size;
4. close the bluedroid stack log, can save 120k code size.
2017-04-25 04:55:29 -04:00
Ivan Grokhotkov 8131c77860 Merge branch 'feature/xtal_freq_autodetect' into 'master'
XTAL frequency detection, support for selecting XTAL frequency

This MR adds more robust XTAL frequency detection code (which gets run in the bootloader) and an option to set XTAL frequency in Kconfig. By default we still use autodetection, since it is more reliable than the one used in ROM code.

This will help with issues about XTAL frequency detection in high ambient temperature conditions.

Ref TW12008

See merge request !694
2017-04-25 16:30:36 +08:00
Ivan Grokhotkov fdfa7e6cc2 Merge branch 'bugfix/sdmmc_timeout' into 'master'
sdmmc: handle card removal when CD is not used

When SD card is removed during transaction, SDMMC peripheral can report
a range of errors, such as timeouts, CRC errors, start/end bit errors.
Under normal conditions (card is inserted), SDMMC peripheral also generates
command done or data done interrupts. When the card is removed, such
interrupts may not be always generated.

This change fixes handling of timeout interrupts and SBE interrupts.
It also adds a one second timeout into the event processing loop. This
timeout allows applications to recover in cases when the SDMMC peripheral
doesn’t generate command/data done event on card removal.

Fixes TW11592.

See merge request !678
2017-04-25 16:27:12 +08:00
Jiang Jiang Jian 3f4e917ad6 Merge branch 'feature/ppp_over_serial' into 'master'
Enable experimental/unsupported PPP over Serial driver

From PR #272 https://github.com/espressif/esp-idf/pull/272

See merge request !690
2017-04-25 14:02:55 +08:00
Jiang Jiang Jian 937940c989 Merge branch 'bugfix/fatfs_sdmmc_cleanup' into 'master'
fat/sdmmc: unmount FATFS object on error

Failure to call f_mount(NULL,...) makes FATFS attempt to clean up the old
FS object upon next mount. If previous mount operation has failed, some
parts of FS object may not be fully initialized, which will cause errors
(such as attempting to delete a mutex which wasn’t allocated).

Fixes TW11594.

See merge request !679
2017-04-25 13:48:34 +08:00
Jiang Jiang Jian 775a1fbc6d Merge branch 'bugfix/remove_unneeded_header_file_including' into 'master'
remove unneeded header file including



See merge request !695
2017-04-25 13:23:03 +08:00
Yulong 45999b69d6 component/bt: Set the style to the same, output the macro in the function.
1.After the separate, can save 15k~25k ram & 240k~460k code size(depending on the menuconfig).
2017-04-24 23:46:37 -04:00
Jiang Jiang Jian 90c8bd93e0 Merge branch 'feature/ethernet_lan8720' into 'master'
ethernet: Add LAN8720 phy support, move PHY to components

Encompasses PR #383 https://github.com/espressif/esp-idf/pull/383

Also includes changes to move PHY support functions into ethernet component, similar to #398 https://github.com/espressif/esp-idf/pull/398/files.





See merge request !540
2017-04-24 17:03:37 +08:00
XiaXiaotian 0c358c37f5 remove unneeded header file including 2017-04-24 16:11:26 +08:00
Ivan Grokhotkov 6b237de909 Add XTAL frequency selection to Kconfig
This change allows XTAL frequency to be selected using menuconfig
2017-04-24 15:55:02 +08:00
Ivan Grokhotkov 3323f31cfb soc: implement XTAL frequency detection
ROM code already implements XTAL frequency detection, but it uses the 8M
clock before the clock tuning parameters are initialized. With the
zero clock tuning parameter, 8M clock has significant frequency deviation
at high temperatures, which can lead to erroneous detection of 40 MHz
crystal as a 26 MHz one.

This change adds XTAL frequency detection code to rtc_clk_init routine,
and detection is performed after the 8M clock tuning parameter as been
initialized.
2017-04-24 15:29:30 +08:00
Jiang Jiang Jian 99e461c676 Merge branch 'bugfix/tw7105_tcp_stable_test_abort_issue' into 'master'
lwip: fix tcp stable test abort issue

This MR covers following changes:
1. Modify dhcp server timer to 1 seconds
2. Enable ETHARP_TRUST_IP_MAC. Consider following scenario: we are in throughput test or traffic stability test, if this option is disabled, then every 5 minutes, the IP/MAC entry in arch cache is aged out, however, the traffic continuously send to lwip from application, because there is no IP/MAC entry in ARP cache, then the packets have to be buffered in ARP queue and a ARP request is triggered, but the ARP queue can only holds 3 packets, the later packets will be dropped, then if the traffic is big, a lot of packets will be dropped here before we get the right ARP response. For TCP, this will trigger re-transmit, it's intolerable for some application, such as real time audio, if re-transmit happen, then performance of voice will be impact. For UDP, sometimes it may also cause problem, such as DHCP, if here we failed to send the DHCP here, we has to wait the DHCP timeout etc... so this option is enabled here by default.

See merge request !681
2017-04-24 13:10:21 +08:00
Jiang Jiang Jian 733e404fcf Merge branch 'feature/optimize_text_rodata_in_iram_dram' into 'master'
optimize WiFi text rodata in iram dram

1. optimize text and rodata in wifi lib

2. update smartconfig

See merge request !668
2017-04-24 13:03:07 +08:00
Jiang Jiang Jian 29002a1c83 Merge branch 'feature/add_limit_for_all_dynamic_ebuf' into 'master'
esp32: update wifi lib for limitting dynamic wifi buffer

Add limit for all dynamic wifi ebuf to avoid wifi run out of memory in some extreme scanrio. 
The default max allocated dynamic tx buffer is 32
The default max allocated dynamic rx buffer is 64, make default value is bigger because when all packets we received are small packets, e.g. the length is 64Bytes, then 64K can hold 1000 packets, so 64 maybe a good candidate default value, anyway the customer can configure it via menuconfig.
The default dynamic wifi internal long/long-long mgmt is 32, generally 32 is enough for mgmt packet (beacon/auth/assoc/probe/null etc). Generally when all the 32 mgmt buffer is run out of memory, it means internal wifi state machine may has problem, we need to debug it.

See merge request !683
2017-04-24 11:49:50 +08:00
Jiang Jiang Jian 97142bb8db Merge branch 'feature/support_read_mac_addr_from_customer_efuse' into 'master'
Add customer MAC address that read from efuse



See merge request !673
2017-04-24 11:30:55 +08:00
XiaXiaotian 9d8425bd72 put RODATA of libphy.a into DRAM
There are some RODATAs of libphy.a that are called in ISR. So need
    to put them into DRAM to avoid access them when R/W SPI flash. Due
    to the RODATAs which are called in ISR haven't been picked out to
    put into DRAM, put all of the RODATA of libphy.a into DRAM. This
    will be optimized in the future.
2017-04-24 11:22:49 +08:00
Alexey Gerenkov 77a92e6dcc esp32: Added dumping info from traceport upon reset by any WDT
- Last PC info and waiti mode indication are printed for both CPUs
 - Raw traceport regs values are printed only for log levels higher than DEBUG
2017-04-23 22:07:56 +03:00
Yulong 2cfde4dfd9 compoent/bt:change the code style 2017-04-23 05:52:18 -04:00
Yulong 1016ab1c2a component/bt:separate the smp_br_connect_callback from the BLE only mode 2017-04-23 00:48:23 -04:00
Ivan Grokhotkov 404e89da4d Merge branch 'bugfix/rtc_reg_fields' into 'master'
soc: allow REG_SET_FIELD to be used for bit fields

- Fixes an issue with `rtc_clk_apll_enable`: https://esp32.com/viewtopic.php?f=13&t=1673
- Fixes `rtc_clk_fast_freq_set` function always selecting XTAL/4 as fast clock source.
- Fixes regression in deep sleep current (7uA instead of 5uA).

See merge request !674
2017-04-21 19:40:45 +08:00
Ivan Grokhotkov 8399ed900a Merge branch 'bugfix/xtal_freq_after_wdt_reset' into 'master'
rtc_clk_init: handle case when XTAL frequency has already been set

On first reset, ROM code writes the estimated XTAL frequency into
RTC_APB_FREQ_REG (aka STORE5). If the application doesn’t specify exact
XTAL frequency (which is always the case for now), rtc_clk_init will
guess what kind of XTAL is used (26M or 40M), based on the estimated
frequency. Later, detected frequency is written into RTC_XTAL_FREQ_REG
(aka STORE4).

When the application switches clock source to PLL, APB frequency changes
and RTC_APB_FREQ_REG is updated. If the application encounters an RTC
WDT reset, RTC_APB_FREQ_REG will not be updated prior to reset. Once the
application starts up again, it will attempt to auto-detect XTAL
frequency based on RTC_APB_FREQ_REG, which now has value of 80000000.
This will fail, and rtc_clk_xtal_freq_estimate will fall back to the
default value of 26 MHz. Due to an incorrect XTAL frequency, PLL
initialization will also take incorrect path, and PLL will run at a
different frequency. Depending on the application this may cause just
garbage output on UART or a crash (if WiFi is used).

This change checks if RTC_XTAL_FREQ_REG has already been set before trying
to estimate XTAL frequency based on the value of RTC_APB_FREQ_REG, and
uses RTC_XTAL_FREQ_REG value if it is valid.

Fixes TW11738.

See merge request !691
2017-04-21 19:38:46 +08:00
XiaXiaotian b238bc691d Do not put the whole object files into IRAM. Add attributes to the functions called in ISR instead. 2017-04-21 15:38:01 +08:00
XiaXiaotian 5553fbd537 add base MAC address storage choice.
Base MAC address can be stored in default manufacture-defined or customer
    pre-defined place in EFUSE and other place e.g. flash or EEPROM.
    If choose to use base MAC address which is stored in other place, please
    call esp_base_mac_addr_set_external() before initializing WiFi/BT/Ehternet.
2017-04-21 14:55:11 +08:00
Yulong b5989a6b26 component/bt:Recovery the btm_establish_continue when created the acl connection 2017-04-21 02:43:35 -04:00
Angus Gratton fd3ef4cdfe Merge branch 'bugfix/github_fixes' into 'master'
Various fixes from Github

Some one-line fixes from Github PRs.

See merge request !689
2017-04-21 12:27:32 +08:00
Angus Gratton 94a61389ff Merge branch 'bugfix/driver_const_params' into 'master'
components/driver: 'const' all config calls.

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

See merge request !687
2017-04-21 12:25:15 +08:00
Angus Gratton f3a567b65d PPPoS: Rearrange config items (move TCP/IP stack size to LWIP), mark as experimental/unsupported
Ref #272
2017-04-21 14:23:34 +10:00
Adrian Muzyka 47c722d674 Enable lwip PPPoS support
* Fix some lwip api bugs
 * Added PPP_SUPPORT parameter to lwip Kconfig
 * Added example pppos_client

Merges #272 https://github.com/espressif/esp-idf/pull/272
2017-04-21 14:23:34 +10:00
Liu Zhi Fu 561a1a64f2 esp32: update wifi lib for limitting dynamic wifi buffer
Add limit for all dynamic wifi ebuf to avoid wifi run out of memory in some extreme scanrio
2017-04-21 10:38:00 +08:00
Ivan Grokhotkov 6e9d60ef70 rtc_clk_init: handle case when XTAL frequency has already been set
On first reset, ROM code writes the estimated XTAL frequency into
RTC_APB_FREQ_REG (aka STORE5). If the application doesn’t specify exact
XTAL frequency (which is always the case for now), rtc_clk_init will
guess what kind of XTAL is used (26M or 40M), based on the estimated
frequency. Later, detected frequency is written into RTC_XTAL_FREQ_REG
(aka STORE4).

When the application switches clock source to PLL, APB frequency changes
and RTC_APB_FREQ_REG is updated. If the application encounters an RTC
WDT reset, RTC_APB_FREQ_REG will not be updated prior to reset. Once the
application starts up again, it will attempt to auto-detect XTAL
frequency based on RTC_APB_FREQ_REG, which now has value of 80000000.
This will fail, and rtc_clk_xtal_freq_estimate will fall back to the
default value of 26 MHz. Due to an incorrect XTAL frequency, PLL
initialization will also take incorrect path, and PLL will run at a
different frequency. Depending on the application this may cause just
garbage output on UART or a crash (if WiFi is used).
2017-04-21 10:33:58 +08:00
Angus Gratton 52c378b447 bluedroid: Fix compilation warnings related to aliasing
Merges PR #518 https://github.com/espressif/esp-idf/pull/518
2017-04-21 11:31:40 +10:00
Michael Kellner eeb0aaa09e spidriver: Display length errors correctly
SPI transfer length is bits, not bytes, so the error should indicate bits. Also, there are separate lengths for rx and
tx (confusingly named rxlength and length... if rxlength is 0, length is used). The code checks the tx length for the
rx, so it never validates rxlength.

Originally contributed as part of #511 https://github.com/espressif/esp-idf/pull/511
2017-04-21 11:03:07 +10:00
Jonathan Kaufmann bf82b441ae Fixed bug in ledc_set_fade_with_step where returned while holding critical section.
Merges PR #515 https://github.com/espressif/esp-idf/pull/515
2017-04-21 11:03:07 +10:00
Michael Kellner a523aa3ef5 mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets
Since mbedtls_net_errno is reset by fcntl, it is reset after calling
net_would_block, so the call to mbedtls_net_errno in mbedtls_net_recv
and mbedtls_net_send will always get back 0. This change propagates
the value returned by mbedtls_net_errno up through net_would_block,
to allow the correct error value to be used and avoid a redundant
call to mbedtls_net_errno.

Merges PR #511 https://github.com/espressif/esp-idf/pull/511
2017-04-21 10:46:34 +10:00
Yulong bc807a18d1 component/bt:Finish all the separate code from BT & BLE 2017-04-20 07:18:05 -04:00
Angus Gratton 453b5ded1d ethernet: Add convenience functions esp_eth_smi_wait_value() & esp_eth_smi_wait_set()
Covers the common case of waiting for a particular PHY register to have a particular value.
2017-04-20 18:03:00 +10:00
Angus Gratton 453722ba54 ethernet: Refactor PHY support to be part of ethernet component
Move generic PHY support into its own interface
2017-04-20 18:03:00 +10:00
Liu Zhi Fu ab37f89f55 lwip: fix tcp stable test abort issue
1. Modify dhcp server timer to 1 seconds
2. Enable ETHARP_TRUST_IP_MAC

modify according to review
2017-04-19 17:39:32 +08:00
Yulong 2723504473 add the GATTC_INCLUDED marco to close the bta_gattc module when not used the GATTC 2017-04-19 05:16:24 -04:00
Yulong 0ddadc98a3 separate the btm layer from SMP security 2017-04-19 03:44:01 -04:00
Ivan Grokhotkov 8f02730e1f fat/sdmmc: unmount FATFS object on error
Failure to call f_mount(NULL,...) makes FATFS attempt to clean up the old
FS object upon next mount. If previous mount operation has failed, some
parts of FS object may not be fully initialized, which will cause errors
(such as attempting to delete a mutex which wasn’t allocated).
2017-04-19 15:03:30 +08:00
Jiang Jiang Jian 29b32be97c Merge branch 'bugfix/tw11779_softAP_crash_when_wifi_connect' into 'master'
esp32: update wifi lib to fix wifi connect cause crash

Fix softap wifi connect crash bug

See merge request !672
2017-04-19 14:34:53 +08:00
Ivan Grokhotkov 49848eaed5 sdmmc: handle card removal when CD is not used
When SD card is removed during transaction, SDMMC peripheral can report
a range of errors, such as timeouts, CRC errors, start/end bit errors.
Under normal conditions (card is inserted), SDMMC peripheral also generates
command done or data done interrupts. When the card is removed, such
interrupts may not be always generated.

This change fixes handling of timeout interrupts and SBE interrupts.
It also adds a one second timeout into the event processing loop. This
timeout allows applications to recover in cases when the SDMMC peripheral
doesn’t generate command/data done event on card removal.
2017-04-19 12:50:51 +08:00
Yulong 65ff8bd160 l2cap can send data to low layer when close the classic bt. 2017-04-18 05:42:55 -04:00
Ivan Grokhotkov 5d1bb42c18 soc: allow REG_SET_FIELD to be used with single-bit fields 2017-04-18 17:34:26 +08:00
Ivan Grokhotkov faaf59ccb3 soc: define missing M, V macros for nrx, bb, fe, emac, iomux
Recipe:
- Add _M and _V for single-bit fields
  Search: (#define (\w+)\s*(\(BIT\(\d+\)\)))
  Replace: \1\n#define \2_M \3\n#define \2_V 1

- Add _M and _V for multi-bit fields
  Search: (#define (\w+)\s*(0x[\dA-Fa-f]+))
  Replace: \1\n#define \2_M (\2_V << \2_S)\n#define \2_V \3
2017-04-18 17:34:26 +08:00
Jeroen Domburg f73c6f875c Merge branch 'bugfix/dont_log_before_bss_inited' into 'master'
Remove ESP_EARLY_LOGI before bss is initialized; it crashes the CPU

There's an ESP_EARLY_LOGI line that can get called before the BSS is initialized; the early logging code doesn't cope well with that: it checks if FreeRTOS is up, but the variables it uses for that contains garbage because it isn't cleared yet, giving the wrong result. The logging code then tries to set a mux, crashing the entire system. This patch removes the log line and adds a warning at the BSS initialization line not to do anything complex before that point.

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

See merge request !671
2017-04-18 11:21:31 +08:00
Yulong 22ccf6c368 component/bt:rebase the BT_BLE_separate to the new master 2017-04-17 22:53:43 -04:00
Alexey Gerenkov 55f1a63faf esp32: Adds functionality for application tracing over JTAG
- Implements application tracing module which allows to send arbitrary
   data to host over JTAG. This feature is useful for analyzing
   program modules behavior, dumping run-time application data etc.
 - Implements printf-like logging functions on top of apptrace module.
   This feature is a kind of semihosted printf functionality with lower
   overhead and impact on system behaviour as compared to standard printf.
2017-04-17 23:26:29 +03:00
Ivan Grokhotkov ad50a70440 fix test for dumping trace data 2017-04-17 22:19:14 +03:00
Ivan Grokhotkov 639557d975 trace: add Kconfig options for app level trace
CONFIG_MEMMAP_TRACEMEM is now a hidden underlying option, which can be enabled using either CONFIG_ESP32_TRAX or CONFIG_ESP32_APP_TRACE
2017-04-17 22:19:14 +03:00
Ivan Grokhotkov 3ac080fc80 test tracing over JTAG 2017-04-17 22:19:14 +03:00
XiaXiaotian 03e2618d35 Add customer MAC address that read from efuse 2017-04-17 21:24:15 +08:00
Liu Zhi Fu b94e5f7855 esp32: update wifi lib to fix wifi connect cause crash
Fix softap wifi connect crash bug
2017-04-17 19:18:26 +08:00
Ivan Grokhotkov 3624149344 wear_levelling: add unit test sub-component 2017-04-17 11:01:18 +08:00
Ivan Grokhotkov 3a39475d20 wear_levelling: run host side test in CI 2017-04-17 11:01:18 +08:00
Ivan Grokhotkov 8f76fe1d7f move Catch framework header into tools directory 2017-04-17 11:01:18 +08:00
Ivan Grokhotkov 57e380fa99 nvs_flash, wear_levelling: ignore host test files 2017-04-17 11:01:18 +08:00
Ivan Grokhotkov 52b51df859 add wear_levelling component and example 2017-04-17 11:01:17 +08:00
Dmitry Yakovlev aeabbd305c fatfs: add support for small disc sizes (less then 16 MB) 2017-04-17 11:01:17 +08:00
Ivan Grokhotkov 7388efa953 fatfs: add support for variable sector size 2017-04-17 11:01:17 +08:00
Ivan Grokhotkov ed6957302f Kconfig: fix “symbol value '' invalid for PHY_DATA_OFFSET” warning
PHY_DATA_OFFSET is only used if ESP32_PHY_INIT_DATA_IN_PARTITION is set
2017-04-17 11:01:17 +08:00
Jeroen Domburg 76a4082de7 Remove ESP_EARLY_LOGI before bss is initialized; it crashes the CPU 2017-04-16 23:34:03 +08:00
Jiang Jiang Jian 0ea4c3c06b Merge branch 'bugfix/btdm_alarm_event_transfer' into 'master'
component/bt: transfer bluedroid timer events to be handled by BTC task

NVS operation can take long time for timer task to handle. Transfer the alarm event to be handled by BTC task.

See merge request !670
2017-04-14 21:20:19 +08:00
Ivan Grokhotkov 15ec487fde Merge branch 'feature/esp32_d2wd_support' into 'master'
ESP32-D2WD support

Support ESP32-D2WD with integrated flash in ESP-IDF.

Includes fix for https://github.com/espressif/esp-idf/issues /521


See merge request !639
2017-04-14 20:57:39 +08:00
wangmengyang 4f3b391674 component/bt: transfer bluedroid timer events to be handled by BTC task 2017-04-14 18:49:30 +08:00
Yulong 4715fa16ae change the make error in bta_dm_ble_set_rand_address func 2017-04-14 02:52:43 -04:00
Yulong cb5c296829 component/bt:move the bugfix/ble_set_rand_addr_bug here for fix the conflict with the master 2017-04-14 02:45:07 -04:00
Yulong f6f094213e compoment/bt:Change the tabs to space in btc_ble_storage.c & btc_gap_ble.c file 2017-04-13 23:50:14 -04:00
Yulong aff8758fe4 delete the debug log in the btc_ble_storage file 2017-04-13 22:40:37 -04:00
Michel Pollet 349a77cb55 components/driver: 'const' all config calls.
Some were, some weren't. They all could/should be.

Signed-off-by: Michel Pollet <buserror@gmail.com>
2017-04-13 18:33:33 +01:00
Yulong c6a516f122 component/bt:move the btdm_rebase_ssp_api branch to this branch 2017-04-13 10:14:28 -04:00
Jiang Jiang Jian 9050307dfe Merge branch 'feature/check_invalid_cache_access' into 'master'
Detect invalid cache access

This MR adds always-on feature which detects cache invalid access and triggers panic handler when invalid access interrupt is raised.


See merge request !660
2017-04-13 16:11:19 +08:00
Jiang Jiang Jian 7c6c74dff0 Merge branch 'bugfix/check_wifi_state_when_wifi_deinit_is_called' into 'master'
check wifi state when wifi deinit is called



See merge request !663
2017-04-13 16:01:39 +08:00
Angus Gratton f7793840e1 bootloader: Add QIO support for ESP32-D2WD SPI flash 2017-04-13 17:55:47 +10:00
Angus Gratton 85e76a7cfc spiflash ROM functions: Remove Quad I/O mode enable/disable code from flash ROM functions
Confusion here is that original ROM has two functions:

* SPIReadModeCnfig() - sets mode, calls enable_qio_mode/disable_qio_mode
* SPIMasterReadModeCnfig() - As above, but doesn't set QIO mode in status register

However we never want to use the ROM method to set/clear QIO mode flag, as not all flash chips work this way. Instead we
do it in flash_qio_mode.c in bootloader.

So in both cases (ROM or "patched ROM") we now call SPIMasterReadModeCnfig(), which is now named
esp_rom_spiflash_config_readmode().
2017-04-13 17:54:42 +10:00
Ivan Grokhotkov 378884660a Merge branch 'feature/tw11250_add_tcp_delay_statistics' into 'master'
lwip: refactor to esp specific counter

1. Add tcp debug counter
2. Refactor other ESP specific counter

See merge request !635
2017-04-13 15:29:36 +08:00
Ivan Grokhotkov 3cd6d4e5fc Merge branch 'bugfix/uart_tx_buffer_blocked' into 'master'
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.

See merge request !658
2017-04-13 15:29:09 +08:00
Ivan Grokhotkov 8a9516a973 Merge branch 'bugfix/bootloader_error_handling_code' into 'master'
Add error handling code in bootloader

Forgotten error handling

See merge request !650
2017-04-13 15:28:49 +08:00
Ivan Grokhotkov af0ecca492 add test case for invalid cache access interrupt 2017-04-13 15:27:39 +08:00
Ivan Grokhotkov a8f1918d88 panic handler: access exception frame members via struct fields 2017-04-13 15:27:38 +08:00
Ivan Grokhotkov aae441951b panic handler: send output to the UART configured as console 2017-04-13 15:27:38 +08:00
Jeroen Domburg 0b79d07d34 add detection of invalid cache access
- fix level 4 interrupt vectors to produce correct backtrace
- initialize invalid cache access interrupt on startup
- handle invalid cache access in panic handler
2017-04-13 15:27:38 +08:00
Ivan Grokhotkov 3c6c1e36ec soc: add invalid cache access interrupt bits to dport_reg 2017-04-13 15:27:38 +08:00
Jiang Jiang Jian 82b7ca92ad Merge branch 'bugfix/lwip_sta_ap_netif_names' into 'master'
give the AP and STA netifs different names for ease of debugging lwip

Both AP and STA netifs used to be called "en". This changes the name to "st" for STA and "ap" for AP.

Ref https://github.com/espressif/esp-idf/pull/456.

See merge request !653
2017-04-13 14:43:13 +08:00
Jiang Jiang Jian 6ace4f6fa4 Merge branch 'feature/btdm_avrc' into 'master'
Feature/btdm avrc

The source branch "feature/btdm_avrc" includes classic Bluetooth profiles A2DP(sink role) and AVRCP(controller role); 
Menuconfig options to control whether to enable classic BT is added.

See merge request !591
2017-04-13 14:36:58 +08:00
XiaXiaotian 454d00e2ae check wifi state when wifi deinit is called 2017-04-13 14:34:40 +08:00
Angus Gratton 66308774db esptool: Update to include ESP32-D2WD support (and other SPI flash remapping) 2017-04-13 16:25:15 +10:00
Liu Zhi Fu 743359a6bf esp32: update wifi lib for some refactor
1. Refactor for wifi ebuf management
2. Refactor for wifi rate control/long rate/tx
2017-04-13 11:41:42 +08:00
Ivan Grokhotkov 4eaf5e218a Merge branch 'feature/change_ssid_len_to_33' into 'master'
change scanned ap's ssid array len to 33



See merge request !661
2017-04-13 11:16:11 +08:00
XiaXiaotian d61959b583 change scanned ap's ssid array len to 33 2017-04-13 10:09:07 +08:00
Ivan Grokhotkov a845f211e3 Merge branch 'bugfix/ota_runtime_check_encrypted_flash' into 'master'
Enable checks for encrypted flash in OTA

Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED.

Rationale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader generates keys for encryption or not, but flash encryption can be configured externally. With this change, it's possible to have boot loader not generate keys but still have encryption working.

Also fix use of it->part

Ref. https://github.com/espressif/esp-idf/pull/453

See merge request !647
2017-04-12 21:30:07 +08:00
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
wangmengyang b503d68045 component/bt: implement classic Bluetooth profiles A2DP(sink) and AVRCP(controller) 2017-04-12 16:42:14 +08:00
Jiang Jiang Jian 79173c0f2a Merge branch 'bugfix/btdm_gatt_memory_leak' into 'master'
bt component: Fix memory leak while using gatt server

- fix memory leak while creating attribute table
- fix memory leak while deleting service

See merge request !656
2017-04-12 15:43:32 +08:00
island f688309b3a bt component: Fix memory leak while using gatt server
- fix memory leak while creating attribute table
- fix memory leak while deleting service
2017-04-12 14:58:45 +08:00
island 941a12cb4e bt component: Add stop adv/scan completed event 2017-04-12 14:19:16 +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
Edmund Huber eab6d483a5 give the AP and STA netifs different names for ease of debugging lwip 2017-04-11 20:40:36 +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
Deomid Ryabkov 516c708fc7 Enable checks for encrypted flash in OTA
Even if firmware is compiled without CONFIG_FLASH_ENCRYPTION_ENABLED
Rayionale: CONFIG_FLASH_ENCRYPTION_ENABLED controls whether boot loader
generates keys for encryption or not, but flash encryption can be
configured externally. With this change, it's possible to have boot
loader not generate keys but still have encryption working.

Also fix use of it->part
2017-04-11 19:10:26 +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
Anton Maklakov e4353f2119 bootloader: Add error handling code 2017-04-11 18:15:36 +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
wangmengyang ccfe4fefeb component/bt: implement classic Bluetooth profiles A2DP(sink) and AVRCP(controller) 2017-04-10 16:12:21 +08:00
Liu Zhi Fu ece61944f4 lwip: refractor to esp specific counter
1. Add tcp debug counter
2. Refractor other ESP specific counter
2017-04-10 14:46:48 +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
wangmengyang b5ea92a26e component/bt: implement classic Bluetooth profiles A2DP(sink) and AVRCP(controller) 2017-04-06 16:56:18 +08:00
wangmengyang dbd4e0522e Merge branch 'master' into feature/btdm_avrc 2017-04-06 14:59:58 +08: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