]> granicus.if.org Git - esp-idf/log
esp-idf
7 years agounit tests: change type of flash_test partition to ‘fat’
Ivan Grokhotkov [Thu, 4 May 2017 08:42:22 +0000 (16:42 +0800)]
unit tests: change type of flash_test partition to ‘fat’

This change makes the spi_flash test partition usable for WL and FATFS
tests.

7 years agovfs_fat: allocate FIL structures on the heap in vfs_fat_link
Ivan Grokhotkov [Thu, 4 May 2017 06:49:33 +0000 (14:49 +0800)]
vfs_fat: allocate FIL structures on the heap in vfs_fat_link

vfs_fat_link opened two files to perform copy operation. File structures
were allocated on the stack. When _MAX_SS setting was increased in
ffconf.h due to wear levelling feature, the size of these structures
increased to ~4k each (~8k total). This exceeds stack size allocated for
tasks in most typical cases.

This change makes file structures dynamically allocated.

7 years agovfs_fat: fix prepend_drive_to_path
Ivan Grokhotkov [Thu, 4 May 2017 06:46:11 +0000 (14:46 +0800)]
vfs_fat: fix prepend_drive_to_path

Originally, prepend_drive_to_path was designed to be a macro, and it
modified local path variables to point to a temporary buffers.
When it was converted into a function, modification to path variables
were no longer visible outside of this function.

In addition to that, prepend_drive_to_path allocated 2k bytes on the
stack for temporary path buffers. This is replaced with path buffers
allocated as part of vfs_fat context object. Locking is added around
parts of code which use these temporary buffers.

Additionally, _lock member of vfs_fat_ctx_t was placed after the
variable-sized files array, which caused the first entry in the
array to be never used. This change fixes the order of members
and adds comments.

7 years agoFix vfs_fat_spiflash failed to mount / f_mkfs()
Nineis K [Tue, 2 May 2017 16:23:45 +0000 (23:23 +0700)]
Fix vfs_fat_spiflash failed to mount / f_mkfs()

7 years agoMerge branch 'feature/btdm_vhci_intnum' into 'master'
Jiang Jiang Jian [Thu, 4 May 2017 06:58:32 +0000 (14:58 +0800)]
Merge branch 'feature/btdm_vhci_intnum' into 'master'

change VHCI interrupt type to software interrupt

component/bt : change VHCI interrupt type to software interrupt(int no 7)

See merge request !717

7 years agoMerge branch 'bugfix/gattc_not_pro_svc_chg_evt_#12079' into 'master'
Jiang Jiang Jian [Thu, 4 May 2017 06:51:42 +0000 (14:51 +0800)]
Merge branch 'bugfix/gattc_not_pro_svc_chg_evt_#12079' into 'master'

component/bt:fix the bug with gatt client cant not receive the gatt server service change event.

fix the bug with gatt client cant not receive the gatt server service change event.

See merge request !726

7 years agoMerge branch 'bugfix/btdm_auto_rsp_comment' into 'master'
Jiang Jiang Jian [Thu, 4 May 2017 06:49:06 +0000 (14:49 +0800)]
Merge branch 'bugfix/btdm_auto_rsp_comment' into 'master'

component/bt : fix the comment

 fix the comment about auto response of GATT write/read operation

See merge request !730

7 years agocomponent/bt : fix the comment
Tian Hao [Wed, 3 May 2017 03:58:52 +0000 (11:58 +0800)]
component/bt : fix the comment

7 years agocomponent/bt:fix the bug with gatt client cant not receive the gatt server service...
Yulong [Wed, 3 May 2017 02:53:48 +0000 (22:53 -0400)]
component/bt:fix the bug with gatt client cant not receive the gatt server service change event.

7 years agoMerge branch 'bugfix/ble_fix_bluedroid6.0_bug_from_7.1' into 'master'
Jiang Jiang Jian [Tue, 2 May 2017 11:38:50 +0000 (19:38 +0800)]
Merge branch 'bugfix/ble_fix_bluedroid6.0_bug_from_7.1' into 'master'

compoent/bt:Fixed the BT/BLE statck bug from bluedroid7.1.1

The bluedroid 7.1.1 has fixed some bug, synchronize to our SDK now.

See merge request !719

7 years agoMerge branch 'bugfix/gatts_cannot_set_value_#11754' into 'master'
Jiang Jiang Jian [Tue, 2 May 2017 11:37:45 +0000 (19:37 +0800)]
Merge branch 'bugfix/gatts_cannot_set_value_#11754' into 'master'

component/bt:Fixed the bug for #11754:GATT service should provide command to set…

… char/descriptor read value.

See merge request !721

7 years agoMerge branch 'bugfix/rtc_fast_freq_init' into 'master'
Ivan Grokhotkov [Fri, 28 Apr 2017 11:57:42 +0000 (19:57 +0800)]
Merge branch 'bugfix/rtc_fast_freq_init' into 'master'

esp32: select 8M clock as RTC_FAST_CLK on startup

Even though RTC_CLK_CONFIG_DEFAULT correctly had RTC_FAST_FREQ_8M as the
fast clock, the bootloader modified fast_freq field to the currently
selected RTC_FAST_CLK (so that the clock choice is not affected by the
bootloader). The application startup code never switched to 8M clock,
which caused the default (XTAL/4) to be used as RTC_FAST_CLK. This had
caused a number of issues, such as touch pads not working in deep sleep.

Fixes https://github.com/espressif/esp-idf/issues/542.
Ref TW12053.

See merge request !709

7 years agoMerge branch 'bugfix/assert_on_pin_task_nonexistent_cpu' into 'master'
Ivan Grokhotkov [Fri, 28 Apr 2017 11:55:26 +0000 (19:55 +0800)]
Merge branch 'bugfix/assert_on_pin_task_nonexistent_cpu' into 'master'

Assert when a new task is started on a nonexisting CPU

Previously, starting a task on a CPU ID higher than the amount of CPUs FreeRTOS is configured with would not start the task and possibly have unintended side effects due to some out-of-bounds array writes. Assert on this so the app aborts cleanly.

See merge request !701

7 years agoMerge branch 'bugfix/fix_wifi_ebuf_sanity_check_not_pass_issue' into 'master'
Ivan Grokhotkov [Fri, 28 Apr 2017 11:54:46 +0000 (19:54 +0800)]
Merge branch 'bugfix/fix_wifi_ebuf_sanity_check_not_pass_issue' into 'master'

esp32: update WiFi lib for ebuf sanity check fail issue

By default the WiFi canary check is disabled, before release 2.1, we only have canary check for AMPDU, in release2.1, we add sanity check for all kinds of dynamic ebuf, the checking is disabled by default for performance reason. We found some kinds of packets can't pass sanity check, this MR is to fix it.

See merge request !718

7 years agocomponent/bt:Fixed the bug for #11754:GATT service should provide command to set...
Yulong [Fri, 28 Apr 2017 11:23:52 +0000 (07:23 -0400)]
component/bt:Fixed the bug for #11754:GATT service should provide command to set char/descriptor read value.

7 years agocompoent/bt:Fixed the BT/BLE statck bug from bluedroid7.1.1
Yulong [Fri, 28 Apr 2017 09:31:57 +0000 (05:31 -0400)]
compoent/bt:Fixed the BT/BLE statck bug from bluedroid7.1.1

7 years agoesp32: update WiFi lib for ebuf sanity check fail issue
Liu Zhi Fu [Fri, 28 Apr 2017 09:27:55 +0000 (17:27 +0800)]
esp32: update WiFi lib for ebuf sanity check fail issue

Fix WiFi ebuf sanity check issue

7 years agocomponent/bt : change VHCI interrupt type to software interrupt(int no 7)
Tian Hao [Fri, 28 Apr 2017 09:17:39 +0000 (17:17 +0800)]
component/bt : change VHCI interrupt type to software interrupt(int no 7)

7 years agoMerge branch 'bugfix/adjust_lwip_options_and_update_wifi_lib' into 'master'
Jiang Jiang Jian [Fri, 28 Apr 2017 08:07:25 +0000 (16:07 +0800)]
Merge branch 'bugfix/adjust_lwip_options_and_update_wifi_lib' into 'master'

esp32/lwip: adjust some lwip options and update wifi lib

1. Modify TCP TX window from 2 to 4 to keep RX/TX window same size
2. Modify TCPIP task stack default size from 2048 to 2560 to avoid stack overflow
3. Update wifi lib for TCP performance optimization

See merge request !714

7 years agoesp32/lwip: adjust some lwip options and update wifi lib
Liu Zhi Fu [Thu, 27 Apr 2017 13:58:38 +0000 (21:58 +0800)]
esp32/lwip: adjust some lwip options and update wifi lib

1. Modify TCP TX window from 2 to 4
2. Modify TCPIP task stack default size from 2048 to 2560
3. Update wifi lib for TCP performance optimization

7 years agoMerge branch 'bugfix/i2s_driver' into 'master'
Angus Gratton [Fri, 28 Apr 2017 00:00:07 +0000 (08:00 +0800)]
Merge branch 'bugfix/i2s_driver' into 'master'

I2S driver - fixed support for 24 and 32-bits, fixed tx/rx at the same time

- Modify sample can test with 24, 32-bits audio
- Add i2s sample README
- simply i2s_push function
- change sample rates, bits per sample, channel on fly

See merge request !483

7 years agoMerge branch 'feature/doc_get-started' into 'master'
Angus Gratton [Thu, 27 Apr 2017 23:14:12 +0000 (07:14 +0800)]
Merge branch 'feature/doc_get-started' into 'master'

doc: Getting Started guides

* [x] Redesign ReadTheDocs home page to cover the following sections:
  * Get Started (new  + revised contents, see below)
  * API Reference
  * H/W Reference
  * API Guides (former "What Else?")
  * Contribute
  * Resources

* [x] Convert "Getting Started" guides from PDF to RST, review and update
  * ESP32-DevKitC Getting Started Guide
  * ESP-WROVER-KIT Getting Started Guide

* [x] Review installation  manuals for Windows, Linux and MacOS

  * Separate "Standard / cookie cutter" contents from "Advanced / customize this installation" contents
  * Harmonize "Standard" installation instructions by providing distinct sections

      * (1) Install Prerequisites
      * (2) Install Toolchain (binary only)
      * (-) O/S flavors, ref to "Advanced" installation

* [x] Extract / update existing instructions common to all O/S - idf-template based
  * (3) Get esp-idf
  * (4) Start a Project
  * (5) Connect
  * (6) Build and Flash
  * (7) Monitor

* [x] Correct partition table address from 0x4000 to 0x8000 in `docs/get-started/make-project.rst` and `README.md`

See merge request !612

7 years agoGetting started guides
krzychb [Sun, 26 Mar 2017 22:01:52 +0000 (00:01 +0200)]
Getting started guides

7 years agoMerge branch 'feature/ci_minor_fixes' into 'master'
Ivan Grokhotkov [Thu, 27 Apr 2017 16:25:13 +0000 (00:25 +0800)]
Merge branch 'feature/ci_minor_fixes' into 'master'

ci minor fixes

See merge request !707

7 years agoMerge branch 'bugfix/spi_master_ci_test_fix' into 'master'
Ivan Grokhotkov [Thu, 27 Apr 2017 16:24:28 +0000 (00:24 +0800)]
Merge branch 'bugfix/spi_master_ci_test_fix' into 'master'

Fix SPI master CI test

CI test fails because the values it checks haven't been updated to the changes in the clock calculations. This fixes that.

See merge request !710

7 years agoMerge branch 'bugfix/freertos_suspend_resume' into 'master'
Jiang Jiang Jian [Thu, 27 Apr 2017 13:16:15 +0000 (21:16 +0800)]
Merge branch 'bugfix/freertos_suspend_resume' into 'master'

freertos: Enable vTaskSuspend()/vTaskResume() API

Adds relevant unit tests.

TW11878

See merge request !702

7 years agoMerge branch 'bugfix/btdm_gattc_adv_bug' into 'master'
Jiang Jiang Jian [Thu, 27 Apr 2017 13:13:16 +0000 (21:13 +0800)]
Merge branch 'bugfix/btdm_gattc_adv_bug' into 'master'

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

See merge request !706

7 years agoMerge branch 'feature/btdm_ble_bt_separa' into 'master'
Jiang Jiang Jian [Thu, 27 Apr 2017 13:12:44 +0000 (21:12 +0800)]
Merge branch 'feature/btdm_ble_bt_separa' into 'master'

Feature/btdm ble bt separa

@Jack @snake @igrokhotkov @angus @island please help to review the code.
Separate the bt/ble code. After the separate, can save 15k~25k ram & 240k~460k code size(depending on the menuconfig).

See merge request !684

7 years agoMerge branch 'feature/opt_scan_before_connect' into 'master'
Jiang Jiang Jian [Thu, 27 Apr 2017 13:11:13 +0000 (21:11 +0800)]
Merge branch 'feature/opt_scan_before_connect' into 'master'

optimize scan before station connecting to AP

1. Store the information of AP(ssid, password, bssid, channel, etc)
    into nvs when station connects to AP successfully. If station
    connects to the same AP next time, it will scan the stored channel of the AP
    first.

2. Add a parameter of channel for scanning before connecting to AP.
    If the channel is set to 0, station will scan full channels. If it
    is set to 1~13, station will only scan the channel.

See merge request !704

7 years agoFix SPI master CI test
Jeroen Domburg [Thu, 27 Apr 2017 06:50:02 +0000 (14:50 +0800)]
Fix SPI master CI test

7 years agooptimize scan before station connecting to AP
XiaXiaotian [Wed, 26 Apr 2017 03:45:30 +0000 (11:45 +0800)]
optimize scan before station connecting to AP

    1. Store the information of AP(ssid, password, bssid, channel, etc)
    into nvs when station connects to AP successfully. If station
    connects to the same AP next time, it will scan the stored channel of the AP
    first.

    2. Add a parameter of channel for scanning before connecting to AP.
    If it is set to 1~13, station will scan starting from the channel.
    If the channel of AP is unknown, set it to 0.

7 years agoesp32: select 8M clock as RTC_FAST_CLK on startup
Ivan Grokhotkov [Thu, 27 Apr 2017 04:42:56 +0000 (12:42 +0800)]
esp32: select 8M clock as RTC_FAST_CLK on startup

Even though RTC_CLK_CONFIG_DEFAULT correctly had RTC_FAST_FREQ_8M as the
fast clock, the bootloader modified fast_freq field to the currently
selected RTC_FAST_CLK (so that the clock choice is not affected by the
bootloader). The application startup code never switched to 8M clock,
which caused the default (XTAL/4) to be used as RTC_FAST_CLK. This had
caused a number of issues, such as touch pads not working in deep sleep.

Fixes https://github.com/espressif/esp-idf/issues/542.
Ref TW12053.

7 years agoMerge branch 'feature/spi_slave' into 'master'
Jeroen Domburg [Thu, 27 Apr 2017 04:28:42 +0000 (12:28 +0800)]
Merge branch 'feature/spi_slave' into 'master'

Split common SPI stuff out of master driver; add slave driver; add workaround for DMA issue.

This merge req mainly adds a slave device. In order to do this, the original master driver is refactored into common code shared by master and slave modes, and a slave driver is added.

The other things added are:
- Added a workaround for a 'feature' of the ESP32 silicon that can lock up the receive DMA channel in some situations. This can only be fixed by resetting *both* DMA channels. The workaround implemented makes sure that the reset only happens when both channels are idle
- Got rid of the automatic choice between register- and DMA-based transfers. The master (and slave) code will now always go for a DMA transfer if a DMA channel is given, and always go for register-based transfers if no DMA channel is given.
- Add in a bunch of fixes for outstanding Github issues.

See merge request !659

7 years agoSPI: More MR issues fixed, style fixup
Jeroen Domburg [Thu, 27 Apr 2017 03:24:44 +0000 (11:24 +0800)]
SPI: More MR issues fixed, style fixup

7 years agoSPI: Also check SPI_TRANS_USE_[T|R]XDATA when decifding to turn on MOSI/MISO. Fixes...
Jeroen Domburg [Mon, 24 Apr 2017 08:14:09 +0000 (16:14 +0800)]
SPI: Also check SPI_TRANS_USE_[T|R]XDATA when decifding to turn on MOSI/MISO. Fixes https://github.com/espressif/esp-idf/issues/488

7 years agoSPI: SPI master clock calculation: n has a minimum of 2 to allow for both a low and...
Jeroen Domburg [Mon, 24 Apr 2017 08:13:22 +0000 (16:13 +0800)]
SPI: SPI master clock calculation: n has a minimum of 2 to allow for both a low and a high cycle. Fixes https://github.com/espressif/esp-idf/issues/491

7 years agoSPI: Fix comment for 3wire, make GPIO pins GPIO_MODE_INPUT_OUTOUT. Fixes https:/...
Jeroen Domburg [Mon, 24 Apr 2017 08:10:37 +0000 (16:10 +0800)]
SPI: Fix comment for 3wire, make GPIO pins GPIO_MODE_INPUT_OUTOUT. Fixes https://github.com/espressif/esp-idf/issues/533

7 years agoSPI: Small fixes according to MR comments
Jeroen Domburg [Thu, 13 Apr 2017 03:14:35 +0000 (11:14 +0800)]
SPI: Small fixes according to MR comments

7 years agoSPI: Split common SPI stuff out of master driver; add slave driver; add workaround...
Jeroen Domburg [Fri, 31 Mar 2017 07:05:25 +0000 (15:05 +0800)]
SPI: Split common SPI stuff out of master driver; add slave driver; add workaround for DMA issue.

7 years agoci: Fix the incorrect path
Anton Maklakov [Tue, 25 Apr 2017 07:10:32 +0000 (15:10 +0800)]
ci: Fix the incorrect path

7 years agoci: A config generator doesn't using anymore
Anton Maklakov [Wed, 26 Apr 2017 10:32:30 +0000 (18:32 +0800)]
ci: A config generator doesn't using anymore

7 years agoci: Delete the unused variable
Anton Maklakov [Wed, 26 Apr 2017 10:30:32 +0000 (18:30 +0800)]
ci: Delete the unused variable

7 years agoci: Reorder the clauses for more convenience
Anton Maklakov [Wed, 26 Apr 2017 10:09:14 +0000 (18:09 +0800)]
ci: Reorder the clauses for more convenience

7 years agoMerge branch 'bugfix/i2s_driver' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into...
Tuan PM [Thu, 27 Apr 2017 03:00:42 +0000 (10:00 +0700)]
Merge branch 'bugfix/i2s_driver' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into bugfix/i2s_driver

7 years agoI2S: fixed support for 24 and 32-bits, fixed tx/rx at the same time and others in...
Tuan PM [Mon, 6 Feb 2017 06:11:11 +0000 (13:11 +0700)]
I2S: fixed support for 24 and 32-bits, fixed tx/rx at the same time and others in log:

Add support 24, 32 bits

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

Add support 24, 32 bits

reduce push function

Modify sample can test with 24, 32-bits

Add i2s sample README

Fixed i2s_set_clk got reset sometime

can changes bit-wide while running

Fix sample rate calculation for DAC mode from @jeroen

modify example can change bits per sample every 5 seconds

cleanup

add comment for bytes_per_sample

update as @angus suggestions

Add i2s_set_clk api

I2S driver bug fixed as following log:

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

limit dma buffer to 4092

change gpio_matrix_*_check to inline function, remove some comments and rename test_i2s function to setup_triangle_sine_waves

for change commit title

7 years agobuild: Fix warning if the auto.conf does not exist
Anton Maklakov [Wed, 26 Apr 2017 10:26:21 +0000 (18:26 +0800)]
build: Fix warning if the auto.conf does not exist

    esp-idf/make/common.mk:10 some/include/config/auto.conf: No such file or directory

7 years agobuild: Fix comments and avoid build warning
Anton Maklakov [Fri, 14 Apr 2017 04:00:59 +0000 (12:00 +0800)]
build: Fix comments and avoid build warning

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 agocomponent/bt:Change the bt Kconfig BT_ACL_CONNECTIONS type from choice to int(range).
Yulong [Wed, 26 Apr 2017 09:27:21 +0000 (05:27 -0400)]
component/bt:Change the bt Kconfig BT_ACL_CONNECTIONS type from choice to int(range).

7 years agocomponent/bt:Fixted the bug of HCI comment timeout error.
Yulong [Wed, 26 Apr 2017 08:23:45 +0000 (04:23 -0400)]
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

7 years agocomponent/bt: Fix memory leakage, connection fail bugs
island [Tue, 18 Apr 2017 07:23:38 +0000 (15:23 +0800)]
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

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

7 years agocomponent/bt:Change the bt Kconfig BT_ACL_CONNECTIONS from int to choice.
Yulong [Wed, 26 Apr 2017 06:28:34 +0000 (02:28 -0400)]
component/bt:Change the bt Kconfig BT_ACL_CONNECTIONS from int to choice.

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 agoI2S: fixed support for 24 and 32-bits, fixed tx/rx at the same time and others in...
Tuan PM [Mon, 6 Feb 2017 06:11:11 +0000 (13:11 +0700)]
I2S: fixed support for 24 and 32-bits, fixed tx/rx at the same time and others in log:

Add support 24, 32 bits

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

Add support 24, 32 bits

reduce push function

Modify sample can test with 24, 32-bits

Add i2s sample README

Fixed i2s_set_clk got reset sometime

can changes bit-wide while running

Fix sample rate calculation for DAC mode from @jeroen

modify example can change bits per sample every 5 seconds

cleanup

add comment for bytes_per_sample

update as @angus suggestions

Add i2s_set_clk api

I2S driver bug fixed as following log:

@jxmao optimize i2s_zero_buffer

@jxmao correct config support slave mode

@jxmao correct setup pin support tx/rx at the same time

Enhance pin power

@jxmao add dynamic change number of channels

remove nvs_init

remove start log and enhance power pin setup

using enum for i2s_channel and i2s_bits_per_sample, return ESP_ERR_INVALID_ARG when check params

validate i2s_bits_per_sample and channel

check tx & rx buffer before fill zero

remove checking channel as @jxmao suggest

limit dma buffer

modify i2s pin back to gpio mux before configure gpio matrix, resolve github issue #512

limit dma buffer to 4092

change gpio_matrix_*_check to inline function, remove some comments and rename test_i2s function to setup_triangle_sine_waves

for change commit title

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 agofreertos: Enable vTaskSuspend()/vTaskResume() API
Angus Gratton [Wed, 26 Apr 2017 02:45:24 +0000 (12:45 +1000)]
freertos: Enable vTaskSuspend()/vTaskResume() API

Adds relevant unit tests.

TW11878

7 years agocomponent/bt:change the kconfig.
Yulong [Wed, 26 Apr 2017 02:47:16 +0000 (22:47 -0400)]
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.

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 agocomponent/bt:Merge the new master to this branch
Yulong [Tue, 25 Apr 2017 12:14:54 +0000 (08:14 -0400)]
component/bt:Merge the new master to this branch

7 years agoMerge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf
Yulong [Tue, 25 Apr 2017 11:58:24 +0000 (07:58 -0400)]
Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf

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 agoAssert when a new task is started on a nonexisting CPU
Jeroen Domburg [Tue, 25 Apr 2017 09:47:25 +0000 (17:47 +0800)]
Assert when a new task is started on a nonexisting CPU

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 agocomponent/bt:separate the SMP, GATT module set the macro output the function.
Yulong [Tue, 25 Apr 2017 08:55:29 +0000 (04:55 -0400)]
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.

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 agocomponent/bt: Set the style to the same, output the macro in the function.
Yulong [Tue, 25 Apr 2017 03:46:37 +0000 (23:46 -0400)]
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).

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 agocompoent/bt:change the code style
Yulong [Sun, 23 Apr 2017 09:52:18 +0000 (05:52 -0400)]
compoent/bt:change the code style

7 years agocomponent/bt:separate the smp_br_connect_callback from the BLE only mode
Yulong [Sun, 23 Apr 2017 04:48:23 +0000 (00:48 -0400)]
component/bt:separate the smp_br_connect_callback from the BLE only mode

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 agocomponent/bt:Recovery the btm_establish_continue when created the acl connection
Yulong [Fri, 21 Apr 2017 06:43:35 +0000 (02:43 -0400)]
component/bt:Recovery the btm_establish_continue when created the acl connection

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