]> granicus.if.org Git - esp-idf/log
esp-idf
7 years agoMerge branch 'bugfix/esp32_core_dump_sanity_checks' into 'master'
Ivan Grokhotkov [Thu, 27 Apr 2017 02:43:58 +0000 (10:43 +0800)]
Merge branch 'bugfix/esp32_core_dump_sanity_checks' into 'master'

esp32: Core dump sanity checks

Adds sanity checks when doing core dump to flash

- CRC for core dump flash partition config
- Tasks with corrupted TCBs are skipped
- Assertions to check that nothing is written beyond core dump flash partition

Ref TW11879

See merge request !686

7 years agoMerge branch 'feature/cpu_restart_sequence' into 'master'
Ivan Grokhotkov [Thu, 27 Apr 2017 01:30:42 +0000 (09:30 +0800)]
Merge branch 'feature/cpu_restart_sequence' into 'master'

Restart sequence requires set up for app cpu.

These changes required to make correct restart of CPU form JTAG.

See merge request !703

7 years agoesp32: Core dump sanity checks were added
Alexey Gerenkov [Thu, 20 Apr 2017 16:38:38 +0000 (19:38 +0300)]
esp32: Core dump sanity checks were added

 - CRC for core dump flash partition config
 - Tasks with corrupted TCBs are skipped
 - Assertions to check that nothing is written beyond core dump flash partition

7 years agoDebug info removed.
Dmitry Yakovlev [Wed, 26 Apr 2017 07:31:05 +0000 (10:31 +0300)]
Debug info removed.

7 years agoMerge branch 'feature/32k_xtal' into 'master'
Ivan Grokhotkov [Wed, 26 Apr 2017 06:01:59 +0000 (14:01 +0800)]
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

7 years agoRestart sequence requires set up for app cpu.
Dmitry Yakovlev [Wed, 26 Apr 2017 04:47:37 +0000 (07:47 +0300)]
Restart sequence requires set up for app cpu.

7 years agoAdd support for 32k XTAL as RTC_SLOW_CLK source
Ivan Grokhotkov [Mon, 24 Apr 2017 10:36:47 +0000 (18:36 +0800)]
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.

7 years agoMerge branch 'bugfix/secure_boot_enable_image_verify' into 'master'
Angus Gratton [Wed, 26 Apr 2017 02:58:55 +0000 (10:58 +0800)]
Merge branch 'bugfix/secure_boot_enable_image_verify' into 'master'

Fix secure boot enable - can verify bootloader image

Secure boot enable would fail because esp_image_basic_verify() would fail to verify the bootloader image.

* 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

See merge request !693

7 years agobootloader: Add some debug logging around OTA selection
Angus Gratton [Mon, 24 Apr 2017 07:13:35 +0000 (17:13 +1000)]
bootloader: Add some debug logging around OTA selection

7 years agosecure boot: Fix bootloader image verification failure
Angus Gratton [Mon, 24 Apr 2017 06:21:27 +0000 (16:21 +1000)]
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

7 years agoMerge branch 'feature/wear_levelling' into 'master'
Ivan Grokhotkov [Tue, 25 Apr 2017 11:46:11 +0000 (19:46 +0800)]
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

7 years agoMerge branch 'bugfix/lwip_makefile_ppp' into 'master'
Ivan Grokhotkov [Tue, 25 Apr 2017 10:30:29 +0000 (18:30 +0800)]
Merge branch 'bugfix/lwip_makefile_ppp' into 'master'

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

See merge request !700

7 years agolwip: fix error when building on OS X, only build ppp if enabled
Ivan Grokhotkov [Tue, 25 Apr 2017 09:22:09 +0000 (17:22 +0800)]
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

7 years agoMerge branch 'feature/xtal_freq_autodetect' into 'master'
Ivan Grokhotkov [Tue, 25 Apr 2017 08:30:36 +0000 (16:30 +0800)]
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

7 years agoMerge branch 'bugfix/sdmmc_timeout' into 'master'
Ivan Grokhotkov [Tue, 25 Apr 2017 08:27:12 +0000 (16:27 +0800)]
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

7 years agoMerge branch 'feature/ppp_over_serial' into 'master'
Jiang Jiang Jian [Tue, 25 Apr 2017 06:02:55 +0000 (14:02 +0800)]
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

7 years agoMerge branch 'bugfix/fatfs_sdmmc_cleanup' into 'master'
Jiang Jiang Jian [Tue, 25 Apr 2017 05:48:34 +0000 (13:48 +0800)]
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

7 years agoMerge branch 'bugfix/remove_unneeded_header_file_including' into 'master'
Jiang Jiang Jian [Tue, 25 Apr 2017 05:23:03 +0000 (13:23 +0800)]
Merge branch 'bugfix/remove_unneeded_header_file_including' into 'master'

remove unneeded header file including

See merge request !695

7 years agoMerge branch 'feature/ethernet_lan8720' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 09:03:37 +0000 (17:03 +0800)]
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

7 years agoremove unneeded header file including
XiaXiaotian [Mon, 24 Apr 2017 08:11:26 +0000 (16:11 +0800)]
remove unneeded header file including

7 years agoAdd XTAL frequency selection to Kconfig
Ivan Grokhotkov [Mon, 24 Apr 2017 07:30:27 +0000 (15:30 +0800)]
Add XTAL frequency selection to Kconfig

This change allows XTAL frequency to be selected using menuconfig

7 years agosoc: implement XTAL frequency detection
Ivan Grokhotkov [Mon, 24 Apr 2017 07:29:30 +0000 (15:29 +0800)]
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.

7 years agoMerge branch 'bugfix/gattc_example_strcmp' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 05:11:41 +0000 (13:11 +0800)]
Merge branch 'bugfix/gattc_example_strcmp' into 'master'

Fix device_name check in gatt_client example

`strcmp` was used against `adv_name` array, which was not a zero terminated string, causing `strcmp` check to fail for valid names.

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

See merge request !652

7 years agoMerge branch 'bugfix/tw7105_tcp_stable_test_abort_issue' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 05:10:21 +0000 (13:10 +0800)]
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

7 years agoMerge branch 'example/perf_tcp_udp_revision' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 05:07:32 +0000 (13:07 +0800)]
Merge branch 'example/perf_tcp_udp_revision' into 'master'

tcp_udp_perf: add license and modify some details

tcp_udp_perf: add license and modify some details

See merge request !666

7 years agoMerge branch 'feature/optimize_text_rodata_in_iram_dram' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 05:03:07 +0000 (13:03 +0800)]
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

7 years agoMerge branch 'feature/add_limit_for_all_dynamic_ebuf' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 03:49:50 +0000 (11:49 +0800)]
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

7 years agoMerge branch 'feature/support_read_mac_addr_from_customer_efuse' into 'master'
Jiang Jiang Jian [Mon, 24 Apr 2017 03:30:55 +0000 (11:30 +0800)]
Merge branch 'feature/support_read_mac_addr_from_customer_efuse' into 'master'

Add customer MAC address that read from efuse

See merge request !673

7 years agoput RODATA of libphy.a into DRAM
XiaXiaotian [Mon, 24 Apr 2017 03:22:49 +0000 (11:22 +0800)]
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.

7 years agoMerge branch 'feature/esp32_wdt_rst_info' into 'master'
Ivan Grokhotkov [Mon, 24 Apr 2017 02:32:16 +0000 (10:32 +0800)]
Merge branch 'feature/esp32_wdt_rst_info' into 'master'

esp32: Added dumping debug info from traceport upon reset by any WDT

Adds ability to dump debug info (PC and internal processor state) from traceport upon reset by any WDT.

See merge request !654

7 years agoesp32: Added dumping info from traceport upon reset by any WDT
Alexey Gerenkov [Tue, 11 Apr 2017 19:55:31 +0000 (22:55 +0300)]
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

7 years agoMerge branch 'bugfix/rtc_reg_fields' into 'master'
Ivan Grokhotkov [Fri, 21 Apr 2017 11:40:45 +0000 (19:40 +0800)]
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

7 years agoMerge branch 'bugfix/xtal_freq_after_wdt_reset' into 'master'
Ivan Grokhotkov [Fri, 21 Apr 2017 11:38:46 +0000 (19:38 +0800)]
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

7 years agoDo not put the whole object files into IRAM. Add attributes to the functions called...
XiaXiaotian [Wed, 12 Apr 2017 09:42:45 +0000 (17:42 +0800)]
Do not put the whole object files into IRAM. Add attributes to the functions called in ISR instead.

7 years agoadd base MAC address storage choice.
XiaXiaotian [Wed, 19 Apr 2017 13:00:00 +0000 (21:00 +0800)]
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.

7 years agoPPPoS example: Move pin configuration to menuconfig, add log statement
Angus Gratton [Fri, 21 Apr 2017 04:29:16 +0000 (14:29 +1000)]
PPPoS example: Move pin configuration to menuconfig, add log statement

Also remove spurious infinite loop in app_main()

7 years agoMerge branch 'bugfix/github_fixes' into 'master'
Angus Gratton [Fri, 21 Apr 2017 04:27:32 +0000 (12:27 +0800)]
Merge branch 'bugfix/github_fixes' into 'master'

Various fixes from Github

Some one-line fixes from Github PRs.

See merge request !689

7 years agoMerge branch 'bugfix/driver_const_params' into 'master'
Angus Gratton [Fri, 21 Apr 2017 04:25:15 +0000 (12:25 +0800)]
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

7 years agoMerge branch 'bugfix/mbedtls_wrong_errno' into 'master'
Angus Gratton [Fri, 21 Apr 2017 04:24:59 +0000 (12:24 +0800)]
Merge branch 'bugfix/mbedtls_wrong_errno' into 'master'

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

See merge request !688

7 years agoPPPoS: Rearrange config items (move TCP/IP stack size to LWIP), mark as experimental...
Angus Gratton [Fri, 21 Apr 2017 01:08:40 +0000 (11:08 +1000)]
PPPoS: Rearrange config items (move TCP/IP stack size to LWIP), mark as experimental/unsupported

Ref #272

7 years agoEnable lwip PPPoS support
Adrian Muzyka [Fri, 20 Jan 2017 11:05:38 +0000 (12:05 +0100)]
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

7 years agoesp32: update wifi lib for limitting dynamic wifi buffer
Liu Zhi Fu [Thu, 20 Apr 2017 07:01:59 +0000 (15:01 +0800)]
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

7 years agortc_clk_init: handle case when XTAL frequency has already been set
Ivan Grokhotkov [Fri, 21 Apr 2017 02:33:58 +0000 (10:33 +0800)]
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).

7 years agobluedroid: Fix compilation warnings related to aliasing
Angus Gratton [Fri, 21 Apr 2017 01:31:40 +0000 (11:31 +1000)]
bluedroid: Fix compilation warnings related to aliasing

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

7 years agoMake sure LD -L option is calculated correctly when the project Makefile has specifie...
Eyob [Sat, 8 Apr 2017 22:18:16 +0000 (18:18 -0400)]
Make sure LD -L option is calculated correctly when the project Makefile has specified SRCDIRS components that are not directly below Makefile folder level.

For example,
SRCDIRS = comp_a  happy/comp_b  /c/dev/comp_c

Then the following are built:
build/comp_a/libcomp_a.a
build/comp_b/libcomp_b.a
build/comp_c/libcomp_c.a

But when LD is run the -L is calculated as follows
-L build/comp_a
-L build/happy/comp_b
-L build//c/dev/comp_c

This means comp_b and comp_c are not found by LD. With this change set -L is calculated correctly for comp_b and comp_c

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

7 years agoOTA example readme: [typo]: Worflow to Workflow
rudi ;-) [Mon, 10 Apr 2017 03:07:12 +0000 (05:07 +0200)]
OTA example readme: [typo]: Worflow to Workflow

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

7 years agospidriver: Display length errors correctly
Michael Kellner [Thu, 13 Apr 2017 18:11:13 +0000 (11:11 -0700)]
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

7 years agoFixed bug in ledc_set_fade_with_step where returned while holding critical section.
Jonathan Kaufmann [Wed, 12 Apr 2017 23:23:32 +0000 (18:23 -0500)]
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

7 years agombedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets
Michael Kellner [Tue, 11 Apr 2017 20:08:35 +0000 (13:08 -0700)]
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

7 years agoEthernet example: Add README, use menuconfig for all example pin assignments
Angus Gratton [Fri, 3 Mar 2017 00:06:32 +0000 (11:06 +1100)]
Ethernet example: Add README, use menuconfig for all example pin assignments

7 years agoethernet: Add convenience functions esp_eth_smi_wait_value() & esp_eth_smi_wait_set()
Angus Gratton [Wed, 19 Apr 2017 03:43:25 +0000 (13:43 +1000)]
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.

7 years agoethernet: Refactor PHY support to be part of ethernet component
Angus Gratton [Wed, 19 Apr 2017 02:02:53 +0000 (12:02 +1000)]
ethernet: Refactor PHY support to be part of ethernet component

Move generic PHY support into its own interface

7 years agoexamples/ethernet: Add LAN8720 phy support
Robin Cutshaw [Sun, 26 Feb 2017 18:27:11 +0000 (13:27 -0500)]
examples/ethernet: Add LAN8720 phy support

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

7 years agoMerge branch 'bugfix/ci_ssc_build_nonverbose' into 'master'
Ivan Grokhotkov [Thu, 20 Apr 2017 07:12:38 +0000 (15:12 +0800)]
Merge branch 'bugfix/ci_ssc_build_nonverbose' into 'master'

ci: Build SSC with V=0

BATCH_BUILD implies V=1, but SSC produces a *lot* of log output in verbose mode.

See merge request !682

7 years agoci: Build with V=0
Angus Gratton [Thu, 20 Apr 2017 03:43:20 +0000 (13:43 +1000)]
ci: Build with V=0

BATCH_BUILD implies V=1, but SSC produces a *lot* of log output in verbose mode.

For now, disable setting V=1 for all CI build modes.

7 years agolwip: fix tcp stable test abort issue
Liu Zhi Fu [Wed, 19 Apr 2017 08:18:07 +0000 (16:18 +0800)]
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

7 years agofat/sdmmc: unmount FATFS object on error
Ivan Grokhotkov [Wed, 19 Apr 2017 07:03:30 +0000 (15:03 +0800)]
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).

7 years agoMerge branch 'bugfix/tw11779_softAP_crash_when_wifi_connect' into 'master'
Jiang Jiang Jian [Wed, 19 Apr 2017 06:34:53 +0000 (14:34 +0800)]
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

7 years agosdmmc: handle card removal when CD is not used
Ivan Grokhotkov [Wed, 19 Apr 2017 04:50:51 +0000 (12:50 +0800)]
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.

7 years agosoc: allow REG_SET_FIELD to be used with single-bit fields
Ivan Grokhotkov [Tue, 18 Apr 2017 04:09:19 +0000 (12:09 +0800)]
soc: allow REG_SET_FIELD to be used with single-bit fields

7 years agosoc: define missing M, V macros for nrx, bb, fe, emac, iomux
Ivan Grokhotkov [Tue, 18 Apr 2017 04:06:27 +0000 (12:06 +0800)]
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

7 years agotcp_udp_perf: add license and modify some details
chenyudong [Thu, 13 Apr 2017 11:14:01 +0000 (19:14 +0800)]
tcp_udp_perf: add license and modify some details

7 years agoMerge branch 'bugfix/dont_log_before_bss_inited' into 'master'
Jeroen Domburg [Tue, 18 Apr 2017 03:21:31 +0000 (11:21 +0800)]
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

7 years agoMerge branch 'feature/log_via_apptrace' into 'master'
Ivan Grokhotkov [Tue, 18 Apr 2017 02:45:14 +0000 (10:45 +0800)]
Merge branch 'feature/log_via_apptrace' into 'master'

Apptrace interface and logging via apptrace

- adds apptrace module which allows arbitrary data to be sent to host over JTAG
- implements printf-like logging to host via apptrace module

This feature depends on changes in idf/openocd-esp32!2

See merge request !548

7 years agoReplace to strncmp from strcmp to check device_name on examples/bluetooth/gatt_client
Asuki Kono [Tue, 11 Apr 2017 11:54:33 +0000 (20:54 +0900)]
Replace to strncmp from strcmp to check device_name on examples/bluetooth/gatt_client

(Amended slightly from version in https://github.com/espressif/esp-idf/pull/502 to
account for differences when adv_name is a prefix of device_name.)

7 years agoesp32: Adds functionality for application tracing over JTAG
Alexey Gerenkov [Wed, 25 Jan 2017 16:35:28 +0000 (19:35 +0300)]
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.

7 years agofix test for dumping trace data
Ivan Grokhotkov [Tue, 17 Jan 2017 14:58:54 +0000 (22:58 +0800)]
fix test for dumping trace data

7 years agotrace: add Kconfig options for app level trace
Ivan Grokhotkov [Tue, 17 Jan 2017 14:58:11 +0000 (22:58 +0800)]
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

7 years agotest tracing over JTAG
Ivan Grokhotkov [Sun, 15 Jan 2017 16:42:10 +0000 (00:42 +0800)]
test tracing over JTAG

7 years agoAdd customer MAC address that read from efuse
XiaXiaotian [Mon, 17 Apr 2017 13:16:16 +0000 (21:16 +0800)]
Add customer MAC address that read from efuse

7 years agoesp32: update wifi lib to fix wifi connect cause crash
Liu Zhi Fu [Mon, 17 Apr 2017 07:38:41 +0000 (15:38 +0800)]
esp32: update wifi lib to fix wifi connect cause crash

Fix softap wifi connect crash bug

7 years agowear_levelling: add unit test sub-component
Ivan Grokhotkov [Mon, 10 Apr 2017 14:07:10 +0000 (22:07 +0800)]
wear_levelling: add unit test sub-component

7 years agowear_levelling: run host side test in CI
Ivan Grokhotkov [Mon, 10 Apr 2017 13:41:19 +0000 (21:41 +0800)]
wear_levelling: run host side test in CI

7 years agomove Catch framework header into tools directory
Ivan Grokhotkov [Mon, 10 Apr 2017 13:31:27 +0000 (21:31 +0800)]
move Catch framework header into tools directory

7 years agonvs_flash, wear_levelling: ignore host test files
Ivan Grokhotkov [Mon, 10 Apr 2017 13:22:14 +0000 (21:22 +0800)]
nvs_flash, wear_levelling: ignore host test files

7 years agoadd wear_levelling component and example
Ivan Grokhotkov [Mon, 10 Apr 2017 14:06:35 +0000 (22:06 +0800)]
add wear_levelling component and example

7 years agofatfs: add support for small disc sizes (less then 16 MB)
Dmitry Yakovlev [Fri, 24 Mar 2017 00:45:05 +0000 (03:45 +0300)]
fatfs: add support for small disc sizes (less then 16 MB)

7 years agofatfs: add support for variable sector size
Ivan Grokhotkov [Mon, 10 Apr 2017 07:38:43 +0000 (15:38 +0800)]
fatfs: add support for variable sector size

7 years agoKconfig: fix “symbol value '' invalid for PHY_DATA_OFFSET” warning
Ivan Grokhotkov [Mon, 10 Apr 2017 08:22:53 +0000 (16:22 +0800)]
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

7 years agoRemove ESP_EARLY_LOGI before bss is initialized; it crashes the CPU
Jeroen Domburg [Sun, 16 Apr 2017 15:34:03 +0000 (23:34 +0800)]
Remove ESP_EARLY_LOGI before bss is initialized; it crashes the CPU

7 years agoMerge branch 'bugfix/btdm_alarm_event_transfer' into 'master'
Jiang Jiang Jian [Fri, 14 Apr 2017 13:20:19 +0000 (21:20 +0800)]
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

7 years agoMerge branch 'feature/esp32_d2wd_support' into 'master'
Ivan Grokhotkov [Fri, 14 Apr 2017 12:57:39 +0000 (20:57 +0800)]
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

7 years agocomponent/bt: transfer bluedroid timer events to be handled by BTC task
wangmengyang [Fri, 14 Apr 2017 10:49:30 +0000 (18:49 +0800)]
component/bt: transfer bluedroid timer events to be handled by BTC task

7 years agoMerge branch 'bugfix/rb_ble_set_rand_addr' into 'master'
Jiang Jiang Jian [Fri, 14 Apr 2017 07:17:29 +0000 (15:17 +0800)]
Merge branch 'bugfix/rb_ble_set_rand_addr' into 'master'

move the bugfix/ble_set_rand_addr_bug here for fix the conflict with the master

move the bugfix/ble_set_rand_addr_bug to here avoid the conflict with the master

See merge request !669

7 years agochange the make error in bta_dm_ble_set_rand_address func
Yulong [Fri, 14 Apr 2017 06:52:43 +0000 (02:52 -0400)]
change the make error in bta_dm_ble_set_rand_address func

7 years agocomponent/bt:move the bugfix/ble_set_rand_addr_bug here for fix the conflict with...
Yulong [Fri, 14 Apr 2017 06:45:07 +0000 (02:45 -0400)]
component/bt:move the bugfix/ble_set_rand_addr_bug here for fix the conflict with the master

7 years agoMerge branch 'feature/btdm_sec_rebase_api' into 'master'
Jiang Jiang Jian [Fri, 14 Apr 2017 04:12:24 +0000 (12:12 +0800)]
Merge branch 'feature/btdm_sec_rebase_api' into 'master'

component/bt:move the btdm_rebase_ssp_api branch to this branch

remove the btdm_rebase_ssp_api branch & move it to this branch avoid the conflict with the maset

See merge request !667

7 years agocompoment/bt:Change the tabs to space in btc_ble_storage.c & btc_gap_ble.c file
Yulong [Fri, 14 Apr 2017 03:50:14 +0000 (23:50 -0400)]
compoment/bt:Change the tabs to space in btc_ble_storage.c & btc_gap_ble.c file

7 years agodelete the debug log in the btc_ble_storage file
Yulong [Fri, 14 Apr 2017 02:40:37 +0000 (22:40 -0400)]
delete the debug log in the btc_ble_storage file

7 years agocomponents/driver: 'const' all config calls.
Michel Pollet [Thu, 13 Apr 2017 17:33:33 +0000 (18:33 +0100)]
components/driver: 'const' all config calls.

Some were, some weren't. They all could/should be.

Signed-off-by: Michel Pollet <buserror@gmail.com>
7 years agocomponent/bt:move the btdm_rebase_ssp_api branch to this branch
Yulong [Thu, 13 Apr 2017 14:14:28 +0000 (10:14 -0400)]
component/bt:move the btdm_rebase_ssp_api branch to this branch

7 years agoMerge branch 'feature/check_invalid_cache_access' into 'master'
Jiang Jiang Jian [Thu, 13 Apr 2017 08:11:19 +0000 (16:11 +0800)]
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

7 years agoMerge branch 'bugfix/check_wifi_state_when_wifi_deinit_is_called' into 'master'
Jiang Jiang Jian [Thu, 13 Apr 2017 08:01:39 +0000 (16:01 +0800)]
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

7 years agounit tests: Shrink unit test partition table so tests can run on 2MB of flash
Angus Gratton [Thu, 13 Apr 2017 07:37:35 +0000 (17:37 +1000)]
unit tests: Shrink unit test partition table so tests can run on 2MB of flash

7 years agobootloader: Add QIO support for ESP32-D2WD SPI flash
Angus Gratton [Thu, 13 Apr 2017 07:08:53 +0000 (17:08 +1000)]
bootloader: Add QIO support for ESP32-D2WD SPI flash

7 years agospiflash ROM functions: Remove Quad I/O mode enable/disable code from flash ROM functions
Angus Gratton [Wed, 12 Apr 2017 01:31:26 +0000 (11:31 +1000)]
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().

7 years agoMerge branch 'feature/tw11250_add_tcp_delay_statistics' into 'master'
Ivan Grokhotkov [Thu, 13 Apr 2017 07:29:36 +0000 (15:29 +0800)]
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

7 years agoMerge branch 'bugfix/uart_tx_buffer_blocked' into 'master'
Ivan Grokhotkov [Thu, 13 Apr 2017 07:29:09 +0000 (15:29 +0800)]
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

7 years agoMerge branch 'bugfix/bootloader_error_handling_code' into 'master'
Ivan Grokhotkov [Thu, 13 Apr 2017 07:28:49 +0000 (15:28 +0800)]
Merge branch 'bugfix/bootloader_error_handling_code' into 'master'

Add error handling code in bootloader

Forgotten error handling

See merge request !650

7 years agoadd test case for invalid cache access interrupt
Ivan Grokhotkov [Wed, 12 Apr 2017 09:50:42 +0000 (17:50 +0800)]
add test case for invalid cache access interrupt