Commit graph

4756 commits

Author SHA1 Message Date
Angus Gratton
01befe4d6a Merge branch 'bugfix/i2c_hw_fsm_recover' into 'master'
bugfix(i2c): add I2C hardware reset if the hw FSM get stuck

See merge request !1272
2017-10-23 10:16:02 +08:00
Ivan Grokhotkov
fbd52dcf34 spi_flash: fix build error with profiling enabled 2017-10-22 12:57:56 +08:00
Ivan Grokhotkov
f039aac1e5 Merge branch 'bugfix/i2s_bck_polariy' into 'master'
bugfix(i2s): fix bck polarity issue when using pll clock.

See merge request !1428
2017-10-22 12:36:27 +08:00
Ivan Grokhotkov
000a4f5941 Merge branch 'bugfix/rmt_thresh_check' into 'master'
bugfix(rmt): fix event thresh check issue

See merge request !1423
2017-10-22 12:35:44 +08:00
Ivan Grokhotkov
59b7d98fec Merge branch 'feature/dfs' into 'master'
Dynamic frequency scaling

See merge request !1189
2017-10-22 12:34:11 +08:00
Wangjialin
ed1e32f583 bugfix(i2c): add I2C hardware reset if the hw FSM get stuck
Reported from different sources from github or bbs:

https://github.com/espressif/esp-idf/issues/680

https://github.com/espressif/esp-idf/issues/922

We tested reading several sensor or other I2C slave devices, if the power and SDA/SCL wires are in proper condition, everything works find with reading the slave.
If we remove the power supply for the slave during I2C is reading, or directly connect SDA or SCL to ground, this would  cause the I2C FSM get stuck in wrong state, all we can do is the reset the I2C hardware in this case.
After this commit, no matter whether the power supply of I2C slave is removed or SDA / SCL are shorted to ground, the driver can recover from wrong state.

We are not sure whether this the save issue with the reported one yet, but to make the driver more robust.

Further information:

1. For I2C master mode, we have tested different situations, e.g., to short the SDA/SCL directly to GND/VCC, to short the SDA to SCL, to un-plug the slave device, to power off the slave device. Under all of those situations, this version of driver can recover and keep working.
2. Some slave device will die by accident and keep the SDA in low level, in this case, master should send several clock to make the slave release the bus.
3. Slave mode of ESP32 might also get in wrong state that held the SDA low, in this case, master device could send a stop signal to make esp32 slave release the bus.

Modifications:

1. Disable I2C_MASTER_TRAN_COMP interrupt to void extra interrupt.
2. Disable un-used timeout interrupt for slave.
3. Add bus reset if error detected for master mode.
4. Add bus clear if SDA level is low when error detected.
5. Modify the argument type of i2c_set_pin.
6. add API to set timeout value
7. add parameter check for timing APIs
2017-10-21 02:10:59 +08:00
Angus Gratton
f76a3c45c0 newlib: Disable sys/types.h implementations of FD_SET, etc.
Temporary measure, until we have VFS-level select() support.

Closes https://github.com/espressif/esp-idf/issues/1141
2017-10-20 18:11:32 +08:00
Angus Gratton
e5ae0f5927 lwip: Make LWIP_SOCKET_OFFSET signed, remove need for underflow check
This reverts commit 541493d877.
2017-10-20 18:04:28 +08:00
Angus Gratton
22756b6c02 Merge branch 'feature/FreeRTOS_Trace_Facilities' into 'master'
feature/make freertos trace facility configurable

See merge request !1420
2017-10-20 16:42:15 +08:00
Ivan Grokhotkov
b6f37bda97 Merge branch 'feature/i2s_built_in_adc' into 'master'
feature(I2S-ADC): add ADC mode for I2S.

See merge request !1077
2017-10-20 15:52:56 +08:00
Darian Leung
a6854b72cd freertos/make trace facility configurable
This commit makes configUSE_TRACE_FACILITY and
configUSE_STATS_FORMATTING_FUNCTIONS configurable in kconfig. Test cases fro the
functions enabled by the two configurations above have also been added.

Test cases for the following functions have been added...

- uxTaskGetSystemState()
- uxTaskGetTaskNumber()
- vTaskSetTaskNumber()

- xEventGroupClearBitsFromISR()
- xEventGroupSetBitsFromISR()
- uxEventGroupGetNumber()

- uxQueueGetQueueNumber()
- vQueueSetQueueNumber()
- ucQueueGetQueueType()

Test cases for the following functions were not required...

- prvListTaskWithinSingleList()
- prvWriteNameToBuffer()
- vTaskList()
2017-10-20 15:17:17 +08:00
Angus Gratton
477ed8ce62 Merge branch 'bugfix/touchpad_dac_mismatch_on_tp8_tp9' into 'master'
bugfix(touch): add workaround for touch pad DAC hardware source mismatch on tp8 and tp9.

See merge request !1288
2017-10-20 14:18:32 +08:00
Ivan Grokhotkov
dbebece1d2 Merge branch 'feature/unit-test-configs' into 'master'
unit-test-app: add support for testing multiple configurations

See merge request !1249
2017-10-20 14:03:53 +08:00
Angus Gratton
b30c0d1bbb Merge branch 'feature/add_dns_api' into 'master'
tcpip_adapter/lwip: add dns api

See merge request !1405
2017-10-20 11:54:20 +08:00
Angus Gratton
47aaf402b8 heap: Add heap_caps_dump() / heap_caps_dump_all() functions
Dump the structure of the heap for debugging purposes.
2017-10-20 11:38:24 +08:00
Angus Gratton
b10e1a92b6 freertos: Update comments in "port" section (portMUX/etc)
Some comments had fallen out of date.
2017-10-20 11:17:44 +08:00
Wangjialin
a84db78eb1 bugfix(i2s): fix bck polarity issue when using pll clock.
reported from github: https://github.com/espressif/esp-idf/issues/1119

Digital team think it is due to the decimal divider.
We can reset the i2s tx and rx when calling i2s_stop to avoid this.
2017-10-19 23:23:01 +08:00
Ivan Grokhotkov
90bbcbcdc0 unit tests: fix warnings, build with -Werror
- libsodium: silence warnings
- unit tests: fix warnings
- spiram: fix warnings
- ringbuf test: enable by default, reduce delays
2017-10-19 21:35:23 +08:00
Ivan Grokhotkov
b52e3fae64 build system: fix warning about undefined variable 'quote' 2017-10-19 21:35:23 +08:00
Ivan Grokhotkov
ae7404972c sleep: don't power down VDD_SDIO in light sleep if SPIRAM is enabled 2017-10-19 21:35:23 +08:00
Ivan Grokhotkov
d55ddfe56d update libstdc++.a built with pSRAM workaround 2017-10-19 21:35:22 +08:00
Ivan Grokhotkov
8990549e89 spi_flash: fix spi_flash_read into buffer in external RAM, add test 2017-10-19 21:35:21 +08:00
Ivan Grokhotkov
099565635b soc: correct values of SOC_BYTE_ACCESSIBLE_LOW, SOC_MEM_INTERNAL_LOW
Internal byte accessible memory starts with Internal ROM 1 at 0x3FF90000.
Region of RTC fast memory starting at 0x3FF80000 is not used in IDF as
it is mapped to PRO CPU only.
2017-10-19 21:35:21 +08:00
Ivan Grokhotkov
ee99bdfbad spi_flash_cache_enabled: report correct result in single core mode 2017-10-19 21:35:21 +08:00
Ivan Grokhotkov
cc67500d3e unit test: adapt tests to single core configuration 2017-10-19 21:35:21 +08:00
He Yin Ling
1fc2ac8b09 unit-test: esp timer use same name as ets timer
We will use case name to select test cases in UT jobs.
Same case name is not allowed.
2017-10-19 21:35:21 +08:00
Ivan Grokhotkov
6cc8099610 Merge branch 'bugfix/malloc_failure' into 'master'
heap: Fix race condition causing malloc() to fail under some conditions

See merge request !1424
2017-10-19 21:30:26 +08:00
Ivan Grokhotkov
c360f8dece Merge branch 'bugfix/heap_check_integrity' into 'master'
heap: Fix spurious heap_caps_check_integrity() errors in Comprehensive mode

See merge request !1421
2017-10-19 21:30:16 +08:00
Liu Zhi Fu
cf7ae8135b tcpip_adapter/lwip: make dhcp domain name server option configurable
Add api to configure dhcp option: domain name server

1.closes https://github.com/espressif/esp-idf/issues/162

2.closes https://github.com/espressif/esp-idf/issues/705
2017-10-19 19:28:00 +08:00
Angus Gratton
b0c5665f15 heap: Fix race condition causing malloc() to fail under some conditions
During a call to multi_heap_malloc(), if both these conditions were true:
- That heap only has one block large enough for the allocation
  (this is always the case if the heap is unfragmented).
- Another allocation is simultaneously occurring in the same heap.

... multi_heap_malloc() could incorrectly return NULL.

This caused IDF heap_caps_malloc() and malloc() to also fail, particularly
often if only one or two heaps had space for the allocation (otherwise
heap_caps_malloc() fails over to the next heap).
2017-10-19 16:05:00 +08:00
Ivan Grokhotkov
8e01b4aef8 Merge branch 'docs/esp32_hooks' into 'master'
docs/Added documentation about esp32 hooks

See merge request !1417
2017-10-19 12:32:36 +08:00
Wangjialin
ab1abff080 bugfix(rmt): fix event thresh check issue
reported from: https://github.com/espressif/esp-idf/issues/1011

1. Fix event thresh check issue
2. Change IO number in example in case it conflicts with GPIO16(psram cs pin).
2017-10-18 18:49:09 +08:00
Ivan Grokhotkov
54d2dc7681 Merge branch 'bugfix/fix_some_wifi_bugs' into 'master'
esp32: fix some wifi bugs

See merge request !1414
2017-10-18 16:20:09 +08:00
Angus Gratton
04188d8ec7 heap: Fix spurious heap_caps_check_integrity() errors in Comprehensive mode
Heap was not being locked before poisoning, so heap_caps_check_integrity()
would sometimes race with checking the poison bytes and print unnecessary
errors.

Details: https://esp32.com/viewtopic.php?f=2&t=3348&p=15732#p15732
2017-10-18 15:57:52 +08:00
Darian Leung
461f8da704 docs/Added documentation about esp32 hooks
This commit adds documentation about the esp32 Idle and Tick Hooks
2017-10-18 15:19:35 +08:00
Angus Gratton
78f70d4e79 Merge branch 'bugfix/cxx_exceptions' into 'master'
Full C++ Exception Support option (& reclaim memory when exceptions disabled)

See merge request !1353
2017-10-18 15:08:10 +08:00
Deng Xin
80b14fc77f esp32: fix some wifi bugs
1. Fix WiFi timer enable twice issue
2. Fix a softAP compatibility issue
3. Fix ebuf alloc counter issue
4. remove nvs_flash_init() in esp_wifi_init()
5. Fix scan only find few APs after set bssid
6. Fix can not connect to hidden SoftAP
7. Remove group key entry before connecting ot AP
2017-10-18 14:53:19 +08:00
Ivan Grokhotkov
d503b991b4 bt: lock APB frequency while BT controller is enabled 2017-10-18 14:37:22 +08:00
Ivan Grokhotkov
373d85dd9f freertos: fix error when including xtensa-timer.h from other components 2017-10-18 14:37:22 +08:00
Ivan Grokhotkov
266d2b3e4f ethernet: lock APB frequency while ethernet is enabled 2017-10-18 14:37:22 +08:00
Ivan Grokhotkov
5048d38ce7 spi slave: lock APB frequency while driver is in use 2017-10-18 14:37:21 +08:00
Ivan Grokhotkov
e4616588b7 spi master: lock APB frequency while in transaction 2017-10-18 14:19:21 +08:00
Ivan Grokhotkov
330b6bd668 sdmmc: lock APB frequency while in transaction 2017-10-18 14:19:20 +08:00
Ivan Grokhotkov
c2fff997ea sysview: always use TG as timestamp source 2017-10-18 14:19:20 +08:00
Ivan Grokhotkov
fba9678c56 uart: add support for REF_TICK 2017-10-18 14:19:20 +08:00
Ivan Grokhotkov
bfeecd2b56 freertos: deprecate XT_CLOCK_FREQ
- freertos: add deprecated definition for XT_CLOCK_FREQ
- flash_ops: don't use XT_CLOCK_FREQ
- unity: don't use XT_CLOCK_FREQ
- hw_random: don't use XT_CLOCK_FREQ
- core_dump: don't use XT_CLOCK_FREQ
- app_trace: don't use XT_CLOCK_FREQ
- xtensa_init: init xt_tick_divisor
2017-10-18 14:19:19 +08:00
Ivan Grokhotkov
df3c857a30 esp32: add power management hooks for WiFi library 2017-10-18 14:19:19 +08:00
Ivan Grokhotkov
eb0c34e5c9 esp_timer: add support for frequency scaling 2017-10-18 14:19:18 +08:00
Ivan Grokhotkov
3f818f4862 pm: support for tracing using GPIOs 2017-10-18 14:19:18 +08:00
Ivan Grokhotkov
535695f0b9 freertos: add frequency switching hooks to ISR and idle task 2017-10-18 14:19:17 +08:00
Ivan Grokhotkov
42d51a4224 esp32: initialize PM at startup, add Kconfig options 2017-10-18 14:19:17 +08:00
Ivan Grokhotkov
68e1751b78 pm: initial implementation for ESP32 2017-10-18 14:19:16 +08:00
Ivan Grokhotkov
47e3c9dd4b pm: initial version of power management APIs 2017-10-18 14:19:16 +08:00
Ivan Grokhotkov
4798b7d775 unit tests: add test to dump esp_timer stats 2017-10-18 14:19:15 +08:00
Ivan Grokhotkov
3788b35f87 unit tests: more robust esp_timer test 2017-10-18 14:19:15 +08:00
Ivan Grokhotkov
b03e08dc4e soc/rtc: add function to convert CPU frequency in MHz to rtc_cpu_freq_t 2017-10-18 14:19:15 +08:00
Ivan Grokhotkov
a242ae6d0b soc/rtc: add fast paths for switching between PLL and XTAL 2017-10-18 14:19:14 +08:00
Ivan Grokhotkov
37e9bc715c esp_clk.h: make public, add getters for RTC time, CPU/APB freq 2017-10-18 14:19:14 +08:00
Ivan Grokhotkov
f13623d97d make esp_timer.h public 2017-10-18 12:31:38 +08:00
Ivan Grokhotkov
566f018996 crosscore_int: add support for FREQ_SWITCH event 2017-10-18 12:31:38 +08:00
Ivan Grokhotkov
2e8441df9e Merge branch 'feature/fsync' into 'master'
vfs,fat: add fsync to VFS interface, implement it for fatfs

See merge request !1412
2017-10-18 07:17:56 +08:00
Ivan Grokhotkov
07c44d7f01 fatfs: expose some configuration values in Kconfig
- _FS_TINY: disables per-file caches
- _FS_TIMEOUT: locking timeout for concurrent access
- _FS_LOCK: prevents operations which are not allowed on open files

Also sets _MAX_SS based on sector size configured for wear_levelling.
This reduces memory usage of FATFS if wear_levelling is using 512 byte
sectors.
2017-10-17 18:43:46 +08:00
Tian Hao
09862b5918 component/esp32 : update phy & rtc
RTC V230
add BT AGC saturation protection, replace RTC V229.

PHY V362
Power up print: "phy_version: 362.0, 61e8d92, Sep 8 2017, 18:48:13"
1. esp_init_data_v3.bin
modify TX target power
modify WIFI & BT RX gain table
2. modify phy_close_rf()
3. add phy_set_most_tpw()
4. 26M crystal work OK
5. noise_check_loop ok
2017-10-17 18:02:42 +08:00
Ivan Grokhotkov
6b8c8bf638 Merge branch 'bugfix/slave_dma_claim' into 'master'
fix(spi_slave): enable DMA clock when initialization.

See merge request !1385
2017-10-17 17:41:39 +08:00
Ivan Grokhotkov
7babc74fce Merge branch 'feature/reduce_min_num_of_wifi_static_tx_buffer' into 'master'
Reduce minimum number of WiFi static tx buffer

See merge request !1398
2017-10-17 17:40:14 +08:00
Angus Gratton
3f4c8f7174 pthreads local storage: add test for unique keys 2017-10-17 15:29:25 +08:00
Angus Gratton
69e92ee320 unit tests: If heap tracing is enabled in sdkconfig, leak trace each test 2017-10-17 15:29:25 +08:00
Angus Gratton
9c7477ef34 cxx: Add KConfig option for C++ exceptions, disable by default
Fixes https://github.com/espressif/esp-idf/issues/1072

(Additional 20KB is still used if C++ exception support is enabled in
menuconfig.)
2017-10-17 15:29:25 +08:00
Ivan Grokhotkov
502c3d0243 vfs,fat: add fsync to VFS interface, implement it for fatfs 2017-10-17 15:14:53 +08:00
Angus Gratton
a231ba22f3 cxx: Add a sanity check for C++ exception support 2017-10-17 14:46:08 +08:00
Angus Gratton
86c89ff169 pthread: Add support for pthread thread local storage
Refactors LWIP to use this for the LWIP thread local semaphore
2017-10-17 14:46:08 +08:00
Angus Gratton
3234064b6a freertos: Idle task shouldn't hold xTaskQueueMutex while calling TLS destructors
If the callbacks use any blocking call (ie printf), this can otherwise trigger a deadlock.
2017-10-17 14:31:58 +08:00
Angus Gratton
2ccc2ec5ee cxx tests: Fix race condition w/ leak checker when tearing down test tasks 2017-10-17 14:31:58 +08:00
Angus Gratton
90bf40587e Merge branch 'feature/sockets_files_shared_fd_space' into 'master'
lwip & vfs: POSIX I/O functions operate on sockets and files (first stage, no select() yet)

See merge request !1352
2017-10-17 14:17:09 +08:00
Ivan Grokhotkov
6e7dd5962b Merge branch 'bugfix/add_mutex_for_dual_core_hooks' into 'master'
freertos/Add mutex for dual core hooks

See merge request !1406
2017-10-17 14:15:09 +08:00
Ivan Grokhotkov
08d6ca4f70 Merge branch 'bugfix/ets_timer_iram' into 'master'
wifi/bt coexistence: Fix disabled cache access race when writing to flash

See merge request !1409
2017-10-17 14:12:43 +08:00
Gabriel Carstoiu
8128bb95ef fix(spi_slave): enable DMA clock when initialization.
merging in the code updates to the SPI master code done in commit b834fcf78a.

TW#15670, Closes #1027
2017-10-17 12:20:40 +08:00
michael
88f602a0e0 fix(periph_ctrl): fix reset function in periph_ctrl.c 2017-10-17 12:20:40 +08:00
michael
8e31a36562 feat(spi_slave): append trans_len field in trans_desc to show length actually transferred. 2017-10-17 12:01:12 +08:00
Ivan Grokhotkov
d3bb9de36a Merge branch 'feature/spiram_init_in_app' into 'master'
spiram: expose function to initialize SPI RAM cache

See merge request !1281
2017-10-17 04:56:35 +08:00
Ivan Grokhotkov
b58e19f8a2 Merge branch 'bugfix/soc_component_rodata' into 'master'
soc: place constant data from rtc_clk.c into DRAM

See merge request !1321
2017-10-17 04:54:43 +08:00
Ivan Grokhotkov
edb212986f Merge branch 'bugfix/sd_card_fixes' into 'master'
SD card fixes

See merge request !1393
2017-10-17 04:45:24 +08:00
Ivan Grokhotkov
2bba4a77c4 Merge branch 'bugfix/console_empty_command' into 'master'
console: handle empty input to esp_console_run correctly

See merge request !1390
2017-10-17 04:44:19 +08:00
Ivan Grokhotkov
468d90762a Merge branch 'bugfix/freertos_portmux_debug' into 'master'
freertos: fix compilation errors with portMUX debugging enabled

See merge request !1392
2017-10-17 04:44:04 +08:00
Ivan Grokhotkov
a638871aa5 Merge branch 'bugfix/nvs_init_partition' into 'master'
nvs: fix nvs_flash_init_partition initializing default partition

See merge request !1391
2017-10-17 04:43:54 +08:00
Angus Gratton
094cf4d79d wifi/bt coexistence: Fix disabled cache access race when writing to flash
Moves the ets_timer_arm() / ets_timer_disarm() code paths to RAM

Overhead is 740 bytes of IRAM, 0 bytes DRAM

(For comparison: If all of esp_timer.c is moved to RAM, overhead is 1068 bytes IRAM and 480 bytes DRAM.)
2017-10-16 19:47:33 +08:00
Jiang Jiang Jian
99f2996779 Merge branch 'bugfix/tw15595_eth_got_ip_log_error' into 'master'
esp32/tcpipadapter: correct eth ip got event info

See merge request !1388
2017-10-16 17:30:14 +08:00
Jiang Jiang Jian
50c993a1b2 Merge branch 'feature/some_refactor_for_esp_ping' into 'master'
lwip: refactor to socket ping

See merge request !875
2017-10-16 17:30:00 +08:00
Yulong
4b1968f315 component/bt: Change the queue_data->p_attr->p_value->attr_val.attr_len += queue_data->len code to the if case. 2017-10-16 03:42:49 -04:00
Darian Leung
7584f89278 esp32/Add mutex for dual core hooks
This commit adds critical sections for the dual core hooks
2017-10-16 11:47:38 +08:00
Angus Gratton
539262b5c2 vfs: Remove fd_offset member
This was intended for integrating LWIP, but a different approach was used.
2017-10-16 09:45:50 +08:00
Angus Gratton
4a9d4587b7 vfs: Add C++ guards to esp_vfs_dev.h
Closes https://github.com/espressif/esp-idf/issues/1069
2017-10-16 09:45:50 +08:00
Angus Gratton
541493d877 lwip: Check for underflow in FD_SET()/FD_GET()
select() only works with LWIP sockets which have a high LWIP_SOCKET_OFFSET,
so chance of accidental underflow is high.
2017-10-16 09:45:50 +08:00
Angus Gratton
3f83914f7a lwip: Fix bug with LWIP_SOCKET_OFFSET & IGMP group support 2017-10-16 09:45:50 +08:00
Angus Gratton
48d9d507aa newlib: Remove fcntl() implementation from libc
Allows fcntl() implementation in vfs to be used.

Closes https://github.com/espressif/esp-idf/issues/1070

Note this is different to the other libc file-related syscalls, as there is no
reent structure involved.
2017-10-16 09:45:50 +08:00
Angus Gratton
3ebf7923d3 lwip: Route LWIP socket POSIX I/O functions via IDF VFS layer
No more conflicts between LWIP & newlib read(), write(), fcntl(), etc.

select() still only works if all of the fds are sockets.

Closes https://github.com/espressif/esp-idf/issues/273
2017-10-16 09:45:49 +08:00
Angus Gratton
a320fed3b5 vfs: Add ioctl() to filesystem set 2017-10-16 09:45:49 +08:00
Angus Gratton
0c50b65a34 lwip: Increase minimum TCP/IP task stack size if log level is Debug or Verbose
... unless nano formatting is enabled.

Fixes stack overflow in tcpip_adapter at the default level, as reported on forum:
https://esp32.com/viewtopic.php?f=2&t=3250&p=15538#p15447
2017-10-16 09:43:23 +08:00
Angus Gratton
b013f5d490 Merge branch 'bugfix/freertos_resume_scheduler_pending_tasks' into 'master'
freertos: Fix bug with xTaskResumeAll() not resuming all tasks

See merge request !1330
2017-10-16 09:43:04 +08:00
Ivan Grokhotkov
1da3204a7c spiram: expose function to initialize SPI RAM cache
Some frameworks based on ESP-IDF need to be able to decide whether to
initialize SPI RAM after the application has started. This change splits
out part of esp_spiram_init which manipulate cache MMU into a separate
function. Applications can disable cache, call esp_spiram_init_cache,
re-enable cache, and then call esp_spiram_init.
Disabling and re-enabling the cache can be achieved using functions
provided in esp_spi_flash.h.
2017-10-16 09:15:11 +08:00
He Yin Ling
3a271a4ae7 Merge branch 'bugfix/freertos_dual_core_hooks' into 'master'
bugfix/freertos_dual_core_hooks

See merge request !1399
2017-10-14 09:41:03 +08:00
Jiang Jiang Jian
a1d23051b4 Merge branch 'bugfix/tw15538_ipv6_socket_close_error' into 'master'
lwip: init lwip error code

See merge request !1379
2017-10-13 19:15:44 +08:00
Darian Leung
95d63137d1 bugfix/freertos_dual_core_hooks
This commit fixes bugs with the dual core changes to freeRTOS tick and idle hooks.
Interrupt watchdog now registers tick hooks to both cores.
API for cross core tick and idle hook registration were also added
2017-10-13 18:27:53 +08:00
XiaXiaotian
c730f676c3 Reduce minimum number of WiFi static tx buffer
Calibrate tx power after sending five packets
2017-10-13 17:11:31 +08:00
Jiang Jiang Jian
713dee57f0 Merge branch 'feature/add_const_for_wifi_api' into 'master'
esp32: add const for some WiFi api

See merge request !1394
2017-10-13 17:08:29 +08:00
Liu Zhi Fu
3bcaa592ee lwip: refactor to socket ping
Do some refactor to socket ping:
1. Add ping_deinit to kill ping thread
2. Apply configuration set by esp_ping_set_target to socket ping
3. Limit only one ping thread
2017-10-13 16:37:09 +08:00
Jiang Jiang Jian
a0ad3ff008 Merge branch 'bugfix/btdm_fix_set_attr_value_crash_when_length_is_0' into 'master'
component/bt: fix crash when the length of attr value set zero

See merge request !1397
2017-10-13 16:00:15 +08:00
Liu Zhi Fu
e2d077cea1 lwip: init lwip error code
Init the error code to ERR_OK when call tcpip_apimsg
2017-10-13 15:59:04 +08:00
Jiang Jiang Jian
90be957af1 Merge branch 'bugfix/btdm_fix_register_app_id_failed_when_more_than_3' into 'master'
component/bt: fix register more than three app_ids failed

See merge request !1389
2017-10-13 15:57:00 +08:00
Liu Zhi Fu
e04a0d66b8 esp32/tcpipadapter: correct eth ip got event info
1. Raise SYSTEM_EVENT_ETH_GOT_IP when eth got ip
2. Add default handler for SYSTEM_EVENT_ETH_GOT_IP
3. Minor change about ethernet kconfig
2017-10-13 15:56:51 +08:00
Jiang Jiang Jian
6ff5c32ae5 Merge branch 'feature/alloc_memories_of_wifi_and_lwip_in_spiram_first' into 'master'
Allocate some memories in SPIRAM first.

See merge request !1367
2017-10-13 15:47:27 +08:00
Jiang Jiang Jian
aa7a1e5e2d Merge branch 'bugfix/btdm_controller_deinit' into 'master'
component/bt : allow init after de-init

See merge request !1371
2017-10-13 15:44:58 +08:00
Liu Zhi Fu
0e586a4cdf esp32: add const for some WiFi api
Add const if the pointer parameter is const
2017-10-13 15:10:34 +08:00
zhiweijian
520b3340f6 Component/bt: fix crash when set attr value 0 2017-10-13 15:06:08 +08:00
XiaXiaotian
5df39cd4b6 Allocate some memories in SPIRAM first.
Try to allocate some WiFi and LWIP memories in SPIRAM first. If
    failed, try to allocate in internal RAM then.
2017-10-13 10:11:24 +08:00
Angus Gratton
0a52dbccca Merge branch 'bugfix/spi_reset_race' into 'master'
periph_ctrl: Refactor to add periph_module_reset(), avoid potential race in SPI DMA workaround

See merge request !1349
2017-10-13 08:51:36 +08:00
Angus Gratton
5d8bd1aa9e Merge branch 'bugfix/libsodium_mbedtls_sha' into 'master'
libsodium: Fix mbedTLS SHA256 & SHA512 implementation, make optional

See merge request !1329
2017-10-13 08:50:24 +08:00
Ivan Grokhotkov
715d081341 freertos: fix compilation errors with portMUX debugging enabled
Fixes https://github.com/espressif/esp-idf/issues/1057

Ref TW15702.
2017-10-13 08:33:57 +08:00
Ivan Grokhotkov
3cf23ff77d sdmmc: allow command timeouts to be configured
Previously the timeout was set to the same value (1000ms) for all kinds
of commands. In some cases, such as with slow cards, write commands
failed to complete in time.
This change makes command timeouts configurable via sdmmc_host_t
structure, and also makes default timeouts different for ordinary
commands and write commands.

Closes https://github.com/espressif/esp-idf/issues/1093

Ref TW15774.
2017-10-13 08:16:07 +08:00
Angus Gratton
ca7485cc9a freertos: Remove "stop program on scheduler start when JTAG/OCD is detected" option
No longer used with new dual core target & JTAG instructions.
2017-10-13 10:54:02 +11:00
Ivan Grokhotkov
ab13db0e45 nvs: fix nvs_flash_init_partition initializing default partition
Fixes https://github.com/espressif/esp-idf/issues/1052.

Ref TW15698.
2017-10-13 07:19:16 +08:00
Ivan Grokhotkov
4d42b5ea24 console: handle empty input to esp_console_run correctly
Fixes https://github.com/espressif/esp-idf/issues/1067

Ref. TW15752
2017-10-13 07:14:53 +08:00
zhiweijian
49ad8bf6c3 Component/bt: fix register more than 3 app_id failed 2017-10-12 21:07:40 +08:00
Jiang Jiang Jian
8e47c355fa Merge branch 'feature/i2s_apll' into 'master'
driver/i2s: add support apll clock

See merge request !1115
2017-10-12 19:06:50 +08:00
Jiang Jiang Jian
244e947beb Merge branch 'bugfix/btdm_fix_add_whitelist_failed' into 'master'
Component/bt: fix add whitelist failed

See merge request !1326
2017-10-12 19:01:01 +08:00
Jiang Jiang Jian
dbee895741 Merge branch 'bugfix/phy_init_remove_descriptions' into 'master'
phy init: remove descriptions of PHY init parameters

See merge request !1363
2017-10-12 19:00:10 +08:00
Jiang Jiang Jian
f8caa403db Merge branch 'bugfix/btdm_remove_bond_device_not_return_error' into 'master'
component/bt: Fixed the bug when remove the bonded device with not exist address…

See merge request !1370
2017-10-12 18:59:09 +08:00
Jiang Jiang Jian
73462c052e Merge branch 'bugfix/btdm_fix_set_scan_params_not_work' into 'master'
component/bt: fix scan params not work when start scan

See merge request !1307
2017-10-12 18:57:36 +08:00
Jiang Jiang Jian
e0922c9564 Merge branch 'bugfix/i2s_set_pin_valid_gpio' into 'master'
change to GPIO_IS_VALID_OUTPUT_GPIO for data out pin

See merge request !764
2017-10-12 18:21:25 +08:00
Jiang Jiang Jian
da247c2cf8 Merge branch 'bugfix/ledc_duty_type_change' into 'master'
ledc_get_duty return type changed from int to uint32_t, target_duty changed from int to uint32_t

See merge request !752
2017-10-12 18:18:33 +08:00
Jiang Jiang Jian
52be20343b Merge branch 'bugfix/tw15438_mem_leak_on_wifi_start_stop_loop' into 'master'
Release DHCP structure memory when netif is down.

See merge request !1386
2017-10-12 17:51:58 +08:00
Jiang Jiang Jian
a4e4322f6c Merge branch 'bugfix/btdm_set_sec_properity_error' into 'master'
component/bt: Fix bug of set sec properity error

See merge request !1336
2017-10-12 17:45:32 +08:00
Jiang Jiang Jian
3f1198529f Merge branch 'bugfix/fail_to_connect_in_wps' into 'master'
WiFi :bug fix of fail to connect in wps

See merge request !1384
2017-10-12 17:39:29 +08:00
XiaXiaotian
ad1350f0ac Release DHCP structure memory when netif is down. 2017-10-12 17:03:44 +08:00
Angus Gratton
3a4bd7f16c Merge branch 'bugfix/wifi_tx_buffer_doc' into 'master'
wifi docs: Clarify WIFI_DYNAMIC_TX_BUFFER_NUM config item limit

See merge request !1375
2017-10-12 13:20:28 +08:00
Angus Gratton
f3681e22de wifi docs: Clarify WIFI_DYNAMIC_TX_BUFFER_NUM config item limit
Setting WIFI_DYNAMIC_TX_BUFFER_NUM to zero is not possible.

Also edit some of the related config docs a little.
2017-10-12 15:53:53 +11:00
Deng Xin
a99c89f6af bug fix of fail to connect in wps 2017-10-12 12:01:11 +08:00
Yulong
7617a3c434 component/bt: Fix the bug cann't use esp_ble_gatts_get_attr_value to get the attribute value after long write. 2017-10-11 07:47:12 -04:00
Deng Xin
a05867f673 Wifi: bugfix of fail to reconnect after reboot
fix the issue fail to reconnect after reboot
2017-10-11 17:58:36 +08:00
Jiang Jiang Jian
3ed90a559d Merge branch 'bugfix/btdm_fix_multi_connection_failed' into 'master'
component/bt: modify some comments

See merge request !1332
2017-10-11 17:00:34 +08:00
zhiweijian
cd3d9715bb Component/bt: fix add whitelist failed
- fix add whitelist failed
- add add whitelist callback func
2017-10-11 15:30:09 +08:00
Angus Gratton
353e81da63 freertos: Also test (& handle) the case where scheduler is disabled on other CPU...
ie CPU A has scheduler disabled and task blocked on Q. CPU B sends to Q (or gives mutex, etc.) Task on CPU A should be woken on scheduler resume.
2017-10-11 10:48:20 +11:00
Angus Gratton
3e62c2e052 freertos: When scheduler is disabled, tasks on other core should immediately resume
... if triggered by a SemaphoreGive/etc.

Previously they would resume after scheduler was resumed, on next
RTOS tick of other CPU.
2017-10-11 10:48:20 +11:00
Angus Gratton
f2f9170abc freertos: Fix bug with xTaskResumeAll() not resuming all tasks
Previously if multiple tasks had been added to xPendingReadyList for the CPU, only the first one was resumed.

Includes a test case for resuming multiple (pending) tasks on xTaskResumeAll().

Document the limitation that while scheduler is suspended on one CPU, it can't wake tasks on either CPU.
2017-10-11 10:48:20 +11:00
Yulong
fc359e4491 component/bt: Change the _btc_storage_remove_ble_bonding_keys function ret default vaule from 1 to 0. 2017-10-10 04:19:11 -04:00
Yulong
25e8c09b6d component/bt: Change the param.remove_bond_dev_cmpl.status value. 2017-10-10 04:02:05 -04:00
Tian Hao
b54ef13fae component/bt : allow init after de-init 2017-10-10 15:35:17 +08:00
Yulong
e02ff1ed89 component/bt: Change the bta_gattc_pop_command_to_send function to static. 2017-10-10 03:12:00 -04:00
Angus Gratton
30b40a2175 Merge branch 'bugfix/ff_ioctl_types' into 'master'
fatfs: use correct return types in ioctl calls

See merge request !1362
2017-10-10 15:01:47 +08:00
Angus Gratton
dda136eab7 Merge branch 'bugfix/heap_debugging_cleanup' into 'master'
Heap debugging docs cleanup & convenience functions

See merge request !1347
2017-10-10 14:59:54 +08:00
Yulong
8e08097151 component/bt: Fixed the bug when remove the bonded device with not exist address will not return error. 2017-10-10 02:29:54 -04:00
Jeroen Domburg
a8131b14b0 Merge branch 'feature/docs_update_uart_api' into 'master'
Updated functional overview of UART API documentation

See merge request !1328
2017-10-10 14:06:08 +08:00
Jeroen Domburg
1835c3a213 Merge branch 'feature/docs_update_pcnt_api' into 'master'
Extended description of the Pulse Counter API and removed redundant comments from the example

See merge request !1312
2017-10-10 14:06:03 +08:00
Jiang Jiang Jian
904d6c8f2b Merge branch 'feature/scan_optimize' into 'master'
wifi: scan optimize

See merge request !1334
2017-10-10 13:39:16 +08:00
Angus Gratton
f0d7cfdafe heap: Add new heap_caps_check_integrity_all() & heap_caps_check_integrity_addr() debugging functions
Easier to either check all heaps, or focus on checking a particular region.
2017-10-10 16:19:30 +11:00
Angus Gratton
bb8ba76604 Merge branch 'bugfix/multi_heap_get_info_typo' into 'master'
Fix multi_heap_get_info alias (from github)

See merge request !1357
2017-10-10 13:14:09 +08:00
Deng Xin
d515494d1b wifi: optimize scan feature
1. add the threshold of match AP in fast scan
2. add blacklist feature
3. make sure would wrong if password didn't set
4. add scan example
2017-10-10 12:27:02 +08:00
Jiang Jiang Jian
3106ca1c1e Merge branch 'bugfix/btdm_ea_overloaded' into 'master'
component/bt: increase programming delay for event arbiter to allow for heavy workload

See merge request !1338
2017-10-10 12:26:25 +08:00
Angus Gratton
19d983974f Merge branch 'feature/freertos_dual_core_hooks_github' into 'master'
freertos: Make the tick/idle hooks dual core compatible (from github)

See merge request !1361
2017-10-10 12:06:05 +08:00
Ivan Grokhotkov
104204ce56 fatfs: use correct return types in ioctl calls
GET_SECTOR_SIZE should return WORD (unsigned short) but returned
uint32_t.

Reference: http://elm-chan.org/fsw/ff/doc/dioctl.html

Closes https://github.com/espressif/esp-idf/pull/1031.
2017-10-10 12:02:32 +08:00
Ivan Grokhotkov
139b0c8396 Merge branch 'bugfix/fatfs_timezone' into 'master'
fatfs: use localtime_r instead of gmtime to get timezone

See merge request !1358
2017-10-10 12:00:24 +08:00
krzychb
9107b47deb Updated UART API documentation and examples. Included a fix of #1091 from GitHub 2017-10-10 05:54:36 +02:00
Ivan Grokhotkov
fdc24eb118 phy init: remove descriptions of PHY init parameters 2017-10-09 14:40:08 +08:00
Angus Gratton
ec85f9fc3f heap: Fix documentation references to multi_get_heap_info() 2017-10-09 14:42:31 +11:00
Daniel Campora
1c046f30a6 freertos: Make the tick/idle hooks dual core compatible
The way these hooks are implemented at the moment, once you register a tick or idle task hook, it is run by both cores, leading to intermittent crashes that are difficult to explain (and debug). One solution is to register the hook with the core that is currently running, which is what this patch attempts to do.

Merges https://github.com/espressif/esp-idf/pull/781
2017-10-09 13:04:20 +11:00
Angus Gratton
110c71d3f1 Merge branch 'feature/ipv6_socket_options' into 'master'
IPV6 multicast socket options

See merge request !964
2017-10-09 09:03:30 +08:00
Tuan PM
9d39881981 i2s: add support apll clock
using apll_param to setup APLL

new apll calculation method, much faster

validate freq calculation

Ensure that the i2s frequency is greater than the hardware limit

Add description of how to calculate apll clock, support apll for other 16-bits audio, check rev0 chip

correct space
2017-10-06 15:36:24 +07:00
Angus Gratton
de750e9921 Merge branch 'bugfix/pthread_join_hangup' into 'master'
Bugfix/pthread join hangup

See merge request !1346
2017-10-06 13:14:51 +08:00
Angus Gratton
acff3c9c59 libsodium: Fix mbedTLS SHA256 & SHA512 implementation, make optional
* Only direct invocation of cypto_hash_sha256 & crypto_hash_sha512 produced correct output.
* Some remaining header file mixups, so changed approach to wrapping the state structures.
* Fixes https://github.com/espressif/esp-idf/issues/1044 (crypto_sign problems)
* Add option to disable mbedTLS implementation for SHA256 & SHA512 in libsodium
2017-10-06 11:51:55 +11:00
Angus Gratton
0dd9b899b7 periph_ctrl: Refactor to add periph_module_reset(), avoid potential race in SPI DMA workaround
Also refactor use of direct clock access in unit test ref_clock (probably not a real issue)
2017-10-02 17:48:16 +11:00
Angus Gratton
530bca1813 freertos: Remove obsolete "Enable heap memory debug" option
All heap debugging is now under the Heap component.
2017-10-02 13:43:54 +11:00
Angus Gratton
3fdb1944d3 lwip: Disable IPV4 Link-Local addressing by default
Keeps existing IDF behaviour the same. Can still be enabled via menuconfig.
2017-10-02 10:50:27 +11:00
Angus Gratton
2cc8c91ad8 lwip: Remove undocumented CONFIG_MDNS macro flag
All options that were enabled via CONFIG_MDNS are now in menuconfig, with
the default values set the same as with CONFIG_MDNS enabled (meaning existing
projects that were using CONFIG_MDNS do not need to change).
2017-10-02 10:50:27 +11:00
Angus Gratton
04a2cefb26 lwip: Enable IPV6_ONLY option for UDP sockets (BSD & netconn)
* setsockopt(s, IPV6_ONLY, &one, sizeof(int)) will disable IPV6-only
  mode. Incoming/outgoing IPV4 packets are dropped.

* Otherwise, sockets bound to IPV6_ANY_ADDR can receive unicast packets
  for IPV4 or IPV6.

* sendto() a IPV6-mapped-IPV4 address on a UDP socket works correctly
  (not supported for RAW or TCP sockets.)

* getaddrinfo() option AI_V4MAPPED is implemented.

As well as extending support to TCP & RAW, there is some potential improvement
to dropping incoming packets - the drop happens a bit late in the process and
there is no "ICMP port unreachable" response sent.
2017-10-02 10:50:27 +11:00
Angus Gratton
961180617e lwip: Add IPV6 multicast group membership socket options
As described in RFC2133: IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS,
IPV6_MULTICAST_LOOP, IPV6_MULTICAST_LOOP, IPV6_DROP_MEMBERSHIP.
2017-10-02 10:50:27 +11:00
Alexey Gerenkov
5795ccc806 freertos: Fixes deadlock in pthread_once for init_routines calling pthread_once 2017-10-01 19:52:48 +03:00
Alexey Gerenkov
54a529f596 freertos: Fixes hangup upon pthread_join on finished thread 2017-10-01 19:52:48 +03:00
Luc
6e0f054884 use localtime_r instead of gmtime to get timezone
on fatfs
2017-09-30 21:44:35 +08:00
wangmengyang
2797966c47 component/bt: increase programming delay for event arbiter to allow for heavy workload 2017-09-30 18:12:45 +08:00
Jeroen Domburg
b6a2bd1184 Revert "esp32: New Task Watchdog API"
This reverts commit 616baa239d.
2017-09-30 18:07:19 +08:00
zhiweijian
c75da555af Component/bt: fix set scan params and start scan action 2017-09-30 17:01:57 +08:00
zhiweijian
4720196015 Component/bt: fix multi-connection failed
- modify some comments
2017-09-30 16:30:43 +08:00
Yulong
1a07a13727 component/bt: Change the 0x04 to Macro BTA_LE_AUTH_REQ_MITM. 2017-09-30 04:05:21 -04:00
Jiang Jiang Jian
91c259b105 Merge branch 'bugfix/btdm_change_pll_track_interrupt' into 'master'
component/bt : change pll track interrupt bits

See merge request !1310
2017-09-30 15:53:58 +08:00
Jiang Jiang Jian
c2a4713958 Merge branch 'bugfix/btdm_btc_ble_set_rand_addr' into 'master'
component/bt: Fix bug of function btc_ble_set_rand_addr

See merge request !1297
2017-09-30 15:49:53 +08:00
Jiang Jiang Jian
b420c62602 Merge branch 'bugfix/btdm_mem_leak_of_gattc_open_and_close' into 'master'
component/bt: Fix bug of memory leak of gatt open and close

See merge request !1325
2017-09-30 15:48:57 +08:00
Jiang Jiang Jian
a8dab7680a Merge branch 'bugfix/btdm_gattc_mutiple_read_bug' into 'master'
component/bt: Fixed the bug of mutiple read can not callback.

See merge request !1286
2017-09-30 15:45:56 +08:00
Jiang Jiang Jian
816fe6cf1f Merge branch 'bugfix/btdm_gattc_get_db_prop_bug' into 'master'
component/bt: Fiexd the bug of the gattc cannot get the db properties.

See merge request !1284
2017-09-30 15:42:45 +08:00
Jiang Jiang Jian
f619386967 Merge branch 'bugfix/btdm_fail_to_find_handle_#15534' into 'master'
component/bt: Fix the bug of total attr didn't reset when init the gattc cache.

See merge request !1331
2017-09-30 15:42:07 +08:00
Yulong
3d3bcd6275 component/bt: Added the gattc command queue support. 2017-09-30 13:59:14 +08:00
Yulong
fb93a59619 component/bt: added the queue to store the gattc commands. 2017-09-30 13:59:14 +08:00
Darian Leung
616baa239d esp32: New Task Watchdog API
Legacy API of task watchdog used the same function esp_task_wdt_feed() to add
and feed a task. This caused issues of implicitly adding a task to the wdt list
if the function was used in shared code.

The new API introduces init, adding, feeding, deleting, deinit functions. Tasks
must now be explicitly added to the task watchdog using their handles. Deletion
must also be explicit using task handles. This resolves the issue of implicit
task additions to the task watchdog due to shared code calling
esp_task_wdt_feed().

Task watchdog is now fully configurable at runtime by calling the init and
deinit functions.

Also added functions to get the handles of idle tasks of the other core. This
helps when adding idle tasks to the watchdog at run time.

Configuring the task watchdog using menu config is still available, however
menu config will only result in calling the init and add functions for idle
tasks shortly after the scheduler starts.

Menu config also allows for using legacy behavior, however the legacy behavior
willcall the new API functions but with slight variations to make them legacy
compatible.

Documentation and example have also been updated

gcov_rtio.c headers updated to prevent error of freertos header files being
included in the wrong order.

Resolves issue TW#13265
2017-09-29 23:10:55 +08:00
Darian Leung
ae9041ab71 esp32: Fix task watchdog timer triggering issues TW#14794
The two task watchdog timer bugs are as follows...
1) If only a single task existed on the wdt task list, and esp_task_wdt_feed()
was only called once, the watchdog triggers but fails to print task name
2) If a single task already exists on the task wdt list, and another task calls
esp_task_wdt_feed() once, the watchdog fails to trigger

Problem stemmed from the loop responsible for resetting the watchdog timer
having incorrect loop parameters. The loop failed to traverse the full length
of the task wdt list
2017-09-29 22:12:58 +08:00
baohongde
b78da3b715 component/bt: Fix bug of set sec properity error 2017-09-29 18:46:28 +08:00
baohongde
b59708ca87 component/bt: Fix bug of function btc_ble_set_rand_addr 2017-09-29 11:46:08 +08:00
Jeroen Domburg
740f8a79f0 Add logic to make external RAM usable with malloc() 2017-09-28 17:17:50 +08:00
baohongde
27e1db508d component/bt: Fix bug of function btc_ble_set_rand_addr 2017-09-28 14:41:31 +08:00
baohongde
68958a2485 component/bt: Fix bug of memory leak of gatt open and close 2017-09-28 14:34:57 +08:00
Yulong
f7a2cc37b3 component/bt: Fix the bug of total attr didn't reset when init the gattc cache. 2017-09-28 02:09:02 -04:00
Jeroen Domburg
58a5d883f4 Merge branch 'test/spi_master_internal_connect' into 'master'
test(spi_master): add test case for 3 DMA issues with internal connection by gpio mux.

See merge request !1217
2017-09-27 17:00:31 +08:00
Angus Gratton
a3a4a20518 Merge branch 'bugfix/bt_sdp_server_continuation' into 'master'
bluedroid: Add continuation offset check to SDP server

See merge request !1323
2017-09-27 11:13:54 +08:00
michael
fcd0f52e21 test(spi_master): add test case for 3 DMA issues with internal connection by gpio mux.
3 issues are:
1. RX buffer not aligned (start and end)
2. not setting rx_buffer
3. setting rx_length != length

also add spi release code here.
2017-09-27 10:44:28 +08:00
Angus Gratton
c9241b4310 bluedroid: Add continuation offset check to SDP server
Fix for CVE-2017-0785
https://android.googlesource.com/platform/system/bt/+/818cf6f%5E%21/#F0
2017-09-27 09:49:04 +10:00
krzychb
e69691427c Extended description of the Pulse Counter API and removed redundant comments from the example 2017-09-26 22:44:46 +02:00
Deomid Ryabkov
882f164e7c Fix multi_heap_get_info alias 2017-09-26 15:00:47 +01:00
Ivan Grokhotkov
73e8afc5b9 soc: place constant data from rtc_clk.c into DRAM
In release mode, switches in rtc_clk_bbpll_set would be converted to
jump tables. These tables would be placed into .rodata, which caused
rtc_clk_cpu_freq_set to be unusable while cache is disabled. This
manifested itself in crashes when exiting from light sleep:

https://esp32.com/posting.php?mode=reply&f=13&t=3089#pr14590
2017-09-26 17:08:49 +08:00
Ivan Grokhotkov
7d436c9a44 Merge branch 'bugfix/timestamp' into 'master'
fix(global, log): correct the CCOUNT register when switching CPU clock during boot 2nd and before scheduler.

See merge request !1296
2017-09-26 16:15:42 +08:00
Ivan Grokhotkov
b7a79ab67e Merge branch 'bugfix/bind_dhcp_server_udp_to_ip_of_ap' into 'master'
Fix the bug that if one device is in station+softap mode, other device can not get IP address after connecting to the softap.

See merge request !1314
2017-09-26 16:06:55 +08:00
Ivan Grokhotkov
545421be47 Merge branch 'feature/support_wifi_country_api' into 'master'
esp32: support wifi country code

See merge request !1300
2017-09-26 16:05:49 +08:00
Ivan Grokhotkov
bbab9ecf23 Merge branch 'feature/docs_update_sigmadelta_api' into 'master'
Updated sigma delta API documenation and example

See merge request !1319
2017-09-26 16:05:18 +08:00
michael
9d9e771933 fix(global, log): fix esp_log(_early)_timestamp readings after startup by correct the CCOUNT register when switching CPU clock.
TW#13332, Closes #700
2017-09-26 15:18:17 +08:00
Liu Zhi Fu
762f8da078 esp32: support wifi country code
1. Add completed support for WiFi country code
2. Modify esp_wifi_set_country API
2017-09-26 13:36:53 +08:00
Ivan Grokhotkov
fd02668d8b Merge branch 'feature/record_more_info_of_scanned_ap' into 'master'
Record more information of scanned AP

See merge request !1289
2017-09-26 10:13:48 +08:00
Ivan Grokhotkov
6875fd2339 Merge branch 'feature/tw15502_add_iperf_example' into 'master'
example: add iperf example

See merge request !1313
2017-09-26 09:38:34 +08:00
Liu Zhi Fu
05b0d567e5 example: add iperf example
Support iperf
2017-09-26 09:19:01 +08:00
krzychb
b5e4c76bfe Updated sigma delta API documenation and example 2017-09-25 21:31:09 +02:00
Tian Hao
e1177ca9cb component/bt : change pll track interrupt bits 2017-09-25 18:35:46 +08:00
Jiang Jiang Jian
2908e8a33a Merge branch 'bugfix/scan_fail' into 'master'
component/bt : fix bug of scan fail after a long time

See merge request !1301
2017-09-25 18:28:09 +08:00
Angus Gratton
1773770f44 Merge branch 'feature/multi_heap_assert' into 'master'
multi_heap: Print the problem address when aborting due to heap corruption

See merge request !1277
2017-09-25 09:51:14 +08:00
XiaXiaotian
20064978ba Fix the bug that if one device is in station+softap mode, other device can not
get IP address after connecting to the softap.

    Now the default netif is station in station+softap mode. The UDP pcb of
DHCP server is binded to IP 0.0.0.0. When other device connects to softap, the
DHCP offer will be sent by softap.But because the destination IP of DHCP offer
is broadcast IP and the source IP of it is 0.0.0.0, it will be sent from default
netif, that is station interface. Other device can not receive the DHCP offer
sent from station interface. As a result, other device can not get IP address.
The resolution is that bind UDP pcb to the IP address of softap. So, the source
IP of DHCP offer is that of softap. DHCP offer can be sent from softap interface
by source IP route method.
2017-09-23 20:18:50 +08:00
Ivan Grokhotkov
845c3fba35 Merge branch 'test/update_ble_known_issues' into 'master'
test: udpate new BLE known issues

See merge request !1306
2017-09-22 22:34:18 +08:00
Ivan Grokhotkov
750f47c28b Merge branch 'bugfix/gpio26_rtc_hold' into 'master'
driver/rtc: fix copy-paste error in HOLD_FORCE field name for GPIO26

See merge request !1299
2017-09-22 22:34:04 +08:00
Ivan Grokhotkov
7bfbc5bf7c Merge branch 'bugfix/light_sleep' into 'master'
Light sleep fix

See merge request !1303
2017-09-22 16:37:59 +08:00
XiaXiaotian
98dfb8c0b9 Record more information of scanned AP 2017-09-22 15:43:33 +08:00
Ivan Grokhotkov
6b61c6d39f esp32: exclude DPORT-related code in single core mode 2017-09-22 12:07:05 +08:00
Ivan Grokhotkov
3f761e1a83 light sleep: make sure code to be placed into IRAM is not inlined 2017-09-22 11:41:30 +08:00
He Yin Ling
363a20abec test: udpate new BLE known issues:
1. some cases caused by GATTC can't get correct attribute handle
2. some cases with increased fail ratio
2017-09-22 09:49:18 +08:00
Tian Hao
602b90b892 component/bt : fix bug of scan fail after a long time 2017-09-21 17:40:30 +08:00
Ivan Grokhotkov
0a6fdc3a96 Merge branch 'bugfix/btdm_enable_limit' into 'master'
BT controller: add function to release unused memory to the heap

See merge request !1248
2017-09-21 17:33:09 +08:00
Jeroen Domburg
c54a9ff40a Merge branch 'docs/FreeRTOS_SMP_Changes' into 'master'
docs: Added documentation for FreeRTOS SMP changes

See merge request !1238
2017-09-21 17:10:33 +08:00
Darian Leung
6ab552a6ea docs: Added documentation for FreeRTOS SMP changes
Added documentation about the ESP-IDF changes to FreeRTOS.
The documentation covers changes to the following FreeRTOS aspects.

    - Task Creation
    - Affects on scheduling (Task skipping, scheduler suspension, tick synchronicity)
    - Critical sections and disabling interrupts
    - Thread Local Storage Pointers and deletion callbacks
    - Configuring ESP-IDF FreeRTOS
2017-09-21 16:40:57 +08:00
Tian Hao
3e2ee24e4f component/bt : support bluetooth controller DRAM release dynamically
1. remove CONFIG_BT_DRAM_RELEASE from Kconfig
2. add API to release bluetooth controller DRAM to heap
2017-09-21 14:31:20 +08:00
Deng Xin
ee25caf4b2 WiFi: optimize scan feature
1. Add all channel scan feature
2. Add sort matched SSID by authmode feature
2017-09-21 14:28:49 +08:00
Ivan Grokhotkov
8c4c5ae034 Merge branch 'bugfix/apptrace_down_buf_init' into 'master'
esp32: Fixes double initialization of apptrace down ring buffer in dual core mode

See merge request !1274
2017-09-21 12:37:40 +08:00
Ivan Grokhotkov
64d1f947ed driver/rtc: fix copy-paste error in HOLD_FORCE field name for GPIO26
This error prevented EXT1 wakeup using GPIO26 from working.
2017-09-21 12:26:03 +08:00
Angus Gratton
b5aad2fa3d Merge branch 'bugfix/spiffs_debug' into 'master'
Fix typo in spiffs config

See merge request !1287
2017-09-21 07:24:43 +08:00
Angus Gratton
728b46c578 Merge branch 'bugfix/minor_fixes_github' into 'master'
Minor fixes from github

See merge request !1292
2017-09-21 07:21:32 +08:00
me-no-dev
14b12a27cf Fix typo in spiffs config and update submodule
Fixes github issues #1012 and #1013

https://github.com/espressif/esp-idf/issues/1012
https://github.com/espressif/esp-idf/issues/1013
2017-09-20 17:29:57 +08:00
Yulong
f325ba3942 component/bt: Change the cmpl_evt command in the bta_gattc_read_cmpl function. 2017-09-20 04:28:52 -04:00
Angus Gratton
7e428433e1 Merge branch 'bugfix/lwip_tcp_oversize_assert' into 'master'
fix lwip tcp_oversize_dbgcheck assert

See merge request !1260
2017-09-20 10:16:47 +08:00
Simon Werner
45ad0cdda2 Improved uart_flush() documentation.
Improved `uart_flush()` documentation based on this discussion: https://esp32.com/viewtopic.php?f=13&t=2804&p=13377&hilit=uart_flush#p13373

Merges https://github.com/espressif/esp-idf/pull/970
2017-09-20 12:09:44 +10:00
Tian Hao
b54719d00f component/bt : fix bluetooth controller enable limit && release memory when de-initialize bluetooth controller
1. fix bluetooth controller enable limit
2. release memory when de-initialize bluetooth controller
3. fix heap_caps_add_region limit
2017-09-19 21:14:28 +08:00
Wangjialin
449f9e10a3 bugfix(touch): add workaround for touch pad DAC hardware source mismatch on tp8 and tp9. 2017-09-19 20:10:39 +08:00
michael
1b91cb7be0 fix(sdspi): fix issues causing the sdspi driver to work low efficiently with DMA. 2017-09-19 19:00:47 +08:00
Yulong
e815660824 component/bt: Fixed the bug of mutiple read can not callback. 2017-09-19 04:50:26 -04:00
michael
074f36afff fix(spi_master): fix the heap corruption bug that RX DMA writes over the temporary buffer boundary.
TW#15434

Closes #994.
2017-09-19 16:47:14 +08:00
Yulong
7827bc486d component/bt: Fiexd the bug of the gattc cannot get the db properties. 2017-09-18 23:15:32 -04:00
Ivan Grokhotkov
9325f2a7a4 nvs_flash: emulator: fix issues in load function, add save function 2017-09-19 10:39:44 +08:00
Ivan Grokhotkov
fe30789149 nvs_flash: delete Storage if init fails
Previously, nvs_flash_init_custom would not be called if Storage for a
particular partition was already created. This caused issues if the
first call to nvs_flash_init failed due to Storage init error. This issue
exhibited itself as random failures of NVS CI test.

With this change, storage object is deleted (and not added to storage
list) if initialization fails.
2017-09-19 10:39:44 +08:00
Ivan Grokhotkov
f32b25ebe2 nvs_flash: add functions to deinitialize storage 2017-09-19 10:39:44 +08:00
Amey Inamdar
c8945bb82a nvs: minor - removed unused header inclusion
Signed-off-by: Amey Inamdar <amey.inamdar@gmail.com>
2017-09-18 17:02:32 +05:30
Jiang Jiang Jian
e9655c5d90 Merge branch 'feature/btdm_cherry_pick_ble_new_api' into 'master'
Feature/btdm cherry pick ble new api

See merge request !1113
2017-09-18 18:17:11 +08:00
Yulong
388bf8d579 componnent/bt: remove the <<<<<<< HEAD in the code. 2017-09-18 05:44:50 -04:00
Yulong
8925a90d40 squash again
squash the commit.
component/bt:Added the update_white_list & set_prefer_conn_params API to the bt project.

component/bt: Added the get white list size API & delete the read adv tx power API.

component/bt: Change the esp_gap_ble_api.h esp_ble_gap_set_prefer_conn_params API docs.

changed btm_find_dev to btm_find_or_alloc_dev

component/bt: Change the rssi API deep copy method.

component/bt: Change the code as comment in the gitlab.

squash the commit.
component/bt:Added the update_white_list & set_prefer_conn_params API to the bt project.

component/bt: Added the get white list size API & delete the read adv tx power API.

component/bt: Change the esp_gap_ble_api.h esp_ble_gap_set_prefer_conn_params API docs.

changed btm_find_dev to btm_find_or_alloc_dev

component/bt: Change the rssi API deep copy method.

component/bt: Change the code as comment in the gitlab.

component/bt: change the ESP_BLE_CONN_PARAM_UNDEF redefinition error.

component/bt: Change the ESP_BLE_IS_VALID_PARAM function with the compile error.
2017-09-18 05:39:26 -04:00
Angus Gratton
959462ffb6 multi_heap_poisoning: Use MULTI_HEAP_STDERR_PRINTF (ets_printf) to print heap errors
Needed because normal printf() can trigger a malloc() (for standard stream locks) which
then re-triggers this check.
2017-09-18 16:54:28 +10:00
Angus Gratton
76d8190444 multi_heap: Print the problem address when aborting due to heap corruption
New multi_heap code has proven effective at aborting when buffer overruns occur,
but it's currently hard to debug the stack traces from these failures.
2017-09-18 16:54:23 +10:00
michael
8244fa95fe feat(log): add new function to log buffer with level and hex dump. 2017-09-18 11:44:54 +08:00
Angus Gratton
9a1ba5985b Merge branch 'feature/partition_table_expand_line' into 'master'
partition_table: Expand vars before splitting fields (github #841)

See merge request !1174
2017-09-18 09:18:25 +08:00
Alexey Gerenkov
fe3b557fa8 esp32: Fixes double initialization of apptrace down ring buffer in dual core mode
Additional minor fixes:
 - Host file I/O code warnings
 - Initialization of down buffer for GCOV
2017-09-15 22:45:21 +03:00
Jiang Jiang Jian
3d7ec475d1 Merge branch 'feature/btdm_cherry_pick_change_gattc_api' into 'master'
component/bt: Change all the gattc API && bta gattc layer.

See merge request !1147
2017-09-15 19:39:29 +08:00
Jiang Jiang Jian
18f2a29a99 Merge branch 'bugfix/btdm_smp_close_compile_error' into 'master'
component/bt: fix the bug when close the SMP module in the menuconfig will lead to compile error.

See merge request !1265
2017-09-15 19:36:30 +08:00
Ivan Grokhotkov
4d62f8e5d0 Merge branch 'bugfix/apptrace_init_sequence' into 'master'
Changed initialization sequence of application tracing component on APP CPU so i…

See merge request !1256
2017-09-15 15:02:42 +08:00
Tian Hao
dff95aed65 component/bt : fix a malloc bzero of blufi 2017-09-15 11:08:42 +08:00
Yulong
875ba996d5 component/bt: fix the bug when close the SMP module in the menuconfig will lead to compile error. 2017-09-15 10:32:28 +08:00
zhangyanjiao
336c4b4a55 fix lwip tcp_oversize_dbgcheck assert 2017-09-15 10:28:51 +08:00
Alexey Gerenkov
b09f4acb27 Added proper handling of apptrace and pthread initialization errors 2017-09-14 20:47:43 +02:00
krzychb
a1ebeed303 Changed initialization sequence of application tracing component on APP CPU so it follows completion of initialization of the same component on PRO CPU. Previously, because of missing locking mechanism, both components were printing logs to UART at the same time. As results logs contained only corrupted characters / were not legible at all. Internal tracking: esp-idf/openocd-esp32, Issue 15 2017-09-14 20:47:43 +02:00
yulong
09a3e4fd58 squesh the commit.
component/bt: Change the idf test KnownIssues file.

component/bt: Fixed the bug of gattc mutilple read.
2017-09-14 09:35:36 -04:00
Jiang Jiang Jian
4c97fc04ca Merge branch 'bugfix/optimize_lwip_loopback_route' into 'master'
optimize lwip route when loopback open and in "APSTA" mode

See merge request !1252
2017-09-14 21:07:58 +08:00
Jiang Jiang Jian
5aa52709c2 Merge branch 'bugfix/fix_some_wifi_lib_bugs' into 'master'
Fix some wifi lib bugs

See merge request !1255
2017-09-14 20:39:02 +08:00
Jiang Jiang Jian
c74d944edf Merge branch 'feature/refractor_smartconfig' into 'master'
Refractor smartconfig

See merge request !1253
2017-09-14 20:38:30 +08:00
Jeroen Domburg
0460069582 Merge branch 'bugfix/panic_dport_no_mutex' into 'master'
Panic: stop dport access handler without trying to use a lock

See merge request !1244
2017-09-14 18:07:06 +08:00
Jiang Jiang Jian
fff90da8d6 Merge branch 'bugfix/btdm_gatt_read_by_type_bug' into 'master'
component/bt: Fix gatt read by type response bug

See merge request !1102
2017-09-14 17:24:02 +08:00
zhangyanjiao
164006509f optimize lwip route when loopback open and in "APSTA" mode 2017-09-14 16:19:05 +08:00
XiaXiaotian
6bfbe6e4ed Fix some wifi lib bugs
1. add adc2 coexistence

2. change NOW() to WDEV_NOW()

3. call ets_timer_done() before calling ets_timer_setfn()

4. fix the bug that api lock is not unlocked when call esp_wifi_stop()
   twice

5. more hmac tx buffer limit from 32 to 64.
2017-09-14 15:19:46 +08:00
Kewal Shah
379320bdb2 change to GPIO_IS_VALID_OUTPUT_GPIO for data out pin 2017-09-14 13:33:39 +08:00
Wangjialin
2fceec4d85 feature(I2S-ADC): add ADC mode for I2S.
1. Support built-in ADC for I2S.
2. Modify code of ADC, made no change to the original APIs.
3. Add APIs in I2S:
esp_err_t i2s_set_adc_mode(adc_unit_t adc_unit, adc1_channel_t adc_channel);
4. Add I2S ADC/DAC example code.
5. add old-fashion definition to make it more compatible
6. replase spi_flash_ APIs with esp_partition_ APIs
7. add example of generating audio table from wav
8. change example sound
2017-09-14 13:24:08 +08:00
Jeroen Domburg
6d95934a3c Make 80MHz PSRAM work as well, add testcase for weirdness reported on esp32 forums, clean up unused define in psram code 2017-09-14 10:47:44 +08:00
Jeroen Domburg
875ae6a134 Add option to allocate external RAM using heap_alloc_caps 2017-09-14 10:47:44 +08:00
Jiang Jiang Jian
574daad1c4 Merge branch 'feature/btdm_update_to_bluedroid7.1_l2cap' into 'master'
component/bt: Added the new feature of the l2cap layer from the bluedroid new version 7.1.1

See merge request !1087
2017-09-13 20:39:38 +08:00
Jiang Jiang Jian
33a4a6a510 Merge branch 'feature/add_espnow' into 'master'
add ESPNOW feature

See merge request !1061
2017-09-13 20:32:53 +08:00
Jiang Jiang Jian
b70329040d Merge branch 'bugfix/btdm_gatts_notify_stress_test_crash' into 'master'
component/bt: fix bug for gatts notify stress test crash

See merge request !1245
2017-09-13 20:27:17 +08:00
Ivan Grokhotkov
a91b330b49 Merge branch 'bugfix/spiffs_submodule' into 'master'
spiffs: Track spiffs submodule in component

See merge request !1251
2017-09-13 18:02:32 +08:00
XiaXiaotian
6753f6cb59 Refractor smartconfig
Move code of receiving smartconfig packets and getting password to
    wifi lib. Open source code of sending smartconfig ACK to cellphone
    in IDF.
2017-09-13 16:55:30 +08:00
Angus Gratton
b687e1a41f spiffs: Track spiffs submodule in component
Will now automatically initialise as part of "make".
2017-09-13 14:54:33 +10:00
Jiang Jiang Jian
f1e3b0df02 Merge branch 'feature/adv_scan_simultaneously' into 'master'
component/bt : support adv & scan simultaneously

See merge request !1209
2017-09-13 11:50:57 +08:00
Jiang Jiang Jian
ea7a09c3e4 Merge branch 'bugfix/btdm_sec_config' into 'master'
component/bt : fix btc security storage bug

See merge request !1161
2017-09-13 11:46:34 +08:00
zhiweijian
8921a36828 Component/bt: fix bug for gatts notify stress test crash 2017-09-13 11:19:58 +08:00
Jeroen Domburg
9c56d9e75e Make sure functions that are in ROM in the non-external-ram-workaround version, are in RAM (and not in flash) in the ext-ram workaround version. 2017-09-13 10:36:56 +08:00
Angus Gratton
df888a4f54 Merge branch 'bugfix/openocd_top_used_priority' into 'master'
freertos: place uxTopUsedPriority into DRAM

See merge request !1246
2017-09-13 09:02:27 +08:00
Kewal Shah
c4f15a0e5d ledc_get_duty return type changed from int to uint32_t, target_duty changed from int to uint32_t 2017-09-13 01:43:42 +08:00
Yulong
1759a47060 This is a combination of 4 commits.
squash again all the commit.

component/bt: Change all the gattc API && bta gattc layer.

component/bt: Debug the code and change the btc_ble_gattc_get_db method.

component/bt: Change the gatt read API interface.

component/bt: Reconstruction the BTA_gattc_cache code.

component/bt: Change back the bluedroid_get_status to marco.

component/bt: Added the serch service res start_handle & end_handle to the result.

component/bt: Change the gattc docs format.

component/bt: Change the docs format.

component/bt: fix the read char value bug.

component/bt: change the gattc_get_attr_count method.

component/bt: Change back the bta_gattc write ccc code.

component/bt: Change the gattc api docs format

component/bt: Change the gattc API docs.

component/bt: Change the prepare write descriptor method to avoid the exection.

Component/bt: modify gatt clinet demo with new API

component/bt: Change the p_src_data->read.p_value to avoid exection.

compoent/bt: Change the bugfix of gattc unreg for the notify.

Modify gattc security demo

component/bt: Change the log error.

Component/bt: modify gattc_multi_connect demo

componnet/bt: Change the bta_gattc_cache sdp include.

component/bt: Change the start_handle & end_handle not from the service.

component/bt: Change the gattc API docs.

component/bt: Change the return issues.

component/bt: Fixed the include service bug.

component/bt: Modify gattc_multi_connect demo , add scan log

component/bt: Fixed the BTA_GATTC_GetIncludeService start handle & end handle error bug.

component/bt: Fix the invalid handle of the get all char issues.

component/bt: Fix the bug with get_db_size_with_type of the start handle & end_handle not correted issue.

component/bt: Fixed the get secondly service num not correct issue.

component/bt: Fixed the last service handle not correted issue.
2017-09-12 07:36:02 -04:00
Ivan Grokhotkov
b6d82eeceb Merge branch 'feature/gcov_over_apptrace' into 'master'
esp32: Adds gcov over JTAG feature

See merge request !1117
2017-09-12 18:54:26 +08:00
Tian Hao
00a7cdbb0b component/bt : support adv & scan simultaneously
1. Occupy conn[9] for adv. The max connection number of bluetooth controller decrease to 9. (Previously, it is 10)
2. modify the enum of setting BLE TX power corresponding to connection's.
3. fix libbtdm_app.a cwitch jump table
2017-09-12 16:10:30 +08:00
Ivan Grokhotkov
820df6aa27 Merge branch 'bugfix/btdm_nvs_get_str_or_blob' into 'master'
fix: Fix bug of function nvs_get_str_or_blob

See merge request !1182
2017-09-12 12:20:42 +08:00
XiaXiaotian
e4ba31a8b9 add ESPNOW feature
ESPNOW is a kind of WiFi communication bettween WiFi devices, no
    matter they are connected to each other or not. Once two WiFi
    devices are paired, they can send data to or receive data from
    each other. The data is transmitted in action frame which can
    be encrypted with CCMP method. ESPNOW also support mutilcast frame
    transmitting.
2017-09-12 12:12:13 +08:00
Ivan Grokhotkov
23f10e1a57 Merge branch 'feature/uart_software_flow_control' into 'master'
uart: Add api call to switch on hardware support for 'software' flow control. (github #890)

See merge request !1215
2017-09-12 12:11:11 +08:00
Ivan Grokhotkov
868b0ce228 Merge branch 'bugfix/list_node_naming' into 'master'
Fix "list_node" name conflict in bluedroid & dhcp_server

See merge request !1216
2017-09-12 12:10:54 +08:00
Ivan Grokhotkov
635bd9ac9e Merge branch 'bugfix/btdm_disable_gatts' into 'master'
component/bt: fix build error when GATTS is disabled in menuconfig

See merge request !1232
2017-09-12 12:06:41 +08:00
Ivan Grokhotkov
f4ddaa7a11 Merge branch 'bugfix/crashed_core_dump' into 'master'
esp32: Fixes crash during core dump.

See merge request !1239
2017-09-12 11:32:48 +08:00
me-no-dev
dd87deb278 Add SPIFFS Component to IDF 2017-09-11 19:56:40 +03:00
Alexey Gerenkov
4e0c3a0415 esp32: Fixes crash during core dump.
Removes piece of debugging code introduced by 8d43859b.
2017-09-11 17:20:42 +03:00
Ivan Grokhotkov
64bce3ce59 freertos: place uxTopUsedPriority into DRAM
When debugging crashes caused by flash cache access errors, OpenOCD may
request the value of uxTopUsedPriority when cache is disabled. Placing
it into IRAM to avoid an error in such case.
2017-09-11 20:15:27 +08:00
Ivan Grokhotkov
1e7c3854d3 Merge branch 'bugfix/warn_on_invalid_xtal_freq' into 'master'
soc/rtc: warn if detected XTAL frequency does not match configured one

See merge request !1242
2017-09-11 18:15:11 +08:00
Jeroen Domburg
b3fd494e71 Panic: stop dport access handler without trying to use a lock 2017-09-11 17:24:22 +08:00
Ivan Grokhotkov
de038f502c Merge branch 'feature/gpio_channel_macro' into 'master'
feat(global): add macros for GPIO->channel lookup

See merge request !1170
2017-09-11 12:15:08 +08:00
Ivan Grokhotkov
5a88f90a33 soc/rtc: warn if detected XTAL frequency does not match configured one
Since 9a8c0392, XTAL frequency is set to 40MHz by default, and users
of 26MHz boards need to select 26MHz manually. Most users are not aware
of this change, and existing getting started guides do not mention that
XTAL frequency needs to be set for some boards. So users are left with
garbage output from UART without any clue what to check.

This change adds a warning in case specific XTAL frequency was set, and
it does not match automatically detected one. This should help users
fix the issue.
2017-09-11 11:42:26 +08:00
baohongde
87031f9457 component/bt: fix nvs_get_str_or_blob length output error 2017-09-08 12:02:35 +08:00
baohongde
e1bd51af80 component/bt: fix nvs_get_str_or_blob length output error 2017-09-08 12:02:35 +08:00
baohongde
f3be0395d2 component/bt: fix nvs_get_str_or_blob length output error 2017-09-08 12:02:35 +08:00
Ivan Grokhotkov
e12967297d Merge branch 'feature/docs_touch_pad_api' into 'master'
Touch Pad driver overview

See merge request !1195
2017-09-08 11:55:27 +08:00
wangmengyang
21586063de component/bt: fix build error when GATTS is disabled in menuconfig 2017-09-08 11:34:59 +08:00
Ivan Grokhotkov
33cb16fd2a esp32: fix cache error interrupt handler
Cache error interrupt would read DPORT registers, which caused DPORT
access protection to kick in. Disable DPORT protection before doing the
reads.
2017-09-08 09:59:09 +08:00
Alexey Gerenkov
891f0db31d esp32: Adds gcov over JTAG feature
Implements function to dump GCOV data to host via JTAG.
The following functionality was added:
 - Host file I/O
 - GCOV runtime I/O stubs
 - GCOV example
2017-09-07 18:13:16 +03:00
Tian Hao
38102f4148 component/bt : fix btc security storage bug
1. Remove the bond_device global variable.
2. Fix bond_device add cause memory exception
3. Modify the code location.
4. modify thread security
5. remove esp_ble_clear_bond_device_list() API
6. modify esp_ble_get_gond_device_list() to return list immediately, rather than wait event.
7. modify the gatt_security_server demo to show how to remove all the bonded devices.
8. fix some code bugs may cause something error.
2017-09-07 19:37:49 +08:00
Ivan Grokhotkov
3c470e7c43 Merge branch 'bugfix/rmt' into 'master'
RMT 2 fixes: Rename one API and specify wait_time in another API

See merge request !896
2017-09-07 18:03:08 +08:00
Ivan Grokhotkov
5425d8569c Merge branch 'feature/pthread_api' into 'master'
esp32: pthread API

See merge request !1146
2017-09-07 17:49:42 +08:00
Ivan Grokhotkov
40df6546c0 Merge branch 'feature/multi_heap_poisoning' into 'master'
Heap tracing & poisoning features

See merge request !749
2017-09-07 17:47:51 +08:00
Ivan Grokhotkov
310269bcdc Merge branch 'bugfix/tcpip_adapter_ethernet' into 'master'
tcpip_adapter: Fix bug which prevents setting a static IP address for Ethernet interface (github #657)

See merge request !1178
2017-09-07 17:47:20 +08:00
Ivan Grokhotkov
de06a0b8a7 Merge branch 'feature/mbedtls2_6_0' into 'master'
Update mbedTLS to version 2.6.0

See merge request !1224
2017-09-07 17:45:45 +08:00
Ivan Grokhotkov
b9dfb437ab Merge branch 'bugfix/intr_free' into 'master'
fix(intr): fix the logic for allocating and freeing interrupts.

See merge request !1124
2017-09-07 17:45:18 +08:00
Angus Gratton
c503a01388 mbedtls: Rename net to net_sockets (in line with 2.4.0 API change) 2017-09-07 18:02:39 +10:00
Angus Gratton
3a08ec7b3d mbedtls: Re-apply: MBEDTLS_SHA512_ALT also replaces mbedtls_sha512_process()
IDF-specific patch.
2017-09-07 18:02:26 +10:00
Angus Gratton
3142997830 mbedtls: Re-apply ECP memory leak fix
Fix not yet submitted upstream.

(Previously applied in ffefeef5ea)
2017-09-07 18:02:26 +10:00
Angus Gratton
736db688a8 mbedtls: Re-apply MBEDTLS_BIGNUM_ALT & related macros for custom bignum functions
(IDF-specific patch.)
2017-09-07 18:02:26 +10:00
Angus Gratton
ae382b3bfa mbedtls: Update to 2.6.0 release (without IDF-specific patches) 2017-09-07 18:02:26 +10:00
Angus Gratton
f8339fc1bd newlib: Avoid deprecation warning calling system_get_time() from system_relative_time() 2017-09-07 16:32:05 +10:00
Angus Gratton
73b3ae8a2d lwip: Use hardware RNG for LWIP_RAND(), use LWIP_RAND() for random port assignment 2017-09-07 16:32:05 +10:00
Angus Gratton
72995bfcec doc: Add docs for heap trace & poisoning 2017-09-07 16:32:05 +10:00
Angus Gratton
ec498ad86d libgcc: Place assembly functions (including __xtensa_libgcc_window_spill) in IRAM 2017-09-07 16:32:05 +10:00
Angus Gratton
1c7b8aa3a5 Heap tracing support 2017-09-07 16:32:05 +10:00
Angus Gratton
5c417963eb multi_heap: Add heap poisoning features 2017-09-07 16:32:05 +10:00
Angus Gratton
5222428dde unit tests: Check heap integrity after each test, check for obvious leaks 2017-09-07 16:32:05 +10:00
Angus Gratton
1cb0f30933 heap_caps: Add heap_caps_check_integrity() function 2017-09-07 16:32:05 +10:00
Ivan Grokhotkov
63e1e4e502 Merge branch 'test/modify_mtu_cases' into 'master'
test: update BLE GATT MTU cases

See merge request !1223
2017-09-07 14:27:41 +08:00
chensheng
ac5e1f65b2 test:update BLE GATT MTU cases 2017-09-07 13:46:13 +08:00
Jiang Jiang Jian
5146289eea Merge branch 'feature/update_wifi_lib_for_some_feature_and_bugfix' into 'master'
esp32: update wifi lib for a bunch of small feature and bugfix

See merge request !1222
2017-09-07 13:24:24 +08:00
Ivan Grokhotkov
8f5e4bacf3 Merge branch 'bugfix/spi_cache_disable_adjustments_iram' into 'master'
Make sure cache is disabled/enabled when *both* CPUs are running inside the iram guard code

See merge request !1208
2017-09-07 11:02:21 +08:00
Liu Zhi Fu
a568ad2c9d esp32: update wifi lib for a bunch of small feature and bugfix
1. Update RTC V229: add BT AGC saturation protection
2. Update PHY V359: (1). esp_init_data_v2.bin -- modify WIFI and BT RX gain table Setting
                    (2). modify phy_close_rf()
                    (3). noisefloor add limit and no print
3. WiFi supports modem sleep dynamic frequency switch
4. Fix disabling AMPDU cause esp_wifi_init fail issue
5. Fix sniffer mode cause WiFi can't connect issue
6. Optimize an internal rx buffer full issue
7. Rollback the internal wifi init flag when wifi init fail
2017-09-07 11:01:12 +08:00
michael
08b9fbc242 feat(global): add macros for GPIO->channel lookup
including: macros for dac, adc, touch, rtc_gpio, uart and clk_out.

TW#13970
2017-09-07 10:40:25 +08:00
Angus Gratton
4809c70899 Merge branch 'feature/register_heaps_runtime' into 'master'
heap: Support adding new heap regions at runtime

See merge request !1159
2017-09-07 10:18:21 +08:00
Angus Gratton
dcd2f71d11 Merge branch 'bugfix/http_to_https_url_changes' into 'master'
Mass replacement of http with https urls, fixed broken urls

See merge request !1221
2017-09-07 10:16:43 +08:00
Tian Hao
b8b2816f67 component/bt : fix unloaded memory(0x3fff0000 overwrite) bug 2017-09-06 21:45:18 +08:00
Jeroen Domburg
b24d2c4cf3 Make sure cache is disabled/enabled when *both* CPUs are running inside the iram guard code 2017-09-06 16:34:36 +08:00
Yulong
371c55138e component/bt: Added the new feature of the l2cap layer from the bluedroid new version 7.1.1 2017-09-06 04:25:57 -04:00
michael
73ba29e6df refactor(intr): remove useless tags in the debug log. 2017-09-06 15:20:04 +08:00
michael
c82e51cf79 fix(intr): always assign the same intr to a same source, disable the source only when all the handlers disabled.
also document handlers sharing a same source.

TW#13454, https://github.com/nodemcu/nodemcu-firmware/issues/1874

Breaking change: handles assigned to a same source should have the same flag now.
2017-09-06 15:20:01 +08:00
krzychb
672390c458 Mass replacement of http with https urls, fixed broken urls 2017-09-06 08:16:01 +02:00
Alexey Gerenkov
5dea0fca15 esp_pthread_init constructor attr was removed 2017-09-06 10:30:23 +08:00
Alexey Gerenkov
5094965e98 According to comments 2017-09-06 10:30:23 +08:00
Ivan Grokhotkov
e3b86e7bdb pthread: handle statically initialized mutexes 2017-09-06 10:30:23 +08:00
Alexey Gerenkov
20942421c3 According to review comments 2017-09-06 10:30:23 +08:00
Alexey Gerenkov
8859dab10c Cleanup 2017-09-06 10:30:23 +08:00
Alexey Gerenkov
bf8ff8c98b 1) Thread detach functionality added
2) Recursive mutexes support
3) C++ test updated
2017-09-06 10:30:23 +08:00
Alexey Gerenkov
c631c6b358 1) Mux API was added
2) C++ test for threading and mux functions
2017-09-06 10:30:23 +08:00
Alexey Gerenkov
0b09c7006d pthread: Initial version of thread API 2017-09-06 10:30:23 +08:00
Jeroen Domburg
604308f4ab Merge branch 'bugfix/soft_reboot_psram' into 'master'
Fix rebooting when external RAM is active

See merge request !1207
2017-09-05 15:43:30 +08:00
Angus Gratton
74d5f85c53 Merge branch 'feature/build_warn_undefined_vars' into 'master'
Add --warn-undefined-variables to MAKEFLAGS (github #138)

See merge request !1214
2017-09-05 15:39:48 +08:00
Angus Gratton
9471ce9135 dhcpserver: Move DHCP option names to a separate header
Avoids naming conflicts. Resolves TW13826.
2017-09-05 17:28:40 +10:00
Angus Gratton
48333aea48 bluedroid: Move fixed_queue.h to implementation of hci_layer.c
Avoids pulling types like list_node into the public interface.

Closes https://github.com/espressif/esp-idf/issues/948
2017-09-05 17:14:40 +10:00
Angus Gratton
1be6bf6790 dhcpserver: Move list_node to implementation not public interface
Was unused in the public interface.

Closes https://github.com/espressif/esp-idf/issues/948
2017-09-05 17:14:23 +10:00
Alex Burr
93cc3a77cb uart: Add api call to switch on hardware support for 'software' flow control.
Cherry-picks https://github.com/espressif/esp-idf/pull/890
2017-09-05 16:30:21 +10:00
krzychb
ba42c46cb3 Touch Pad driver overview 2017-09-05 08:28:44 +02:00
Deomid Ryabkov
1ea082a053 Expand vars before splitting fields
This allows making entire partition table line a variable.

Merges https://github.com/espressif/esp-idf/pull/841
2017-09-05 16:23:54 +10:00
Angus Gratton
f17bbff4b5 Merge branch 'feature/tcp_msl_menuconfig' into 'master'
components/lwip: Expose TCP_MSL in menuconfig. (github #783)

See merge request !1175
2017-09-05 14:18:36 +08:00
Angus Gratton
8670844acf build system: Restore ifdef/ifndef in Makefiles, clean up examples build 2017-09-05 16:11:03 +10:00
Deomid Ryabkov
9903ea1c11 Add --warn-undefined-variables to MAKEFLAGS
Fix warnings where undefined vars are used.

Make Kconfig emit "FOO=" for unset bool options
To ensure make variables are always defined, even if empty.

When writing auto.conf, include symbols disabled by dependency to make sure all make variables are always defined.

Fixes espressif/esp-idf#137

Cherry-picked from https://github.com/espressif/esp-idf/pull/138
2017-09-05 16:10:46 +10:00
Angus Gratton
167f2cf9e1 Merge branch 'bugfix/nvs_item_crc_check' into 'master'
nvs: check CRC of items on full pages

See merge request !1200
2017-09-05 12:09:40 +08:00
Angus Gratton
5361c08989 heap: Support adding new heap regions at runtime
To facilitate this, the list of registered heap regions is now a linked list
(allowing entries to be appended at runtime.)
2017-09-05 14:07:02 +10:00
Ivan Grokhotkov
8433fed7f4 Merge branch 'bugfix/core_dump_loop' into 'master'
esp32: Fixes infinite loop caused by exception during core dumping

See merge request !1210
2017-09-05 11:40:31 +08:00
Angus Gratton
74a017e1e4 Merge branch 'bugfix/mbedtls_net_failures' into 'master'
mbedtls: Don't assign ctx->fd until connect() or bind() has succeeded

See merge request !1211
2017-09-05 11:28:43 +08:00
Ivan Grokhotkov
9362d66812 Merge branch 'feature/adc_calibration' into 'master'
Bugfix/ added esp_adc_cal include guards

See merge request !1192
2017-09-05 11:23:05 +08:00
Ivan Grokhotkov
c007213fed Merge branch 'bugfix/deep_sleep_wakeup_stub' into 'master'
deep sleep: don't use protected DPORT access in wake stub

See merge request !1194
2017-09-05 11:22:52 +08:00
Alexey Gerenkov
fb8b0c534a esp32: Fixes infinite loop caused by exception during core dumping 2017-09-05 11:15:27 +08:00
Ivan Grokhotkov
51e8f439b8 Merge branch 'bugfix/cpu_clk_disable_spi' into 'master'
spi_master, sdmmc: fix regressions due to peripherals being disabled by default

See merge request !1193
2017-09-05 10:41:51 +08:00
Angus Gratton
d531b56d93 Merge branch 'bugfix/spinlock_performance' into 'master'
freertos: Reduce CPU spinlock (portmux) overhead

See merge request !497
2017-09-05 09:16:10 +08:00
Angus Gratton
8ce09c2c1c mbedtls: Don't assign ctx->fd until connect() or bind() has succeeded
Avoid leaking closed file descriptors via ctx->fd

Reported: https://esp32.com/viewtopic.php?f=13&t=2910&sid=8568b1fd93a4c8d5760628a638efc48b#p13620
2017-09-05 11:08:35 +10:00
Angus Gratton
11a87ca811 Merge branch 'bugfix/bootloader_ota_sel' into 'master'
Fix bootloader OTA regression

See merge request !1205
2017-09-05 07:25:08 +08:00
Ivan Grokhotkov
e93c33050e ethernet: enable EMAC module clock on initialization 2017-09-04 22:43:52 +08:00
Ivan Grokhotkov
b38186dc43 sdmmc: use periph_ctrl to enable peripheral when initializing the host 2017-09-04 22:43:52 +08:00
Ivan Grokhotkov
956a28a95c driver: add periph_ctrl support for SDMMC, SDIO slave, CAN, EMAC 2017-09-04 22:43:51 +08:00
michael
b834fcf78a fix(spi_master): this fix the SPI MOSI output missing bug. 2017-09-04 22:43:51 +08:00
Jiang Jiang Jian
f254555a41 Merge branch 'feature/btdm_add_set_local_MTU_API_for_gatt' into 'master'
component/bt: add set local MTU API

See merge request !1152
2017-09-04 21:32:23 +08:00
Alexey Gerenkov
cf29dd47a9 apptrace lock acquire function was re-designed to minimize waiting time with disabled IRQs 2017-09-04 20:44:11 +08:00
Jeroen Domburg
0e74ec67be Fix rebooting when PSRAM is active 2017-09-04 19:00:47 +08:00
Ivan Grokhotkov
9da1bf1a45 Merge branch 'bugfix/lwip_send_timeout' into 'master'
match sys tick with lwip_send_timeout

See merge request !1203
2017-09-04 18:19:59 +08:00
Angus Gratton
a19aaf2072 esp32: Update wifi lib to use new spinlock implementation 2017-09-04 19:11:51 +10:00
Angus Gratton
4486d4cb10 portmux: Add vPortCPUAcquireMutexTimeout() function
Refactor app_trace locking to use this function.
2017-09-04 19:11:51 +10:00
Angus Gratton
397c0bfb4b freertos scheduler test: Free timer group interrupt handle when test finishes 2017-09-04 19:11:51 +10:00
Angus Gratton
5c996a1b29 freertos: Inline vPortCPUAcquireMutex/vPortCPUReleaseMutex into implementations
Further improves performance:
No contention -> 134 cycles
Recursion -> 117 cycles
Contention -> 323 cycles
2017-09-04 19:11:51 +10:00
Angus Gratton
db58a2732b freertos: vPortCPUReleaseMutex() no longer returns a value
Unlocking a never-locked mutex is an assertion failure in debug mode.

In release mode, this further improves performance:
No-Contention ->  153 cycles
Recursion No-Contention -> 138 cycles
Contention -> 378 cycles
2017-09-04 19:11:51 +10:00
Angus Gratton
4d42b2d100 freertos spinlock/portmux: Reduce spinlocking overhead
Ref TW7117

Microbenchmarks in unit tests:

(All numbers in cycles per benchmarked operation):

Release mode
No lock contention lock/unlock -       301 -> 167 (-45%)
Recursive no contention lock/unlock -  289 -> 148 (-49%)
Lock contention two CPUs (lock/unlock) 699 -> 400 (-43%)

Debug mode
No lock contention lock/unlock -       355 -> 203 (-43%)
Recursive no contention lock/unlock -  345 -> 188 (-46%)
Lock contention two CPUs (lock/unlock) 761 -> 483 (-36%)
2017-09-04 19:11:51 +10:00
Angus Gratton
f2952de3a5 freertos spinlocks/portmux: Add combination unit tests & microbenchmarks 2017-09-04 19:11:51 +10:00
Angus Gratton
f487bb19d7 Merge branch 'bugfix/ci_build_examples_more' into 'master'
CI build_examples: Fix build flakiness

See merge request !1191
2017-09-04 16:02:12 +08:00
Angus Gratton
c275ad4ca4 build system: Add dependencies to component clean steps
Build directory must exist, component_project_vars.mk must be generated if it is going to be.
2017-09-04 17:40:15 +10:00
Angus Gratton
3dfcc312c8 ota_ops: Fix get_selected_boot_partition() in case there is no factory partition
get_selected_boot_partition() now follows the same basic logic as the bootloader to find the
default boot partition.
2017-09-04 17:37:28 +10:00
Angus Gratton
1cd2ce2471 bootloader: Fix regression preventing OTA updates
Regression introduced in 43e231c.

Thanks to @yanbe for pointing out issue in https://github.com/espressif/esp-idf/pull/955

This is a different fix, tries to keep the behaviour that 43e231c was aiming to correct (unnecessarily testing an
invalid slot more than once.)
2017-09-04 17:37:28 +10:00
zhangyanjiao
547b7b0246 match sys tick with lwip_send_timeout 2017-09-04 14:52:16 +08:00
Ivan Grokhotkov
c0269bc1cd nvs: check CRC of items on full pages
Previously NVS did check CRC values of key-value pairs on the active
page, but the check for full pages was missing. This adds the necessary
check and a test for it.
2017-09-04 14:37:33 +08:00
Jeroen Domburg
c0510c4266 Merge branch 'feature/psram_in_address_space' into 'master'
Feature/psram in address space

See merge request !1069
2017-09-04 14:18:23 +08:00
Jeroen Domburg
153275b743 Merge branch 'bugfix/uart_5mbaud' into 'master'
Fix off-by-one in 5MBaud arg checking; propagate errors better

See merge request !1184
2017-09-04 12:06:33 +08:00
Jeroen Domburg
34372a091c Add initial SPI RAM support. This adds support for an ESP-PSRAM32 chip connected to the default flash pins and GPIO 16 and 17. The RAM is mapped to address 0x3F800000, but otherwise ignored by esp-idf as of yet. 2017-09-04 12:05:49 +08:00
zhiweijian
f1c4eda373 Component/bt: add set local MTU API
- add esp_ble_gatt_set_local_mtu( ) API
- modify esp_ble_gattc_config_mtu(esp_gatt_if_t gattc_if, uint16_t conn_id)
- modify  gattc demo
2017-09-01 21:55:28 +08:00
Jiang Jiang Jian
3a1de7dba3 Merge branch 'bugfix/btdm_fix_connection_parameters_update' into 'master'
component/bt: fix connection parameters update

See merge request !1099
2017-09-01 20:15:30 +08:00
Ivan Grokhotkov
b9ff771e2c deep sleep: don't use protected DPORT access in wake stub 2017-09-01 18:35:42 +08:00
Jeroen Domburg
518edac42f Add GD chip into qio data, so (at least my) ESP-WROVER uses QIO mode succesfully. 2017-09-01 16:53:05 +08:00
Ivan Grokhotkov
5666fc0a56 Merge branch 'feature/esp_timer_improvements' into 'master'
esp_timer improvements

See merge request !1172
2017-09-01 16:14:01 +08:00
Jeroen Domburg
fe140fe347 Fix off-by-one in 5MBaud arg checking; propagate errors better 2017-09-01 12:15:28 +08:00
Darian Leung
4fbeaba77f Bugfix/ added esp_adc_cal include guards 2017-09-01 12:07:37 +08:00
Ivan Grokhotkov
f31efb697c newlib: rename esp_setup_time_syscalls to esp_set_time_from_rtc
This function no longer sets up syscalls, and new name reflects its
purpose better.
2017-09-01 10:36:14 +08:00
Ivan Grokhotkov
d2acf1ce77 sleep: add light sleep, factor out APIs common for deep/light sleep 2017-09-01 10:36:14 +08:00
Ivan Grokhotkov
65b046f17f dport access: introduce pause/resume instead of deinit 2017-09-01 10:36:14 +08:00
Ivan Grokhotkov
f8b719d911 soc/rtc: add sleep flag to control powerdown of VDD_SDIO 2017-09-01 10:36:14 +08:00
Ivan Grokhotkov
06af8cd086 esp_timer: return signed timestamp (int64_t)
Since timestamps are 64-bit, loosing one bit of range due to sign does
not present an issue, however for applications doing calculations on
timestamps, signed return type is more convenient.
2017-09-01 10:34:36 +08:00
Ivan Grokhotkov
c5632d3012 esp32: use ref_clock in esp_timer and delay tests 2017-09-01 10:34:36 +08:00
Ivan Grokhotkov
1af6384349 esp_timer: lock-free implementation of esp_timer_get_time
The implementation of esp_timer_get_time used a critical section, which
resulted in a call time of ~1.8us. To make esp_timer_get_time more
useable as a high-resolution time source, this change replaces the lock
with polling. Call time is reduced to ~0.7us.
2017-09-01 10:34:36 +08:00
Ivan Grokhotkov
c743bdac88 soc/rtc: round APB clock frequency to nearest MHz 2017-09-01 10:34:36 +08:00
Ivan Grokhotkov
d24e0dcc2c Merge branch 'bugfix/ci_build_examples' into 'master'
ci: fix example builds and unit tests

See merge request !1188
2017-09-01 10:33:38 +08:00
Ivan Grokhotkov
d4e950d311 Merge branch 'feature/cxx_exceptions' into 'master'
Partial support for C++ exceptions

See merge request !930
2017-09-01 00:27:41 +08:00
Ivan Grokhotkov
b76a672aed ci: disable sd card tests 2017-08-31 23:50:56 +08:00
Ivan Grokhotkov
c92fba3261 Merge branch 'feature/timeradd' into 'master'
feat(time): enable the macro timeradd, timersub, timerclear, etc.

See merge request !1177
2017-08-31 13:57:19 +08:00
Ivan Grokhotkov
0a5a705ca8 Merge branch 'bugfix/log_tag_change_level' into 'master'
bugfix(log): fix the log tag to update existing rather than add new tag when calling ``esp_log_level_set``

See merge request !1153
2017-08-31 10:45:55 +08:00
Ivan Grokhotkov
1cfe96b1d7 Merge branch 'bugfix/i2s_dac_channel' into 'master'
fix(i2s_dac): fix the disable function which only disables DAC_CHANNEL_1.

See merge request !1169
2017-08-31 10:45:30 +08:00
Ivan Grokhotkov
b4857fc159 Merge branch 'bugfix/memory_issues_pr838' into 'master'
vfat, i2s, mdns: Fix two memory leaks, one double free (github #838)

See merge request !1173
2017-08-31 10:45:19 +08:00
Ivan Grokhotkov
e57a664798 Merge branch 'feature/freertos_interrupt_backtrace_opt' into 'master'
freertos: introduce CONFIG_FREERTOS_INTERRUPT_BACKTRACE

See merge request !1167
2017-08-31 10:45:06 +08:00
Angus Gratton
96f9ae3e30 Merge branch 'bugfix/minor_prs_github' into 'master'
Minor bugfixes and corrections from github

See merge request !1181
2017-08-31 07:11:30 +08:00
Angus Gratton
4f812eb29c Remove redundant code line from uart.c
Merges part of https://github.com/espressif/esp-idf/pull/650
2017-08-30 17:55:00 +10:00
Simon Werner
c8d8fb58e7 Fixed incorrect value in comments for GPIO_NUM_33.
Merges https://github.com/espressif/esp-idf/pull/676
2017-08-30 17:55:00 +10:00
Deomid Ryabkov
3e6c515d5b Using a 128-bit UUID is not an error
Merges https://github.com/espressif/esp-idf/pull/713
2017-08-30 17:55:00 +10:00
Geza Husi
eb8bd937c6 deep_sleep: RTC-GPIO pin calculation incorrect
Merges https://github.com/espressif/esp-idf/pull/822
2017-08-30 17:55:00 +10:00
Lacy Rhoades
c61b3e89f1 Typo fixes
Merges https://github.com/espressif/esp-idf/pull/831
2017-08-30 17:55:00 +10:00
phuzi
762d5fcb4c Update documentation for esp_avrc_api
Updated documentation for esp_err_t esp_avrc_ct_send_passthrough_cmd to show both pressed and released key states

Merges https://github.com/espressif/esp-idf/pull/846
2017-08-30 17:55:00 +10:00
Stephen Casner
1e3dd2a4fa Add missing debug log message for out-of-sockets case
Merges https://github.com/espressif/esp-idf/pull/903
2017-08-30 17:55:00 +10:00
Deomid Ryabkov
8c1acb0363 Provide a default for CONFIG_BT_RESERVE_DRAM
...when BT is not built

Merges https://github.com/espressif/esp-idf/pull/910
2017-08-30 17:55:00 +10:00
devsaurus
92535158e7 components/lwip: Expose TCP_MSL in menuconfig.
Merges https://github.com/espressif/esp-idf/pull/783
2017-08-30 16:44:53 +10:00
michael
8f994b9dce feat(time): enable the macro timeradd, timersub, timerclear, etc.
TW#14488

Closes https://github.com/espressif/esp-idf/issues/867
2017-08-30 14:08:14 +08:00
Henrik Maier
95fe7929c0 Fix spinlock bug for uart_set_rts and uart_set_dtr
Merges https://github.com/espressif/esp-idf/pull/649
2017-08-30 15:32:23 +10:00
Angus Gratton
ef60d73fe4 Merge branch 'bugfix/mdns_tcpip_threadsafe' into 'master'
mdns: Use LwIP IPC for low-level API calls

See merge request !925
2017-08-30 13:28:51 +08:00
Henrik Maier
58ba8a2a24 tcpip_adapter: Fix bug which prevents setting a static IP address for Ethernet interface
Merges https://github.com/espressif/esp-idf/pull/657
2017-08-30 14:50:22 +10:00
Ivan Grokhotkov
a25eb825e1 Merge branch 'bugfix/dport_protect_crypto' into 'master'
add protection for crypto registers in DPORT

See merge request !928
2017-08-30 11:45:35 +08:00
Ivan Grokhotkov
547ef83020 Merge branch 'feature/disable_some_perip_clk_when_cpu_start' into 'master'
Disable some peripheral clocks when cpu starts

See merge request !1089
2017-08-30 11:43:38 +08:00
zhiweijian
1a9b02ccbc component/bt: fix connection parameters update
- update connection parameters timeout due to master update illegal connection parameters
- slave returns error status when slave check the connection parameters
- slave connection parameters update callback get that interval_max is equal to interval_min
2017-08-30 11:29:25 +08:00
Quentin Thérond
b6b36bd9dd mdns: fix leak after _mdns_create_service if we have a malloc error. 2017-08-30 12:11:57 +10:00
Quentin Thérond
88e71a680e vfs: fix double free. 2017-08-30 12:11:57 +10:00
Quentin Thérond
36eccee213 i2s: fix leak in i2s_create_dma_queue if we have a malloc issue. 2017-08-30 12:11:03 +10:00
Jeroen Domburg
a1b5813049 Merge branch 'feature/adc_calibration' into 'master'
esp_adc_cal component

See merge request !1084
2017-08-30 10:00:19 +08:00
Angus Gratton
8bd6feedd4 Merge branch 'bugfix/docs_updates' into 'master'
Removed redundant 'Logging to Host' and docs cleaning

See merge request !1158
2017-08-30 09:43:00 +08:00
Angus Gratton
b4eda4c4f7 Merge branch 'feature/disable_rom_console' into 'master'
esp32: Add KConfig option to disable BASIC ROM Console fallback on first boot

See merge request !1134
2017-08-30 07:56:00 +08:00
krzychb
8c3169b6be Removed redundant 'Logging to Host' and docs cleaning 2017-08-29 20:47:10 +02:00
Darian Leung
88b05f9391 esp_adc_cal: Added ADC calibration component
Added component containg API that is able to correct raw ADC readings
into a voltage in mV. Also provided a helper function that combines
the process of getting the raw ADC1 reading then converting it to a
voltage in mV. In doing so, the adc1_get_voltage() function of the ADC
driver has been deprecated. Instead there is now adc1_get_raw to obtain
the raw ADC1 reading, and adc1_to_voltage() that gets the raw reading
and converts all in one function. Functions using the deprecated
adc1_get_voltage() have also been updated to use adc1_get_raw().

Conversion is based on ADC characteristics. The characteristics are based
on the ADC's v_ref, herefore the appropriate structure and functions have
been provided to obtain the ADC characteristics.

The existing ADC driver has also been modified by adding a function to
route the internal ADC reference voltage to a GPIO allowing users to measure
it manually.

Relevant documentation has also been updated
2017-08-29 18:43:14 +08:00
michael
9ec3757349 fix(i2s_dac): fix the disable function which only disables DAC_CHANNEL_1. 2017-08-29 15:31:39 +08:00
Ivan Grokhotkov
9a764f3108 Merge branch 'bugfix/freertos_xportgetcoreid_iram' into 'master'
freertos: make sure xPortGetCoreID is placed into IRAM

See merge request !1165
2017-08-29 13:32:37 +08:00
Ivan Grokhotkov
71fa25c560 Merge branch 'bugfix/vfs_uart_read_write_lock' into 'master'
vfs_uart: fix write operation blocked by a read

See merge request !1164
2017-08-29 13:32:24 +08:00
Angus Gratton
7a18575af8 flash encryption: Also always disable ROM BASIC console when enabling flash encryption 2017-08-29 14:52:00 +10:00
Angus Gratton
1e22bcdfde esp32: Add KConfig option to disable ROM Console fallback on first boot 2017-08-29 14:52:00 +10:00
Jeroen Domburg
881aa43b69 Merge branch 'bugfix/struct_h_extern_c' into 'master'
fix(struct_h): add extern "C" protection to *_struct.h header files.

See merge request !1162
2017-08-29 11:24:34 +08:00
Jeroen Domburg
edbeee8326 Merge branch 'bugfix/spi_def_typo_lsbfirst' into 'master'
bugfix(spi_master): fix the definition of ``SPI_DEVICE_BIT_LSBFIRST``.

See merge request !1154
2017-08-29 11:24:31 +08:00
XiaXiaotian
4776f73ca4 Disable some peripheral clocks when cpu starts
All peripheral clocks are default enabled after chip is powered on.
    When CPU starts, if reset reason is CPU reset, disable those clocks
    that are not enabled before reset. Otherwise, disable all those
    useless clocks.
    These peripheral clocks must be enabled when the peripherals are
    initialized and disabled when they are deinitialized.
2017-08-29 11:18:42 +08:00
Jeroen Domburg
4da7ee1295 Merge branch 'bugfix/ringbuf_fix_assert_0byte_payload' into 'master'
Fix faulty ringbuffer assert

See merge request !1163
2017-08-29 11:15:34 +08:00
Ivan Grokhotkov
99a4b6b2db freertos: introduce CONFIG_FREERTOS_INTERRUPT_BACKTRACE
The code in xtensa_vectors.S did not handle XT_DEBUG_BACKTRACE
consistently: #if was used in one case, and #ifdef in another. This makes
the checks consistent, and also introduces a Kconfig option to enable
backtrace.
2017-08-29 08:54:26 +08:00
Angus Gratton
3c992f872f Merge branch 'bugfix/secure_boot_enable' into 'master'
Fix regression when enabling secure boot

See merge request !1120
2017-08-29 08:44:13 +08:00
Ivan Grokhotkov
eb1b4f971b freertos: make sure xPortGetCoreID is placed into IRAM
In some cases, xPortGetCoreID was not inlined, and ended up in flash.
Since this function is used in many situations when cache is disabled,
that caused exceptions. Adding IRAM attribute to fix that.
2017-08-29 08:31:36 +08:00
Ivan Grokhotkov
13ef3938a6 vfs_uart: fix write operation blocked by a read
vfs_uart used same locks for read and write operations on a single UART.
If read operation was blocking (i.e. carried out via UART driver), the
lock was held by reading task until it received a line. During this time,
other tasks trying to write to the same UART would get blocked.

This change introduces separate read/write locks, and adds a test.

Another vfs_uart test if fixed (it was disabled since the
CONFIG_NEWLIB_STDOUT_ADDCR option was removed).
2017-08-29 08:27:36 +08:00
Jeroen Domburg
d0bf9e61da Fix an assert that erroneously triggered when popping a zero-byte payload from the end of the ringbuffer 2017-08-28 19:31:26 +08:00
michael
c7173e0d08 fix(struct_h): add extern "C" protection to *_struct.h header files. 2017-08-28 18:10:46 +08:00
Ivan Grokhotkov
3161854efb Merge branch 'bugfix/spi_hd_rx' into 'master'
fix(spi_dma_rx): add check to avoid using SPI half-duplex mode DMA with both MOSI and MISO phases.

See merge request !1111
2017-08-28 17:36:58 +08:00
Ivan Grokhotkov
82763a02af Merge branch 'feature/ets_timer' into 'master'
esp_timer: add high-resolution timer api

See merge request !1090
2017-08-28 16:38:11 +08:00
michael
cfd95b62cb feat(log): add tags only when no one exist, otherwise refresh linked list and cache. 2017-08-28 16:25:40 +08:00
michael
940f5fcb89 refactor(log): replace the tag uncached list with standard SLIST.
NOTE: split the header modify outside.
2017-08-28 16:25:39 +08:00
michael
28c4ba1288 doc(log): document the log macros. 2017-08-28 16:25:39 +08:00
Jeroen Domburg
a589411a3c Place uart_tx_wait_idle in IRAM 2017-08-28 11:35:27 +08:00
Ivan Grokhotkov
d8b66e5088 soc: release interrupts which are not reserved by timers any more 2017-08-28 11:35:27 +08:00
Ivan Grokhotkov
42e9d49bb1 newlib: implement gettimeofday using of esp_timer 2017-08-28 11:35:27 +08:00
Ivan Grokhotkov
857a29872d esp_timer: add high resolution software timer API 2017-08-28 11:35:26 +08:00
Ivan Grokhotkov
a4fe12cb6d Merge branch 'bugfix/sdmmc_test' into 'master'
sdmmc: don't use high speed mode with SD over SPI

See merge request !1149
2017-08-28 11:32:20 +08:00
Jeroen Domburg
ce03879300 Merge branch 'bugfix/uart_wait_idle_iram' into 'master'
Place uart_tx_wait_idle in IRAM

See merge request !1157
2017-08-28 10:55:58 +08:00
Ivan Grokhotkov
b636f81619 Merge branch 'bugfix/spi_command' into 'master'
fix(spi_master): fix the command field to make it more intuitive to use.

See merge request !1119
2017-08-28 10:29:56 +08:00
michael
0cb14f1648 fix(spi_dma_rx): add check to avoid using SPI half-duplex mode DMA with both MOSI and MISO phases. 2017-08-26 02:15:30 +08:00
michael
dd1e6ea296 typo(spi_master): fix the definition of `SPI_DEVICE_BIT_LSBFIRST`.
also fix the documentation of spi_device_transmit.
2017-08-26 02:04:37 +08:00
Jeroen Domburg
3e4627479b Place uart_tx_wait_idle in IRAM 2017-08-25 17:46:28 +08:00
Jiang Jiang Jian
4654278b1b Merge branch 'bugfix/btdm_controller_hci_fc' into 'master'
component/bt: bugfix for hci acl flow control

See merge request !1151
2017-08-25 16:16:47 +08:00
Ivan Grokhotkov
631f552489 sdmmc: don't use high speed mode with SD over SPI
Disabling due to limitation of SPI driver (max 26MHz for full-duplex
mode over GPIO matrix)
2017-08-25 14:33:19 +08:00
Angus Gratton
703d143619 hwcrypto: Fix bug with concurrent SHA access
If two different types of SHA hashes were active in the hardware
concurrently, a race condition meant the SHA unit could be incorrectly
reset leading to all-zero results.
2017-08-25 16:08:03 +10:00
Angus Gratton
0ea4cd67dd mbedtls: Remove "unsafe" warning, enable AES by default & make SHA/MPI optional 2017-08-25 16:08:03 +10:00
Angus Gratton
afb6119504 dport access: Fix WDT bug (permanent locking) in non-pinned tasks
If scheduler switches cores in narrow window during esp_dport_access_stall_other_cpu_start(), could cause the stall
interrupt to occur on the running CPU - halting the CPU until WDT cleans up.

Related to https://github.com/espressif/esp-idf/issues/630
2017-08-25 16:08:03 +10:00
Angus Gratton
50e0a54630 esp32 hwcrypto: Use spinlock instead of lock to protect AES
More than doubles performance of mbedTLS AES self-tests.
2017-08-25 16:08:03 +10:00
Angus Gratton
2624e10055 esp32 hwcrypto: Use AES registers directly 2017-08-25 16:08:03 +10:00
Angus Gratton
e256fb6d96 hwcrypto: Use DPORT-safe accesses with AES 2017-08-25 16:08:03 +10:00
Angus Gratton
99c663a6e9 mbedtls tests: utility tests for APB corruption
Used when running mbedTLS self-tests to verify DPORT protection is working correctly.
2017-08-25 16:08:03 +10:00
Angus Gratton
d0c300c52d hwcrypto: SHA acceleration using safe DPORT reads 2017-08-25 16:08:03 +10:00
Angus Gratton
7be002ec0f hwcrypto bignum/MPI: Batch safe DPORT reads to improve performance 2017-08-25 16:08:02 +10:00
Angus Gratton
cb31222e8b dport access: Add _DPORT_REG_SET_BIT & _DPORT_REG_CLR_BIT 2017-08-25 16:08:02 +10:00
Angus Gratton
dc8c33892e dport access: Fix nested calls to DPORT_STALL_OTHER_CPU_START() 2017-08-25 16:08:02 +10:00
Ivan Grokhotkov
08287852ab esp32: add protection for DPORT registers of RSA 2017-08-25 16:08:02 +10:00
wangmengyang
d532f33bdb component/bt: bugfix for hci acl flow control
1. trigger hci data transmission upon reception of hci_host_nb_of_cmpl_pkts when hci acl flow control is in effect
2017-08-24 20:59:32 +08:00
Wu Jian Gang
791daea835 Merge branch 'bugfix/xtal_freq_40' into 'master'
esp32: by default, set 40MHz crystal frequency

See merge request !1140
2017-08-24 20:40:22 +08:00
Ivan Grokhotkov
a66df0826e soc: fix/update definitions related to FRC timers
1. BIT(8) of CTRL is actually read-only bit indicating interrupt status

2. BIT(0) or CTRL had inverted meaning: 1 is “level”, 0 is “edge”

3. Add definitions of prescaler values
2017-08-24 16:33:12 +08:00
Ivan Grokhotkov
0420c4ec82 Merge branch 'feature/multipart_nvs_support' into 'master'
Multiple partition support in NVS

See merge request !1129
2017-08-24 14:42:14 +08:00
Ivan Grokhotkov
b9cdbfea87 Merge branch 'test/UT_SDMMC' into 'master'
Enable SDMMC driver test cases

See merge request !1106
2017-08-24 14:41:39 +08:00
Ivan Grokhotkov
922c584de6 Merge branch 'feature/libsodium_use_mbedtls' into 'master'
libsodium: Use mbedTLS implementations for SHA256 & SHA512

See merge request !1121
2017-08-24 14:40:52 +08:00
Ivan Grokhotkov
87a0ec77b5 Merge branch 'bugfix/mbedtls_config_mismatch' into 'master'
mbedtls: Add a shim header to account for including "mbedtls/config.h" directly in program

See merge request !1125
2017-08-24 14:40:39 +08:00
Ivan Grokhotkov
d02e850785 Merge branch 'bugfix/nghttp2_v124' into 'master'
nghttp: Restore nghttp2 v1.24

See merge request !1132
2017-08-24 14:40:24 +08:00
Ivan Grokhotkov
e0e1c07bd1 Merge branch 'bugfix/console_cmd_register' into 'master'
console: initialize buf_size before calling open_memstream

See merge request !1138
2017-08-24 14:35:29 +08:00
Ivan Grokhotkov
0ead095512 Merge branch 'bugfix/dport_stall_in_esp32_component' into 'master'
Also do dport stalling in esp32 component

See merge request !1141
2017-08-24 14:35:16 +08:00
Ivan Grokhotkov
327f0b6225 Merge branch 'bugfix/menuconfig_phy' into 'master'
component/esp32 : move Phy out of Wifi section

See merge request !1145
2017-08-24 14:34:56 +08:00
Jiang Jiang Jian
72a6b26244 Merge branch 'bugfix/tw14823_lwip_assert_err' into 'master'
assert when close a connecting socket

See merge request !1136
2017-08-24 11:29:32 +08:00
Jiang Jiang Jian
d42208ffe8 Merge branch 'bugfix/ampdu_default_wifi_settings' into 'master'
wifi: Fix compilation error in WIFI_INIT_CONFIG_DEFAULT() if AMPDU disabled

See merge request !1139
2017-08-24 11:02:54 +08:00
Jiang Jiang Jian
258480822b Merge branch 'bugfix/btdm_config_local_privacy_func' into 'master'
component/bt: bugfix config local privacy

See merge request !1137
2017-08-24 10:48:57 +08:00
Jiang Jiang Jian
8b4229fcd6 Merge branch 'bugfix/btdm_fix_set_rand_addr_func' into 'master'
component/bt: fixbug_set_rand_addr()

See merge request !1123
2017-08-24 10:48:20 +08:00
Wang Jia Lin
f1ecffb46c Merge branch 'bugfix/touch_pad_driver' into 'master'
driver(touch): fix bug and add more features

See merge request !1056
2017-08-23 19:12:39 +08:00
Ivan Grokhotkov
de10032717 Merge branch 'feature/btdm_remove_gki' into 'master'
component/bt : remove all GKI reference

See merge request !1122
2017-08-23 18:01:54 +08:00
Tian Hao
08221589fc component/esp32 : move Phy outof Wifi section
1. move Phy out of Wifi section
2. lowercase the Ethernet and Phy from 2nd letter.
2017-08-23 17:51:31 +08:00
zhiweijian
19bf8cef1f Component/bt: bugifx config local privacy 2017-08-23 17:42:38 +08:00
Jeroen Domburg
123966deea Also do dport stalling in esp32 component 2017-08-23 16:43:57 +08:00
Ivan Grokhotkov
9a8c0392f5 esp32: by default, set 40MHz crystal frequency 2017-08-23 16:33:26 +08:00
Tian Hao
e4f63819a1 component/bt : remove all GKI reference
1. remove GKI(not use osi_free_and_reset)
2. modify mutex/semaphore to individual directory
3. set osi_malloc as malloc(previously use calloc)
4. change osi allocator debug osi_free
5. fix rebase of remove GKI
2017-08-23 15:29:30 +08:00
Angus Gratton
7755015f4f secure boot: Fix enabling secure boot on first bootloader boot
Bootloader would accidentally check its own image for a secure boot signature,
but bootloader is unsigned (protected by secure boot digest).
2017-08-23 11:19:42 +10:00
Angus Gratton
43e231c916 bootloader: Don't unnecessarily test OTA app slots more than once per boot
Would loop more than once through each OTA possibility, but really only
needs to try each slot once.
2017-08-23 11:19:42 +10:00
Angus Gratton
83a3241341 wifi: Fix compilation error in WIFI_INIT_CONFIG_DEFAULT() if AMPDU disabled 2017-08-23 09:33:47 +10:00
Ivan Grokhotkov
0ed64da963 console: initialize buf_size before calling open_memstream
POSIX open_memstream documentation [1] does not mention that it may use
the  value supplied in buf_size before the call.
newlib implementation of open_memstream does use it as a hint of the
buffer size [2]. To avoid using potential garbage in this variable,
newlib caps the size to 64kB (!).

If the allocation of this initial buffer fails, NULL file pointer is
returned. Previous code did not check returned file pointer and crashed
when it was used.

Initialize size to zero (in which case newlib allocates a 64 byte
buffer), and check the returned file pointer.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/open_memstream.html
[2] https://github.com/espressif/newlib-esp32/blob/23c0f21/newlib/libc/stdio/open_memstream.c#L26-L29
    https://github.com/espressif/newlib-esp32/blob/23c0f21/newlib/libc/stdio/open_memstream.c#L324-L336
2017-08-23 01:10:30 +08:00
Ivan Grokhotkov
2861f3e88e Merge branch 'bugfix/spi_dma_align' into 'master'
fix(spi_dma): fix the receive error with RX DMA start with non-aligned address.

See merge request !1112
2017-08-22 23:39:53 +08:00
Wangjialin
842caaab21 driver(touch): fix bug and add more features
1. add sens_struct.h
2. add definition of RTCCNTL and RTCIO
3. modify touch pad examples
4. update example code.
5. add comments add option in menuconfig
6. fix issue that pad index 8 and 9 are mismatched
7. add touch_pad_read_filtered() api to get value filtered by iir filter
8. modify touch pad isr func
9. Make the items in perihperal.ld in the sequence of address
10. delete Kconfig for touch pad
11. add touchpad filter APIs to adjust the filter
12. add touch_pad into index.rst
13. add touch_pad in Doxyfile
14. add touch_pad.rst
2017-08-22 21:21:39 +08:00
houchenyao
cf64c7e9a6 unit test: add sd env and spi env for sdmmc 2017-08-22 21:01:34 +08:00
zhangyanjiao
61f64e38d9 assert when close a connecting socket 2017-08-22 20:36:35 +08:00
Ivan Grokhotkov
4f4808445f Merge branch 'feature/sdmmc_highspeed_mode' into 'master'
SDMMC: add support for high-speed mode

See merge request !1108
2017-08-22 19:31:10 +08:00
Ivan Grokhotkov
0532d37373 Merge branch 'feature/esptool-v2.1' into 'master'
esptool: Update to v2.1 final release

See merge request !1131
2017-08-22 19:30:48 +08:00
baohongde
593fbe6d8d updata gatt read by type response bug 2017-08-22 18:11:01 +08:00
Amey Inamdar
a2dcf7faa8 nvs: Support for handling multiple NVS partitions
This commit adds support for multiple NVS partitions. This provides application a flexibility to have multiple NVS
partitions such as separate partition with read-only manufacturing data and read-write partition with configuration.
Application can also use this to separate out application's configuration storage from system configuration.

This feature does not change any of the basic property of NVS subsystem. The same-named namespaces across partitions are
considered to be different namespaces. The original NVS API available for the applications remains unchanged. The only
difference is that instead of first NVS partition in the partition table, it now operates on the partition with label
"nvs" (which is default in the IDF provided partition table files). Additional APIs are provided to open a handle and
erase NVS with partition name as a parameter.

A test case is added in the host tests and it is made sure that all the host tests pass. nvs_rw_value app is also tested
with multiple partitions.

Signed-off-by: Amey Inamdar <amey.inamdar@gmail.com>
2017-08-22 13:48:14 +05:30
Amey Inamdar
3e4e4dd07a nvs_flash: Reduced visibility of handle counter
Monotonically increasing handle counter need not be visible outside the HandleEntry class.

Signed-off-by: Amey Inamdar <amey.inamdar@gmail.com>
2017-08-22 12:58:56 +05:30
Ivan Grokhotkov
08e787dc4d mbedtls: remove duplicate Kconfig options 2017-08-22 15:12:35 +08:00
Ivan Grokhotkov
fb43948413 Update several Kconfig files to make help texts compatible with ReST 2017-08-22 14:34:19 +08:00
zhiweijian
974cff4773 Component/bt: fixbug_set_rand_addr()
- The two most significant bits of the address shall be equal to 1
- All bits of the random part of the address shall not be equal to 1
- All bits of the random part of the address shall not be equal to 0
2017-08-22 14:25:10 +08:00
Jiang Jiang Jian
9b18625d29 Merge branch 'bugfix/memory_leak_when_run_wpa2' into 'master'
wpa2: fix memory leak when run wpa2

See merge request !1126
2017-08-22 14:18:17 +08:00
Jiang Jiang Jian
9f24f06a65 Merge branch 'bugfix/btdm_security_section_remove_bug' into 'master'
component/bt: Change the remove section error &&  SMP_INCLUDE marco

See merge request !1133
2017-08-22 14:13:29 +08:00
Jiang Jiang Jian
b0188b3f29 Merge branch 'bugfix/btdm_add_check_value_length_for_gatts_get_attribute_value' into 'master'
component/bt: add check value and length for esp_ble_gatts_get_attr_value(uint16…

See merge request !1110
2017-08-22 11:37:56 +08:00
Yulong
71d35c7770 component/bt: Change the remove section error. 2017-08-21 23:28:45 -04:00
Angus Gratton
581aa57a05 nghttp: Restore nghttp2 v1.24
We had already updated to v1.24 months ago, but the submodule commit was accidentally
reverted in 1fb85b494c.

Fixes (again) error when compiling with assertions disabled.

As reported on forum: https://esp32.com/viewtopic.php?f=13&t=2750&p=13069
2017-08-22 13:01:36 +10:00
Deng Xin
d739e6bf05 WPA2:Fix the issue memory leak when run wifi enterprise
fix the issue memory leak when run wpa2
2017-08-22 10:49:31 +08:00
Angus Gratton
d6c3fb52c8 esptool: Update to v2.1 final release
Replaces v2.1-beta1 release.

Compared to beta, fixes issues with espefuse.py not prompting correctly on Windows (TW11139).
2017-08-22 11:49:07 +10:00
michael
4c9754726f fix(spi_master): fix the command field to make it more intuitive to use. 2017-08-21 20:37:57 +08:00
Jiang Jiang Jian
fc85cb683d Merge branch 'feature/wifi_and_ip_event_process_refactor' into 'master'
Feature/wifi and ip event process refactor

See merge request !986
2017-08-21 19:49:30 +08:00
Jiang Jiang Jian
5c9d9ae696 Merge branch 'bugfix/btdm_smp_invalid_key_size' into 'master'
component/bt: Change the SMP key size analyzing conditions.

See merge request !958
2017-08-21 19:38:15 +08:00
Yulong
202c5783db component/bt:squash the 2 commits.
component/bt: cherry-pick the bugfix/btdm_api_manage_pair_info_#13119 to this branch.

component/bt: Change the ble gap API code format & added the status judgment in the btc_storage_load_bonded_ble_devices function.
2017-08-21 06:17:21 -04:00
Yulong
c5ea00c727 component/bt: Change the debug info. 2017-08-21 17:49:05 +08:00
Yulong
eebc2e2df1 component/bt: Change the btm ble security key size range. 2017-08-21 17:49:05 +08:00
Yulong
677f58577f component/bt: Change the SMP key size analyzing conditions. 2017-08-21 17:49:05 +08:00
Ivan Grokhotkov
abe9516fdc newlib: implement usleep 2017-08-21 15:58:28 +08:00
Ivan Grokhotkov
10f0543080 console: add support for terminal probing and dumb terminal mode 2017-08-21 15:58:28 +08:00
Ivan Grokhotkov
1e4587a09f vfs: implement fcntl via VFS interface 2017-08-21 15:58:28 +08:00
Ivan Grokhotkov
489c523870 vfs: support for blocking reads, more newline conversion options
Previously VFS driver for UART could only use simple non-blocking
functions to read from and write to the UART. UART driver provides more
complex blocking and interrupt-driven functions, which can be used
instead.
This commit adds optional support for using UART driver's functions.

Also added is a more flexible mechanism for configuring newline
conversion rules on input and output.

This commit also fixes a bug that all UARTs shared one static variable
used as a character buffer in newline conversion code. This variable is
changed to be per-UART.
2017-08-21 15:58:28 +08:00
Ivan Grokhotkov
a8075ea140 console/argtable3: expose arg_print_formatted function 2017-08-21 15:58:28 +08:00
Ivan Grokhotkov
160f842d35 console/argtable3: fix usage of char as argument to ctype functions 2017-08-21 15:58:27 +08:00
Ivan Grokhotkov
5de7c91a54 add console component and example 2017-08-21 15:58:27 +08:00
Jiang Jiang Jian
363f201603 Merge branch 'bugfix/exection_not_init_bt_use_smp_api_#13691' into 'master'
component/bt: Added the bluedorid status checkout for the BLE security API.

See merge request !1045
2017-08-21 14:51:17 +08:00
Liu Zhi Fu
b45433110f tcpip_adapter/lwip: optimize wifi/ip event 2017-08-21 14:36:44 +08:00
Angus Gratton
2c0ff0c1e1 mbedtls: Add a shim header to account for including "mbedtls/config.h" directly in program
Previously this resulted in a config mismatch between default config and esp_config.h

Closes https://github.com/espressif/esp-idf/issues/711
2017-08-21 12:37:53 +10:00
Angus Gratton
f44091e48a Merge branch 'feature/mbedtls_cipher_config' into 'master'
mbedtls: Add compile-time configuration, better default configuration

See merge request !1118
2017-08-21 07:19:24 +08:00
zhiweijian
6276e71fc1 Component/bt: add check value and length for esp_ble_gatts_get_attr_value(uint16_t attr_handle, uint16_t *length, const uint8_t **value); 2017-08-20 19:12:57 +08:00
Ivan Grokhotkov
bb7d5fc10f Merge branch 'feature/remove_ethernet_config_option' into 'master'
ethernet: remove CONFIG_ETHERNET

See merge request !1116
2017-08-18 18:45:49 +08:00
Angus Gratton
66ad84d318 mbedtls: Add more config options to disable Elliptic Curve features
Can save up to an additional 20KB when not using EC in TLS, or disable
unwanted features as needed.
2017-08-18 17:44:33 +10:00
Angus Gratton
c0f65f6680 mbedtls: Expose compile-time config, disable some things by default
* Disables 3DES, Camellia, Blowfish, RC4, RIPEMD160, SSLv3, TLS-PSK modes, DTLS by default
* Saves about 40KB from the default TLS client code size
* Defaults no longer get "Bad" howsmyssl.com rating (no more vulnerable 3DES)
  (ping https://github.com/espressif/arduino-esp32/issues/575 )
* Allows up to another 20-30KB code size to be trimmed without security
  implications if using DER formatted certificates, RSA ciphersuites only,
  etc.
* Can save up to another 8KB by setting the TLS Role to Server or Client only.
2017-08-18 17:15:08 +10:00
Angus Gratton
979eabeba5 libsodium: Use mbedTLS implementations for SHA256 & SHA512
* Adds support for hardware accelerated SHA
* Saves code size (~5.5KB) for SHA256 & SHA512 where libsodium & mbedTLS both used
2017-08-18 16:29:04 +10:00
Kedar Sovani
4c1c62a453 wifi: refactor code to match ethernet's init function structure 2017-08-18 08:33:02 +05:30
Kedar Sovani
8348a71847 ethernet: remove CONFIG_ETHERNET
1. Hello World application shows no footprint difference before and
after this change
2. examples/ethernet/ethernet application compiles properly (can't
test with my board)
2017-08-18 08:31:43 +05:30
michael
a01db5569c fix(spi_dma): fix the receive error with RX DMA start with non-aligned address. 2017-08-18 10:14:49 +08:00
Ivan Grokhotkov
eddc07eebf Merge branch 'feature/set_static_ip_to_zero' into 'master'
Zero static IP address can also be set

See merge request !1101
2017-08-16 19:12:01 +08:00
Ivan Grokhotkov
14c96838bf sdmmc: add more comments about card initialization steps 2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
6baf8195ee sdmmc: add support for high speed (HS) mode
By default SD cards are initialized in default speed (DS) mode. Enabling
HS mode requires SWITCH_FUNC command to be sent twice: first time to
query if the card supports switching to HS mode, second time to perform
the switch.

This change implements SWITCH_FUNC command and adds the procedure to
switch to HS mode.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
9253d316e7 sdmmc: implement deselecting a card
In some cases the card needs to be returned to standby mode from data
transfer mode. This is done using CMD7 command, which does not receive
any response in this case.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
f908425b13 sdmmc: introduce is_app_cmd flag, check it along with opcode
‘make_hw_cmd’ function checks opcodes in a few cases. Comparing opcode
does not tell the whole story, because for some SD commands there is are
APP commands with the same opcodes. This change introduces a flag which
indicates whether the next command is going to be an APP command.
The check for APP_SET_BUS_WIDTH command is updated to use this flag.
This fixes a bug with an unexpected STOP_TRANSMISSION command sent after
SWITCH_FUNC command, which has opcode 6, same as APP_SET_BUS_WIDTH.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
e6258ac6cb sdmmc: don’t flip word order in MMC_RSP_BITS
MMC_RSP_BITS helper function had a hack that it flipped word order in
the response, assuming that response size is 4 words. This hack does not
work for responses which are not 4 words long (such as the SWITCH_FUNC
response, which is 64 words long).

This change removes the hack and the matching word order reversal code
in sdmmc driver.
2017-08-16 18:59:04 +08:00
Ivan Grokhotkov
159a2d01d1 Merge branch 'bugfix/spi_dma' into 'master'
bugfix(spi_master): fix several issues when using RX DMA

See merge request !1006
2017-08-16 18:55:25 +08:00
Ivan Grokhotkov
8a7bc34b78 Merge branch 'feature/remove_wifi_config_option' into 'master'
Remove wifi config option

Remove Wi-Fi enable/disable option from Kconfig. This can be detected by the presence of esp_wifi_init() function in the application. Minimum footprint impact after the change.

See merge request !1098
2017-08-16 18:43:56 +08:00
Kedar Sovani
6405d6f874 kconfig: Add an option for skipping binary blobs 2017-08-16 15:55:42 +05:30
Kedar Sovani
ba8cd58b08 kconfig: Remove Wi-Fi on/off as a menuconfig option
This is no longer required since the functions automatically get
pulled in based on the usage. A quick summary of footprint
comparisions before and after these set of patches is shown below:

Hello-World: (simplified for readability)
 old Total image size:~ 104902 bytes (.bin may be padded larger)
 old Total image size:~ 105254 bytes (.bin may be padded larger)
 Per-archive contributions to ELF file:
             Archive File DRAM .data & .bss   IRAM Flash code & rodata   Total
 old              libesp32.a       1973    177   4445       3939     2267   12801
 new              libesp32.a       1973    185   4473       3939     2267   12837

 new             libnvs_flash.a          0     92      0        274        8     374
 new             libstdc++.a          0      0      0         24        0      24

For some reason, nvs_flash.a (~400bytes) gets pulled in (particularly
the nvs_flash_init() function).

Power-Save: (simplified for readability)
 old Total image size:~ 421347 bytes (.bin may be padded larger)
 old Total image size:~ 421235 bytes (.bin may be padded larger)

 old      libtcpip_adapter.a          0     81      0       1947      115       2143
 new      libtcpip_adapter.a          0     69      0       1897      115       2081

The size actually shrinks a bit, since the AP interface function
doesn't get pulled in.
2017-08-16 15:55:28 +05:30
Kedar Sovani
a24130b390 tcpip_adapter: Decompose tcpip_adapter_start() into interface specification options
Since only the used interface's start function gets called, it pulls
in only the functions that are required in the current application,
thereby saving footprint.
2017-08-16 15:54:29 +05:30
Kedar Sovani
159e7e81b4 esp32: Make 'restart' function independent of Wi-Fi
Restart being a lower-layer system-level function, needn't depend on
the higher level Wi-Fi libraries.

This also enables us to get rid of one more WIFI_ENABLED ifdef check
2017-08-16 15:54:28 +05:30
Kedar Sovani
a41b1a9d1f esp32: Register event handlers on the esp_wifi_init() call 2017-08-16 15:54:28 +05:30
Kedar Sovani
55a6aca355 wifi: Map esp_wifi_init() to esp_wifi_init_internal()
Follow-on patches will include additional functionality in
esp_wifi_init()
2017-08-16 15:54:28 +05:30
Kedar Sovani
8063b93497 wifi_lib: Update to the change in the wifi_lib repository 2017-08-16 15:54:13 +05:30
Ivan Grokhotkov
1633582ac4 Merge branch 'bugfix/spi_address' into 'master'
fix(spi_master): make the address field more intuitive to use.

See merge request !1074
2017-08-16 10:25:21 +08:00
Nilay Sheth
0eb59844bb bugfix(driver): fix RMT issues from github
1. Rename api from rmt_get_ringbuf_handler to rmt_get_ringbuf_handle (Github Issue #274)
2. doxygen param rename
3. change API rmt_wait_tx_done to specify maximum waiting time
4.Change return type of rmt_wait_tx_done API from bool to esp_err_t
5. update doc
2017-08-15 17:23:51 +08:00
michael
ed1d084aea fix(spi_master): make the address field more intuitive to use.
The address field should be placed at the highest bits of address and slv_wr_status registers. Instead of breaking the address into two parts and fill in each register, move the address to the highest bits and write to the registers respectively.

Breaking change: if you fill-in the SPI address filed in a previous version in some way and it works correctly, you still have to rewrite the address, in a more intuitive way.
2017-08-15 14:49:31 +08:00
Angus Gratton
969f1bb9be Merge branch 'bugfix/ota_failsafe' into 'master'
bootloader: Fallback if OTA data is invalid

See merge request !1033
2017-08-15 08:11:38 +08:00
Angus Gratton
5eef5e7a5d bootloader: Fallback if OTA data is invalid
Make bootloader more robust if either OTA data or some OTA app slots are corrupt.
2017-08-15 09:42:19 +10:00
michael
366e4397e9 fix(spi_dma_rx): fixed the invalid argument issue in full-duplex mode.
force rxlength=length and mosi=1 and inlink.start=1 on in full-duplex mode.
set rxlength > length is forbidden in full-duplex mode.

TW#12609, TW#14240, https://www.esp32.com/viewtopic.php?f=13&t=2519
2017-08-14 17:25:30 +08:00
michael
227b011f6a fix(spi_master): fix SPI master, now able to transfer more than 32 bytes in non-DMA-accessable area.
apply for internal space to hold these data.
use DMA when it's enabled, no matter long or short.

TW#12226, github#551
2017-08-14 17:19:57 +08:00
Angus Gratton
8f44efc619 Merge branch 'bugfix/ledc_fade_divided_by_zero' into 'master'
bugfix(ledc): fix integer divided by zero in function ledc_set_fade_with_time

See merge request !1048
2017-08-14 13:52:36 +08:00
Ivan Grokhotkov
5fdde089e5 Merge branch 'bugfix/wl_ext_size_test' into 'master'
wear_levelling: fix unit test, fix sector erase in performance mode

See merge request !1093
2017-08-14 09:35:12 +08:00
Kedar Sovani
0cc59d5f67 build: Print real paths for 'ulp' build objects as well
Signed-off-by: Kedar Sovani <kedars@gmail.com>
2017-08-11 14:26:44 +05:30
baohongde
b041c042bb component/bt: Fix gatt read by type response bug 2017-08-10 20:05:10 +08:00
XiaXiaotian
67b6327c4e Zero static IP address can also be set 2017-08-10 19:43:26 +08:00
Ivan Grokhotkov
43b81c8f11 Merge branch 'feature/fast_crypto_used_in_supplicant' into 'master'
Add the fast crypto function in supplicant, relate to the task tw13712

See merge request !1075
2017-08-09 21:55:05 +08:00
Deng Xin
57bc38d867 Add the fast crypto function in supplicant
optimize the speed when do wifi connect
2017-08-09 21:36:13 +08:00
Dmitry Yakovlev
af414eadbd Log level changed to remove useless info. 2017-08-09 10:25:40 +03:00
Dmitry Yakovlev
8f0f9d8ab0 Fix: tests now process correct. The length of written array now fit to the defined range.
Fix: perfomance mode bugfix for big sector sizes.
2017-08-09 09:35:32 +03:00
Yulong
4efc97efc1 component/bt: All esp_bluedroid_get_status check-return could be used as MACRO ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED); 2017-08-08 05:28:19 -04:00
Ivan Grokhotkov
5539bfb83b sdmmc: mark new unit test as ignored 2017-08-08 03:51:54 +08:00
Ivan Grokhotkov
59a28ebccc wear_levelling: temporarily disable 512 byte sectors
Unit tests are failing with the new 512 byte sector option. Disabling
this option to let the tests pass.
2017-08-08 03:26:14 +08:00
Ivan Grokhotkov
097dced499 wear_levelling: clean up Kconfig 2017-08-08 03:26:14 +08:00
Ivan Grokhotkov
b260f6cb25 Merge branch 'bugfix/sdmmc_unaligned_write' into 'master'
sdmmc: fix reads/writes to/from unaligned buffers

See merge request !1071
2017-08-08 02:55:13 +08:00
Ivan Grokhotkov
a88435ccbf Merge branch 'feature/aws_iot_menuconfig' into 'master'
aws_iot: Expose common SDK compile-time configuration in menuconfig

See merge request !1030
2017-08-07 17:22:48 +08:00
Ivan Grokhotkov
dfda0fa67b Merge branch 'feature/add_gpio_drive_capability' into 'master'
feature(gpio): add APIs to set and get pad drive capability.

See merge request !1010
2017-08-07 17:21:42 +08:00
Ivan Grokhotkov
7421452ca2 Merge branch 'bugfix/nghttp_build_port' into 'master'
nghttp: build port directory

See merge request !1057
2017-08-07 17:21:15 +08:00
Ivan Grokhotkov
72ee0120cd Merge branch 'feature/wl_ext_sector_size' into 'master'
Feature/wl ext sector size

See merge request !1038
2017-08-07 17:20:34 +08:00
Ivan Grokhotkov
938085e749 Merge branch 'bugfix/windows_build' into 'master'
Disable link time optimisation for bootloader

See merge request !1044
2017-08-07 17:19:16 +08:00
Jiang Jiang Jian
a92806b089 Merge branch 'bugfix/tw14130_fix_buf_err' into 'master'
emac:fix rx buf err

See merge request !1073
2017-08-04 15:17:33 +08:00
shangke
01a2c31e1f change copy right 2017-08-04 14:56:58 +08:00
Jiang Jiang Jian
886ea722ec Merge branch 'bugfix/btdm_add_set_local_privacy_callback' into 'master'
component/bt: add set local privacy func callback

See merge request !1026
2017-08-04 14:52:02 +08:00
Jiang Jiang Jian
ea3b3046c2 Merge branch 'bugfix/btdm_fix_esp_ble_gatts_set_attr_value_memory_leak' into 'master'
component/bt: fix esp_ble_gatts_set_attr_value() memory leak

See merge request !1068
2017-08-04 14:40:54 +08:00
shangke
05aa09fbb9 beautify the code 2017-08-04 14:24:44 +08:00
shangke
1e6f904d38 add comments for rx list 2017-08-03 14:44:22 +08:00
Jiang Jiang Jian
e165336428 Merge branch 'bugfix/btdm_Wrong_return_code_type_for_esp_ble_gattc_register_for_notify_and_unregister_for_notify_func' into 'master'
component/bt: fix wrong return code type for notify functions

See merge request !1070
2017-08-03 10:49:47 +08:00
Ivan Grokhotkov
d286d2f647 Merge branch 'feature/apptrace_api_ext' into 'master'
esp32: Apptrace API enhancement

See merge request !1021
2017-08-02 14:34:42 +08:00
shangke
ae571ddddf fix rx buf 2017-08-01 11:59:57 +08:00
Tian Hao
d2872cbf2e component/bt : remove fixed queue from btu 2017-08-01 11:35:22 +08:00
Jiang Jiang Jian
fedc5090d1 Merge branch 'bugfix/btdm_optimize_controller_task' into 'master'
component/bt : fix a bug and optimize controller task handler

See merge request !1066
2017-08-01 11:10:56 +08:00
Ivan Grokhotkov
512898edee sdmmc: fix reads/writes to/from unaligned buffers
SDMMC hardware treats all buffers as aligned, and ignores 2 LSBs of
addresses written into DMA descriptors. Previously SDMMC host driver
assumed that data buffers passed from SDDMC command layer would be
aligned. However alignment checks were never implemented in the command
layer, as were the checks that the buffer coming from the application
would be in DMA capable memory. Most of the time this was indeed true.
However in some cases FATFS library can pass buffers offset by 2 bytes
from word boundary. “DMA capable” restriction may be broken if pSRAM
support is used.

This change adds buffer checks to the SDMMC host driver (alignment and
DMA capability), so that the host layer will error out for incompatible
buffers. In SDMMC command layer, a check is added to read and write
functions. If an incompatible buffer is passed from the application, new
buffer (512 bytes size) is allocated, and the transfer is performed
using {READ,WRITE}_SINGLE_BLOCK commands.
2017-08-01 03:15:11 +08:00
Jeroen Domburg
9314bf0d37 Merge branch 'bugfix/spi_change_host' into 'master'
fix(spi_master): fix the bug that VSPI no respond when host changed from HSPI to VSPI, and vice versa.

See merge request !997
2017-07-31 18:33:36 +08:00
Dmitry Yakovlev
831cc4b42f Typos correction. 2017-07-31 13:19:41 +03:00
Dmitry Yakovlev
06805842ea Some typos corrected in readme. 2017-07-31 13:19:38 +03:00
Dmitry Yakovlev
9ebb68c2dc Added component to change standard size of the flash device. Now the sector size could be less. The configuration supports it. 2017-07-31 13:19:36 +03:00
zhiweijian
6ff53d1967 Component/bt: wrong return code type for notify func
- fix  esp_ble_gattc_register_for_notify()  returen wrong code type
- fix  esp_ble_gattc_unregister_for_notify()  returen wrong code type
2017-07-31 18:02:15 +08:00
zhiweijian
87d58b9ddb Component/bt: fix esp_ble_gatts_set_attr_value( ) memory leak 2017-07-31 17:24:07 +08:00
Tian Hao
6afadc3286 component/bt : fix a bug and optimize controller task handler
1. fix controller task printf in ISR may cause exception.
2. optimize task handler process.
2017-07-31 14:48:39 +08:00
XiaXiaotian
1c4f7f2081 add get and set wifi maximum transmit power API 2017-07-28 15:06:52 +08:00
Jiang Jiang Jian
a31736990c Merge branch 'bugfix/btdm_osi' into 'master'
component/bt : add osi_is_in_isr && fix vhci delay

See merge request !1054
2017-07-28 11:35:04 +08:00
Jiang Jiang Jian
ff3aa69e76 Merge branch 'feature/tw13968_optimize_for_tcp_close' into 'master'
lwip: optimize TCP close

See merge request !1022
2017-07-28 11:34:12 +08:00
Ivan Grokhotkov
3bd6194c58 Merge branch 'feature/docs_jtag_debugging' into 'master'
Update and extension of Debugging documentation

See merge request !850
2017-07-27 22:03:45 +08:00
Liu Zhi Fu
4ad1f2b272 lwip: optimize TCP close
Optimize TCP close:
1. Not remove TCP pcb when IP address is changed since the lwip netconn still need the pcb
2. If the TCP connection is in TCP_FIN_WAIT_1 for too long time, remove it
2017-07-27 12:44:39 +08:00
Jiang Jiang Jian
843159b0d7 Merge branch 'feature/add_menuconfig_option_for_ba_window' into 'master'
esp32: add menuconfig options to configure BA window

See merge request !915
2017-07-27 10:46:04 +08:00
zhiweijian
fc05851b05 Component/bt: add set local privacy func callback 2017-07-26 17:29:10 +08:00
krzychb
1fb85b494c JTAG Debugging - revamping of Debugging documentation 2017-07-26 14:53:43 +08:00
Ivan Grokhotkov
ee6d0631f4 nghttp: build port directory
Fixes https://github.com/espressif/esp-idf/issues/843
2017-07-26 14:27:20 +08:00
Ivan Grokhotkov
002f38fa8f Merge branch 'feature/sdspi_driver' into 'master'
SD SPI mode driver

This MR adds functionality to support SD cards connected via SPI interface.
Additionally, two bugs are fixed:
- Definition of `SPI_TRANS_MODE_DIOQIO_ADDR` in spi_master driver
- SD card probing frequency was 4000kHz instead of 400kHz as required by the standard

See merge request !727
2017-07-26 13:51:37 +08:00
Jiang Jiang Jian
460ab2e33b Merge branch 'feature/make_tcp_udp_receive_mbox_configurable' into 'master'
lwip: Make UDP/TCP receive mail box configurable

See merge request !1051
2017-07-25 20:45:38 +08:00
Tian Hao
b500d6558a component/bt : add osi_is_in_isr && fix vhci delay 2017-07-25 19:58:39 +08:00
Liu Zhi Fu
7b2f388abc lwip: Make UDP/TCP receive mail box configurable
Different application may require different TCP/UDP receiv mail box size,
so make them configurable.
2017-07-25 13:56:32 +08:00
Liu Zhi Fu
c99c5d13e6 esp32: add menuconfig options to configure BA window
Make AMPDU Block Ack Window configurable in menuconfig because we need to configure it
in some special cases, such as iperf test etc
2017-07-25 13:11:38 +08:00
Liu Zhi Fu
9ae5c6700b lwip/ethernet: fix emac rx buf err
1. Lwip not free the ethernet buf in lwip layer
2. Fix emac counter error
2017-07-25 11:19:31 +08:00
Alexey Gerenkov
60c45ae2c4 Updated acc to comments 2017-07-24 20:07:21 +03:00
Alexey Gerenkov
c2c9149a24 esp32: Apptrace API enhancement
- User down buffer configuration support
 - bugfix: ring buf - avalable write size undeflow
 - SysView down buf support updated
2017-07-24 19:57:44 +03:00
Ivan Grokhotkov
6fbd6a007b Merge branch 'bugfix/uart_tx_glitch' into 'master'
bugfix(uart): fix signal glitch on tx pin

See merge request !1032
2017-07-24 19:43:25 +08:00
Yulong
9d9280a8ea component/bt: Added the bluedorid status checkout for the BLE security API. 2017-07-24 02:50:23 -04:00
Ivan Grokhotkov
967611cfaa Revert "bootloader: Add option to build with Link Time Optimisation enabled"
This reverts commit d1b66a08c1.
2017-07-24 05:14:31 +08:00
qianyicheng
acec9b9d35 bugfix(ledc): fix integer divided by zero in function ledc_set_fade_with_time 2017-07-21 19:06:44 +08:00
michael
99769f0b00 fix(spi_master): fix the bug that VSPI no respond when host changed
from HSPI to VSPI, and vice versa.

fix the SPI control bits written wrong in the headers.

TW#12123, Github#477
2017-07-21 14:50:17 +08:00
Tian Hao
63566f6650 component/bt : fix RX packets losing bug 2017-07-20 15:53:01 +08:00
Jiang Jiang Jian
8fd6ab9a39 Merge branch 'feature/btdm_ble_tx_power_new' into 'master'
component/bt : add ble tx power && fix controller deinit mem leak

See merge request !1018
2017-07-20 15:16:13 +08:00
Wangjialin
9d466de235 bugfix(uart): fix signal glitch on tx pin
gpio_matrix_out function will set output enable for GPIO, seems in gpio_matrix_out there will be a short moment that the chip will output GPIO level.
So we can set GPIO as high before gpio_matrix_out function.
2017-07-20 14:34:11 +08:00
Ivan Grokhotkov
292c2abd3b Merge branch 'bugfix/init_nvs_in_bluetooth' into 'master'
bt: call nvs_flash_init in examples, show error if NVS is not initialized

See merge request !1003
2017-07-20 14:25:49 +08:00
Dmitry Yakovlev
e5bb45f381 driver: SD protocol driver for SPI peripheral 2017-07-20 13:43:07 +08:00
Ivan Grokhotkov
5f8785eaec sdmmc: add support for SPI protocol commands 2017-07-20 13:34:21 +08:00
Ivan Grokhotkov
3b96771feb sdmmc: fix probing clock frequency
Probing clock frequency should be 400kHz, not 4MHz.
2017-07-20 13:34:21 +08:00
Ivan Grokhotkov
54dc350907 spi_master: fix duplicate bit mask for SPI_TRANS_MODE_DIOQIO_ADDR 2017-07-20 13:34:21 +08:00
Angus Gratton
eeb8dc9c35 aws_iot: Expose common SDK compile-time configuration in menuconfig
Closes https://github.com/espressif/esp-idf/issues/637
2017-07-20 15:28:29 +10:00
Ivan Grokhotkov
b9f660524c Merge branch 'bugfix/exception_lomem_heap_init' into 'master'
heap_caps: Allow for possibility a region is too small to register a heap

See merge request !1024
2017-07-20 12:13:12 +08:00
Angus Gratton
871ba41a09 bootloader: Remove unnecessary KEEP on data/bss sections, save static RAM 2017-07-19 18:31:59 +10:00
Angus Gratton
d1b66a08c1 bootloader: Add option to build with Link Time Optimisation enabled 2017-07-19 18:31:59 +10:00
Angus Gratton
17adb40ca8 bootloader: Calculate SHA256 hash of image on every boot
Makes app image booting more reliable (256-bit rather than 8-bit verification.)

Some measurements, time to boot a 655KB app.bin file and run to app_main() execution.

(All for rev 1 silicon, ie no 340ms spurious WDT delay.)

80MHz QIO mode:
before = 300ms
after = 140ms

40MHz DIO mode:
before = 712ms
after = 577ms

40MHz DIO mode, secure boot enabled
before = 1380ms
after = 934ms

(Secure boot involves two ECC signature verifications (partition table, app) that take approx 300ms each with 80MHz CPU.)
2017-07-19 18:31:59 +10:00
Angus Gratton
caaa29c676 esp_image_format: ESP32 additional header does not contain an encrypt flag 2017-07-19 18:25:17 +10:00
Angus Gratton
43b99edf2b bootloader: Calculate SHA-256 of image while loading/verifying 2017-07-19 18:25:17 +10:00
Angus Gratton
8f6134dd96 bootloader: Obfuscate loaded memory until verification is complete 2017-07-19 18:25:17 +10:00
Angus Gratton
0c8888d68f bootloader: Combine loading from flash & verifying to save boot time
Still needs updating to account for secure boot.
2017-07-19 18:25:17 +10:00
Angus Gratton
105c4b7386 Merge branch 'feature/esptool_image_padding' into 'master'
esptool: Optimise app image size by using RAM-loaded data for padding

See merge request !1017
2017-07-19 15:52:22 +08:00
Angus Gratton
2d9770fd00 linker script: Add some comments about significance of 0x18 byte offset 2017-07-19 17:38:05 +10:00
Angus Gratton
0feb40833a heap_caps: Allow for possibility a region is too small to register a heap
May happen due to sdkconfig, static allocation of RAM.

Closes https://github.com/espressif/esp-idf/issues/802
2017-07-19 17:24:24 +10:00
Angus Gratton
c230e4280c linker scripts: Limit DROM/IROM section lengths correctly 2017-07-19 16:33:48 +10:00
Angus Gratton
d92c541b1a esptool: Optimise generated image size by using RAM-loaded data for padding
Can save almost 128KB from some images.
2017-07-19 16:24:17 +10:00
Angus Gratton
ec64fa3416 bootloader flash QIO mode: Restore DIO/DOUT mode if enabling quad fails
Previously, flash was degraded to single I/O mode.
2017-07-19 15:04:09 +10:00
Angus Gratton
0715d1f8c1 bootloader: When customising SPI flash pins in efuse, set WP pin in menuconfig
Allows custom configurations for QIO/QOUT mode.
2017-07-19 15:04:08 +10:00
Wangjialin
c30149e4bd feature(gpio): add APIs to set and get pad drive capability. RTC pads use RTC registers to contol drive capability. 2017-07-19 11:23:41 +08:00
Angus Gratton
d664e32394 build system: Use component.mk for all components, refactor bootloader build
For config-only components, component.mk should now contain "COMPONENT_CONFIG_ONLY := 1"

Also refactored some of the generation of linker paths, library list. This required cleaning up the way the bootloader
project works, it's now mostly independent from the parent.
2017-07-19 09:10:48 +10:00
Tian Hao
006a90e075 component/bt : add ble tx power && fix controller deinit mem leak
1. add ble tx power functions
2. add more osi functions.
3. modify bluetooth controller task procedure
4. fix a memory leak when controller deinit
5. add controller disable return value.
2017-07-18 20:22:28 +08:00
Ivan Grokhotkov
aef5e90cce Merge branch 'feature/mmap_unordered_flash_pages' into 'master'
Add function to map non-contiguous flash pages to contiguous memory space.

See merge request !873
2017-07-18 10:49:12 +08:00
Ivan Grokhotkov
0ae916d555 Merge branch 'feature/high_level_interrupts' into 'master'
Break out high-level interrupts so a component can override them

See merge request !675
2017-07-18 10:42:31 +08:00
Angus Gratton
4029ed1df4 Merge branch 'bugfix/rom_gpio_typo' into 'master'
bugfix(typo): fix typo in rom/gpio.h

See merge request !1009
2017-07-18 06:53:30 +08:00
Ivan Grokhotkov
979fce0df5 bt: call nvs_flash_init in examples, show error if NVS is not initialized
NVS is used to store PHY calibration data, WiFi configuration, and BT
configuration. Previously BT examples did not call nvs_flash_init,
relying on the fact that it is called during PHY init. However PHY init
did not handle possible NVS initialization errors.

This change moves PHY init procedure into the application, and adds
diagnostic messages to BT config management routines if NVS is not
initialized.
2017-07-17 21:29:50 +08:00
Ivan Grokhotkov
fd2d53fca6 Merge branch 'bugfix/wl_write' into 'master'
wear_levelling: fix write and read length for single access was wrong.

See merge request !993
2017-07-17 18:31:27 +08:00
Dmitry Yakovlev
b36e580756 wear_levelling: fix write and read length for single access was wrong. 2017-07-17 12:00:40 +03:00
Wangjialin
10340d718f bugfix(typo): fix typo in rom/gpio.h 2017-07-17 15:41:02 +08:00
Angus Gratton
c2e6e10dcc Merge branch 'bugfix/nghttp2_build_submodules' into 'master'
nghttp2: Add submodule to COMPONENT_SUBMODULES, update to v1.24

See merge request !977
2017-07-17 14:14:28 +08:00
Angus Gratton
e50870c2dc Merge branch 'bugfix/bootloader_stack_smash' into 'master'
Fix crashes when >approx 185KB of DRAM is statically allocated

See merge request !983
2017-07-17 14:11:35 +08:00
Angus Gratton
f824829a13 Merge branch 'bugfix/dont_link_unused_data_sections' into 'master'
ld: Save RAM by removing unused .data sections at link time

See merge request !985
2017-07-17 14:10:12 +08:00
Jiang Jiang Jian
4ec2abbf23 Merge branch 'feature/some_refactor_for_tcpip_adapter' into 'master'
tcpip_adapter: not remove netif when tcpip adapter is stopped

See merge request !943
2017-07-13 22:16:00 +08:00
Jiang Jiang Jian
5ac0503ce7 Merge branch 'bugfix/btdm_modify_BTA_GATTC_KNOWN_SR_MAX_for_Multi-connection' into 'master'
component/bt: modify BTA_GATTC_KNOWN_SR_MAX for Multi-connection bug

See merge request !992
2017-07-13 21:55:24 +08:00
Liu Zhi Fu
d724cc23d2 tcpip_adapter: not free netif when tcpip adapter is stopped
When tcpip adapter is stop, don't free the netif
2017-07-13 18:42:45 +08:00
Angus Gratton
399ec29a68 Merge branch 'feature/silent_assertions' into 'master'
Add "silent" assertion option

See merge request !984
2017-07-13 17:21:09 +08:00
zhiweijian
ca3bf570cd Component/bt: modify BTA_GATTC_KNOWN_SR_MAX for Multi-connection bug 2017-07-13 16:22:44 +08:00
Angus Gratton
1ed4eadfab Merge branch 'bugfix/mbedtls_ecp_failure_memory_leak' into 'master'
mbedtls: Fix memory leak in initial ECDH exchange if OOM/failure occurs

See merge request !987
2017-07-13 15:39:40 +08:00
Ivan Grokhotkov
0c28b3bc4c Merge branch 'bugfix/btdm_update_connect_params_for_gattc' into 'master'
component/bt: bugfix update connect params for gattc

See merge request !991
2017-07-13 14:32:20 +08:00
Jiang Jiang Jian
fc4d3df890 Merge branch 'bugfix/tw13744_make_low_rate_work' into 'master'
esp32: update wifi lib to make low rate work

See merge request !965
2017-07-13 14:26:02 +08:00
Ivan Grokhotkov
7fc25f18d2 Merge branch 'feature/enable_brownout_detector' into 'master'
Enable brownout detector

See merge request !811
2017-07-13 11:40:37 +08:00
Angus Gratton
8cd03c84d0 Merge branch 'feature/ip_route_base_on_source_ip' into 'master'
Broadcast IP route based on source IP address.

See merge request !942
2017-07-12 17:31:24 +08:00
Angus Gratton
7b565e4b25 assertions: Add "silent" option
Reduces assertion codesize overhead by approximately 35%
2017-07-12 17:29:26 +08:00
Angus Gratton
d8d2933bde Merge branch 'bugfix/gdbstub_handler_noreturn' into 'master'
gdbstub: Mark the panic handler entry as noreturn

See merge request !975
2017-07-12 17:23:59 +08:00
Angus Gratton
ffefeef5ea mbedtls: Fix memory leak in initial ECDH exchange if OOM/failure occurs
In ecp_mul_comb(), if (!p_eq_g && grp->T == NULL) and ecp_precompute_comb() fails (which can happen due to OOM), then the new array of points T was leaked.
2017-07-12 16:34:26 +08:00
Angus Gratton
cfbb1a652b Merge branch 'doc/esp_random' into 'master'
esp_random: Add some documentation about using before RF subsystem is on

See merge request !976
2017-07-12 16:18:43 +08:00
Angus Gratton
99fe61716c startup: Add assertion checks around various initialisation sequences
These may fail if close to 192KB of static RAM is allocated (remaining early heap RAM is too small.)
2017-07-12 13:06:56 +08:00
Angus Gratton
2b0f623259 bootloader/early boot: Error out if >192KB of static DRAM is allocated (temporary fix)
Currently the last 128KB of DRAM is reserved for the bootloader & early boot stacks. This means if >192KB of static DRAM
is allocated, the only available heap is this region - which is disabled until the scheduler starts. As a result, you
get either heap corruption on early boot if the static data overlaps startup heap (leading to very weird errors), or
FreeRTOS will fail to start when it can't malloc() anything.

Long term fix is to move the stacks & bootloader data to the very end of RAM, and only reserve that part for early
boot. This is a little fiddly because of also wanting to make sure this memory is not preemptively fragmented when it
gets reintroduced to the heap. This will become more important if/when we have more static allocation options in the
future.

For now, these errors make it clear why the boot has failed.

Ref TW13909
2017-07-12 13:06:56 +08:00
Angus Gratton
187b5fb888 ld: Remove unused .data sections at link time
Reduces static RAM, code size.
2017-07-12 13:05:54 +08:00
Angus Gratton
083f7d667b nghttp2: Add submodule to COMPONENT_SUBMODULES, update to release v1.24
Removes need for -DNDEBUG hack in component.mk (fixed upstream).
2017-07-12 11:16:55 +08:00
Angus Gratton
d601bedb85 pvPortMalloc: Fix regression when changing to new heap implementation 2017-07-12 11:10:11 +08:00
Angus Gratton
7ae93f271c Merge branch 'feature/multi_heap' into 'master'
Separate the heap implementation from FreeRTOS

See merge request !731
2017-07-12 10:53:37 +08:00
Angus Gratton
3ad163e644 freertos: Bump idle stack size to 1KB, min stack to 768 bytes, make configurable
Reverts regression mentioned at
3fe0022efa (commitcomment-23013504)
2017-07-11 14:48:15 +08:00
Angus Gratton
3bb90bab97 esp_random: Add some documentation about using before RF subsystem is on 2017-07-11 14:27:20 +08:00
zhiweijian
8460f1a972 Component/bt: bugfix update connect params for gattc 2017-07-11 11:27:36 +08:00
Angus Gratton
c049cd55a6 gdbstub: Mark the panic handler entry as noreturn
Fixes a warning in panic.c when this panic mode is enabled.
2017-07-11 10:18:08 +08:00
Angus Gratton
ad60c30de0 heap: Rename memory "tags" to "types" to avoid confusion w/ old tag allocator API 2017-07-10 17:46:03 +08:00
Angus Gratton
8d7074ed5c soc: Move esp_ptr_dma_capable() function to soc_memory_layout.h 2017-07-10 17:46:03 +08:00
Angus Gratton
71c70cb15c heap: Refactor heap regions/capabilities out of FreeRTOS
Remove tagged heap API, rename caps_xxx to heap_caps_xxx

Also includes additional heap_caps_xxx inspection functions.
2017-07-10 17:46:03 +08:00
Angus Gratton
5ee49fd311 heap: Add new multi_heap heap implementation to replace FreeRTOS-based tagged heaps 2017-07-10 17:46:03 +08:00
Ivan Grokhotkov
01b185977c brownout detector: enable by default
Because of errata related to BOD reset function, brownout is handled as follows:

- attach an ISR to brownout interrupt
- when ISR happens, print a message and do a software restart
- esp_restart_nonos enables RTC watchdog, so if restart fails,
  there will be  one more attempt to restart (using the RTC
  watchdog)
2017-07-10 17:25:55 +08:00
Ivan Grokhotkov
780569c04a esp32: fix RTC watchdog configuration in esp_restart
RTC watchdog didn’t have any actions configured for any of the stages.
This change configures it to use SW_SYSTEM_RESET at stage 0 and a
full reset at stage 1. The timeout is now calculated based on
RTC_SLOW_CLK frequency.
2017-07-10 17:21:49 +08:00
Ivan Grokhotkov
cbe23147bf driver/rtc: add support for attaching handlers to RTC_CNTL interrupts 2017-07-10 17:21:49 +08:00
Liu Zhi Fu
e1f13eda49 esp32: update wifi lib to make low rate work
Make low rate work
2017-07-07 22:05:54 +08:00
Tian Hao
7a79d31db0 fix reg operation missing 2017-07-07 20:04:24 +08:00
Jeroen Domburg
d3290479b2 Merge panic and dport high level interrupt code to both use int level 4 2017-07-07 12:51:33 +08:00
Jeroen Domburg
1d748db209 Break out high-level interrupts so a component can override them 2017-07-07 12:51:33 +08:00
Anton Maklakov
3d1d4fe150 build: Fix the warnings that break the tests
unused variable 'lfn'
    'isr_handler' defined but not used
    'servo_set_angle' defined but not used
    'gpio_test_signal' defined but not used
    'change_duty' defined but not used
2017-07-07 11:03:25 +08:00
Jeroen Domburg
927b5685cd Merge branch 'bugfix/partition_mmap_size' into 'master'
esp_partition_mmap size calculation fix

See merge request !947
2017-07-06 18:44:59 +08:00
Jeroen Domburg
6c2b4854e1 Add test for partition mmap straddling 64K page issue 2017-07-06 18:22:43 +08:00
Angus Gratton
fd9d889e62 mbedtls unit tests: Allow for longer timeout using software SHA
Hardware SHA runs SHA operations faster than software...
2017-07-06 15:54:01 +08:00
Jiang Jiang Jian
6d03d42d2f Merge branch 'bugfix/btdm_error_length_unit' into 'master'
Component/bt: fix bug for  error length unit

See merge request !950
2017-07-06 14:48:29 +08:00
Ivan Grokhotkov
9aa0188655 Merge branch 'bugfix/small_typos' into 'master'
Fix a few minor typos in docs

See merge request !954
2017-07-06 14:27:22 +08:00
Ivan Grokhotkov
571ee9d1cb Merge branch 'bugfix/disable_crypto_acceleration' into 'master'
mbedtls: Temporarily disable hardware acceleration in dual-core mode

See merge request !956
2017-07-06 14:26:41 +08:00
Ivan Grokhotkov
6b2e16e51b soc: fix typo in register name 2017-07-06 12:36:06 +08:00
Ivan Grokhotkov
1194f59e1a Merge branch 'bugfix/i2s_return_err_code' into 'master'
i2s driver: return error code if register isr error

See merge request !829
2017-07-06 11:25:40 +08:00
Ivan Grokhotkov
a054ced740 esp_chip_info: populate ‘model’ field 2017-07-06 11:01:40 +08:00
Angus Gratton
c35aa1d9a2 mbedtls: Temporarily disable hardware acceleration in dual-core mode
Temporary fix, until DPORT bugs in crypto accelerators are completely fixed.
2017-07-05 12:03:00 +08:00
Ivan Grokhotkov
ef63811e6d phy_init: fix log level for "PHY data partition validated" message 2017-07-05 11:29:53 +08:00
zhiweijian
ad8cce3053 Component/bt: fix bug for error length unit 2017-07-04 10:57:36 +08:00
Jiang Jiang Jian
55b3ea9ccc Merge branch 'bugfix/btdm_cherry-pick_ble_smp_bonding_issues' into 'master'
component/bt: Fixed the bug crash of disconnet BLE when close the SMP module in the menuconfig.

See merge request !941
2017-07-03 19:41:56 +08:00
Jeroen Domburg
93b7eaf5b2 esp_partition_mmap could map a page less than needed because it did not take the region offset into account. 2017-07-03 18:02:28 +08:00
wangmengyang
8959c7de20 component/bt: bugfix for AVDTP state machine during disconnection in failure to handle NULL parameter 2017-07-03 17:25:44 +08:00
Yulong
5b9a89f04d component/bt: squech the commit
component/bt: Fixed the bug crash of disconnet BLE when close the SMP module in the menuconfig.

component/bt: Removed the Excess #endid ///SMP_INCLUDED == TRUE in the l2cu_no_dynamic_ccbs function.
2017-07-03 03:07:23 -04:00
Ivan Grokhotkov
0837b3b743 Merge branch 'doc/wifi_set_vendor_ie' into 'master'
Document the WiFi Vendor-Specific Information Element API

See merge request !933
2017-06-30 16:37:18 +08:00
Ivan Grokhotkov
15231f1cce Merge branch 'bugfix/newlib_lock_init' into 'master'
newlib locks: Fix _lock_init() & _lock_init_recursive() failing to initialise a lock

See merge request !937
2017-06-30 16:36:47 +08:00
Ivan Grokhotkov
a4ae3efcd2 Merge branch 'bugfix/ipc_task_stack_size' into 'master'
Bugfix IPC task stack size

See merge request !938
2017-06-30 16:36:18 +08:00
XiaXiaotian
7a64e19ba8 Broadcast IP route based on source IP address.
If destination IP address of the packet is broadcast address, firstly compare
    source IP address with the that of each network interface. If it matches,
    packet is forwarded from the interface.
2017-06-30 16:18:29 +08:00
Angus Gratton
9297edaf60 ipc task: Allow configuration of IPC task stack size
Fixes regression in 3fe0022ef
2017-06-30 15:04:19 +10:00
Ivan Grokhotkov
016a579806 Merge branch 'bugfix/uart_tx_buffer_length' into 'master'
bugfix(uart): fix bugs reported from github

See merge request !927
2017-06-30 12:30:25 +08:00
Angus Gratton
75d6fdf73c newlib locks: Fix _lock_init() & _lock_init_recursive() failing to initialise a lock
If scheduler was running, and lock was an automatic variable (ie stack-allocated) to be initialised by _lock_init*,
initialisation could be skipped if the lock variable was non-zero (and lock would be left invalid).

In other cases the lock is statically initialised to zero by __LOCK_INIT*
2017-06-30 08:54:56 +10:00
Angus Gratton
5c925bf96e esp_wifi.h: Document the Vendor-Specific Information Element functions 2017-06-29 17:29:23 +10:00
Angus Gratton
b3603ccf58 esp_wifi header: Fix typo 2017-06-29 17:19:17 +10:00
Angus Gratton
3fe0022efa stack sizes: Revert stack size increases added in 8d43859
Set min stack size to 2048 if AppTrace support is enabled, 512 bytes otherwise.
2017-06-29 14:57:13 +10:00
Angus Gratton
415a7d742a dport_access: Fix spurious warning in unicore mode, refactor 2017-06-29 13:57:13 +10:00
Ivan Grokhotkov
9b955f4c9f Merge branch 'feature/sysview_via_apptrace' into 'master'
sysview via apptrace

See merge request !708
2017-06-29 08:40:13 +08:00
Jan Mrázek
f698a1b2d3 Add missing support for C++ exceptions
Specifying -fexceptions for the compiler is not enough.

- add necessary zero padding after .eh_frame section
- link .gcc_except_table_table in a way flash script does not complain
- call __registrer_frame_info before global constructors

Kudos jcmvbkbc for the necessary help.
2017-06-28 13:53:42 +08:00
Angus Gratton
540a506d0f Merge branch 'bugfix/lwip_assert' into 'master'
lwip: Remove port-specific sys_arch_assert(), use libc __assert_func() instead

See merge request !926
2017-06-28 06:09:04 +08:00
Alexey Gerenkov
8d43859b6a esp32: SEGGER SystemView Tracing Support
Implements support for system level traces compatible with SEGGER
SystemView tool on top of ESP32 application tracing module.
That kind of traces can help to analyse program's behaviour.
SystemView can show timeline of tasks/ISRs execution, context switches,
statistics related to the CPUs' load distribution etc.

Also this commit adds useful feature to ESP32 application tracing module:
 - Trace data buffering is implemented to handle temporary peaks of events load
2017-06-27 20:52:43 +03:00
Ivan Grokhotkov
bd09f186b6 Merge branch 'test/ci_add_ble_cases' into 'master'
CI: add ble cases to CI

See merge request !917
2017-06-27 23:49:17 +08:00
Ivan Grokhotkov
fff0a001d3 Merge branch 'bugfix/btdm_ble_smp_bonding_issues' into 'master'
component/bt: Fix bugs of the SMP security module

See merge request !923
2017-06-27 23:49:00 +08:00
Wangjialin
40fd9db55d bugfix(uart): fix bugs reported from github
1. uart_set_line_inverse API issue, https://github.com/espressif/esp-idf/issues/673
2. tx buffer length issue, https://github.com/espressif/esp-idf/issues/710
2017-06-27 16:41:59 +08:00
Angus Gratton
857a7f186e lwip: Make LWIP_ERROR behave as if assertions were off, even if they are on 2017-06-27 18:36:54 +10:00
Angus Gratton
f5e7f2bb8f lwip: Remove port-specific sys_arch_assert(), use libc __assert_func() instead 2017-06-27 17:32:17 +10:00
Ivan Grokhotkov
f5920e8d24 Merge branch 'bugfix/nvs_err_code' into 'master'
ESP_ERR_NVS_VALUE_TOO_LONG had conflicting value.

See merge request !924
2017-06-27 14:33:12 +08:00
Ivan Grokhotkov
3f8f618df5 Merge branch 'feature/lwip_expose_more_config' into 'master'
lwip: Expose more config in IDF menuconfig

See merge request !909
2017-06-27 12:53:42 +08:00
Ivan Grokhotkov
aeeb6cff17 Merge branch 'test/add_dual_core_dport_access_unit_test_case' into 'master'
test: add UT case for accessing dport and apb at the same time

See merge request !910
2017-06-27 12:47:37 +08:00
Ivan Grokhotkov
19b7158a9a Merge branch 'bugfix/gpio_set_direction_sets_matrix' into 'master'
gpio driver: Clear GPIO matrix output config when setting pin as input

See merge request !919
2017-06-27 11:42:56 +08:00
Ivan Grokhotkov
f045123691 nvs: add test for ESP_ERR_NVS_INVALID_LENGTH 2017-06-27 11:28:37 +08:00
He Yin Ling
31f7e8d7e5 CI: add BLE test cases to CI 2017-06-27 10:35:33 +08:00
Simon Werner
dacb053546 ESP_ERR_NVS_VALUE_TOO_LONG had conflicting value.
`ESP_ERR_NVS_VALUE_TOO_LONG` had conflicting value, its original value was `0x0c`, which is the same as `ESP_ERR_NVS_INVALID_LENGTH`
2017-06-27 11:58:49 +12:00
Eugene Zagidullin
713964fe9e Use LwIP IPC for low-level API calls 2017-06-27 00:41:41 +03:00
Yulong
b60b58a333 component/bt: Added the bta gattc write ccc judgment. 2017-06-26 05:39:14 -04:00
Yulong
574d0cf846 component/bt: Fixed a very important bug of the SMP security module when use SMP to connected after bonding. 2017-06-26 05:02:57 -04:00
Ivan Grokhotkov
ff6a3b1a11 Merge branch 'bugfix/default_vfs_paths' into 'master'
Make relative paths match the default VFS, if provided

See merge request !913
2017-06-26 14:03:22 +08:00
Ivan Grokhotkov
9716447fcc Merge branch 'bugfix/esp32d2wd_gpio0' into 'master'
esptool: Update to v2.0.1, fix ESP32-D2WD GPIO0 issue

See merge request !918
2017-06-26 14:02:48 +08:00
Jiang Jiang Jian
f9abf98f46 Merge branch 'bugfix/l2cap_disconnect_timeout' into 'master'
component/bt: bugfix for L2CAP state machine to access NULL lcb during disconnection

See merge request !920
2017-06-26 14:02:36 +08:00
Jiang Jiang Jian
e033b018d4 Merge branch 'bugfix/wrong_macro_uart_base_addr' into 'master'
fix bug that uart register base address macro was wrong

See merge request !912
2017-06-26 13:55:37 +08:00
Angus Gratton
17747b3358 gpio driver: Clear GPIO matrix output config when setting pin as input
Otherwise, if a non-GPIO peripheral has been routed to this pin
(as an output), output driver can remain enabled.
2017-06-26 12:47:08 +10:00
Angus Gratton
c26baeb610 esptool: Update to v2.0.1
Fixes issue with GPIO 0 being enabled as an output on ESP32D2WD (or when setting SPI pins in efuse)
and not using Quad-I/O modes.

Ref: https://esp32.com/viewtopic.php?f=2&t=2205
2017-06-26 12:16:09 +10:00
Liu Zhi Fu
a7ef510551 esp32: update wifi lib to fix a sniffer issue
Fix sniffer only receives the first MDPU in AMPDU when the AMPDU is not for our station/soft-AP
2017-06-24 10:45:20 +08:00
Deomid Ryabkov
ee5eba793f Make relative paths match the default VFS, if provided
https://github.com/espressif/esp-idf/issues/158
2017-06-23 13:12:28 +01:00
Jack
ab9f63aba7 fix bug that uart register base address macro was wrong 2017-06-23 19:56:12 +08:00
wangmengyang
6da84eff76 component/bt: fix a bug for L2CAP state machine to access lcb after it is released 2017-06-23 17:26:43 +08:00
Ivan Grokhotkov
3bd3640d60 Merge branch 'bugfix/fatfs_unit_test_name' into 'master'
fatfs: fix duplicate unit test name

See merge request !911
2017-06-23 16:32:51 +08:00
He Yin Ling
7c6208c9e0 test: add UT case for dual dport and apb access 2017-06-23 16:15:57 +08:00
Jiang Jiang Jian
1480251aa7 Merge branch 'bugfix/spiflash_rom_symbols' into 'master'
spiflash rom: Add symbols accidentally removed in refactor

See merge request !804
2017-06-23 15:24:04 +08:00
Ivan Grokhotkov
24c4bc9cc4 fatfs: fix duplicate unit test name 2017-06-23 14:59:21 +08:00
Jeroen Domburg
113bb30218 This commit adds spi_flash_mmap_pages(), a function to map a set of unordered 64K pages in flash into a contiguous region in memory space. 2017-06-23 14:28:57 +08:00
Angus Gratton
0c301206cf lwip debug: fix typo 2017-06-23 16:28:38 +10:00
Angus Gratton
8f4fc209a1 lwip: Enable LWIP assertions unless they are disabled globally 2017-06-23 16:26:11 +10:00
Angus Gratton
1c6510ed96 lwip: Allow configuring/disabling some TCP options to save RAM
RAM savings are small, but may add up when running large numbers of sockets.
2017-06-23 16:26:11 +10:00
Angus Gratton
8aa09aea10 event handler: Add debug event handler for confirmed IPv6 LL address 2017-06-23 16:15:16 +10:00
Angus Gratton
1ea0ddb025 lwip: Expose broadcast/multicast ping enable options in menuconfig 2017-06-23 16:15:00 +10:00
Ivan Grokhotkov
85baf0afaa Merge branch 'buxfix/panic_handler_not_halting_cpu' into 'master'
Panic Handler not halting when running on both cores

See merge request !903
2017-06-23 11:34:03 +08:00
Ivan Grokhotkov
e918ee20da Merge branch 'bugfix/vfs_fixes' into 'master'
VFS fixes

See merge request !901
2017-06-23 11:33:27 +08:00
Ivan Grokhotkov
dc0632789f Merge branch 'bugfix/sdmmc_send_init_bits' into 'master'
sdmmc: send init sequence to card before MMC_GO_IDLE_STATE

See merge request !906
2017-06-23 11:31:29 +08:00
Jiang Jiang Jian
3dd2861e2a Merge branch 'bugfix/btdm_ble_update_conn_params_issues' into 'master'
component/bt: Modifed the update connection method to fixed the bug of connectio…

See merge request !889
2017-06-22 20:50:37 +08:00
Jiang Jiang Jian
df76a904b0 Merge branch 'bugfix/fix_ieee80211_output_assert_and_restore_task_priority_in_wifi_lib' into 'master'
Fix the bug that lora vendor size was not added to probe response.

See merge request !908
2017-06-22 16:38:48 +08:00
Yulong
d79aeab3aa component/bt: Added the error log to the l2cble_start_conn_update func. 2017-06-22 03:53:27 -04:00
XiaXiaotian
8411aa7362 Fix the bug that lora vendor size was not added to probe response.
Restore priority of tasks in wifi lib.
2017-06-22 15:06:58 +08:00
wangmengyang
55c0a4ea60 component/bt: bugfix for NULL pointer access when HCI CTLR to HOST flow control is in use 2017-06-22 14:59:51 +08:00
Ivan Grokhotkov
45037efc45 Merge branch 'bugfix/vfs_write_return_type' into 'master'
Change esp_vfs_t.write return value to ssize_t

See merge request !897
2017-06-22 11:48:34 +08:00
James Sarrett
b772024699 send bus initialization bits before MMC_GO_IDLE_STATE command to initialize card after poweron 2017-06-22 11:08:47 +08:00
Jiang Jiang Jian
157749c77b Merge branch 'bugfix/btdm_modify_some_log_info' into 'master'
component /bt: modify some log infor

See merge request !905
2017-06-22 11:03:01 +08:00
Darian Leung
21f02a6955 Bugfix - Panic Handler not halting when running on both cores
Bug occurs when core dump destination in menuconfig is set to flash. When
programme crashes, xt_unhandled_exception or panicHandler will both trigger
commonErrorHandler. commonErrorHandler calls esp_core_dump_to_flash which
will attempt to use DPORT functions and hang due to trying to a stall and already
stalled processor (already stalled in xt_unhandled_exception and panicHandler).
Program will eventually be rebooted when wdt expires.

Added esp_dport_access_int_deinit after calls to haltOtherCore() so that DPORT
functions don't try to halt and already halted cpu hence preventing hang.

Fixes TW#12944 https://github.com/espressif/esp-idf/issues/646
2017-06-21 16:58:48 +08:00
wangmengyang
bbf449dbde component/bt: bugfix for hci_le_rd_rmt_used_feats_cmd handler which does not check connection state 2017-06-21 15:52:32 +08:00
Yulong
328e93ddc4 component/bt: Change the l2cble_start_conn_update return value to BOOLEAN. 2017-06-21 02:39:36 -04:00
Ivan Grokhotkov
5b678eed0d vfs: add support for nested mount points
Fixes https://github.com/espressif/esp-idf/issues/135
2017-06-21 14:17:14 +08:00
Ivan Grokhotkov
4f71b4574a vfs: fix NULL pointer dereference in esp_vfs_unregister 2017-06-21 13:54:04 +08:00
zhiweijian
eec989f026 Component /bt: modify some log infor 2017-06-21 10:54:51 +08:00
Ivan Grokhotkov
2ccfe3da96 vfs: fix opendir of a filesystem root directory
Previously opendir("/data") would fail if filesystem with "data" prefix
was registered in VFS, while opendir("/data/") would succeed.
This change fixes handling for the former case and adds relevant tests.
2017-06-21 01:21:14 +08:00
Ivan Grokhotkov
7ed8c66547 Merge branch 'bugfix/uxTaskGetSystemState_github_#12142' into 'master'
Bugfix for uxTaskGetSystemState

See merge request !883
2017-06-20 17:27:08 +08:00
Ivan Grokhotkov
89d503edf0 Merge branch 'bugfix/doc_bugfixes' into 'master'
Corrected small issues in documentation, fixes #694 and merges #706

See merge request !894
2017-06-20 17:25:03 +08:00
krzychb
05f56d1d25 [TW#13322] Typo in documentation, fixes #694 2017-06-19 22:42:22 +02:00
Liu Zhi Fu
59479eb7dd esp32: update wifi lib to fix a wifi connect issue
Fix WiFi fails to connect TP842N bug
2017-06-19 21:23:24 +08:00
Yulong
01705166bc component/bt: Modifed the update connection method to fixed the bug of connection parameters not correct. 2017-06-19 03:22:25 -04:00
Angus Gratton
99962b7905 Merge branch 'feature/esptool_v20' into 'master'
esptool: Update to v2.0 final release

See merge request !862
2017-06-19 08:37:10 +08:00
Jiang Jiang Jian
c8201275f7 Merge branch 'bugfix/btdm_ble_client_muti_conn_issue' into 'master'
component/bt: change the MAX_L2CAP_CHANNELS macro from 2 to MAX_ACL_CONNECTIONS …

See merge request !882
2017-06-16 16:52:38 +08:00
Darian Leung
1c798b0eab BugFix: uxTaskGetSystemState test case update
Updated test case to include configASSERT cases (+1 squashed commits)

Squashed commits:

[871ec26f] Freertos:Bugfix uxTaskGetSystemState

Bug (github #12142) with uxTaskGetSystemState where
if called immediately after creating a bunch of tasks,
those tasks would be added twice into the TaskStatusArray.
Bug caused due to use old implementation using vTaskSuspendAll
which did not stop newly created task on other core from accessing the
read/waiting task lists whilst the list were being read by
uxTaskGetSystemState. Fixed bug by replacing vTaskSuspendAll
with taskENTER_CRITICAL and added test case for the bugfix
2017-06-16 16:00:54 +08:00
Yulong
0d318ea2da component/bt: change the MAX_L2CAP_CHANNELS macro from 2 to MAX_ACL_CONNECTIONS when in the BLE only mode. 2017-06-16 03:46:46 -04:00
Jiang Jiang Jian
a5c5748de2 Merge branch 'bugfix/pcnt_reset' into 'master'
pcnt: Fix pcnt_set_pin/pcnt_counter_clear reported on github

See merge request !872
2017-06-16 15:43:04 +08:00
Jiang Jiang Jian
07ccbb8dbc Merge branch 'bugfix/rtc_time_issues' into 'master'
Fixes for RTC time issues

See merge request !849
2017-06-16 15:29:56 +08:00
Jiang Jiang Jian
ff6c0a6cc8 Merge branch 'bugfix/spi_flash_large_writes' into 'master'
spi_flash: Fix large writes, unaligned writes, and writes from flash

See merge request !843
2017-06-16 15:04:01 +08:00
Jiang Jiang Jian
7c50916c53 Merge branch 'bugfix/phy_init_procedure' into 'master'
component/esp32 : fix phy init with NULL init_data

See merge request !879
2017-06-16 15:03:03 +08:00
Nilay
769944b067 PCNT: fix for pcnt_set_pin API, it can now use all pcnt channels 2017-06-16 11:18:00 +05:30
Nilay
f50b5481fa PCNT: Fixed pcnt_counter_clear, Pulse Count now able to resume after API call 2017-06-16 11:11:52 +05:30
Jiang Jiang Jian
e045253883 Merge branch 'bugfix/btdm_conn_enhanecd_issue' into 'master'
component/bt: added the temp enhanced to solve the conn_interval not collect issues.

See merge request !881
2017-06-16 13:18:41 +08:00
Tian Hao
bb4a87dbfe component/esp32 : fix phy init with NULL init_data
1. fix phy init with NULL init_data
2. do full calibration without CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
3. fix libphy.a printf
2017-06-16 12:09:13 +08:00
Ivan Grokhotkov
8ccb2a4990 esp32: make time monotonic across resets
Small changes to clock calibration value will cause increasing errors
the longer the device runs. Consider the case of deep sleep, assuming
that RTC counter is used for timekeeping:
- before sleep:
   time_before = rtc_counter * calibration_val
- after sleep:
   time_after = (rtc_counter + sleep_count) * (calibration_val + epsilon)
where 'epsilon' is a small estimation error of 'calibration_val'.
The apparent sleep duration thus will be:
time_after - time_before = sleep_count * (calibration_val + epsilon)
                           + rtc_counter * epsilon

Second term on the right hand side is the error in time difference
estimation, it is proportional to the total system runtime (rtc_counter).

To avoid this issue, this change makes RTC_SLOW_CLK calibration value
persistent across restarts. This allows the calibration value update to
be preformed, while keeping time after update same as before the update.
2017-06-16 12:06:04 +08:00
Jiang Jiang Jian
9a6b1c3b11 Merge branch 'bugfix/always_disable_ints_in_critical_region' into 'master'
Always disable interrupts in a critical region

See merge request !821
2017-06-16 11:36:27 +08:00
Yulong
1739216787 component/bt: added the temp enhanced to solve the conn_interval not collect issues. 2017-06-15 10:15:49 -04:00
Jiang Jiang Jian
a64f5de091 Merge branch 'bugfix/sw_reset_fixes' into 'master'
Fixes for esp_restart

See merge request !865
2017-06-15 22:10:13 +08:00
Jiang Jiang Jian
1cae2da0a0 Merge branch 'bugfix/classicBT_SMP_dependence' into 'master'
component/bt: add constraint in Kconfig to enable SMP_ENABLE when using classic BT

See merge request !877
2017-06-15 21:28:36 +08:00
Jiang Jiang Jian
fe1f8a25b5 Merge branch 'bugfix/intrrupt_num_conflict' into 'master'
component/bt : fix interrupt number conflict

See merge request !878
2017-06-15 20:45:57 +08:00
wangmengyang
85e9a0fa17 component/bt: add constraint in Kconfig to enable SMP_ENABLE when using classic BT
1. For now, some security related functions used in classic Bluetooth are controlled by "SMP_ENABLE". This commit fixes the dependency.
2. The two options, "CLASSIC_BT_ENABLED" and "SMP_ENABLED" The two options will be decoupled in the future.
2017-06-15 20:06:49 +08:00
Jiang Jiang Jian
fd12a6c706 Merge branch 'bugfix/btdm_add_set_pkt_data_length_evt_cback' into 'master'
component / bt: add set pkt data length event callback

See merge request !869
2017-06-15 19:51:22 +08:00
Tian Hao
09f7cf45dd component/bt : fix interrupt number conflict
1. the typical problem is when push keyboard on serial tool, the bluetooth may stop.
2017-06-15 19:41:54 +08:00
Ivan Grokhotkov
ffdcbc5355 libsodium: don’t link tests when TEST_ALL=1 is used
Currently libsodium tests add about 800kB to the binary, which is too
much for a partition table constrained to 2MB. Disable libsodium tests
until we start building multiple unit test apps for different subsets.
2017-06-15 18:15:37 +08:00
Ivan Grokhotkov
8cb0d52c43 esp_system: remove link time dependency on WiFi stack
- esp_restart will not pull in WiFi stack (if it is not used otherwise)
- esp_restore is moved into a separate file to break link time
  dependency
2017-06-15 18:15:36 +08:00
Ivan Grokhotkov
6538ebe8ad cxx: don’t pull libstdc++ local support in unit tests 2017-06-15 18:15:36 +08:00
Ivan Grokhotkov
9353666cc1 esp32: reset APP CPU when doing esp_restart
This fixes a bug introduced by !848, where APP CPU would not be reset
during esp_restart, if esp_restart was called from a task running on APP
CPU, and wouldn’t be reset by PRO CPU on startup.
This change replaces stalling APP CPU with resetting it.

Also adds a non-automated esp_restart tests.
2017-06-15 18:15:35 +08:00
Ivan Grokhotkov
a72b1abc51 esp32: disable DPORT access protection when doing esp_restart
DPORT access protection can not work when the other CPU is stalled.
Writes to DPORT registers in esp_restart caused the program to hang due
to access protection, and the reset happened due to RTC_WDT, not SW_RST.
This change adds esp_dport_access_int_deinit function and calls it from
esp_restart once the other core is stalled.
2017-06-15 18:15:35 +08:00
Ivan Grokhotkov
75658ee29b bootloader: workaround for clock switching bug in ESP32 rev. 0
In ESP32 rev. 0, switching between 240MHz and 80MHz (even via an
intermediate frequency of 40MHz) may cause the chip to lock up.
The bootloader used to enable 80MHz CPU clock at startup, which could
cause lock up after software reset. With this change, if 240MHz CPU
clock is enabled in menuconfig, bootloader will also use 240MHz to avoid
lock-up.
2017-06-15 18:15:35 +08:00
zhiweijian
58b65291d9 component / bt: add set pkt data length event callback 2017-06-15 16:02:03 +08:00
Jiang Jiang Jian
491932b80c Merge branch 'bugfix/btdm_cherry_pick_hit_limit_github_#12259' into 'master'
component/bt: cherry-pick the btdm_hit_limit_github_#12259 branch to this branch.

See merge request !867
2017-06-15 15:14:10 +08:00
Jiang Jiang Jian
ac5040a7c2 Merge branch 'bugfix/btdm_ll_get_remote_feature' into 'master'
component/bt: Fix can't get remote's feature bug

See merge request !871
2017-06-15 15:10:52 +08:00
Yulong
83b7144207 component/bt: Added the lmp_verion default value to 4.0. 2017-06-15 02:13:31 -04:00
Jiang Jiang Jian
5f24dcdf4e Merge branch 'bugfix/btdm_blufi' into 'master'
component/bt : fix blufi second init fail bug

See merge request !866
2017-06-15 13:37:31 +08:00
Yulong
6ffa30a408 component/bt: Change the return position in the btc_gatts_inter_cb function. 2017-06-14 23:40:25 -04:00
Jiang Jiang Jian
113c21a481 Merge branch 'bugfix/fail_to_disconn_after_pair_#13172' into 'master'
component/bt: Added the judgment to check the address is public or not.

See merge request !868
2017-06-15 11:20:12 +08:00
Jiang Jiang Jian
2e33dace16 Merge branch 'bugfix/fix_wifi_assert_at_ieee80211_output_line_733' into 'master'
fix the bug that wifi assert at ieee80211_output.c line 733

See merge request !870
2017-06-15 11:06:04 +08:00
Tian Hao
7cf5eea36f component/bt : fix blufi second init fail bug 2017-06-15 11:05:21 +08:00
Jiang Jiang Jian
a18032fe80 Merge branch 'bugfix/btdm_gattc_refresh_cache_does_not_work_properly' into 'master'
component /bt: using esp_ble_gattc_cache_refresh() does not work when open event callback

See merge request !864
2017-06-15 11:02:35 +08:00
island
e2e5f4caae component/bt: Fix can't get remote's feature bug
- Slave send version_ind cause some Android 7.0 devices can't encrypt correctly
2017-06-14 21:56:59 +08:00
XiaXiaotian
435b907475 fix the bug that wifi assert at ieee80211_output.c line 733 2017-06-14 21:20:28 +08:00
Yulong
a03e5f95be component/bt: Added the judgment to check the address is public or not. 2017-06-14 09:01:29 -04:00
Yulong
00bcee2df2 component/bt: cherry-pick the btdm_hit_limit_github_#12259 branch to this branch. 2017-06-14 07:14:23 -04:00
Jiang Jiang Jian
aefde1517d Merge branch 'bugfix/i2c_delete_interrupt_race' into 'master'
i2c driver: When deleting, disable interrupts before freeing data structures

See merge request !836
2017-06-14 17:47:22 +08:00
zhiweijian
60d5b677e7 Component /bt: using esp_ble_gattc_cache_refresh() does not work when open event callback. 2017-06-14 16:45:17 +08:00
Jiang Jiang Jian
ae7269d39d Merge branch 'bugfix/btdm_smp_auth_complete_error' into 'master'
component/bt: Change the btc layer data copy method.

See merge request !844
2017-06-14 15:16:38 +08:00
Jiang Jiang Jian
6b3a559ee7 Merge branch 'bugfix/btdm_master_write_service_change_ccc' into 'master'
component/bt: Fix slave initiate service change ccc discovery procedure bug

See merge request !847
2017-06-14 15:12:45 +08:00
Angus Gratton
55bec0e82f Merge branch 'feature/libsodium' into 'master'
Add libsodium cryptography library component (v1.0.12)

See merge request !852
2017-06-14 14:58:16 +08:00
Jiang Jiang Jian
db87a640ea Merge branch 'feature/optimize_task_priority_in_wifi_lib' into 'master'
Optimize priorities of pp, pm, timer, wps and wpa2 tasks.

See merge request !861
2017-06-14 14:01:53 +08:00
Angus Gratton
211580bf4f Add libsodium v1.0.12
Run some unit test cases based (poorly) around sodium's test infrastructure.

Increase in unity test task stack is due to signature tests, load a lot of data onto the stack.
2017-06-14 15:51:08 +10:00
Angus Gratton
8e0ec6a9ab Merge branch 'bugfix/abort_in_interrupt_context' into 'master'
Panic handler backtrace fixes

See merge request !835
2017-06-14 13:45:36 +08:00
Angus Gratton
6068c1be9a esptool: Update to v2.0 final release
For IDF use, most changes are minor compared to 2.0-beta3.

One notable addition, esptool.py now prints chip model & silicon
revision when it connects.
2017-06-14 15:41:51 +10:00
island
c5debed621 component/bt: Fix bug while writing slave's service change characteristic
- Fix slave initiate service discovery procedure
- Fix master re-discovery every time connection established
- Optimize service discovery char ccc write procedure
- Optimize esp_log_buffer function
- Modify default supervision timeout from 20s to 2s
2017-06-14 13:12:38 +08:00
Jiang Jiang Jian
06fa08b022 Merge branch 'bugfix/btdm_config_bluedroid_mem_debug_github_#12631' into 'master'
component/bt: Change the osi_mem_dbg_init to the esp_bluedroid_init function.

See merge request !860
2017-06-14 11:18:34 +08:00
XiaXiaotian
28e84a5299 Optimize priorities of pp, pm, timer, wps and wpa2 tasks. 2017-06-14 11:06:57 +08:00
Jiang Jiang Jian
69e8085624 Merge branch 'bugfix/wps_receive_m2d_fail_process' into 'master'
ESP32: Add error wps fail reason

See merge request !855
2017-06-14 10:57:59 +08:00
Jiang Jiang Jian
243bc97119 Merge branch 'bugfix/btdm_task_post' into 'master'
component/bt : fix task post bug && fix controller init protection

See merge request !856
2017-06-14 10:52:56 +08:00
Yulong
3f997d3e8c component/bt: Added the unhandle log to the btc dm case. 2017-06-13 22:37:44 -04:00
Ivan Grokhotkov
0c83e46b08 Merge branch 'bugfix/nvs_max_value_size' into 'master'
nvs: check value size before writing, document limitations

See merge request !796
2017-06-14 09:15:59 +08:00
Ivan Grokhotkov
6e704fc421 Merge branch 'bugifx/cplusplus_guards' into 'master'
add C++ include guards to header files which are missing them

See merge request !799
2017-06-14 09:14:02 +08:00
Ivan Grokhotkov
71d7716a45 Merge branch 'bugfix/esp_event_send_init_check' into 'master'
esp_event_send: check if the event loop is initialized

See merge request !817
2017-06-14 09:11:50 +08:00
Angus Gratton
91593a5237 Merge branch 'bugfix/rmt_driver_interrupts' into 'master'
rmt driver: Fix some issues around interrupts

See merge request !837
2017-06-14 08:35:22 +08:00
Angus Gratton
8bf675786a Merge branch 'feature/freertos_get_priority' into 'master'
freertos: Mark uxTaskPriorityGet() as tested, add SMP task priority unit tests

See merge request !794
2017-06-14 08:31:00 +08:00
Angus Gratton
5d7bffea2b panic handler: Print backtraces with calling address not return address
This seems to clean up some of the more wrong addr2line output results (not
sure why, something to do with optimisations I think - perhaps the return
address may also be a jump target from some earlier line of the code.)
2017-06-14 10:30:04 +10:00
Deng Xin
3d963f1c61 Merge branch bugfix/wps_receive_m2d_fail_process to master
ESP32: Add error wps fail reason enum in esp_event.h
see merge request !226
2017-06-13 21:48:48 +08:00
Ivan Grokhotkov
81f98c0a77 Merge branch 'test/nvs_compatible_test' into 'master'
test: add WIFI NVS compatible test case

See merge request !812
2017-06-13 21:32:50 +08:00
Jiang Jiang Jian
ff8287645b Merge branch 'bugfix/tw13140_fix_assoc_timeout_bug' into 'master'
esp32: update wifi lib to fix assoc timeout issue

See merge request !854
2017-06-13 21:14:33 +08:00
Jiang Jiang Jian
12c1238730 Merge branch 'bugfix/btdm_uuid_convert' into 'master'
component/bt : fix uuid convert warning

See merge request !857
2017-06-13 21:03:55 +08:00
Yulong
2a759a9864 component/bt: Change the osi_mem_dbg_init to the esp_bluedroid_init function. 2017-06-13 08:52:26 -04:00
Tian Hao
063dccd6c0 component/bt : fix uuid convert warning 2017-06-13 20:21:59 +08:00
Liu Zhi Fu
bf4dd5175b esp32: update wifi lib to fix assoc timeout issue
Fix assoc timeout thread-safe issue
2017-06-13 20:08:00 +08:00
Jiang Jiang Jian
1ce18758d4 Merge branch 'bugfix/tw13140_fix_throughput_test_crash_issue' into 'master'
esp32: update wifi lib to fix wifi crash bug

See merge request !840
2017-06-13 18:22:39 +08:00
Jiang Jiang Jian
57d27faee8 Merge branch 'bugfix/btdm_write_API_to_write_char_get_wrong_status_when_server_response_NULL' into 'master'
component /bt: write_API_to_write_char_get_wrong_status_when_server_response_NULL

See merge request !842
2017-06-13 18:18:30 +08:00
Ivan Grokhotkov
cd89a653e4 Merge branch 'bugfix/app_cpu_reset' into 'master'
esp32: don’t reset APP CPU if it was already reset by OpenOCD

See merge request !848
2017-06-13 18:15:47 +08:00
Jiang Jiang Jian
be680a0ef3 Merge branch 'bugfix/btdm_auth_val_error_#12962' into 'master'
component/bt: correct the security demo pair status code.

See merge request !841
2017-06-13 18:14:39 +08:00
Tian Hao
808b07799c component/bt : fix task post bug && fix controller init protection
1. fix bluedroid task post to blocking.
2. use semphore protect btdm controller task when be called from higher priority task
2017-06-13 17:14:50 +08:00
Tuan PM
f91715438a i2s: return error code if register isr error, resolve #587 (github)
set p_i2s_obj = NULL when return error
2017-06-13 14:28:47 +07:00
Angus Gratton
47e789f538 abort handler: Fix abort stack trace when abort() called in ISR
Previously, this resulted in task stack frames turning up incorrectly in the backtrace, ie

Backtrace: 0x400d22a0:0x3ffb0fa0 0x40085a3c:0x3ffb0fc0 0x400f32c4:0x3ffb0fe0 0x40081965:0x3ffb1010
0x400d22a0: esp_vApplicationIdleHook at /home/esp/esp-idf/components/esp32/./freertos_hooks.c:
52
0x40085a3c: prvIdleTask at /home/esp/esp-idf/components/freertos/./tasks.c:4431
0x400f32c4: i2c_isr_handler_default at /home/esp/esp-idf/components/driver/./i2c.c:598
0x40081965: _xt_lowint1 at xtensa_vectors.o:?

Fix is to implement abort() via an unhandled exception rather than a breakpoint, I think
because of relative priority of exception types.

Another approach would be to assign a software-only INUM to abort()ing and defined a
PANIC_RSN_ABORTED, but this is more complex and interrupt numbers are more scarce than RAM!
2017-06-13 10:19:01 +10:00
Ivan Grokhotkov
cc8af68244 syscalls: fix wraparound of RTC time
This change removes the erroneous cast to uint32_t (which caused time to
wrap around after 1 hour) and splits the multiplication into two terms
to remove the wraparound after 13 days.

Ref. https://esp32.com/viewtopic.php?f=13&t=1908
2017-06-12 15:21:43 +08:00
Ivan Grokhotkov
f327a9b1cf esp32: don’t reset APP CPU if it was already reset by OpenOCD
When ‘reset halt’ command is executed, OpenOCD will take the APP CPU
out of reset and enable the clock. At this point, user can set a
breakpoint on code which will run on APP CPU. Previously, app startup
code would do another reset of APP CPU, thereby removing any breakpoints
which may have been set. This change makes APP CPU reset conditional on
DPORT_APPCPU_CLKGATE_EN bit, which is 0 by default but is set to 1 by
OpenOCD after reset.
2017-06-12 15:16:57 +08:00
zhiweijian
352cc0c7fe Component /bt: write_API_to_write_char_get_wrong_status_when_server_response_NULL 2017-06-12 15:02:21 +08:00
Deomid Ryabkov
b8782bdd90 Change esp_vfs_t.write return value to ssize_t
write() should return ssize_t, not size_t.
2017-06-09 21:24:00 +01:00
Yulong
411b5ecc43 component/bt: delete the bd_addr to avoid the warning. 2017-06-09 05:07:26 -04:00
Yulong
e07482504a component/bt: Change the btc ESP_BLE_SM_SET_RSP_KEK to ESP_BLE_SM_SET_RSP_KEY 2017-06-09 04:54:56 -04:00
Yulong
4734ba40b0 component/bt: Change the btc layer data copy method. 2017-06-09 04:32:01 -04:00
Angus Gratton
11d2db40f4 spi_flash: Fix SPI flash write alignment/size bugs
* Writing >4 bytes to unaligned offsets would fail
* Writiing data from flash would fail (wrong buffer was used)
* Writing >8192 bytes from RAM would over-write data multiple times

Adds test cases for the above.
2017-06-09 17:33:27 +10:00
Angus Gratton
edd2459934 esp_log_buffer_hex: Make buffer argument a void pointer 2017-06-09 17:16:58 +10:00
Yulong
e5adfb8119 component/bt: correct the security demo pair status code. 2017-06-09 02:37:28 -04:00
Angus Gratton
c77b699463 rmt driver: Manage driver interrupt handler based on which channels are enabled
Previously the first call to rmt_driver_uninstall() would remove the interrupt handler,
even if other channels still had the driver installed.

Adds an OS-level lock to control concurrent registration/deregistration of channels.
2017-06-09 16:11:21 +10:00
Ivan Grokhotkov
e7db29b2a8 Merge branch 'bugfix/btdm_crash_invalid_control_param' into 'master'
component/bt: Fix crash problem while using invalid control parameter

See merge request !832
2017-06-09 12:00:18 +08:00
Angus Gratton
5a1a8b4637 Merge branch 'bugfix/resume_task_cpu1_when_scheduler_disabled' into 'master'
Fix bug waking a task on CPU1 when scheduler is disabled

See merge request !819
2017-06-09 07:10:10 +08:00
Liu Zhi Fu
c1e8988240 esp32: update wifi lib to fix wifi crash bug
Fix a wifi crash bug which happens in throughput test
2017-06-08 20:51:21 +08:00
Angus Gratton
4b58cc12cd rmt driver: When deleting, disable interrupt before freeing data structures
Fixes potential race if RMT interrupt happens while deregistering (unlikely
due to timing of taking semaphore tx_sem, but still possible.)
2017-06-08 16:14:51 +10:00
Angus Gratton
a89e93fc3d i2c driver: When deleting, disable interrupts before freeing data structures
Fixes a potential race if I2C interrupt occurs while driver is being delted.
2017-06-08 15:57:31 +10:00
island
30783d481d component/bt: Fix crash problem while using invalid control parameter
- Fix crash problem while using invalid control parameter to set gatt characteristic or descriptor
2017-06-07 20:18:36 +08:00
Tian Hao
bd309731da component/bt : fix bug of task schedule delayed.
1. BLE RX test mode require quick task reaction, so allow higher priority task schedule from ISR.
2. Maybe other scenario also require this.
2017-06-07 14:58:17 +08:00
Jiang Jiang Jian
99d5959d8a Merge branch 'bugfix/btdm_library' into 'master'
component/bt : revert the bluetooth library

See merge request !827
2017-06-07 14:17:33 +08:00
Jiang Jiang Jian
35f6a2a8af Merge branch 'feature/tw10091_add_sniffer_filter' into 'master'
esp32: add sniffer filter api

See merge request !790
2017-06-07 13:55:35 +08:00
Tian Hao
460c37ddf6 component/bt : revert the bluetooth library
bluetooth library use a old one, so update to the newest.
2017-06-07 13:52:28 +08:00
Jiang Jiang Jian
7da4b42ed1 Merge branch 'feature/btdm_add_connect_event_and_disconnect_event_for_gattc' into 'master'
component/bt: Add disconnect & connect func and event

See merge request !806
2017-06-07 13:45:43 +08:00
Jiang Jiang Jian
82b8b1db1f Merge branch 'bugfix/bt_ble_separation' into 'master'
component/bt: fix the build error when using classic BT, with GATTC, GATTS and SMP disabled

See merge request !822
2017-06-06 20:56:05 +08:00
Jiang Jiang Jian
b78242da58 Merge branch 'bugfix/btdm_rebase_update_param_#9626' into 'master'
component/bt: rebase the btdm_updata_param_bug_#9626 to the new master.

See merge request !808
2017-06-06 20:55:23 +08:00
Liu Zhi Fu
f40be8eb77 esp32: add sniffer filter api
Add sniffer filter to filter specified packets
2017-06-06 19:07:12 +08:00
Yulong
e6acc32df6 component/bt: rebase the btdm_updata_param_bug_#9626 to the new master.
- Added the error code for the time out status.
2017-06-06 05:51:31 -04:00
Yulong
531f751fd3 component/bt: Cherry-pick the btdm_no_doc_for_value_type_github_#118659 to this branch to avoid conflict. 2017-06-06 05:22:17 -04:00
zhiweijian
db96edc5d9 component/bt: Add disconnect & connect func and event
- Add disconnect func for gap
- Add connect event and disconnect event for gattc
2017-06-06 16:53:37 +08:00
Angus Gratton
1cbdb35e1e Merge branch 'bugfix/i2s_channel_setting' into 'master'
bugfix(i2s): fix error when changing channel number in i2s_set_clk function

See merge request !784
2017-06-06 14:40:43 +08:00
Angus Gratton
99454d4a73 Merge branch 'feature/nghttp2_v1_22' into 'master'
nghttp module: Update to v1.22, use submodule instead of in-tree source

See merge request !763
2017-06-06 14:38:41 +08:00
Angus Gratton
ae05787a51 Merge branch 'bugfix/make_srcdirs_order' into 'master'
build system: Fix bug where component src subdirs needed listing before parent source dirs

See merge request !778
2017-06-06 14:37:21 +08:00
Jiang Jiang Jian
b0d93fccce Merge branch 'bugfix/btdm_ble_scan_5min_stop_github_#12723' into 'master'
component/bt: Change the duration type from UINT8 to UINT32

See merge request !815
2017-06-06 14:11:05 +08:00
wangmengyang
ca4506fba9 component/bt: fix the build error when using classic BT, with GATTC, GATTS and SMP disabled 2017-06-05 21:01:58 +08:00
jack
ba32dd30a1 bugfix:Fix bug that wdt reset information for CPU1 was not correct 2017-06-05 18:26:14 +08:00
Jeroen Domburg
d4b0f85eb4 Make portENTER_CRITICAL and portENTER_CRITICAL_ISR the same, plus some changes to fix an issue this causes 2017-06-05 15:57:42 +08:00
Angus Gratton
b9fc5ecf68 freertos: Fix crash when waking task on CPU1 with scheduler disabled
xPendingReadyList[1] was never initialised correctly, so if a task is added to this list (ie by xSemaphoreGiveFromISR()
or similar) while scheduler is disabled, then it causes a null pointer dereference.

Bug produces stack traces similar to:
0x40086e87: vListInsertEnd at /home/gus/esp/32/idf/components/freertos/./list.c:130
0x40084ba3: xTaskRemoveFromEventList at /home/gus/esp/32/idf/components/freertos/./tasks.c:3439
0x40083c54: xQueueGiveFromISR at /home/gus/esp/32/idf/components/freertos/./queue.c:2034
0x400f50a0: timer_group0_isr at /home/gus/esp/32/idf/components/freertos/test/./test_suspend_scheduler.c:27
0x40081d7d: _xt_lowint1 at xtensa_vectors.o:?
2017-06-05 16:12:20 +10:00
Angus Gratton
f40ae10a5d freertos: add test case for ISRs waking tasks when scheduler disabled 2017-06-05 16:12:20 +10:00
Ivan Grokhotkov
17da994345 esp_event_send: check if the event loop is initialized
Fixes https://github.com/espressif/esp-idf/issues/668
2017-06-05 11:01:26 +08:00
He Yin Ling
2e7f6a2247 test: add NVS compatible test case and CI job 2017-06-04 10:29:15 +08:00
Yulong
a42bf640bc component/bt: Change the duration type from UINT8 to UINT32 2017-06-03 01:00:10 -04:00
Jiang Jiang Jian
cc46038142 Merge branch 'bugfix/add_dport_protect_in_libphy' into 'master'
Add dport protect in libphy.a

See merge request !803
2017-06-02 19:13:18 +08:00
Jiang Jiang Jian
bd17791fd4 Merge branch 'bugfix/tw12798_dhcp_server_crash' into 'master'
lwip: fix dhcp server crash issue

See merge request !797
2017-06-02 19:09:43 +08:00
Jiang Jiang Jian
0a66f0db4c Merge branch 'bugfix/btdm_bit_against_enums_github_#12289' into 'master'
component/bt: Change the esp_gatt_perm_t & esp_gatt_char_prop_t type from enum t…

See merge request !809
2017-06-02 15:41:01 +08:00
Liu Zhi Fu
cd58f089c2 lwip: fix dhcp server crash issue
Fix long dhcp request packet cause dhcp server crash issue
2017-06-02 14:02:33 +08:00
Jiang Jiang Jian
1eaf88262d Merge branch 'bugfix/btdm_add_open_and_close_event_for_gatts' into 'master'
component/bt: add open and close event for gatts

See merge request !786
2017-06-02 13:53:03 +08:00
Yulong
be3eda0044 component/bt: Change the esp_gatt_perm_t & esp_gatt_char_prop_t type from enum to uint16_t & uint8_t. 2017-06-02 01:48:56 -04:00
XiaXiaotian
66ef886d77 Add dport protect in libphy.a 2017-06-01 19:43:55 +08:00
Jiang Jiang Jian
ab0f7264ee Merge branch 'bugfix/tw12174_connect_ap_fail' into 'master'
Fix the bug that station fails to connect to AP sometimes.

See merge request !802
2017-06-01 19:40:02 +08:00
zhiweijian
f5a59f4f78 component/bt: add open and close event for gatts
1.added open event and close event for gatts.
2.used esp_log_buffer_char/hex for gattc scan result.
2017-06-01 15:01:54 +08:00
Angus Gratton
b428d28950 spiflash rom: Add symbols accidentally removed in refactor 2017-06-01 09:08:29 +10:00
XiaXiaotian
d2f24f1b81 Fix the bug that station fails to connect to AP sometimes. 2017-05-31 20:27:02 +08:00
jack
fc130fba86 fix bug that files missing commit in MR 773 2017-05-31 19:37:39 +08:00
Ivan Grokhotkov
06accaf851 add C++ include guards to header files which are missing them
Fixes https://github.com/espressif/esp-idf/issues/628
2017-05-31 17:20:17 +08:00
Ivan Grokhotkov
a25a4a0a7c nvs: check value size before writing, document limitations
Writing values longer than half of the page size (with header taken into
account) causes fragmentation issues. Previously it was suggested on the
forum that using long values may cause issues, but this wasn’t checked
in the library itself, and wasn’t documented. This change adds necessary
checks and introduces the new error code.

Documentation is also fixed to reflect the fact that the maximum length
of the key is 15 characters, not 16.
2017-05-31 12:59:24 +08:00
Angus Gratton
4947c953d3 freertos: Mark uxTaskPriorityGet() as tested
Also adds some SMP-aware dynamic task priority unit tests
2017-05-29 16:19:00 +10:00
Angus Gratton
d718cbd873 Merge branch 'bugfix/deep_sleep_example_stub_delay' into 'master'
sdkconfig: set CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 by default

See merge request !758
2017-05-29 12:11:56 +08:00
Angus Gratton
2b1365a51b Merge branch 'feature/docs_gen-dxd' into 'master'
docs: Automatically generate API reference list / Doxygen directives

See merge request !723
2017-05-29 07:08:53 +08:00
Jiang Jiang Jian
636d2b384e Merge branch 'bugfix/ble_comfirm_reply_not_work_#12881' into 'master'
component/bt: Added the esp_ble_passkey_reply BTC_GAP_BLE_PASSKEY_REPLY_EVT &BTC…

See merge request !793
2017-05-27 14:40:26 +08:00
Yulong
e9fae704e3 component/bt: Merge the new master to avoid conflict. 2017-05-26 22:47:56 -04:00
Yulong
9679c238aa component/bt: Added the esp_ble_passkey_reply BTC_GAP_BLE_PASSKEY_REPLY_EVT &BTC_GAP_BLE_CONFIRM_REPLY_EVT
event.
2017-05-26 05:26:15 -04:00
Jiang Jiang Jian
826e96248d Merge branch 'bugfix/btdm_ble_crash_read_long_char_#12338' into 'master'
component/bt: Change the fragement method to avoid crash when the data transmit should fragement.

See merge request !789
2017-05-26 14:40:47 +08:00
Jiang Jiang Jian
87a5bd0179 Merge branch 'bugfix/btdm_value_relate_to_internal' into 'master'
fix bugs of some constant value not equal internal define but quotes internal define

See merge request !787
2017-05-26 14:24:52 +08:00
Jiang Jiang Jian
adac20dc36 Merge branch 'bugfix/tw12643_board_no_response' into 'master'
fix close socket block issue

See merge request !781
2017-05-26 14:11:53 +08:00
Yulong
e40810adbb compoennt/bt: change the remaining_length compare with the max_packet_size value when the data packet should fragment and dispatch. 2017-05-25 23:09:50 -04:00
Yulong
81ff34742b component/bt: Change the fragement method to avoid crash when the data transmit should fragement. 2017-05-25 09:59:03 -04:00
Tian Hao
0c6d966bff component/bt : fix bugs of some constant value not equal internal define but quotes internal define 2017-05-25 16:12:48 +08:00
Yulong
66bb6a2f2b component/bt: squash the branch of the early commit
component/bt: squash the branch of the early commit

component/bt: Added the set static random address callback to the bt project.

component/bt: fixed the set static random address error.

component/bt: fixed the set static random address error.
2017-05-25 02:13:27 -04:00
Jiang Jiang Jian
2aadbee43c Merge branch 'bugfix/i2c_read_size' into 'master'
component/driver : fix i2c slave read size bug

See merge request !770
2017-05-25 10:55:28 +08:00
Ivan Grokhotkov
3c583a7655 sdkconfig: set CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 by default
To increase the chances that the examples work out of the box, this
change is raising the default deep sleep wakeup delay to 1ms.
If GPIO15 is low at startup, ROM code takes less time to execute
(because no logging is performed), so more time may be needed to allow
flash chip to become ready.
2017-05-25 10:51:39 +08:00
wangmengyang
cdea87168c component/bt: bugfix for A2DP in dropping of media packet when data buffer size goes beyond threshold 2017-05-24 15:08:46 +08:00
XiaXiaotian
c0fa8a0354 fix close socket block issue
LWIP rx task receives NULL buffer pointer only when closing socket.
    So, do not need to close it again.
2017-05-23 21:08:03 +08:00
Wangjialin
f68c5baea6 bugfix(i2s): fix error when changing changel number in i2s_set_clk function 2017-05-23 19:32:10 +08:00
Jiang Jiang Jian
ba55461686 Merge branch 'bugfix/ble_gatt_server_example_receive_prepare_write' into 'master'
component/bt: gatt_server example receive prepare write

See merge request !741
2017-05-23 13:57:39 +08:00
Liu Zhi Fu
365b66b95b esp32: update wifi lib to fix ota fail bug
Fix ota fails on dual core
2017-05-23 11:38:45 +08:00
Ivan Grokhotkov
55fb4c54c8 Merge branch 'bugfix/release_coproc_regs_taskdelete' into 'master'
Release coprocessor registers when a task is deleted.

See merge request !765
2017-05-22 11:05:47 +08:00
zhiweijian
4ffb4911e1 gatt_server example receive prepare write 2017-05-22 10:33:36 +08:00
Angus Gratton
99771a255f build system: Fix bug where component src subdirs needed listing before parent source dirs
Triggered on make 3.81, happens sometimes on Linux and always(?) on macOS. May depend on the order the OS' filesystem
resolves wildcards in.

Includes a revert to the LWIP component to verify this is properly fixed.

See also https://github.com/espressif/esp-idf/issues/632
2017-05-22 11:45:55 +10:00
krzychb
30edcca1fb docs: Generate Doxygen directives for API documentation
This is to resolve issue reported in https://github.com/espressif/esp-idf/issues/130.
2017-05-19 18:26:02 +02:00
Ivan Grokhotkov
a38cecefa7 Merge branch 'bugfix/fix_dport_access_in_isr' into 'master'
Fix Dport access in interrupts

Dport accesses would re-enable interrupts unconditionally, breaking things when called in an ISR. This saves and restores the interrupt status, fixing this.

This fixes a crash in the SPI slave driver, and possibly other things.

See merge request !772
2017-05-19 19:08:34 +08:00
wangmengyang
25b07ed79a component/bt: bugfix for handling HCI_Host_Number_Of_Completed_Packets in BT controller 2017-05-19 17:36:02 +08:00
Jeroen Domburg
fded7b4270 Dport accesses would re-enable interrupts unconditionally, breaking things when called in an ISR. This saves and restores the interrupt status, fixing this. 2017-05-19 15:25:02 +08:00
Ivan Grokhotkov
972d1d9242 Merge branch 'feature/ci_test_config_autogen' into 'master'
CI: auto generate configs for test jobs

Currently CI test jobs are static configured by several pre-generated config files.
This approach have several disadvantages:

1. not flexible to select test cases to run, which is important feature of @bot
2. difficult to update test as we need to pre-generate quite a lot files
3. need to maintain extra config files in IDF
4. not flexible to support new test apps or chips, can't use some new features of test bench

Therefore we'll add assign_test stage between build and test, to generate configs for test jobs.

See merge request !738
2017-05-19 11:56:45 +08:00
Ivan Grokhotkov
67a147fc6f Merge branch 'bugfix/bt_controller_log_clean_up' into 'master'
component/bt: disable information loggings from bt controller

clean-up information loggings during controller initialization

See merge request !769
2017-05-19 11:50:11 +08:00
Tian Hao
45c815f9ad component/driver : fix i2c slave read size bug
when no available data, the slave read size not return 0, so fix it.
2017-05-19 11:22:08 +08:00
Angus Gratton
dbb862299d Merge branch 'bugfix/github_small_prs' into 'master'
Small PR fixes from github

Small bug fixes & typo corrections from github.

See merge request !762
2017-05-19 07:51:47 +08:00
wangmengyang
df3164bd58 component/bt: disable information loggings from bt controller 2017-05-18 21:44:06 +08:00
Jeroen Domburg
356ce2f15a Make compiler happy 2017-05-18 18:50:15 +08:00
Jeroen Domburg
da5d166356 Release coprocessor registers when a task is deleted. 2017-05-18 15:35:28 +08:00
Jiang Jiang Jian
d8c0b505f6 Merge branch 'bugfix/btdm_gattc_discover_refresh_cache_#11077' into 'master'
component/bt: fixed the discover primary service not correct if server changes s…

…ervice during disconnect period.

See merge request !761
2017-05-18 15:04:36 +08:00
Jiang Jiang Jian
b5e2bcbb2c Merge branch 'bugfix/ble_add_adv_state_bug_#12301' into 'master'
component/bt: Fix the bug that sometimes received a ble connection & the adv wil…

…l stop, can not send adv again.

See merge request !759
2017-05-18 15:03:41 +08:00
Jiang Jiang Jian
0d66ac256b Merge branch 'bugfix/minor_fix_about_wifi_api_comments' into 'master'
esp32: minor fix for wifi api comments

Minor fix about the comments of wifi_promiscuous_pkt_type_t

See merge request !760
2017-05-18 14:59:50 +08:00
Jiang Jiang Jian
46519a019c Merge branch 'bugfix/btdm_switch_gatts_error_#12659' into 'master'
component/bt:fix the bug of uild error if switch off BLE GATTS. Bug number is #12659.

switch off BLE GATTS and build.

See merge request !766
2017-05-18 14:58:24 +08:00
Jiang Jiang Jian
9229902dff Merge branch 'bugfix/lib_dport_access' into 'master'
component/esp32 : fix library dport access protections.

1. add esp32 library access DPORT register protections.
2. add bluetooth library access DPORT register protections.
3. change register operation(suffix/prefix) to new style.

See merge request !757
2017-05-18 14:56:38 +08:00
Yulong
b401bbc4d6 component/bt: change the esp_ble_gattc_cache_refresh API return value from esp_gatt_status_t to esp_err_t. 2017-05-18 02:11:42 -04:00
Yulong
8f1a6989ee component/bt: Added the declaration for esp_ble_gattc_cache_refresh in the gattc api header file. 2017-05-18 02:07:16 -04:00
Yulong
d13c083397 component/bt:fix the bug of uild error if switch off BLE GATTS. Bug number is #12659. 2017-05-17 07:17:22 -04:00
Angus Gratton
b6063d160c nghttp module: Update to v1.22, use submodule instead of in-tree source 2017-05-17 14:05:54 +10:00
Tian Hao
52515d0edf component/esp32 : update wifi library and phy library 2017-05-17 11:46:53 +08:00
Angus Gratton
1ddf40feb7 Merge branch 'bugfix/freertos_larger_stacksize' into 'master'
Make internal stack size variables in FreeRTOS 32-bit instead of 16-bit

Stock FreeRTOS uses an uint16 to store stack sizes, making it impossible to allocate a stack >64K. This changes this into an uint32, allowing for larger stacks.

See merge request !677
2017-05-17 10:23:39 +08:00
Deomid Ryabkov
3ac3a78d7d Print the name of the task that hit the stack watchpoint
This may be enough to troubleshoot (increase stack size).

Merges https://github.com/espressif/esp-idf/pull/607
2017-05-17 11:36:13 +10:00
zelll
0b447db8d8 uart driver: Move UART_EVENT_MAX to last
Merges https://github.com/espressif/esp-idf/pull/594
2017-05-17 11:36:13 +10:00
Ankit Daftery
66191fc0b5 doc: Update wifi scan description
Code was refactored, updating documentation to reflect that

Merges https://github.com/espressif/esp-idf/pull/593
2017-05-17 11:36:13 +10:00
Konstantin Fedorov
31de20a217 docs: Error in gpio_install_isr_service() description
Merges https://github.com/espressif/esp-idf/pull/564
2017-05-17 11:04:17 +10:00
Deomid Ryabkov
a40fd2e7bd esp32.ld: Add an entry for ets_write_char_uart
It is mentioned in ets_sys.h, but not actually PROVIDEd.

Merges https://github.com/espressif/esp-idf/pull/545
2017-05-17 10:45:17 +10:00
Yulong
00cdf62ce7 component/bt: fixed the discover primary service not correct if server changes service during disconnect period. 2017-05-16 09:10:37 -04:00
Liu Zhi Fu
f59bf74057 esp32: minor fix for wifi api comments
Minor fix about the comments of wifi_promiscuous_pkt_type_t
2017-05-16 17:01:42 +08:00
Yulong
e797cd03f0 component/bt: Fix the bug that sometimes received a ble connection & the adv will stop, can not send adv again. 2017-05-16 03:10:16 -04:00
Angus Gratton
4dad7ab621 Merge branch 'bugfix/gen_esp32part' into 'master'
Partition table gen esp32part fixes: App offset errors, Python 3 support

As mentioned on forums, gen_esp32part.py wasn't erroring correctly if a non-64KB-aligned app partition was referenced.

Also merges a PR to add Python 2&3 support (with some tweaks). Not very useful in IDF right now, but useful for Arduino.

See merge request !751
2017-05-16 15:03:11 +08:00
Ivan Grokhotkov
98e15df7f6 examples: add ULP ADC example 2017-05-16 13:15:02 +08:00
Tian Hao
3d22f1ee2f component/esp32 : fix library sport access protections.
1. add esp32 library access DPORT register protections.
2. add bluetooth library access DPORT register protections.
3. change register operation(suffix/prefix) to new style.
2017-05-13 19:55:11 +08:00
Jiang Jiang Jian
1e0710f1b2 Merge branch 'bugfix/bt_acl_tx' into 'master'
components/bt: update libbtdm.a with a bugfix for an assertion failure when ACL-…

…U transmission is resumed

See merge request !755
2017-05-12 18:23:20 +08:00
Jiang Jiang Jian
a6608648db Merge branch 'driver_merge_tmp/mcpwm' into 'master'
feature: Motor Control PWM(mcpwm) driver and examples



See merge request !698
2017-05-12 18:21:38 +08:00
Jiang Jiang Jian
9e46b89a75 Merge branch 'feature/i2s_pdm_and_dac' into 'master'
Driver update: I2S pdm and built-in DAC

1. Modify I2S DAC built-in mode settings
2. Add I2S pdm mode
3. Correct I2S signal index in full-duplex mode
4. Modify dac output function
5. Add dac pad init functions
6. Modify DAC documentation

See merge request !740
2017-05-12 18:21:17 +08:00
Jiang Jiang Jian
bb25ac91f4 Merge branch 'bugfix/dualcore' into 'master'
component/soc: fix register access protection missing

- fix dport register access protection missing
- add rom function protect
- add normal register function check

See merge request !747
2017-05-12 18:19:31 +08:00
wangmengyang
23965694b1 components/bt: update libbtdm.a with a bugfix for an assertion failure when ACL-U transmission is resumed 2017-05-12 17:53:25 +08:00
Wangjialin
1f055d28b8 Driver update: I2S pdm and built-in DAC
1. Modify I2S DAC built-in mode settings
2. Add I2S pdm mode
3. Correct I2S signal index in full-duplex mode
4. Modify dac output function
5. Add dac pad init functions
6. Modify DAC documentation
7. Add i2s_set_dac_mode API
2017-05-12 16:21:02 +08:00
Kewal M Shah
2008f4d88c feature: add Motor Control PWM(mcpwm) driver
1. Name change from chopper to carrier, block diagram update, minor changes to example codes
2. mcpwm_reg.h changed, brought uniformity in comments, worked on suggestions, duty to accept float. Some name changes!
3. Minor readme changes and Indetation
4. Minor change:  move mcpwm_reg.h and mcpwm_struct.h to new path
5. Minor change: addition of BLDC example code and Readme
6. Name changed from epwm to mcpwm
7. Improve the reg name in mcpwm_struct.h
8. Name change chopper>carrier, deadband>deadtime
2017-05-12 15:47:59 +08:00
Tian Hao
377a1f5ea1 component/esp32 : do more fix of dualcore bug
1. the cache API in romcode will access DPORT register, so protect it.
2. fix STALL spelling.
3. check dport access by non-dport access function
2017-05-12 15:41:51 +08:00
Jiang Jiang Jian
9a64744850 Merge branch 'bugfix/ble_fix_exception_build_sr_msg_#12124' into 'master'
component/bt: fix the exception in attp_buil_sr_msg when handling gatt write bug. bug number #12124.

 fix the exception in attp_buil_sr_msg when handling gatt write bug. 

See merge request !743
2017-05-12 15:24:58 +08:00
Ivan Grokhotkov
272551301e Merge branch 'bugfix/unit_test_fixes' into 'master'
Small unit-test-related fixes

Fixes for some small bugs found running unit tests with heap poisoning turned on.

All are bugs in the tests, except for one FreeRTOS fix (when deleting a task, check if it's running on the other CPU and preempt it if so.)


See merge request !746
2017-05-12 14:53:46 +08:00
Ivan Grokhotkov
b576893167 Merge branch 'bugfix/nvs_dynamic_key_names' into 'master'
nvs: remove search cache at page level

Since read cache was introduced at page level, search cache became
useless in terms of reducing the number of flash read operations.
In addition to that, search cache used an assumption that if pointers to
keys are identical, the keys are also identical, which was proven wrong
by applications which generate key names dynamically.

This change removes CachedFindInfo, and all its uses. This is done at
expense of a small extra number of CPU operations (looking up a value in
the read cache is slightly more expensive) but no extra flash read
operations.

Ref TW12505
Ref https://github.com/espressif/arduino-esp32/issues/365

See merge request !753
2017-05-12 14:53:18 +08:00
island
e9dc0115fc component/bt: Add parameter check for attp_build_sr_msg function 2017-05-12 14:30:33 +08:00
Angus Gratton
51f20c6e7c gen_esp32part: Run unit tests on host as part of gitlab-ci 2017-05-12 16:28:41 +10:00
Ivan Grokhotkov
bf01525fc1 nvs: remove search cache at page level
Since read cache was introduced at page level, search cache became
useless in terms of reducing the number of flash read operations.
In addition to that, search cache used an assumption that if pointers to
keys are identical, the keys are also identical, which was proven wrong
by applications which generate key names dynamically.

This change removes CachedFindInfo, and all its uses. This is done at
expense of a small extra number of CPU operations (looking up a value in
the read cache is slightly more expensive) but no extra flash read
operations.

Ref TW12505
Ref https://github.com/espressif/arduino-esp32/issues/365
2017-05-12 12:18:08 +08:00
Angus Gratton
7eb0b3c2d7 gen_esp32part.py: Correctly error out for non-64KB aligned app partitions
Also clean up error handling for verification errors in general.

Ref https://esp32.com/viewtopic.php?f=13&t=1838&p=8685#p8659
2017-05-12 12:27:53 +10:00
Angus Gratton
c9969ab996 gen_esp32part.py: Update documentation link, add license 2017-05-12 12:27:38 +10:00
Angus Gratton
aaa8170865 gen_esp32part.py: Remaining Python 3 changes for unit tests to pass, plus unit tests
Ref https://github.com/espressif/esp-idf/pull/577
2017-05-12 12:27:13 +10:00
David M. Palmer
beffcd6468 gen_esp32part: Make compatible with both python2.7 and python3.
Merges https://github.com/espressif/esp-idf/pull/577
2017-05-12 11:53:44 +10:00
Liu Zhi Fu
dc78c55f61 esp32: update wifi lib to enlarge wifi task stack size
1. Enlarge wifi task stack size by 512Bytes to fix potential stack overflow issue
2. Modify wifi hmac tx queue size from 12 to 32 because we already limit the buffer number in ebuf
   management module
2017-05-12 09:36:41 +08:00
Ivan Grokhotkov
15a6145961 Merge branch 'feature/get_chip_ver' into 'master'
add API to get chip info

This change adds an API to get chip info, such as chip model, enabled capabilities, size of embedded flash, silicon revision.

Hello_world example is modified to print out the information about the chip. The example is also simplified by moving all code into the main task.

Ref TW12031.

See merge request !549
2017-05-11 12:05:55 +08:00
Ivan Grokhotkov
67b08c20ec Merge branch 'bugfix/update_wifi_lib_for_some_bugs' into 'master'
esp32: update wifi lib for some bugfix

1. Fix wifi ebuf free twice issue
2. Fix wifi internal assert issue
3. Fix a bug in esp_wifi_stop
4. Fix wifi crash issue
5. Fix wifi run out of memory when 10 udp connection stability test

See merge request !745
2017-05-11 12:02:50 +08:00
Ivan Grokhotkov
c742f7d860 Merge branch 'feature/base_mac_address' into 'master'
Optimize configuration of base MAC address

Application developer can call APIs to configure base MAC address
instead of using menuconfig.

See merge request !744
2017-05-11 12:01:51 +08:00
Liu Zhi Fu
4235b4c13e esp32: update wifi lib for some bugfix
1. Fix wifi ebuf free twice issue
2. Fix wifi internal assert issue
3. Fix a bug in esp_wifi_stop
4. Fix wifi crash issue
5. Fix 10 UDP connection test out of memory issue
2017-05-11 11:30:08 +08:00
Angus Gratton
304f0a399a freertos tests: Use CCOMPARE1 always in xPortInIsrContext() test
Mismatched CCOMPARE meant test would only run once.
2017-05-10 17:26:25 +10:00
Angus Gratton
3f68c5e988 vfs uart tests: Avoid 1 byte heap overrun & memory leak 2017-05-10 17:24:40 +10:00
Angus Gratton
895e7423a3 freertos: Preempt other CPU when deleting a task running on it
Includes related fix to preemption unit tests (delete a queue after deleting the task blocked on it.)
2017-05-10 17:23:33 +10:00
Jiang Jiang Jian
c518325385 Merge branch 'bugfix/dualcore_dport' into 'master'
component/esp32 : fix dualcore bug

1. When dual core cpu run access DPORT register, must do protection.
2. If access DPORT register, must use DPORT_REG_READ/DPORT_REG_WRITE and DPORT_XXX register operation macro.

See merge request !742
2017-05-10 11:27:01 +08:00
XiaXiaotian
b22067a8f0 Optimize configuration of base MAC address
Application developer can call APIs to configure base MAC address
    instead of using menuconfig.
2017-05-10 10:15:07 +08:00
Jiang Jiang Jian
eb00de5384 Merge branch 'bugfix/btdm_debug_gattc_adv' into 'master'
component/bt: fix adv stop event bug and add attribute table create

- Fix bug that advertising stop event produced while calling start_adv function
- Modify gatt server adv data and scan rsp data raw setting
- Add create attribute table error msg
- Delete redundant printf in previous commits

See merge request !739
2017-05-09 22:36:24 +08:00
Tian Hao
26a3cb93c7 component/soc : move dport access header files to soc
1. move dport access header files to soc
2. reduce dport register write protection. Only protect read operation
2017-05-09 18:06:00 +08:00
Yulong
84aeb2823a component/bt: fix the exception in attp_buil_sr_msg when handling gatt write bug. bug number #12124. 2017-05-09 03:06:29 -04:00
Tian Hao
f7e8856520 component/esp32 : fix dualcore bug
1. When dual core cpu run access DPORT register, must do protection.
2. If access DPORT register, must use DPORT_REG_READ/DPORT_REG_WRITE and DPORT_XXX register operation macro.
2017-05-08 21:53:43 +08:00
Jeroen Domburg
a41ac2d21d Merge branch 'bugfix/spi_example' into 'master'
SPI: Various fixes (examples, mem leak, arg check)

- Fix SPI master example to use DMA-capable memory for display initialization. Fixes https://github.com/espressif/esp-idf/issues/551
- SPI master: Do not leak DMA descriptor pointer array on free
- SPI Master/Slave: Check if DMA'ed buffers actually live in DMA-capable memory



See merge request !735
2017-05-08 17:28:55 +08:00
Jeroen Domburg
9962cc9c9f Fix out-of-bounds on dmaworkaround_channels_busy 2017-05-08 16:11:46 +08:00
island
da67773b02 component/bt: fix adv stop event bug and add attribute table create
error

- Fix bug that advertising stop event produced while calling start_adv function
- Modify gatt server adv data and scan rsp data raw setting
- add create attribute table error msg
- Delete redundant printf in previous commits
2017-05-08 15:44:36 +08:00
He Yin Ling
659cd2af43 CI: remove readme content:
README will be updated in internal wiki
2017-05-08 11:44:45 +08:00
He Yin Ling
24862b1a6c CI: remove CI configs and update test case files:
we'll auto assign cases to test jobs so we don't need those config
files. cases with different wifi modes will now be generated when
creating test case database, we need to remove them from YAML files.
2017-05-08 11:44:38 +08:00
Jiang Jiang Jian
65acd99cce Merge branch 'feature/btdm_gattc_add_API_prepare_write_char_desrc' into 'master'
Component/bt:add API to prepare write descriptor for gattc



See merge request !734
2017-05-05 20:34:41 +08:00
zhiweijian
71401bc9b3 Component/bt:add API to prepare write descriptor for gattc 2017-05-05 18:08:47 +08:00
Jiang Jiang Jian
fd079a8bd6 Merge branch 'bugfix/set_scan_bug_rebase_#10399' into 'master'
component/bt: component/bt: Check own address and filter policy for validity.

rebase the invalid scan params not report error.

See merge request !736
2017-05-05 17:47:27 +08:00
Ivan Grokhotkov
2260c714e7 add esp_chip_info API 2017-05-05 17:28:30 +08:00
Ivan Grokhotkov
33b8b7855e Merge branch 'bugfix/spiflash_fatfs_fixes_and_tests' into 'master'
FATFS fixes and tests

This MR includes a set of fixes related to FATFS, SDMMC, and wear levelling:

- `esp_vfs_fat_spiflash_mount` uses `FM_SFD` flag when creating the partition. The volume layout (given in `VolToPart` variable) was not compatible with SFD mode, so mkfs was failing. This fixes the volume layout to use "autodetect" for both volumes. Merges https://github.com/espressif/esp-idf/pull/559.

- fix `prepend_drive_to_path`function, which didn't prepend drive to path (while consuming 2k of stack space)

- fix stack overflow in vfs_fat_link function which allocated two 4kbyte `FIL` structures on the stack

- fix support for having two FATFS instances (in flash and SD) mounted at the same time

- unit tests written for FATFS on SDMMC are made common between SDMMC and WL implementations; FATFS unit tests on WL will run during CI

- fix inconsistent definition of PATH_MAX and ARG_MAX (TW12207, TW12104, https://github.com/espressif/esp-idf/issues/289)

See merge request !732
2017-05-05 17:03:17 +08:00
Ivan Grokhotkov
00358beb98 Merge branch 'feature/freertos_timer_tests' into 'master'
Unit tests: Add FreeRTOS timer tests

Basic unit tests for FreeRTOS timers.

See merge request !715
2017-05-05 17:02:55 +08:00
Yulong
3453824bf2 component/bt: component/bt: Check own address and filter policy for validity. 2017-05-05 04:31:24 -04:00
Jiang Jiang Jian
a7847dbec9 Merge branch 'bugfix/bt_sniff_mode' into 'master'
component/bt: fix some bugs related to bluetooth sniff mode in controller

1. fix some bugs in bluetooth sniff mode in controller
2. export some symbols to esp32.rom.ld including functions and global variables in ROM code
3. update libbtdm.a which includes "IRAM_ATTR" addition or removal for some functions

See merge request !729
2017-05-05 16:27:37 +08:00
Jiang Jiang Jian
4223c795a7 Merge branch 'feature/btdm_blufi_newcmd' into 'master'
Feature/btdm blufi newcmd

1.add a new cmd for blufi,esp32 close a gatt connection.

See merge request !697
2017-05-05 16:25:41 +08:00
Jiang Jiang Jian
195358ddb7 Merge branch 'bugfix/lwip_loopback' into 'master'
fix(lwip): fix tcp connect fail when enable LOOPIF

when enable the LOOPIF, because of use the loopnetif, the TCP connect will fail. see TW12029

See merge request !711
2017-05-05 15:45:14 +08:00
Ivan Grokhotkov
9f0dae4aeb newlib: define PATH_MAX and ARG_MAX consistently
Fixes https://github.com/espressif/esp-idf/issues/289.
Fixes https://github.com/espressif/esp-idf/issues/534.
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov
53d5c5f668 vfs, fatfs: fix support for two FATFS instances (SD and flash)
- fix null pointer dereference in VFS when VFS implementations are added
  and removed in different order

- vfs_fat_sdmmc, vfs_fat_spiflash: pass correct drive to mkfs
  (previously it would always do mkfs in the first drive)

- add test case
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov
5ac28e843d fatfs: clean up diskio code
- clean up diskio_spiflash, fix the max number of volumes supported
- move SDMMC code into a separate file
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov
4e3ea66ec4 fatfs: run same fatfs tests for WL and SDMMC
This change moves actual test code into test_fatfs_common.c and
refactors setup/teardown code to be contained within separate functions.
For each SDMMC FATFS test, identical test is added which can run with
WL partition in flash.
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov
a428af8c9f unit tests: change type of flash_test partition to ‘fat’
This change makes the spi_flash test partition usable for WL and FATFS
tests.
2017-05-05 15:21:37 +08:00
Ivan Grokhotkov
d18157e108 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.
2017-05-05 15:21:37 +08:00
Ivan Grokhotkov
1a73b41b10 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.
2017-05-05 15:21:37 +08:00
Angus Gratton
72c7941b5e Unit tests: Add FreeRTOS timer tests 2017-05-05 14:38:15 +10:00
Jeroen Domburg
8af3fe4e84 Warn against and check for non-DMA-capable pointers being passed to SPI when DMA is used 2017-05-05 12:28:03 +08:00
devsaurus
530c3ca05c components/driver/spi_master: free dma descriptors
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-05-05 11:13:42 +08:00
zhiweijian
fb45ee7a4c Component/bt: add new cmd for blufi ,ESP32 close a gatt connection 2017-05-04 20:31:58 +08:00
Nineis K
b65779eefe Fix vfs_fat_spiflash failed to mount / f_mkfs() 2017-05-04 17:31:14 +08:00
Liu Zhi Fu
7308db6f94 esp32: update wifi lib to enable ebuf sanity check
Modify wifi ebuf sanity checking from disaled to enabled
2017-05-04 15:14:11 +08:00
wangmengyang
244fbf1e84 component/bt: fix some bugs related to bluetooth sniff mode in controller
1. fix some bugs in bluetooth sniff mode in controller
2. export some symbols to esp32.rom.ld including functions and global variables in ROM code
3. update libbtdm.a which includes "IRAM_ATTR" addition or removal for some functions
2017-05-04 15:08:07 +08:00
Jiang Jiang Jian
8f9707fd07 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
2017-05-04 14:58:32 +08:00
Jiang Jiang Jian
79d9d35414 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
2017-05-04 14:51:42 +08:00
Tian Hao
d648835def component/bt : fix the comment 2017-05-03 11:58:52 +08:00
Yulong
c0825b35c1 component/bt:fix the bug with gatt client cant not receive the gatt server service change event. 2017-05-02 22:53:48 -04:00
Jiang Jiang Jian
1cef8d8ac1 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
2017-05-02 19:38:50 +08:00
Jiang Jiang Jian
29d620fa10 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
2017-05-02 19:37:45 +08:00
Ivan Grokhotkov
07b61d54f7 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
2017-04-28 19:57:42 +08:00
Ivan Grokhotkov
e18f8da528 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
2017-04-28 19:55:26 +08:00
Yulong
e8a3f87e4f component/bt:Fixed the bug for #11754:GATT service should provide command to set char/descriptor read value. 2017-04-28 07:23:52 -04:00
Yulong
834d980e39 compoent/bt:Fixed the BT/BLE statck bug from bluedroid7.1.1 2017-04-28 05:31:57 -04:00
Liu Zhi Fu
e86b2dc9c3 esp32: update WiFi lib for ebuf sanity check fail issue
Fix WiFi ebuf sanity check issue
2017-04-28 17:27:55 +08:00
Tian Hao
5c0d0d4854 component/bt : change VHCI interrupt type to software interrupt(int no 7) 2017-04-28 17:20:06 +08:00
Liu Zhi Fu
5cf3b1c201 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
2017-04-28 15:25:33 +08:00
Angus Gratton
7db85a386a 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
2017-04-28 08:00:07 +08:00
krzychb
1a19747678 Getting started guides 2017-04-27 19:51:42 +02:00
Ivan Grokhotkov
6f0a9f76cd Merge branch 'feature/ci_minor_fixes' into 'master'
ci minor fixes



See merge request !707
2017-04-28 00:25:13 +08:00
Ivan Grokhotkov
b8c1720736 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
2017-04-28 00:24:28 +08:00
Jiang Jiang Jian
5728c8bd2a Merge branch 'bugfix/freertos_suspend_resume' into 'master'
freertos: Enable vTaskSuspend()/vTaskResume() API

Adds relevant unit tests.

TW11878

See merge request !702
2017-04-27 21:16:15 +08:00
Jiang Jiang Jian
0759897bfb 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
2017-04-27 21:13:16 +08:00
Jiang Jiang Jian
a21d524ca0 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
2017-04-27 21:12:44 +08:00
Jiang Jiang Jian
899a5d223f 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
2017-04-27 21:11:13 +08:00
Liu Han
aeecbcc7ee fix(lwip): fix tcp connect fail when enable LOOPIF 2017-04-27 18:59:47 +08:00
Jeroen Domburg
9134c13c73 Fix SPI master CI test 2017-04-27 14:50:02 +08:00
XiaXiaotian
100d2dd938 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.
2017-04-27 14:28:52 +08:00
Ivan Grokhotkov
1c3b40adeb 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.
2017-04-27 12:44:54 +08:00
Jeroen Domburg
46fa2cfb46 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
2017-04-27 12:28:42 +08:00
Jeroen Domburg
04b901e629 SPI: More MR issues fixed, style fixup 2017-04-27 11:49:04 +08:00
Jeroen Domburg
bf0c32364a 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 2017-04-27 11:49:04 +08:00
Jeroen Domburg
881a90b8ab 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 2017-04-27 11:49:04 +08:00
Jeroen Domburg
cecb846450 SPI: Fix comment for 3wire, make GPIO pins GPIO_MODE_INPUT_OUTOUT. Fixes https://github.com/espressif/esp-idf/issues/533 2017-04-27 11:49:04 +08:00
Jeroen Domburg
4c06dca15c SPI: Small fixes according to MR comments 2017-04-27 11:49:04 +08:00
Jeroen Domburg
e9c372bc2d SPI: Split common SPI stuff out of master driver; add slave driver; add workaround for DMA issue. 2017-04-27 11:49:04 +08:00
Tuan PM
fc1ee2666a 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
2017-04-27 10:00:10 +07:00
Anton Maklakov
079b0128de build: Fix comments and avoid build warning 2017-04-27 10:51:45 +08:00
Ivan Grokhotkov
1324e565fa 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
2017-04-27 10:43:58 +08:00
Ivan Grokhotkov
fe695a9af8 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
2017-04-27 09:30:42 +08:00
Alexey Gerenkov
98895af68b 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
2017-04-26 21:13:02 +03:00
Yulong
54aaeacb32 component/bt:Change the bt Kconfig BT_ACL_CONNECTIONS type from choice to int(range). 2017-04-26 05:27:21 -04:00
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
Jeroen Domburg
b209c6dcbb Make internal stack size variables in FreeRTOS 32-bit instead of 16-bit 2017-04-19 10:47:19 +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
Angus Gratton
bdbeaf97d6 freertos tests: Fix accidental "0 delay" in event group tests
Was a slight race condition where tasks on other CPU may not have finished waking up on BIT_CALL when the unity task
polled the event group state.
2017-04-04 10:10:08 +10:00
Angus Gratton
45581dbaca freertos: Delay context switch from queue/task APIs until exiting critical section
Closes #374: https://github.com/espressif/esp-idf/issues/374
2017-04-04 10:10:08 +10:00
me-no-dev
99d39909c4 implement fixes for issues found while fuzz testing 2017-04-03 16:45:59 +03:00
Jiang Jiang Jian
fc15d72038 Merge branch 'feature/implement_lwip_critical_protect_with_mutex' into 'master'
lwip: implement lwip critical session with mutex

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

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

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

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

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

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

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

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

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

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

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

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

    depend on the length of the data delivered from LWIP.

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

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



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

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

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

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

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

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

- build system support for ULP coprocessor toolchain
- documentation for ULP coprocessor instruction set
- documentation for ULP code execution flow, loading programs, exchanging data
- example: counting pulses using ULP


See merge request !394
2017-03-27 13:54:51 +08:00
Dmitry Yakovlev
a6e4e89592 ulp: add build system integration and example 2017-03-27 12:41:00 +08:00
Jiang Jiang Jian
8ee6f8227e Merge branch 'bugfix/reset_mac_cause_bt_cannot_rx_data' into 'master'
Reset WIFI mac when wifi start and update wifi lib

1. reset wifi mac when wifi start

2. roll back rx hung workaround for beacon timeout

3. fix amsdu ap interface wrong issue

4. fix amsdu header parse error

5. fix amsdu flag wrong issue

6. PHY: V350, fix BT rssi bug

7. RTC: V225, fix bt will be not work when wifi is reset

See merge request !606
2017-03-24 17:02:26 +08:00
XiaXiaotian
a30c98c1a2 fix compile bug
1. split some unused rtc functions that calls phy function

2. make check bt idle more safe when reset wifi mac
2017-03-24 16:42:44 +08:00
Ivan Grokhotkov
5cf9ccf6ab Merge branch 'feature/add_auth_type_for_wpa2_enterprise' into 'master'
wpa2: add authenticate type for wpa2 enterprise



See merge request !588
2017-03-24 15:56:21 +08:00
Ivan Grokhotkov
710c853adc Merge branch 'bugfix/spi_flash_lock_period' into 'master'
SPI flash operations lock for shorter periods

Based on bug report here:
https://esp32.com/viewtopic.php?f=13&t=1489&p=6816#p6773

Long SPI flash erase (and possibly write/read) cycles block all tasks on both CPUs for an extended period, and can lead to WiFi dissassociation (and general priority inversion.)

This MR inserts preemption breaks into large operations (all erases, writes every 8KB, reads every 16KB).

Overhead of a single spi_flash_guart_start()/spi_flash_guard_end() cycle measured at approx 67us (assuming no preemption.)

See merge request !600
2017-03-24 15:55:42 +08:00
Ivan Grokhotkov
65baf502b7 Merge branch 'bugfix/esp32_core_dump_issues' into 'master'
bugfix: ESP32 Core Dump reported issues

This MR fixes the following issues:
1.  fixed path to esptool when there is no compiled python module for it
2. GDB inernal failure handling was added

See merge request !599
2017-03-24 14:41:07 +08:00
Angus Gratton
0e31eb458e esp32: Move heap_alloc_caps to IRAM
Rest of malloc() path was already in IRAM
2017-03-24 10:41:45 +08:00
Ivan Grokhotkov
573cc7d36f esp32: make soc header compatible with assembler 2017-03-24 10:11:14 +08:00
Ivan Grokhotkov
6ad0a157e3 driver/rtc: add APIs to enable/disable hold function 2017-03-24 10:11:13 +08:00
Angus Gratton
b9a06e68dd Merge branch 'bugfix/minor_fixes' into 'master'
Minor fixes and PRs cherry-picked from Github



See merge request !602
2017-03-23 17:57:28 +08:00
Ivan Grokhotkov
ecee175962 Merge branch 'bugfix/nvs_init_check_empty_pages' into 'master'
Error handling in NVS initialization

Previously nvs_flash_init worked under an assumption that there should always be at least one free page available. This is true during normal operation, but in some cases (such as when changing application partition table from a non-OTA to an OTA one), NVS partition may get truncated, which will cause empty pages to be lost.

This MR adds error checks for this condition, and updates code which calls `nvs_flash_init` to check for the return code.
For most examples, a simple `ESP_ERROR_CHECK` is added around `nvs_flash_init`. For NVS examples and the OTA example, more robust error handling is added.

This change also removes nvs_flash_init calls from examples which don't use NVS.

See merge request !582
2017-03-23 17:57:15 +08:00
Angus Gratton
0f1109a9a2 Merge branch 'bugfix/idf_monitor' into 'master'
idf_monitor: Small fixes (baud rate, EOL, /dev/tty.X on macOS, Ctrl-T on failure)

* "make monitor" now passed the configured baud rate.
  Closes #436 https://github.com/espressif/esp-idf/issues/436
* Pass toolchain prefix from sdkconfig into monitor tool
* Allow setting EOL in idf_monitor.py, use CRLF by default
* Detect if /dev/tty.X is used on macOS, warn and replace with /dev/cu.X
* If a build fails or gdb exits, ignore Ctrl-T (allowing Ctrl-T Ctrl-A/F to be same key sequence everywhere)
* Add a note about winpty on Windows.
  Ref 02fdf8271d (commitcomment-21369196)
* Fix problems with Console.cancel() not existing in older pyserial
* Print more user-friendly symbols for "start of iram" and "start of flash"

See merge request !594
2017-03-23 17:56:56 +08:00
XiaXiaotian
61de08b0dd tw11087: fix wifi restore exception
1. stop wifi before restore wifi
2017-03-23 17:47:48 +08:00
XiaXiaotian
6181c39f05 Reset WIFI mac when wifi start and update wifi lib
1. reset wifi mac when wifi start

2. roll back rx hung workaround for beacon timeout

3. fix amsdu ap interface wrong issue

4. fix amsdu header parse error

5. fix amsdu flag wrong issue

6. PHY: V350, fix BT rssi bug

7. RTC: V225, fix bt will be not work when wifi is reset
2017-03-23 14:28:27 +08:00
Angus Gratton
8352e7e9ec unit test: Measure test wall time with CCOUNT, so it includes time w/ interrupts off 2017-03-22 15:35:54 +08:00
Angus Gratton
d8fda48551 spi_flash: Split large SPI flash operations into parts, allowing preemption
* Erase range operations allow preemption after each block or sector.
* Write operations allow preemption every 8KB of data.
* Reado operations allow preemption every 16KB of data.
2017-03-22 15:35:54 +08:00
rudi ;-)
5362c7ac50 ethernet: Fix typo in log message
Merges #394 https://github.com/espressif/esp-idf/pull/394
2017-03-22 15:22:27 +08:00
Daniel Campora
01ad387ac8 freertos: Add config parameters to customize FreeRTOS behaviour.
The options are:
    - SUPPORT_STATIC_ALLOCATION
    - ENABLE_STATIC_TASK_CLEAN_UP_HOOK
    - TIMER_TASK_PRIORITY
    - TIMER_TASK_STACK_DEPTH
    - TIMER_QUEUE_LENGTH

Merges #444 https://github.com/espressif/esp-idf/pull/444
2017-03-22 15:21:38 +08:00
Matthias Ringwald
3e7b786af5 component/bt: allow to use alternative Bluetooth stack by disabling Bluedroid
Merges #408 https://github.com/espressif/esp-idf/pull/440
2017-03-22 15:13:25 +08:00
alarruskain
eba6789e6c Fix late argument verification in emac-main
Prevent crash when emac_phy_power_enable is not set.

Merges #426 https://github.com/espressif/esp-idf/pull/426
2017-03-22 15:12:12 +08:00
Edmund Huber
0aab67f0aa esp32: esp_wifi.h: Replace a non-working #error statement with a working _Static_assert statement
Merges #440 https://github.com/espressif/esp-idf/pull/440
2017-03-22 15:01:40 +08:00
Angus Gratton
8438b8aa92 bt: Fix typo ESP_BT_MODE_ILDE
Closes #450 https://github.com/espressif/esp-idf/issues/450
2017-03-22 14:41:44 +08:00
Angus Gratton
64f26be053 rmt driver: Remove accidental ESP_LOGE in isr handler
Closes #451 https://github.com/espressif/esp-idf/issues/451
2017-03-22 14:33:22 +08:00
Angus Gratton
c30bba8c63 rmt driver: Fix parameter & description of rmt_driver_install
Closes #187 https://github.com/espressif/esp-idf/issues/187
2017-03-22 12:30:34 +08:00
Alexey Gerenkov
a593d8a518 bugfix: fixed path to esptool when there is no compiled python module for it
bugfix: GDB inernal failure handling was added
2017-03-21 13:30:38 +03:00
Ivan Grokhotkov
fbaeb55c15 Merge branch 'bugfix/btdm_blufi' into 'master'
component/bt : fix blufi bug of sec_mode reset

fix BLUFI cannot be reconnected by phone without re-init.

See merge request !598
2017-03-21 17:54:19 +08:00
Tian Hao
13f0737883 component/bt : fix blufi bug of sec_mode reset 2017-03-21 17:17:07 +08:00
Angus Gratton
6afea0e81c linker scripts: Add explicit symbols for _iram_start and _flash_cache_start
This is to avoid confusion when idf_monitor prints the first symbol in each section, ie "WindowOverflow4" or similar,
when bootloader prints the section mapping address.

Closes #447 https://github.com/espressif/esp-idf/issues/447
2017-03-21 16:45:13 +08:00
Angus Gratton
e477ce93e9 idf_monitor: Small fixes (baud rate, EOL, /dev/tty.X on macOS, Ctrl-T on failure)
* "make monitor" not passed the configured baud rate
  Closes #436 https://github.com/espressif/esp-idf/issues/436
* Pass toolchain prefix from sdkconfig into monitor tool
* Allow setting EOL in idf_monitor.py, use CRLF by default
* Detect if /dev/tty.X is used on macOS, warn and replace with /dev/cu.X
* If a build fails or gdb exits, ignore Ctrl-T (allowing Ctrl-T Ctrl-A/F to be same key sequence everywhere)
* Add a note about winpty on Windows
  Ref 02fdf8271d (commitcomment-21369196)
2017-03-21 16:00:32 +08:00
Ivan Grokhotkov
9254d2846f Merge branch 'feature/ledc_low_speed_channels' into 'master'
add ledc low speed channels

1. add low speed channels
2. modify example code.

See merge request !490
2017-03-21 15:35:40 +08:00
Ivan Grokhotkov
91d35f01f2 Merge branch 'bugfix/i2c_spikes_on_master_init_#393_from_github' into 'master'
bugfix: I2C spikes on master init

Fix I2C spikes on master init.
Before I2C io init, set high level on SDA/SCK IOs.

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

See merge request !593
2017-03-21 15:09:16 +08:00
Ivan Grokhotkov
e4e8a903c3 Merge branch 'bugfix/touch_pad_read_takes_too_much_time' into 'master'
modify touch pad read function

The touch pad read function taks too much time within spin lock waiting for the "done bit". (about 7.6ms as we tested)
So we try to use a mutex on the touch read function and any other functions might change the "done bit".

See merge request !543
2017-03-21 14:46:30 +08:00
Wangjialin
1ad68de8b8 bugfix: I2C spikes on master init #393 from github
Fix I2C spikes on master init.
This issue is reported from https://github.com/espressif/esp-idf/issues/393
Before I2C io init, set high level on SDA/SCK IOs.
2017-03-19 17:05:07 +08:00
Wangjialin
94b91ee4af bugfix: i2c driver not working in 'RELEASE' configuration
This issue is reported from https://github.com/espressif/esp-idf/issues/304.
We found that when we operate the hw command registers in I2C struct, sometimes the behaviour would be different in DEBUG/RELEASE optimisation level:

The code looks like this:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;

In DEBUG configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f3ab0:    3388          l32i.n    a8, a3, 12
400f3ab2:    14c882            addi    a8, a8, 20
400f3ab5:    a08840            addx4    a8, a8, a4
400f3ab8:    0020c0            memw
400f3abb:    2898          l32i.n    a9, a8, 8
400f3abd:    0020c0            memw
400f3ac0:    28b8          l32i.n    a11, a8, 8
400f3ac2:    74a090            extui    a10, a9, 0, 8
400f3ac5:    00af92            movi    a9, 0xffffff00
400f3ac8:    109b90            and    a9, a11, a9
400f3acb:    2099a0            or    a9, a9, a10
400f3ace:    0020c0            memw
400f3ad1:    2899          s32i.n    a9, a8, 8

In RELEASE configuration:
I2C[i2c_num]->command[p_i2c->cmd_idx].byte_num -= 0;
400f2ba2:    580572            l8ui    a7, a5, 88
400f2ba5:    747070            extui    a7, a7, 0, 8
400f2ba8:    0020c0            memw
400f2bab:    584572            s8i    a7, a5, 88

Looks like the compiler will make it a 8bit operation after optimisation.
But the register value changes from 0x901 to 0x101.
After this 8-bit optimisation, the 11th bit changed from 1 to zero, which caused this error.

We are still trying to find out why that happens, because there might be some risk when operating the register struct.
This is a workaround to avoid "-=" operation on I2C register struct fields.
2017-03-19 16:09:44 +08:00
wangmengyang
af843a9517 component/bt: remove the component esp_audio 2017-03-18 16:10:08 +08:00
wangmengyang
2a5d01a930 component/bt: clean up the A2DP sink example 2017-03-18 16:02:54 +08:00
wangmengyang
8ec94418de component/bt: clean up the API header and generate documentation files 2017-03-18 14:55:31 +08:00
wangmengyang
e132e95476 component/bt: format the new source files 2017-03-17 22:46:49 +08:00
wangmengyang
007efdb852 Merge branch 'master' into feature/btdm_avrc 2017-03-17 21:04:18 +08:00
wangmengyang
1cf5a56896 component/bt: move API to set device name that can be used by both bt and ble applications 2017-03-17 19:16:52 +08:00
XiaXiaotian
a401169ea8 wpa2: add authenticate type for wpa2 enterprise 2017-03-17 17:28:01 +08:00
Wangjialin
7670e93639 Feature: add ledc low speed channels
1. Add low speed channels for LEDC module.
2. Improve fade object allocate mechanism.
3. Improve ledc example, add 2 low speed channels in example.
4. Remove debug code
5. Improve the register bit field name of slow clock.
2017-03-17 17:26:30 +08:00
wangmengyang
66fd3b9768 component/bt: add conditional compilation direvatives to control the source code building of SBC codec 2017-03-17 15:57:30 +08:00
wangmengyang
fda2e89a1e component/bt: add conditional compilation direvatives to control the source code building of classic bluetooth 2017-03-17 15:08:47 +08:00
wangmengyang
b2f52dd22e component/bt: add Kconfig option "CLASSIC_BT_ENABLED" 2017-03-16 22:32:27 +08:00
wangmengyang
aaf0cc00c4 component/bt: minor issue fixes for pre-merge
1. arrange the order of profile ID enums
2. add directory "external" and move SBC codec source into it
2017-03-16 16:48:39 +08:00
Liu Zhi Fu
a8f9d99cae lwip: optimize dhcp renew/rebind timer 2017-03-16 09:46:43 +08:00
Ivan Grokhotkov
51323482b2 Merge branch 'feature/update_wifi_lib_for_some_fixs_and_features' into 'master'
esp32: update wifi lib for some bugfix/features

1. add options to disable nvs
2. add station keepalive with softap
3. fix beacon rx start time not accurate issue
4. set wifi rx desc/buffer boundary check to internal memory boundary

See merge request !578
2017-03-16 09:39:16 +08:00
Ivan Grokhotkov
447ffb23d5 nvs: print page state as text in nvs_dump 2017-03-15 17:28:07 +08:00
Ivan Grokhotkov
4813ab2d28 examples: check return value of nvs_flash_init
nvs_flash_init may return an error code in some cases, and applications
should check this error code (or at least assert on it being ESP_OK, to
make potential issues more immediately obvious).

This change modifies all the examples which use NVS to check the error
code. Most examples get a simple ESP_ERROR_CHECK assert, while NVS
examples, OTA example, and NVS unit tests get a more verbose check which
may be used in real applications.
2017-03-15 10:44:54 +08:00
Angus Gratton
02fdf8271d Merge branch 'feature/idf_monitor' into 'master'
Expand  'make monitor' support

New 'make monitor' idf_monitor tool for better monitor output. Running 'make monitor' will now:
* Automatically look up code addresses via addr2line and print function, source file, line number in terminal.
* Can reset the ESP32 by typing Ctrl-T Ctrl-R.
* Can run "make flash" by typing Ctrl-T Ctrl-F.
* Can run "make app-flash" by typing Ctrl-T Ctrl-A.
* If gdb stub starts, monitor will automatically run gdb and connect. When gdb exits, ESP32 resets and monitor resumes.
* Exit is still Ctrl-[

Have some more features I'd like to add (log output to file, crash dump support) but I think this is at the point of being useful.


See merge request !565
2017-03-15 10:41:08 +08:00
Ivan Grokhotkov
829800f272 Merge branch 'bugfix/mbedtls_non_blocking_sockets' into 'master'
mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets

Previous code read non-blocking status via fcntl first, which resets errno.

* Closes #424 https://github.com/espressif/esp-idf/pull/424
* Merges #425 https://github.com/espressif/esp-idf/pull/425

See merge request !575
2017-03-15 10:39:53 +08:00
Ivan Grokhotkov
94b9898ca7 phy_init: move NVS init into relevant function, check errors
This change also modifies logging statements to print hexadecimal error codes, which are easier to look up.
2017-03-14 22:03:39 +08:00
Ivan Grokhotkov
5a23ec4dc4 nvs: check that storage has at least one free page
This change adds a check for the free page count to nvs_flash_init.
Under normal operation, NVS keeps at least one free page available,
except for transient states such as freeing up new page. Due to external
factors (such as NVS partition size reduction) this free page could be
lost, making NVS operation impossible. Previously this would cause an
error when performing any nvs_set operation or opening a new namespace.
With this change, an error is returned from nvs_flash_init to indicate
that NVS partition is in such a state.
2017-03-14 22:03:39 +08:00
Ivan Grokhotkov
817bbb4bf9 nvs: add missing error code descriptions 2017-03-14 22:03:39 +08:00
wangmengyang
a96df34d9b component/bt: recover the BLE buffer size macros 2017-03-14 21:00:58 +08:00
me-no-dev
c89e11c8fa address security issues with mDNS 2017-03-14 10:08:38 +02:00
wangmengyang
6cb9985e5d component/bt: merge the HCI packet reassemble logic modification 2017-03-14 15:34:56 +08:00
Ivan Grokhotkov
a9ed6d5a24 Merge branch 'bugfix/make_test_components' into 'master'
make: don’t override TEST_COMPONENTS

When idf_monitor is launched from make, it gets modified `TEST_COMPONENTS`
variable which contains full paths to the test components instead of the
names. This causes `TEST_COMPONENT_PATHS` to be empty and the unit test
app gets built without any test components.

This change introduces an internal `TEST_COMPONENTS_LIST` variable which
gets set either from `COMPONENTS` if `TESTS_ALL` is 1, or from
`TEST_COMOPONENTS` otherwise.
Bootloader makefile is also fixed to avoid propagating `TESTS_ALL` to the
bootloader build step.

See merge request !569
2017-03-14 15:16:51 +08:00
Ivan Grokhotkov
10f6f234ff Merge branch 'bugfix/fix_uart_stop_bit_2bit_error' into 'master'
bug fix: fix uart data bug when stop-bit is set as 2-bit mode

This is a workaround for a hardware bug.
When we want to use 2-stop-bit mode, we need to set stop-bit-1 and set dl1_en in rs485 register.

See merge request !544
2017-03-14 14:17:55 +08:00
Angus Gratton
2156408d45 Merge branch 'feature/aws_iot_sdk' into 'master'
Amazon AWS IoT SDK

Amazon IoT SDK component, plus two examples derived from their Linux samples.


See merge request !132
2017-03-14 10:21:08 +08:00
Liu Zhi Fu
67aabbff8f esp32: update wifi lib for some bugfix/features
1. add options to disable nvs
2. add station keepalive with softap
3. fix beacon rx start time not accurate issue
4. set wifi rx desc/buffer boundary check to internal memory boundary
2017-03-14 10:14:26 +08:00
wangmengyang
17696bc679 component/bt: resolve the differences with ESP-IDF master branch 2017-03-13 21:28:53 +08:00
Angus Gratton
da660b234c AWS IoT Device SDK Support
Use device cert/key embedded in firmware, or loaded from filesystem.
2017-03-13 17:23:29 +08:00
wangmengyang
383db0dc81 Merge branch 'master' into feature/btdm_avrc 2017-03-13 16:21:41 +08:00
Neil Kolban
16e1a2716e mbedtls port: Fix detection of EWOULDBLOCK/EAGAIN with non-blocking sockets
Previous code read non-blocking status via fcntl first, which resets errno.

Closes #424 https://github.com/espressif/esp-idf/pull/424
Merges #425 https://github.com/espressif/esp-idf/pull/425
2017-03-13 15:45:11 +08:00
wangmengyang
d101f2113b component/bt: code clean up for btc_media_task
1. remove unused macros variables and functions
2. modify the implementation of API "esp_a2d_register_data_callback" to post messages to BTC task.
2017-03-13 14:54:02 +08:00
Angus Gratton
1544544f8a tools: New idf_monitor 'make monitor' tool for smarter monitor output 2017-03-13 09:31:45 +08:00
Wangjialin
5d5b625d0e bugfix: fix uart 2-stop-bit error
Fix uart data bug when stop-bit is set as 2-bit mode.
This is just a software workaround.
2017-03-12 11:38:14 +08:00
Chu Shu Chen
194d4e9ffd fix(touch_pad): modify touch pad read function and touch_pad_deinit
The touch pad read function taks too much time within spin lock waiting for the "done bit". (about 7.6ms as we tested)
So we try to use a mutex on the touch read function and any other functions might change the "done bit".
2017-03-11 11:42:44 +08:00
Ivan Grokhotkov
47d3759474 Merge branch 'bugfix/adv_type_error' into 'master'
component/bt: modify BLE advertising type error

fix BLE advertising type error

See merge request !568
2017-03-10 14:16:33 +08:00
Jeroen Domburg
dc6c19f560 Merge branch 'feature/tighter_rom_memory_defines' into 'master'
Use more regions reserved for ROM routines/stack we don't use for heap.

This frees up about 28K of RAM.

See merge request !467
2017-03-09 20:25:07 +08:00
wangmengyang
878b85c421 component/bt: update with bugfix that media task failed. 2017-03-09 20:16:10 +08:00
Jeroen Domburg
17a4a2527d MR things 2017-03-09 19:59:09 +08:00
Ivan Grokhotkov
61c33ca24e make: don’t override TEST_COMPONENTS
When idf_monitor is launched from make, it gets modified TEST_COMPONENTS
variable which contains full paths to the test components instead of the
names. This causes TEST_COMPONENT_PATHS to be empty and the unit test
app gets built without any test components.

This change introduces an internal TEST_COMPONENTS_LIST variable which
gets set either from $(COMPONENTS) if TESTS_ALL is 1, and from
TEST_COMOPONENTS otherwise.
Bootloader makefile is also fixed to avoid propagating TESTS_ALL to the
bootloader build step.
2017-03-09 19:43:39 +08:00
wangmengyang
5b7b704365 component/bt: format the API headers 2017-03-09 19:03:34 +08:00
island
123b6f88dc component/bt: modify BLE advertising type error 2017-03-09 15:36:22 +08:00
Jiang Jiang Jian
cd4e4fb351 Merge branch 'feature/wifi_deinit_2' into 'master'
wifi deinit: update esp_wifi_deinit()

1. move ets_timer_deinit() to wifi_deinit()

2. delete wifi api mutex when wifi deinit

See merge request !563
2017-03-09 15:35:36 +08:00
Ivan Grokhotkov
045aa45731 Merge branch 'bugfix/btdm_gatt_attribute_table_debug' into 'master'
bt component: fix bluetooth gatt packets process bugs

1. Add process of prepare write request packets
2. Add process of execute write request packets
3. Add process of reliable write request packets
4. Fix bug of processing read blob request packets
5. Fix bug of processing write request packets
6. Optimize error check and process in stack

See merge request !558
2017-03-09 13:28:11 +08:00
wangmengyang
18814c03d4 component/bt: clean up profile call/callback handlers
1. remove the empty function btc_gap_bt_cb_handler();
2. separate the a2dp profile call/callback handers
2017-03-08 21:08:11 +08:00
Jeroen Domburg
ab5bbfa74b Malloc test: tabs -> spaces, fix description 2017-03-08 19:44:57 +08:00
Jeroen Domburg
3462b53fbc MR suggestions 2017-03-08 19:27:30 +08:00
wangmengyang
07548918df component/bt: clean up AVRC logic and the header file 2017-03-08 19:25:58 +08:00
Jeroen Domburg
37d56b0e8a Add small testcase 2017-03-08 19:04:28 +08:00
Jeroen Domburg
e5f54a9dbd Validate more GPIO ROM functions for non-use of static RAM 2017-03-08 19:04:28 +08:00
Jeroen Domburg
0db8b00b8a tight 28k 2017-03-08 19:04:28 +08:00
island
a74f3f9fd7 bt component: code style update 2017-03-08 17:09:05 +08:00
island
3543d8170c bt component: update if…else code style 2017-03-08 17:00:56 +08:00
Ivan Grokhotkov
cde4072f25 ulp: ignore tests which use deep sleep 2017-03-08 16:19:58 +08:00
Ivan Grokhotkov
66c693eebb Merge branch 'feature/deep_sleep_wakeup_from_touch' into 'master'
add wakeup from touch sensor, and deep sleep example

- add new deep sleep wakeup mode
- change documentation to explain incompatibilities between different wakeup mode, add error checks
- add new ULP instructions necessary for ULP wakeup scenario
- fix issues with I_WR_REG, I_SLEEP, I_END instructions
- add deep sleep example, illustrating the use of timer, gpio, touch, and ULP wakeup triggers

See merge request !461
2017-03-08 14:27:58 +08:00
wangmengyang
e6f36f2dc5 component/bt: modify AVRCP APIs to post events and arguments to be handled by BTC task 2017-03-08 13:48:56 +08:00
XiaXiaotian
624ad1bd8b wifi deinit: update esp_wifi_deinit()
1. move ets_timer_deinit() to wifi_deinit()

2. delete wifi api mutex when wifi deinit
2017-03-08 11:00:02 +08:00
Angus Gratton
74817c35f3 mbedtls: Enable filesystem support 2017-03-08 09:55:31 +11:00
Angus Gratton
5f549aab2e fatfs: Support for Long Filenames 2017-03-08 09:54:40 +11:00
wangmengyang
af13acdc29 component/bt: modify a2dp APIs to post event to BTC task 2017-03-07 21:15:54 +08:00
island
5ffe5474ac bt component: optimize gatt debug information 2017-03-07 19:55:21 +08:00
wangmengyang
cfb18ba537 component/bt: fix some typos and comments 2017-03-07 15:33:05 +08:00
wangmengyang
3acd445f94 component/bt: transport the following modules: btif_config, btif_storage, btif_util 2017-03-07 15:09:52 +08:00
wangmengyang
c23b66b1de component/bt: transport bta_av_co.c 2017-03-07 14:21:26 +08:00
Ivan Grokhotkov
32d5985ad2 Merge branch 'bugfix/btdm_host_init_flow' into 'master'
add extra check before bluedroid init and disable

add extra check before bluedroid init and disable to avoid the mixed call cause unexpected errors.

See merge request !553
2017-03-07 14:17:05 +08:00
Jiang Jiang Jian
8b800df720 Merge branch 'feature/btdm_cfg_stack_size' into 'master'
component/bt: optimize stack size of Bluetooth Tasks and make them be configurab…

Bluetooth tasks' stack size are optimized and can be configured by the CONFIG_NEWLIB_NANO_FORMAT option.

See merge request !559
2017-03-07 11:21:07 +08:00
Angus Gratton
0b7058d8ef mbedTLS: Add generic support for mbedTLS debug output via the esp_log functionality 2017-03-07 10:18:47 +11:00
Angus Gratton
4820b64a7f Add jsmn JSON parser component 2017-03-07 10:18:47 +11:00
Angus Gratton
9f7d8c338e Merge branch 'feature/esptool_espefuse_set_flash_voltage' into 'master'
esptool version bump and new "espefuse.py set_flash voltage" command

* New "espefuse.py set_flash_voltage" command to easily set a fix
  VDD_SDIO regulator voltage (1.8V, 3.3V or disabled).
* Fixes bugs when flashing files with non-4-byte aligned lengths
  (doesn't effect esp-idf image files)
* esptool README improvements
* Detect overlapping files in write_flash
* read_mac now works correctly on ESP32
* Integrates reset fix for older dev boards (formerly the "Windows ESP32R0 reset workaround")


See merge request !481
2017-03-07 07:08:18 +08:00
wangmengyang
870389b3ba component/bt: optimize stack size of Bluetooth Tasks and make them be configurable according to the CONFIG_NEWLIB_NANO_FORMAT option 2017-03-06 23:09:42 +08:00
Ivan Grokhotkov
9463a7c594 Merge branch 'feature/lwip_numbers' into 'master'
Change max number of open sockets

Change max number of open sockets from 16 to 32 because of MFI project need support 21 open sockets at least.

See merge request !532
2017-03-06 22:37:12 +08:00
Ivan Grokhotkov
153472d70d Merge branch 'bugfix/soc_io_mux_h' into 'master'
esp32: update io_mux_reg.h to latest version

fixes https://github.com/espressif/esp-idf/issues/349

See merge request !546
2017-03-06 22:36:19 +08:00
island
2955b20f2e bt component: fix bluetooth gatt packets process bugs
1. Add process of prepare write request packets
2. Add process of execute write request packets
3. Add process of reliable write request packets
4. Fix bug of processing read blob request packets
5. Fix bug of processing write request packets
6. Optimize error check and process in stack
2017-03-06 17:20:45 +08:00
Ivan Grokhotkov
c06cc31d85 Merge branch 'bugfix/partition_and_mmap_issues' into 'master'
Fix partition- and mmap-related issues

- Fix unit tests failing to start up due to a mismatch between sdkconfig flash size and size required by partition table.
- Fix a bug that partition APIs loaded the partition table in reverse order. As such, `esp_partition_next` and `esp_partition_find_first` did not work as expected. Add a test.
- Update the workaround for stale cache reads issue: do Cache_Flush for non-encrypted flash as well. Add a test.

See merge request !555
2017-03-06 15:59:28 +08:00
Ivan Grokhotkov
d790300215 spi_flash: fix stale data being read from mmaped region
The issue that cache entries are not invalidated correctly sometimes
can also be reproduced for non-encrypted flash as well.
This change updates the workaround to do Cache_Flush, enabling it for
non-encrypted flash, and adds a unit test.
2017-03-04 17:48:44 +08:00
Ivan Grokhotkov
4bf96e99b3 partition_table: update unit test
- change order of assert arguments to (expected, actual)
- set expected partition count to 3 to match the new partition table
- use the new get_test_partition facility
- check that partitions are listed in correct order
- remove leftover debugging printfs
2017-03-04 17:45:04 +08:00
Ivan Grokhotkov
fa09c8af61 spi_flash: fix partitions order
Pointer to the tail of linked list was never set, so partitions were
added to the head, instead of adding them to the tail.
2017-03-04 15:34:03 +08:00
Tian Hao
bc020da4f5 add extra check before bluedroid init and disable 2017-03-03 18:42:27 +08:00
Liu Zhi Fu
99102af79e esp32: update wifi lib to fix mpdu len error
Fix mpdu len error which impact espressif smartconfig
2017-03-03 18:06:05 +08:00
Angus Gratton
e7aea584f5 Merge branch 'bugfix/free_iram' into 'master'
uart driver: Remove ISR from IRAM



See merge request !486
2017-03-03 14:08:10 +08:00
Angus Gratton
3db4402f3c uart driver: Remove UART ISR handler from IRAM
Doesn't change example behaviour, as ISR wasn't being registered as
ESP_INTR_FLAG_IRAM.
2017-03-03 16:17:55 +11:00
Angus Gratton
975be7a2c9 Merge branch 'bugfix/github_small_fixes' into 'master'
Merge small bugfix PRs from github

* https://github.com/espressif/esp-idf/pull/389
* https://github.com/espressif/esp-idf/pull/382
* https://github.com/espressif/esp-idf/pull/367
* https://github.com/espressif/esp-idf/pull/366
* https://github.com/espressif/esp-idf/pull/361
* https://github.com/espressif/esp-idf/pull/355
* https://github.com/espressif/esp-idf/pull/350
* https://github.com/espressif/esp-idf/pull/348
* https://github.com/espressif/esp-idf/pull/339
* https://github.com/espressif/esp-idf/pull/46
* https://github.com/espressif/esp-idf/pull/307



See merge request !541
2017-03-03 12:58:22 +08:00
Angus Gratton
527720fb5b esptool: Update esptool.py to integrate reset fix for older dev boards
Originally marked "Reset with ESP32R0 Windows workaround", but proven to be
necessary on some other platforms as well. This is now integrated into the
default esptool.py reset behaviour.

Closes #305 https://github.com/espressif/esp-idf/issues/305
2017-03-03 15:34:04 +11:00
Angus Gratton
5ea9097dbd esptool: Update to latest v2.0 beta version
* New "espefuse.py set_flash_voltage" command to easily set a fix
  VDD_SDIO regulator voltage (1.8V, 3.3V or disabled).
* Fixes bugs when flashing files with non-4-byte aligned lengths
  (doesn't effect esp-idf image files)
* README improvements
2017-03-03 15:34:04 +11:00
Angus Gratton
d6f183fbb9 esp_err: Use separate code path for ESP_ERROR_CHECK assertion
* Minimum code size overhead
* Makes function safe to use when flash cache is disabled

Builds on #339 https://github.com/espressif/esp-idf/pull/339
2017-03-03 15:33:23 +11:00
Angus Gratton
3442d4d463 spi_flash: Add spi_flash_cache_enabled() test function 2017-03-03 15:33:23 +11:00
Angus Gratton
6ee5a1e492 sdmmc: Use slot width as default slot_config width parameter, instead of 4
Ref #361 https://github.com/espressif/esp-idf/pull/361
2017-03-03 14:59:15 +11:00
Derek Gregory
a4a790030d component/bt: fix bug where uuid was not reset in btc_gatts_act_create_attr_tab.
Merges #307 https://github.com/espressif/esp-idf/pull/307
2017-03-03 14:59:15 +11:00
lucashutchinson
8ce94d5bd3 ble: Fix ble_adv data truncation
Fixed issue with ble_adv data being truncated after the 31st octet due to an incorrect length passed in a memcpy.

Merges #389 https://github.com/espressif/esp-idf/pull/389
2017-03-03 14:59:15 +11:00
Angus Gratton
e08cf27b8a esp_err: add NDEBUG guard, comment about flash cache
Follow-up to 316b040
2017-03-03 14:59:15 +11:00
Neil Kolban
e14d65d704 Update to ESP_ERROR_CHECK
See request from ESP_Angus here:
https://esp32.com/viewtopic.php?f=18&t=1179

Merges #339 https://github.com/espressif/esp-idf/pull/339
2017-03-03 14:59:15 +11:00
Anne Jan Brouwer
ec31b39989 Added missing platform.h to mbedtls ssl.h
There was a missing definition of mbedtls_time_t

See for example:
https://travis-ci.org/SHA2017-badge/Firmware/jobs/202459377

Merges #348 https://github.com/espressif/esp-idf/pull/348
2017-03-03 14:59:15 +11:00
Angus Gratton
da723ca11d lwip: Use strlcpy() instead of memcpy() to copy hostname to static buffer 2017-03-03 14:59:15 +11:00
alarruskain
3119f936ab lwip: Fix hostname set in tcpip_adapter_lwip
Hostname for each interface is not correctly stored in "hostinfo" variable.

Merges #350 https://github.com/espressif/esp-idf/pull/350
2017-03-03 14:59:15 +11:00
Daniel Campora
c08a2871e6 sdmmc: Add width field to the slot config.
Therefore if the width is set to 1, you can choose to only
configure the CLK, DAT0 and CMD pins.

Merges #361 https://github.com/espressif/esp-idf/pull/361
2017-03-03 14:59:15 +11:00
Ivan Grokhotkov
7754647e71 Merge branch 'bugfix/separate_ethernet_and_wifi' into 'master'
Allow separate ethernet & wifi configuration

If only 1/2 of ethernet & WiFi are enabled in config, the other interface is no longer linked into the firmware.

* Fixes bug where enabling Ethernet but not WiFi would fail to compile.
* Also means that enabling WiFi but not Ethernet no longer links some unused ethernet interface functions.


See merge request !525
2017-03-03 11:53:32 +08:00
Ivan Grokhotkov
ccbc6183c3 Merge branch 'bugfix/freertos_event_groups' into 'master'
FreeRTOS: Fix cross-core event group sync

As above

Also includes fixes which allowed removing some semi-hacky bits from the event group unit tests - specifically, higher priority tasks will always be started immediately even if they run on the opposite core.

See merge request !535
2017-03-03 11:45:59 +08:00
Ivan Grokhotkov
ea12a1de85 Merge branch 'bugfix/rsa4096' into 'master'
mbedtls: Use two MPI multiplications when multiply operands too large

Allows RSA4096 via hardware crypto operations.

Closes #139 https://github.com/espressif/esp-idf/issues/139

See merge request !477
2017-03-03 11:41:11 +08:00
Ivan Grokhotkov
4ecd26ce77 Merge branch 'feature/fatfs_dynamic_pdrv' into 'master'
FATFS enable support for multiple drives

Current implementation has drive numbers and paths hardcoded to support
only one FATFS drive. Arduino has it's own SPI driver to allow
compatibility and flexibility. With the MR it is possible to have up to
```_VOLUMES``` drives connected (SPI, SDMMC and others) at the same
time and accessed through VFS

See merge request !478
2017-03-03 11:40:37 +08:00
Ivan Grokhotkov
f280d8db13 Merge branch 'bugfix/openssl_debuging_error' into 'master'
components/openssl : Fix compilation error when openssl debugging is enabled



See merge request !512
2017-03-03 11:29:37 +08:00
Ivan Grokhotkov
7a186ba1b0 Merge branch 'feature/freertos_kconfig' into 'master'
freertos kconfig: Add max task length name, move task stack overflow watchpoint

* Allow setting task name length via kconfig
* Move task stack overflow watchpoint out of internals debugging submenu, place next to other stack overflow checks.
* Thread local pointer feature should depend on Ethernet or WiFi

See merge request !531
2017-03-03 11:29:05 +08:00
Ivan Grokhotkov
8911e666a0 Merge branch 'feature/docs_partition_ota_flash' into 'master'
Partition/SPI/OTA docs & OTA new functionality

* Update partition, SPI flash & OTA docs to reflect functionality changes
* Refactor OTA implementation to perform checks mentioned in API doc
* Add new functions to OTA API: esp_ota_get_running_partition() & esp_ota_get_next_update_partition() functions
* Add spi_flash_cache2phys() & spi_flash_phys2cache() functions to support esp_ota_get_running_partition()


See merge request !513
2017-03-03 11:27:01 +08:00
Ivan Grokhotkov
848494b20f Merge branch 'feature/enable_qio_directly' into 'master'
Enable SPI flash Quad I/O in bootloader

Bootloader checks flash ID, enables Quad I/O mode based on flash type.

See merge request !479
2017-03-03 11:25:52 +08:00
Ivan Grokhotkov
65b7b22c09 esp32: update io_mux_reg.h to latest version
fixes https://github.com/espressif/esp-idf/issues/349
2017-03-02 19:35:28 +08:00
Liu Zhi Fu
abdd8feebb esp32: menuconfig adds some WiFi options
1. Add options to enable/disable AMPDU
2. Add options to enable/disable WIFI NVS
3. Add options to configure WiFi RX/TX buffer number
2017-03-02 18:13:49 +08:00
Jiang Jiang Jian
3b8c9a407f Merge branch 'feature/add_user_set_mac' into 'master'
Feature/add user set mac

1. Add menuconfig for user to set mac address of wifi, bt and ethernet.
2. Add the number of MAC address generated from efuse for user to choose.
3. Add MAC address derive method.

See merge request !542
2017-03-02 17:34:14 +08:00
Jiang Jiang Jian
6451c57e52 Merge branch 'bugfix/tw10169_dhcp_release_cause_tcp_abort' into 'master'
Bugfix/tw10169 dhcp release cause tcp abort

Modify the DHCP timer granularity from 1 minutes to 1 second.

See merge request !539
2017-03-02 17:28:11 +08:00
Jeroen Domburg
432b25f755 Merge branch 'feature/in_isr_context' into 'master'
Add xPortInIsrContext function + unit test

As title states.

See merge request !533
2017-03-02 17:17:23 +08:00
Jeroen Domburg
6739d5b99f Add xPortInIsrContext function + unit test. This function returns true when the current CPU runs in an interrupt handler context. 2017-03-02 17:00:32 +08:00
wangmengyang
b0e99a56cb component/bt: modify headers btif_av_api.h, btif_av_co.h 2017-03-02 16:08:24 +08:00
XiaXiaotian
d3eede2110 mac address: add the number of MAC address generated from efuse for user to choose
1. Add the number of MAC address generated from efuse for user to choose.

2. Add MAC address derive method.
2017-03-02 15:54:35 +08:00
wangmengyang
8c84bcba72 component/bt: transport btif_media_task, btif_avrc 2017-03-02 11:47:59 +08:00
Ivan Grokhotkov
ecbe5a66f2 Merge branch 'bugfix/rng_disabled_wifi_stop_2' into 'master'
esp32: Fix hardware rng after esp_wifi_stop (second implementation)

Ensures hardware RNG remains enabled at all times.

Reworked  version of !534

See merge request !536
2017-03-02 10:51:30 +08:00
wangmengyang
6d061ec903 component/bt: modify the bluetooth read_efuse_mac interface 2017-03-01 21:04:12 +08:00
XiaXiaotian
fabe0493c2 mac address: add user set mac address
add menuconfig for user to set mac address of wifi, bt and ethernet.
2017-03-01 20:51:49 +08:00
Liu Zhi Fu
66199b1efe Check DHCP rebind timer before checking dhcp release timer in cause they have the same value.
lwip: modify dhcp timer granularity from 60s to 1s

Current DHCP granularity is 60 seconds, it's not accurate, it can cause DHCP release/rebind/renew timer
timeout at the same time, also it may renew/rebind/release at wrong time, thus cause problem.
2017-03-01 20:50:58 +08:00
XiaXiaotian
23f933a78d mac address: add user set mac address
add menuconfig for user to set mac address of wifi, bt and ethernet.
2017-03-01 20:42:46 +08:00
wangmengyang
e8464e0f61 component/bt: transport btif_sm module 2017-03-01 17:37:39 +08:00
wangmengyang
79ed36495b component/bt: transplant btif_rc module and program works. 2017-03-01 16:18:08 +08:00
wangmengyang
b74eb56710 component/bt: transport btif_avk module 2017-03-01 13:49:26 +08:00
Liu Zhi Fu
3b3c3210a6 lwip: fix bool options default value wrong issue
menuconfig options with bool type should use 'y/n' to use the default value,
instead of '1/0'
2017-03-01 13:37:36 +08:00
Angus Gratton
4d67a2ba8b esp32 phy_init: Move DPORT Wifi clock masks to macro values
Amended fix for c642079 !534
2017-03-01 12:11:57 +11:00
Angus Gratton
98f8594151 esp32 dport_reg.h: Fix typo in register bit names 2017-03-01 12:01:07 +11:00
Ivan Grokhotkov
c025dfbfa7 Merge branch 'bugfix/mmap_instr' into 'master'
spi_flash: fix mmap not working for SPI_FLASH_MMAP_INST

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

See merge request !528
2017-02-28 17:14:38 +08:00
wangmengyang
a25cb988bb component/bt: transport btif_profile_queue.c/h to btc_profile_queue.c/h 2017-02-28 17:06:11 +08:00
wangmengyang
acab9e7ae4 fix btc_dm.c/h and replace the functions which are originally in btif_core.c and btif_dm.c 2017-02-28 15:43:02 +08:00
Ivan Grokhotkov
f3687f7177 spi_flash: fix memory leak when spi_flash_mmap arguments are invalid
Check src_addr and size first, then allocate new_entry.
2017-02-28 15:11:54 +08:00
Angus Gratton
2230b2c8bc freertos tests: Enable test_freertos_task_delete 2017-02-28 15:47:15 +11:00
Angus Gratton
8de26e434c freertos: Schedule tasks immediately when they are created on opposite core 2017-02-28 15:47:15 +11:00
wangmengyang
8f65322a84 component/bt: modify the enable/disable function 2017-02-28 11:47:04 +08:00
Angus Gratton
20212ee823 freertos: Fix cross-core usage of event groups
Fixes & re-enabled broken unit tests
Adds per-event-group spinlock instead of single global lock
2017-02-28 12:06:36 +11:00
Angus Gratton
d0f8fb9b93 freertos Kconfig: Thread local storage pointer feature required for WiFi or Ethernet 2017-02-28 10:59:23 +11:00
XiaXiaotian
f36c909528 update phy and rtc lib
1. RTC V214: modify APLL function for the chip of ECO version.

2. Add API phy_close_rf() and use it in esp_phy_deinit() instead of pm_close_rf().

3. RTC V213: fix BT will not work when BT-init is called more than once.
2017-02-27 19:54:22 +08:00
XiaXiaotian
c6420792f2 1. Do not disable clock for generating random number.
2. And fix the bug that system crashes if call esp_wifi_stop() twice.
2017-02-27 16:48:04 +08:00
Liu Han
03ea45046d lwip: Change max number of open sockets 2017-02-27 14:47:48 +08:00
Ivan Grokhotkov
290c40a4ab Merge branch 'bugfix/sdmmc_fail_no_card' into 'master'
vfs_fat_sdmmc: if card init fails, fail cleanly

This fixes the issue with sdmmc_host not returned to clean state after a failed attempt to mount the card, with no SD card in the slot.

See merge request !527
2017-02-27 10:00:55 +08:00
Angus Gratton
47a5851d45 freertos: Move the "set debug watchpoint as stack overflow check" out of debugging internals
Place it near the other stack overflow kconfig items, instead.
2017-02-27 11:49:46 +11:00
Angus Gratton
3050f06a8d FreeRTOS: Support setting task name max length
Ref: https://esp32.com/viewtopic.php?f=13&t=1297&p=5762
2017-02-27 11:46:16 +11:00
Jiang Jiang Jian
13dfb5568d Merge branch 'bugfix/set_channel_fail_before_enable_sniffer' into 'master'
wifi: fix issue in setting channel API

Update wifi libs to fix issue in setting channel API.

See merge request !529
2017-02-24 22:23:06 +08:00
qiyueixa
d9c649d26e wifi: fix issue in setting channel API 2017-02-24 22:08:54 +08:00
Ivan Grokhotkov
75115e1d83 spi_flash: fix mmap not working for SPI_FLASH_MMAP_INST 2017-02-24 21:50:05 +08:00
Ivan Grokhotkov
c17e05040a vfs_fat_sdmmc: if card init fails, fail cleanly
This fixes the issue with sdmmc_host not returned to clean state after
a failed attempt to mount the card, with no SD card in the slot.
2017-02-24 21:04:22 +08:00
wangmengyang
667ac172df component/bt: modify the init/deinit function 2017-02-24 20:39:41 +08:00
wangmengyang
c7dac035ae component/bt: add module btc_gap_bt and port function esp_bt_gap_set_scan_mode 2017-02-24 17:28:33 +08:00
Jiang Jiang Jian
63e0140ae6 Merge branch 'bugfix/btdm_adv_scan_enable_report' into 'master'
component/bt : add adv/scan start complete event

1. indicate adv/scan start complete success or failed
2. controller do limit of adv/scan concurrence, so add some codes to report adv/scan start failed or not.

See merge request !524
2017-02-24 16:24:22 +08:00
Ivan Grokhotkov
1671879b7a Merge branch 'bugfix/set_channel_fail_before_enable_sniffer' into 'master'
wifi: fix issue in setting channel before sniffer is enabled



See merge request !526
2017-02-24 16:15:39 +08:00
qiyueixa
ff81e17504 wifi: fix issue in setting channel before sniffer is enabled 2017-02-24 15:19:31 +08:00
Ivan Grokhotkov
708539c559 Merge branch 'bugfix/btdm_gatts_write_desc_error' into 'master'
component/bt:fixed the write ccc crash bug error

fix the gatt server write ccc lead to the system crash if not initialize the ccc value.

See merge request !515
2017-02-24 15:11:18 +08:00
Angus Gratton
d9252b3645 wifi event_default_handlers/tcpip_adapter: Support disabling WiFi, keeping Ethernet 2017-02-24 14:46:23 +11:00
Angus Gratton
eb1fbaabce lwip: Refactor support for L2 pbuf free notification into each driver
Makes it easier to handle different drivers enabled at compile/link time.
2017-02-24 14:45:17 +11:00
Ivan Grokhotkov
36b3963efb Merge branch 'feature/btdm_ram_config' into 'master'
Optimize or release memory in bluetooth

1. add option to release about 30K from BT if BLE only
2. later BT/BLE will be separated by BT/BLE macro, but this option should use when user make sure that in BLE only mode.

See merge request !520
2017-02-23 18:21:16 +08:00
Tian Hao
b582697889 component/bt : add adv/scan start complete event
1. indicate adv/scan start complete success or failed
2. controller do limit of adv/scan concurrence, so add some codes to report adv/scan start failed or not.
2017-02-23 17:54:22 +08:00
wangmengyang
41070f6768 Merge branch 'master' into feature/btdm_avrc
1. merge master into feature/btdm_avrc
2. add call of esp_bt_controller_enable() in app_main
2017-02-23 15:10:25 +08:00
wangmengyang
118131109e component/bt: modification to a2dp API to support reconnection
1. add API esp_a2d_sink_connect() to initiate connection to other devices;
2. modify lower layers to transfer the disconnection reason upwards
2017-02-23 14:30:08 +08:00
wangmengyang
80cdfc9e0a componentbt: work around the crashing issue after a2dp is connected to Android Phone but before audio stream starts to play
The root cause is the bug in bluetooth controller, in which the HCI_SNIFF_MODE command is sent to controller and at the same time the controller has received same request from remote device.
For now change the time-out period of local device to enter the SNIFF mode.
2017-02-23 11:59:47 +08:00
wangmengyang
1d98c9849e component/bt: remove the A2DP decoding timer and instead trigger decoding directly upon data arrival 2017-02-23 11:56:38 +08:00
Jeroen Domburg
7dfb1c2e97 Merge branch 'bugfix/app_tasks_start_on_wrong_cpu' into 'master'
Fix a scheduling bug

Fixes:
- Trivial bug where in some special cases a task could be started on the wrong core (and would run there for max 1 tick)
- More major bug causing a yield to be done with a mux held.

See merge request !523
2017-02-23 11:19:37 +08:00
Jeroen Domburg
c057f067c7 Merge branch 'bugfix/spi_master_length' into 'master'
Fix SPI master transmit length

Tx/Rx length fix from https://github.com/espressif/esp-idf/pull/336

I also added an extra commit in to make use of a define instead of a literal, plus fix a (harmless) off-by-one condition.

See merge request !521
2017-02-22 17:11:00 +08:00
Ivan Grokhotkov
e96d653c9e ulp: make sure I_WAKE instruction works with ULP timer disabled
Setting ULP_CP_WAKEUP_FORCE_EN forces ULP wakeup to work even if the
ULP timer has already been disabled.
2017-02-22 17:10:52 +08:00
Jeroen Domburg
ce7d0a7015 Fixed a small bug where a task could initially be scheduled on a wrong CPU, and a much bigger bug where a yield was performed with a held mux. 2017-02-22 17:04:51 +08:00
Ivan Grokhotkov
5cab04075e ulp: rename I_SLEEP, redefine I_WAKE, add I_ADC, add tests
This fixes incorrect descriptions of I_END/I_SLEEP instructions and
changes the definition of I_END. New instruction, I_WAKE, is added,
which wakes up the SoC. Macro for ADC instruction is defined, and new
tests are added.
2017-02-22 15:00:36 +08:00
Ivan Grokhotkov
0465528431 ulp: don’t override SENS_SLEEP_CYCLES_S0
SENS_SLEEP_CYCLES_S0 may be set by the application to control ULP
program timer.
2017-02-22 14:41:10 +08:00
Ivan Grokhotkov
0fcc8918dd ulp: add I_WR_REG_BIT convenience macro 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
cdf122baa0 ulp: add I_WR_REG instruction test 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
7df75c00c7 ulp: fix a bug that ULP may not be restarted correctly 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
d0d2c4cb49 esp32,ulp: add tests for TSENS 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
dbf60eb922 rtc: fix typo in RTC_CNTL_SLOWCLK_FREQ macro name 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
a64181f14f deep sleep: add functions to check wakeup cause
This change adds esp_deep_sleep_get_wakeup_cause, which returns the
source which has caused wakeup from deep sleep.

Similar to esp_deep_sleep_get_ext1_wakeup_status, a function is added
to check touch pad wakeup status: esp_deep_sleep_get_touchpad_wakeup_status.
This function returns the touch pad which has caused wakeup.
2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
07ff47f103 deep sleep: clarify compatibility issues between wakeup sources
ULP and touch FSMs in ESP32 revisions 0 and 1 do not operate correctly
if RTC_PERIPH power domain is force powered on (ESP_PD_OPTION_ON).

Both ULP and touch still work, but clock frequency of the ULP may be
incorrect and touch values may be off by considerable amount. As such,
when these wakeup modes are used, RTC_PERIPH power domain has to be set
to ESP_PD_OPTION_AUTO (or, in the current implementation,
ESP_PD_OPTION_OFF — though this will change in the future when _OFF will
actually *force* the power domain to be powered off).

Because EXT0 wakeup source requires RTC_PERIPH to be powered ON, mark
ULP and touch wakeup sources as incompatible with EXT0. Workaround for
this is to use EXT1 wakeup source instead, which offers similar or
better functions without having to keep RTC_PERIPH powered on.
2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
611e510c49 ulp: add I_SLEEP instruction and improve comments 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
0483548a39 ulp: fix I_{RD,WR}_REG definitions
- I_RD_REG used the wrong union member (.rd_reg) due to a copy-paste
  mistake

- Peripheral register address in bits[7:0] should be given in words,
  not in bytes

Fixes https://github.com/espressif/esp-idf/issues/297
2017-02-22 14:40:36 +08:00
Wangjialin
fb261c0bd5 1. deal with conflicting wakeup triggers
2. modify deep_sleep.rst, add description of touch wakeup.
2017-02-22 14:40:36 +08:00
Wangjialin
cc13b0ea05 deep sleep: allow wakeup from touch sensor interrupt 2017-02-22 14:40:36 +08:00
Ivan Grokhotkov
d772e1489b Merge branch 'bugfix/bootloader_disable_sar_test_mux' into 'master'
Deep sleep fixes

This change fixes extra 24 uA current consumption in deep sleep mode (https://esp32.com/viewtopic.php?f=2&t=1133).

Recent update to libphy/librtc caused another problem that WiFi related parts of RTC are no longer disabled by RTC sleep functions. This means that if WiFi is not disabled by the application before entering deep sleep, extra ~200uA of current would be consumed. This is fixed, and documentation for esp_deep_sleep and SNTP example are updated to mention that applications should take care of disabling WiFi and BT before going into the deep sleep mode.

See merge request !516
2017-02-22 14:32:32 +08:00
Ivan Grokhotkov
dca0377e19 Merge branch 'bugfix/flash_write_single_core' into 'master'
spi_flash: fix protection issues

This MR fixes the two spi_flash related issues:

- esp_intr_noniram_{disable,enable} not being protected by spi_flash_op_{lock,unlock} in single core mode. This caused a safety assert to be triggered in esp_intr_noniram_disable.

- spi_flash_unlock not being protected by spi_flash_guard_{start,end}. This caused a conflict between SPI0 and SPI1 controllers when accessing SPI flash, manifesting in cache data corruption and IllegalInstruction exceptions, for some flash chips.


See merge request !522
2017-02-22 14:17:40 +08:00
Ivan Grokhotkov
cbb71baca9 spi_flash: protect spi_flash_unlock
spi_flash_unlock was missing spi_flash_guard_start, which caused cache
to be enabled during unlock operation, causing hard-to-trace crashes
and cache data corruption.
2017-02-22 12:51:16 +08:00
Angus Gratton
c3544dc090 Build system: Fix error if librtc submodule not available to bootloader
Closes #220 https://github.com/espressif/esp-idf/issues/220
2017-02-22 11:59:37 +11:00
Tian Zhong Xing
c3d5f8e766 app_update: fix logic error when update ota info 2017-02-22 10:26:04 +11:00
Angus Gratton
080350a745 ota ops: Rewrite esp_ota_get_next_update_partition() to be more predictable, add unit tests 2017-02-22 10:26:04 +11:00
Angus Gratton
f687725e97 unit tests: Use a unit test app partition table, configure spi_flash to use data partition 2017-02-22 10:26:04 +11:00
Angus Gratton
4170b8c32e partition iterator: Free iterator when reaching end of linked list 2017-02-22 10:26:04 +11:00
Angus Gratton
902382f622 ota ops: Verify partition argument passed to esp_ota_begin() 2017-02-22 10:26:04 +11:00
Angus Gratton
25f739c183 ota ops: Add new functions esp_ota_get_next_update_partition / esp_ota_get_running_partition
* Update OTA example to use these.
* Refactor esp_ota_begin() to return ESP_ERR_OTA_PARTITION_CONFLICT as documented
2017-02-22 10:24:42 +11:00
Angus Gratton
6a2d152086 spi_flash tests: Refactor mmap tests to be run in any order 2017-02-22 10:22:50 +11:00
Angus Gratton
093dd98101 spi_flash: Add new phys2cache & cache2phys functions to query flash cache mappings 2017-02-22 10:22:50 +11:00
Angus Gratton
de28d3a655 Merge branch 'feature/partition_table_envvars' into 'master'
partition tables: Expand environment variables in gen_esp32part

Allows parametrizing partition table with (exported) make variables.

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

See merge request !505
2017-02-22 07:22:04 +08:00
Ivan Grokhotkov
e76c187efb spi_flash: protect esp_intr_noniram_{disable,enable} in 1-core config
MR !441 (7c155ab) has fixed issue with esp_intr_noniram_{disable,enable}
calls not being properly protected by spi_flash_op_{lock,unlock}.
Unit test was added, but the unit test environment tests only dual-core
config. Similar issue was present in the code path for the single-core
config, where esp_intr_noniram_{disable,enable} calls were unprotected.

This change fixes the protection issue and updates the unit test to
run properly in single core config as well.

The issue with running unit tests for single core config will be
addressed in a separate MR.
2017-02-21 21:57:53 +08:00
Jeroen Domburg
e35ebbf813 Use THRESH_DMA_TRANS define everywhere, make code match "smaller or equal" description 2017-02-21 18:27:56 +08:00
Lourens Naudé
04f7d96623 Fix SPI read edges in spi_intr
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-02-21 18:26:03 +08:00
Tian Hao
55693b1168 component/bt : add option to release about 30K from BT if BLE only
1. later BT/BLE will be separated by BT/BLE macro, but this option should use when user make sure that in BLE only mode.
2017-02-21 17:46:59 +08:00
Ivan Grokhotkov
26dec992eb deep sleep: add note about disabling WiFi and BT
This change adds a note to esp_deep_sleep that applications should disable WiFi and BT before going into deep sleep.
SNTP example is also updated.
2017-02-21 17:07:16 +08:00
Ivan Grokhotkov
d3fde5188e deep sleep: bring some registers into known state
In case WiFi/BT stack has been enabled but wasn’t disabled, some RTC
bits may be left enabled, causing increased current consumption.
This change returns some of the bits back to their default values.
2017-02-21 17:07:15 +08:00
Ivan Grokhotkov
3b583c150f bootloader: disconnect VRTC from SAR input in bootloader_random_disable
Bootloader enables SAR ADC in test mode to get some entropy for the RNG.
The bits which control the ADC test mux were not disabled, which caused
extra ~24uA current to be drawn from VRTC, increasing deep sleep current
consumption. This change disables relevant test mode bits in
bootloader_random_disable.
2017-02-21 17:07:15 +08:00
XiaXiaotian
a51f378ecc bugfix: it causes exception that wifi interrupt happens when read/write flash, if pp_post() is on icache. 2017-02-21 14:25:34 +08:00
XiaXiaotian
678ec0bd04 Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into feature/disable_phy_rf_when_disable_wifi_bt 2017-02-21 01:20:48 +08:00
Tian Hao
12a7293b31 component/bt : add bluetooth status check
1. add bluetooth controller/host initialize status check
2. separate bluetooth controller task schedule loop from controller init
2017-02-21 01:05:37 +08:00
XiaXiaotian
bb0298bc71 coexist: enable coexist when wifi&bt are enabled, disable coexist when one of wifi&bt is disabled. 2017-02-20 23:53:25 +08:00
Yulong
abf87b000d component/bt:fixed the write ccc crash bug error 2017-02-20 08:50:02 -05:00
Ivan Grokhotkov
7eaf1c76dc Merge branch 'bugfix/vfat_open_append' into 'master'
Fix fopen() in “a” (append) mode

fopen() does not work when file is opened in “a” (append) mode

* Merges github PR #302 https://github.com/espressif/esp-idf/pull/302
* Closes #328 https://github.com/espressif/esp-idf/issues/328

See merge request !503
2017-02-20 13:32:32 +08:00
Angus Gratton
1f3a2e900c docs: Improve/clarify partition, OTA & SPI flash docs
Related to #313 https://github.com/espressif/esp-idf/issues/313
2017-02-20 15:31:42 +11:00
XiaXiaotian
770c2ade05 phy init: modify some comments 2017-02-20 10:44:40 +08:00
Dong Heng
25e2b07010 components/openssl : Fix compilation error when openssl debugging is enabled 2017-02-20 09:45:50 +08:00
Angus Gratton
4db4e28b6e uart driver docs: Remove references to setting interrupt number
Closes #185 https://github.com/espressif/esp-idf/issues/185
2017-02-20 10:39:29 +11:00
Angus Gratton
bfdfcbfaef docs: Add missing peripheral driver docs (ADC, DAC, RTC I/O, I2S) 2017-02-20 10:39:29 +11:00
Angus Gratton
21964a42fb rtc_gpio: Replace RTC_GPIO_IS_VALID_GPIO macro with inline function 2017-02-20 10:39:29 +11:00
Tian Hao
4bd5b0c91a component/bt : add bt enable/disable for power save
1. add new APIs bt controller enable/disab/deinit
2. make bt controller work need to call two APIs of esp_bt_controller_init and enable
3. modify phy init to make mac reset once
2017-02-17 19:24:58 +08:00
XiaXiaotian
8f3d1d3184 fix compile error that if enable CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION compile fail 2017-02-17 15:29:11 +08:00
Tian Hao
ad890aa5ea component/bt : wide range work temperature for bluetooth RF
1. add PLL track for bluetooth RF for wide range temperature
2. move some initialized codes to cache
2017-02-17 12:26:28 +08:00
XiaXiaotian
cd13c9e95d disable phy and rf
1. add a macro in menuconfig for users to choose whether store phy calibration data into NVS or not.

2. rename some disable phy and rf APIs so that existing code which calls old APIS will fail to compile.
2017-02-17 10:24:55 +08:00
XiaXiaotian
eb14284c92 disable PHY and RF when stop WiFi and disable BT
1. Add disable PHY and RF when WiFi and BT are both disabled(including call sniffer disable API).

2. Do not init PHY and RF when cpu start. Init PHY and RF when call Wifi or BT start APIs(including sniffer enable API).

3. Add a temporary lib: librtc_clk.a and will delete it when CPU frequency switching function is done.

4. Add an function to get OS tick rate.

5. Do not put the whole pp.a in iram0, only put lmac.o, ieee80211_misc.o, ets_time.o and wdev.o in iram0.
2017-02-17 10:24:54 +08:00
Jiang Jiang Jian
61c7bd3c3a Merge branch 'bugfix/btdm_gatt' into 'master'
component/bt : fix gatt write memory leak

fix bug of GATT write cause memory leak 

See merge request !506
2017-02-16 15:13:05 +08:00
Jiang Jiang Jian
6c139c8ffb Merge branch 'feature/ethernet_phy_power' into 'master'
ethernet: add a gpio to enable/disable phy power

ethernet board v2 use gpio 17 .

See merge request !495
2017-02-16 15:12:09 +08:00
Tian Hao
6648ff427c component/bt : fix connection bug of Iphone7 10.0.2
This connection error caused by iPhone, it think that TX data length must large than 27 when slave support EXTEND_DATA_LENGTH. But this should be allow. Besides,  the problem cannot be found on higher version of Iphone7, apple seemed to have fixed it.
Actually maybe other BLE device have the same problem.
2017-02-16 14:15:46 +08:00
Tian Hao
5023e30a33 component/bt : fix gatt write memory leak 2017-02-15 20:08:39 +08:00
Angus Gratton
9cea5ea075 fatfs: Add unit test for overwrite/append fix 2017-02-15 18:04:28 +11:00
Ivan Grokhotkov
413f05ce09 Merge branch 'docs/flash_encryption_disable' into 'master'
Docs: Document flash encryption disable steps, clean up flash encryption & secure boot docs

Generate clean up of flash encryption & secure boot docs

Including steps for disabling flash encryption (for people who accidentally enable it).

See merge request !500
2017-02-15 13:31:08 +08:00
Ivan Grokhotkov
dd5401749d Merge branch 'bugfix/phy_init_write_nvs_once' into 'master'
phy_init: don’t rewrite valid calibration data

In the default PHY init routine, calibration data is loaded from NVS.
Most of the time the incremental changes to calibration will be fairly
small, so we don’t need to rewrite the existing calibration data stored
in the NVS.

Possible enhancement to be done in the future: expose a function in PHY
library to tell how big was the change in calibration data. If the
change was significant, then calibration data stored in NVS should be
updated.

See merge request !487
2017-02-15 13:26:22 +08:00
Ivan Grokhotkov
01c4a980ee Merge branch 'bugfix/fix_protection_of_queue_list' into 'master'
freertos: fix protection issue in freertos queue event list

When functions in queue.c calls listLIST_IS_EMPTY() to check queue event list, the queue list is
protected by queue mutex, on the other hand, when xTaskIncrementTick() modify the queue list, the
 queue list is protected by xTaskQueueMutex, this may cause xTaskRemoveFromEventList operate on
the empty queue list and cause problem.
This change works around the problem by reducing the window where the race condition can happen.

See merge request !465
2017-02-15 13:25:51 +08:00
Ivan Grokhotkov
25f05bef71 Merge branch 'bugfix/OTA_and_flash_encryption_incompatible' into 'master'
bootloader_support: fix bug OTA & flash encryption incompatible

github issue:https://github.com/espressif/esp-idf/issues/253

See merge request !464
2017-02-15 13:24:10 +08:00
Angus Gratton
24cfe78962 partition table: Fix comment at top of gen_esp32part.py 2017-02-15 10:28:45 +11:00
Angus Gratton
7c7edab328 flash encryption/secure boot: Restructure documentation
Also add steps to disable flash encryption, as some people seem to
accidentally enable it.

Explicitly mark the flash encryption and secure boot as "READ DOCS
FIRST" in menuconfig.
2017-02-15 09:42:46 +11:00
Deomid Ryabkov
22c3877183 Expand environment variables in gen_esp32part
Allows parametrizing partition table with (exported) make variables.
2017-02-14 13:53:17 +08:00
nineisk
57af0d70d3 Fix fopen() in “a” (append) mode
fopen() does not work when file is opened in “a” (append) mode
2017-02-14 16:15:08 +11:00
Jiang Jiang Jian
a65944a8cb Merge branch 'bugfix/update_wifi_lib_to_include_some_fix_and_optimization' into 'master'
esp32: update wifi lib for some fixes and optimizations

1. Reduce the default static rx buffer size from 25 to 10
2. Adjust ampdu interrupt size to 3, namely, raise 1 interrupt per 3-mpdu
3. Make a copy for all received packets, including AMSDU/AMPDU/MPDU
4. Fix softap mis-forward issue
5. Fix pp q full issue
6. Fix sniffer copy wrong content issue

See merge request !491
2017-02-13 21:22:43 +08:00
Jiang Jiang Jian
2664291ba5 Merge branch 'bugfix/btdm_blufi' into 'master'
fix BLUFI bug

fix BLUFI bug with small MTU size

See merge request !493
2017-02-13 14:52:46 +08:00
Tian Hao
5fd7bd14db component/bt : fix GATT disconnect memory leak bug 2017-02-13 14:00:26 +08:00
shangke
e8b7670db3 ethernet: add doc 2017-02-11 16:42:16 +08:00
shangke
9893b71096 ethernet: add a gpio to enable/disable phy power 2017-02-11 15:19:53 +08:00
Tian Hao
2c334b46e0 component/bt : fix BLUFI bug with small MTU size 2017-02-10 11:20:34 +08:00
Liu Zhi Fu
0017e75bda freertos: fix protection issue in freertos queue event list
When functions in queue.c calls listLIST_IS_EMPTY() to check queue event list, the queue list is
protected by queue mutex, on the other hand, when xTaskIncrementTick() modify the queue list, the
 queue list is protected by xTaskQueueMutex, this may cause xTaskRemoveFromEventList operate on
the empty queue list and cause problem. This commit is to fix this bug.

may cause
2017-02-10 10:30:17 +08:00
Liu Zhi Fu
7093c59a74 esp32: update wifi lib for some fixes and optimizations
1. Reduce the default static rx buffer size from 25 to 10
2. Adjust ampdu interrupt size to 3, namely, raise 1 interrupt per 3-mpdu
3. Make a copy for all received packets, including AMSDU/AMPDU/MPDU
4. Fix softap mis-forward issue
5. Fix pp q full issue
6. Fix sniffer copy wrong content issue
2017-02-10 10:28:03 +08:00
Angus Gratton
76d4f65ff9 bootloader: Add more flexible QIO support, for non-orthogonal command sets
Should allow enabling QIO mode on WinBond (not yet tested).
2017-02-09 08:44:05 +11:00
Angus Gratton
68cba2a1fb Bootloader: Support switching to Quad I/O mode during boot process 2017-02-09 08:44:05 +11:00
Jeroen Domburg
c61fdff729 Merge branch 'bugfix/yield_other_core_prio_check_fix' into 'master'
Fix interrupting task on other CPU that has lower prio than current task on current CPU

Fix for a very subtle bug introduced somewhere in december. This bug would cause a cross-core interrupt to only be sent if the activated task has a higher priority than the task currently running on *this* cpu, instead of on the other CPU.

See merge request !475
2017-02-08 12:19:34 +08:00
Ivan Grokhotkov
777816cb99 phy_init: don’t rewrite valid calibration data
In the default PHY init routine, calibration data is loaded from NVS.
Most of the time the incremental changes to calibration will be fairly
small, so we don’t need to rewrite the existing calibration data stored
in the NVS.

Possible enhancement to be done in the future: expose a function in PHY
library to tell how big was the change in calibration data. If the
change was significant, then calibration data stored in NVS should be
updated.
2017-02-07 15:14:45 +08:00
Jiang Jiang Jian
89fea85a45 Merge branch 'bugfix/fix_several_wifi_misc_issues' into 'master'
esp32: fix several misc wifi issue

1. Fix ssid_str not free issue
2. Fix sniffer not work issue
3. Fix null parameter cause esp_wifi_init crash issue
4. Enable ap ampdu rx interface

See merge request !484
2017-02-07 11:15:58 +08:00
Liu Zhi Fu
b748a63a43 esp32: fix several misc wifi issue
1. Fix ssid_str not free issue
2. Fix sniffer not work issue
3. Fix null parameter cause esp_wifi_init crash issue
4. Enable ap ampdu rx interface
2017-02-06 17:56:42 +08:00
Jeroen Domburg
d07a149e2c Fix interrupting task on other CPU that has lower prio than current task on current CPU 2017-02-06 17:53:07 +08:00
Ivan Grokhotkov
c78aa138b0 Merge branch 'bugfix/esp32_core_dump_wd_uart' into 'master'
esp32: Fixes watchdog problem when printing core dump to uart

1) Fixes watchdog problem when printing core dump to uart
2) Also fixes generation of core dumps when flash cache is disabled


See merge request !472
2017-02-06 17:44:08 +08:00
shangke
627bc23b1c ethernet:disable flow control when select l2_to_l3_copy_mode 2017-02-06 11:19:16 +08:00
Angus Gratton
2d5162dc3c OTA: Always clean up OTA handle regardless of esp_ota_end() result
As reported on forum: http://esp32.com/viewtopic.php?f=14&t=1093
2017-02-03 10:07:30 +11:00
me-no-dev
0eeda99a8c pick better name for unregister function and update docs 2017-02-02 12:24:38 +02:00
me-no-dev
972c6f0cae implement review recomendations 2017-02-01 17:55:25 +02:00
Alexey Gerenkov
04acc88023 esp32: Fixes watchdog problem when printing core dump to uart
Also fixes generation of core dumps when flash cache is disabled
2017-02-01 18:39:28 +03:00
Ivan Grokhotkov
b8e2edc99f Merge branch 'bugfix/esp32_core_dump_esptool_search_path' into 'master'
esp32: Fixed search path for esptool

@igrokhotkov @angus Could you review the fix?

See merge request !474
2017-02-01 13:59:40 +08:00
me-no-dev
a57b6326e3 Fix ``if`` breaking the path 2017-01-31 17:43:22 +02:00
me-no-dev
84590ec0a4 FATFS enable support for multiple drives
Current implementation has drive numbers and paths hardcoded to support
only one FATFS drive. Arduino has it's own SPI driver to allow
compatibility and flexibility. With the MR it is possible to have up to
```_VOLUMES``` drives connected (SPI, SDMMC and others) at the same
time and accessed through VFS
2017-01-31 17:23:25 +02:00
Angus Gratton
64e6e7a0ae mbedtls: Use two MPI multiplications when multiply operands too large
Allows RSA4096 via hardware crypto operations.

See github #139 https://github.com/espressif/esp-idf/issues/139
2017-01-31 14:36:26 +11:00
Angus Gratton
0a678ebe8c Merge branch 'feature/openssl_option' into 'master'
components/openssl: refactor openssl debugging and assert function

1. add openssl option at menuconfig
2. remove SSL_ERR to reduce complexity
3. add more functions about debugging and assert

According these, our coders and customers may use and debug the OpenSSL code easily.


See merge request !400
2017-01-27 08:37:02 +08:00
Angus Gratton
21c7fc624a Merge branch 'bugfix/encrypted_partition_flag' into 'master'
Use PART_FLAG_ENCRYPTED value in gen_esp32part.py

Currently paritions marked as encrypted by gen_esp32part.py are not
recognized as such and encrypted writes don't work.

This is part of espressif/esp-idf#253

Merges Pull Request #293 https://github.com/espressif/esp-idf/pull/293

See merge request !470
2017-01-27 08:34:08 +08:00
Angus Gratton
aaa891ada9 Merge branch 'feature/custom_partition_table_csv_path' into 'master'
Allow providing custom PARTITION_TABLE_CSV_PATH

Provide direct absolute path to CSV, without project_path

Github pull request #296: https://github.com/espressif/esp-idf/pull/296

See merge request !469
2017-01-27 08:33:41 +08:00
Angus Gratton
a4c76671c2 Merge branch 'bugfix/spi_multiple_cs_fix' into 'master'
Add missing variable initialisation to make SPI work for multiple CS

Ref https://github.com/espressif/esp-idf/pull/277
From PR: "I am not especially familiar with this platform or with esp-idf -- so review with care.

The spi-master driver would not work for me when the number of devices on a bus exceeded 1 (caused device hang). I believe this is because cur_cs is not properly set (anywhere), and yet is used. This is likely just not noticed because 0 is presumably the correct value when there's only 1 device (and I'm guessing multi-device setup is not tested as thoroughly).

Simply setting cur_cs to the correct slot value resolves the problem and multiple devices on a single bus behave correctly in my test environment."

Looks like a small oversight on my side.

See merge request !468
2017-01-27 08:33:16 +08:00
Alexey Gerenkov
f512923791 esp32: Fixed search path for esptool 2017-01-26 19:28:13 +03:00
Angus Gratton
b6a2329f0f FreeRTOS: esp_crosscore_int_send_yield() should be in IRAM
Possible for xQueueGenericSendFromISR -> xTaskRemoveFromEventQueueList
-> taskYIELD_OTHER_CORE code path to occur while cache is off.
2017-01-26 18:53:02 +11:00
Angus Gratton
eea2788f5a OTA: Fix issues with encrypted OTA
- OTA source can write non-16-byte multiples of data
- Assumption that empty ota_data is 0xFFFFFFFF untrue when encrypted
2017-01-26 18:52:35 +11:00
Liu Zhi Fu
385c61e183 esp32: udpate wifi lib to fix two datapath issues
1. fix ampdu<->mpdu<->ampdu switch may cause rx slow issue by put mpdu into ampdu reorder queue
2. fix each ac first sending always fail issue by adding retry
2017-01-26 15:35:04 +08:00
Angus Gratton
d8aae55eeb Flash encryption: Temporary fix for issue with stale cache reads
Seems doing certain kinds of short reads while flash encryption is
enabled will return stale data. This fixes it, but is probably a
little heavy-handed performance wise.
2017-01-26 18:29:18 +11:00
Angus Gratton
67336672bd OTA: Improve verification of OTA image before writing, incl. secure boot
Verify 0xE9 magic byte on first write, verify entire image before
switching.

Enable verification for secure boot signature (was using invalid ifdef
guard)
2017-01-26 16:20:06 +11:00
Angus Gratton
813395adcb OTA: Fall back to factory partition if ota data partition is invalid 2017-01-26 16:20:06 +11:00
Tian Zhong Xing
2173ad3b45 bootloader_support: fix bug OTA & flash encryption incompatible
ota data partition should be encrypted unconditionally when flash encrypt enable
2017-01-26 16:20:06 +11:00
Dong Heng
93395a3370 components/openssl: Add more debugging information at platform level 2017-01-26 10:12:58 +08:00
Deomid Ryabkov
4f7e4dd0f5 Use PART_FLAG_ENCRYPTED value in gen_esp32part.py
Currently paritions marked as encrypted by gen_esp32part.py are not
recognized as such and encrypted writes don't work.

This is part of espressif/esp-idf#253
2017-01-26 12:27:00 +11:00
Dermot Duffy
33500f2561 Add missing variable initialisation.
Signed-off-by: Jeroen Domburg <jeroen@espressif.com>
2017-01-25 21:41:45 +08:00
Jiang Jiang Jian
32ad1e676d Merge branch 'lwip/optimize_dhcpc_taken_time' into 'master'
lwip: optimize the dhcp client

1. modify the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s.
2. add DHCP_DOES_ARP_CHECK to menuconfig for users to specify if do a ARP check on the offered address.
   If enable, one more second will be taken.

See merge request !459
2017-01-25 21:39:17 +08:00
Ivan Grokhotkov
8e467801bc Merge branch 'bugfix/btdm_debug_gatt_attr_table' into 'master'
component/bt: Fix Gatt table read_req bug and advertising channel 39 not available bug

1. Fix Gatt table read request bug
2. Fix advertising channel 39 not available bug

See merge request !463
2017-01-25 11:48:09 +08:00
Island
c6bb239f0c component/bt: Fix Gatt table read_req bug and advertising channel 39 not available bug 2017-01-25 11:18:26 +08:00
Deomid Ryabkov
74f78540ae Allow providing custom PARTITION_TABLE_CSV_PATH
Provide direct absolute path to CSV, without project_path
2017-01-25 00:30:29 +00:00
Dong Heng
1d0c909daf components/openssl: fixes for github issues 219
"SSL_write" doesn't send large buffers correctly
2017-01-24 17:36:32 +08:00
qiyueixa
03e3b137bf lwip: optimize the dhcp client
1. modify the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s.
2. add DHCP_DOES_ARP_CHECK to menuconfig for users to specify if do a ARP check on the offered address.
   If enable, one more second will be taken in obtaining IP address.
3. update wifi libs
2017-01-23 13:44:34 +08:00
Angus Gratton
d4462664b7 spi_flash: Move FLASH_PAGE_SIZE constant into esp_spi_flash.h 2017-01-20 19:50:01 +08:00
Angus Gratton
14aa1d1b3e docs: spi_flash: Add flash encryption ops, remove boilerplate 2017-01-20 19:50:01 +08:00
Angus Gratton
adc590ff69 spi_flash_write_encrypted: Allow 16-byte aligned block writes
As each 32 byte write has two identical 16 byte AES blocks, it's
possible to write them separately.
2017-01-20 19:48:46 +08:00
Angus Gratton
36ccdee6ec spi_flash: Flush flash cache if flash_mmap()ing a written-to page
Without this, it's possible for stale information to be read from
cache via mmap, even if the MMU table entry had been invalidated
prior to writing flash (if  the same MMU table entry was re-used after
writing flash.)
2017-01-20 19:48:46 +08:00
Angus Gratton
95c150fe2c spiflash: Add spi_flash_read_encrypted() function 2017-01-20 19:48:46 +08:00
Ivan Grokhotkov
374d03093c Merge branch 'bugfix/misc_fixes' into 'master'
Misc fixes (including Github PRs)

Collection of single commit fixes, including several from Github.

See merge request !457
2017-01-20 17:53:12 +08:00
Ivan Grokhotkov
632bd0bb4f Merge branch 'feature/docs_gh_link_roles' into 'master'
docs: use custom roles to generate GitHub links

This change replaces direct links to GitHub master branch with
auto-generated links using docutils custom roles.
These auto-generated links point to the tree or blob for the git commit
ID (or tag) of the repository. This is needed to ensure that links don’t
become broken when files in master branch are moved around or deleted.

The following roles are introduced:

```
- :idf:`path` - points to directory inside ESP-IDF
- :idf_blob:`path` - points to file inside ESP-IDF
- :idf_raw:`path` - points to raw view of the file inside ESP-IDF
- :component:`path` - points to directory inside ESP-IDF components dir
- :component_blob:`path` - points to file inside ESP-IDF components dir
- :component_raw:`path` - points to raw view of the file inside ESP-IDF
  components dir
- :example:`path` - points to directory inside ESP-IDF examples dir
- :example_blob:`path` - points to file inside ESP-IDF examples dir
- :example_raw:`path` - points to raw view of the file inside ESP-IDF
  examples dir
```

A check is added to the CI build script, which searches RST files for
presence of hard-coded links (identified by tree/master, blob/master,
or raw/master part of the URL).
This check can be run manually: cd docs && make gh-linkcheck

Additionally, Sphinx linkcheck build type is used to create new CI test,
which check for broken links. This test has to be triggered explicitly,
because including it in normal build process (when the commit is not yet
deployed to Github) will not work. It can be triggered in a regular
fashion using a combination of cron and Curl, similar to stress tests.

See merge request !455
2017-01-20 17:47:34 +08:00
Ivan Grokhotkov
15072028c4 docs: use custom roles to generate GitHub links
This change replaces direct links to GitHub master branch with
auto-generated links using docutils custom roles.
These auto-generated links point to the tree or blob for the git commit
ID (or tag) of the repository. This is needed to ensure that links don’t
become broken when files in master branch are moved around or deleted.

The following roles are introduced:

- :idf:`path` - points to directory inside ESP-IDF
- :idf_blob:`path` - points to file inside ESP-IDF
- :idf_raw:`path` - points to raw view of the file inside ESP-IDF
- :component:`path` - points to directory inside ESP-IDF components dir
- :component_blob:`path` - points to file inside ESP-IDF components dir
- :component_raw:`path` - points to raw view of the file inside ESP-IDF
  components dir
- :example:`path` - points to directory inside ESP-IDF examples dir
- :example_blob:`path` - points to file inside ESP-IDF examples dir
- :example_raw:`path` - points to raw view of the file inside ESP-IDF
  examples dir

A check is added to the CI build script, which searches RST files for
presence of hard-coded links (identified by tree/master, blob/master,
or raw/master part of the URL).
This check can be run manually: cd docs && make gh-linkcheck

Additionally, Sphinx linkcheck build type is used to create new CI test,
which check for broken links. This test has to be triggered explicitly,
because including it in normal build process (when the commit is not yet
deployed to Github) will not work. It can be triggered in a regular
fashion using a combination of cron and Curl, similar to stress tests.
2017-01-20 17:22:47 +08:00
wangmengyang
2c87e84b0a component/bt: bluetooth storage module clean up and bug fix.
1. clean up bluetooth storage log prints;
2. reduce maximum link key storage size
3. modify so that the link key information of the latest connected device is stored at first
2017-01-20 16:46:10 +08:00
Angus Gratton
fab35cb307 Merge branch 'feature/esptool_v20_beta' into 'master'
Update esptool.py to v2.0-beta1

* Minor bug fixes, no major functionality changes from the esp-idf perspective.
* Now tracks master branch of esptool repo (finally!)
* Supports Python 3, although our other esp-idf Python tools don't yet support Python 3.

See merge request !396
2017-01-20 15:45:03 +08:00
Dermot Duffy
6f3f3bb30c Add missing bit from LEDC interrupt state struct.
Resolves #191 https://github.com/espressif/esp-idf/pull/191
2017-01-20 14:57:24 +11:00
Jan Schmidt
a14f22f65b netconn_gethostbyname: Fix race reporting success
If the DNS request is dispatched and performed very quickly,
then it can complete before tcpip_callback() actually returns,
in which case we'll destroy the actual err_t error value passed
in the message. Use a local variable for the tcpip_callback
error code so that can't happen.

Resolves #269 https://github.com/espressif/esp-idf/pull/269
2017-01-20 14:57:00 +11:00
Jan Schmidt
ac412feb69 gpio: Attach gpio intr to the isr_server on the right core.
Make sure GPIO interrupts get attached to the core that
the ISR service routine is running on, otherwise they
don't arrive.
2017-01-20 14:56:59 +11:00
Angus Gratton
b022232e84 esp_panic.h: Add C++ include guards 2017-01-20 14:56:59 +11:00
Angus Gratton
0b257cfcef bt: esp_ble_gatts_send_indicate: Fix description 2017-01-20 14:56:54 +11:00
Jiang Jiang Jian
0fca7769e8 Merge branch 'bugfix/ethernet_flow_control' into 'master'
ethernet: limit rx buf num when flow ctrl enable.



See merge request !452
2017-01-19 22:16:40 +08:00
Jiang Jiang Jian
aea18f6e74 Merge branch 'feature/btdm_raw_adv' into 'master'
Feature/btdm raw adv

Add APIs to set raw advertising data and scan response data by user self.

See merge request !451
2017-01-19 18:57:39 +08:00
Liu Zhi Fu
12b1c99962 esp32: update wifi lib to fix ap not respond BA bug
Currently softap doesn't respond BA when receiving AMPDU, this fix is to fix this bug
2017-01-19 18:01:32 +08:00
Tian Hao
0073ff3acd component/bt : add api to set raw adv_data/scan_rsp_data
1. add api to set raw scan response data
2. add api to set raw scan response data
3. update doxygen
4. add menuconfig to config gatt server demo
2017-01-19 17:36:40 +08:00
wangmengyang
0f711963d7 component/bt: implement non-volatile memory access module for link key storage
1. btif_storage module is ported
2. update controller library that moves functions called in ISRs to IRAM
2017-01-19 17:11:01 +08:00
shangke
2ea4d7fd02 ethernet: limit rx buf num when flow ctrl enable. 2017-01-19 16:45:30 +08:00
wangmengyang
36a74daa0a component/bt: clean up AVRCP API and example code 2017-01-19 15:23:46 +08:00
Ivan Grokhotkov
7eb570b039 Merge branch 'bugfix/phy_auto_init' into 'master'
Move PHY options out of WiFi config, improve descriptions

- move PHY-related settings into new menu, make it dependent on WIFI_ENABLED || BT_ENABLED

- improve descriptions of Ethernet Kconfig options


See merge request !443
2017-01-19 13:27:17 +08:00
Ivan Grokhotkov
b1df4c47f9 kconfig: define ESP32_PHY_MAX_TX_POWER if PHY_ENABLED
ESP32_PHY_MAX_TX_POWER option is only meaningful for WiFi, so previous
change made it depend on WIFI_ENABLED. However if WiFi is not enabled,
but BT is, this option becomes undefined which breaks phy_init_data
generation.

This change turns ESP32_PHY_MAX_TX_POWER into a hidden parameter, which
depends on PHY_ENABLED. New user-visible parameter,
ESP32_PHY_MAX_WIFI_TX_POWER is introduced which depends on WIFI_ENABLED
and is used as default value for ESP32_PHY_MAX_TX_POWER if WIFI_ENABLED
is set. Otherwise ESP32_PHY_MAX_WIFI_TX_POWER is set to 20.
2017-01-19 10:58:09 +08:00
Ivan Grokhotkov
12e3992ae2 Merge branch 'bugfix/console_uart_none' into 'master'
Fix compilation if CONSOLE_UART is set to NONE

CONFIG_CONSOLE_UART_BAUDRATE is not defined

See merge request !445
2017-01-19 10:18:33 +08:00
Ivan Grokhotkov
1ebf907658 Merge branch 'bugfix/lwip_tcpip_printf' into 'master'
TCPIP: Do not printf if debug level is not correct



See merge request !448
2017-01-19 10:18:12 +08:00
Ivan Grokhotkov
9ae3ecc72c Merge branch 'bugfix/dhcp_debug_printf' into 'master'
DHCP: Do not printf if debug is not enabled



See merge request !447
2017-01-19 10:17:53 +08:00
Ivan Grokhotkov
a6b163c954 Merge branch 'bugfix/frc1_timer_clear' into 'master'
newlib: fix register used for DPORT/RTC bug workaround

While there was no register at DR_REG_FRC_TIMER_BASE + 0x60, due to
peripheral address space wraparound this write actually affected one of
FRC2 registers, which is used by WiFi stack to implement legacy
ets_timer APIs.
This change uses FRC_TIMER_LOAD_REG(0) instead, which can be set to
known value safely.

See merge request !449
2017-01-19 10:17:36 +08:00
Ivan Grokhotkov
7c155ab647 Merge branch 'bugfix/flash_op_unpinned_task' into 'master'
fixes for issues observed when using spi_flash

This MR fixes three unrelated issues:

- Race condition in spi_flash_enable_interrupts_caches_and_other_cpu
  when operations on unpinned tasks are performed.
  The issue is reported in https://github.com/espressif/esp-idf/pull/258

- esp_intr_noniram_disable doesn’t disable interrupts when compiled in
  release mode. This issue manifested itself with an illegal instruction
  exception when task WDT ISR was called at the time when flash was
  disabled.
  Fixes https://github.com/espressif/esp-idf/issues/263.

- Tick hooks on CPU1 were not called if CPU0 scheduler was disabled for
  significant amount of time (which could happen when doing flash erase).
  The issue manifested itself as “INT WDT timeout on core 1” error.
  Fixes https://github.com/espressif/esp-idf/issues/219.

See merge request !441
2017-01-19 10:14:34 +08:00
Angus Gratton
9a8a82e857 phyinit: Use PHY config to enable, don't need phy_get_romfunc_addr to init 2017-01-19 11:18:44 +11:00
Ivan Grokhotkov
90c43ea95e newlib: fix register used for DPORT/RTC bug workaround
While there was no register at DR_REG_FRC_TIMER_BASE + 0x60, due to
peripheral address space wraparound this write actually affected one of
FRC2 registers, which is used by WiFi stack to implement legacy
ets_timer APIs.
This change uses FRC_TIMER_LOAD_REG(0) instead, which can be set to
known value safely.
2017-01-19 00:36:30 +08:00
Ivan Grokhotkov
efbd2805e2 ethernet: improve kconfig option descriptions
Also limit suggested EMAC task priority range to 22, as the top priority
should be used only by IPC tasks.
2017-01-19 00:32:10 +08:00
Tian Hao
97e3c0fec4 kconfig: move PHY-related settings into new menu
- PHY options must be shown when either WIFI or BT is enabled.

- Add clarification that TX power option applies to WiFi only.
2017-01-19 00:30:20 +08:00
Ivan Grokhotkov
31ec0a7c44 freertos: call tick hooks on CPU1 even if CPU0 scheduler is suspended
The block which dispatches ticks on CPU1 was a copy of the code block
for the normal path (CPU0). It used to check uxPendedTicks, with the
logic that uxPendedTicks can be 0 iff the scheduler is not suspended.

On CPU1 however, uxPendedTicks is not related to the state of the
scheduler (as uxPendedTicks is updated on CPU0). Due to this, if CPU0
scheduler was suspended, and uxPendedTicks happened to be nonzero,
tick hooks on CPU1 didn’t run, even though CPU1 scheduler was working.

This change removes the check for uxPendedTicks in CPU1 code path,
so that the tick hooks on CPU1 always get called (as for the CPU0 code
path).
2017-01-18 23:19:05 +08:00
me-no-dev
d3a2d6aedc Do not printf if debug level is not correct 2017-01-18 16:13:09 +02:00
me-no-dev
26015f5d88 Do not printf if debug is not enabled 2017-01-18 16:06:54 +02:00
me-no-dev
865b21d5a1 Fix compilation if CONSOLE_UART is set to NONE
CONFIG_CONSOLE_UART_BAUDRATE is not defined
2017-01-18 15:36:10 +02:00
XiaXiaotian
0564263e5b tw7809: fix station no rewiring softap probability 2017-01-18 20:17:03 +08:00
Ivan Grokhotkov
3128f2b004 Merge branch 'bugfix/partition_write_encrypted' into 'master'
Allow writes to encrypted partitions

There is a size alignment requirement but it is checked by
spi_flash_write_encrypted. However, this check flat-out bans encrypted
writes.

Original PR on Github: https://github.com/espressif/esp-idf/pull/249

See merge request !432
2017-01-18 18:32:03 +08:00
Ivan Grokhotkov
f7e2e456e4 intr_alloc: mark inline asm operand as earlyclobber
When compiling in release mode, compiler was choosing same register for
oldint and intmask variables, so INTENABLE was never modified.
This effectively broke disabling of non-IRAM interrupts during flash
operations, observed in the existing tests if task watchdog is enabled.
This change adds an extra constraint tells the compiler that output
operand should not be placed into the same register as an input one.
2017-01-18 18:31:06 +08:00
Jiang Jiang Jian
680a0d1306 Merge branch 'bugfix/btdm_isr_cache' into 'master'
component/bt : move some codes of controller to iram

1. mv codes which called by isr into iram
2. mv libcoexist.a into iram

See merge request !442
2017-01-18 17:38:55 +08:00
antti
0501507d6b CI: add script for parsing unit test cases for CI from test files
Add python script that parses list of unit test cases for CI from component test folder

Modify .gitlab-ci.yml to run this script as part of build unit tests stage
2017-01-18 17:08:20 +08:00
antti
f8b5c29346 esp32: add [ignore] tag to some unit test cases for CI
Add ignore tag on unit test cases that are not supported in CI yet
2017-01-18 17:08:20 +08:00
Tian Hao
2bb67985dc component/bt : move some codes of controller to iram
1. mv codes which called by sir into iram
2. mv libcoexist.a into iram
2017-01-18 16:38:06 +08:00
Jiang Jiang Jian
6e2e456d62 Merge branch 'bugfix/btdm_minor_misc' into 'master'
component/bt : fix gatt server table bugs

1. fix gatt server table bugs
2. fix blufi a minor bugs
3. fix example minor mistakes

See merge request !438
2017-01-18 16:14:50 +08:00
Ivan Grokhotkov
4676d159ad spi_flash: fix race condition when doing operations in unpinned tasks
spi_flash_enable_interrupts_caches_and_other_cpu function used to enable
non-IRAM interrupts after giving up flash operation lock, which would
cause problems if another task was waiting on the lock to start a flash
operation. In fact, non-IRAM interrupts should be re-enabled before the
task scheduler is resumed. Otherwise non-pinned task can be moved to the
other CPU due to preemption, causing esp_intr_noniram_enable to be
called on the other CPU, causing an abort to be triggered.

Fixes the issue reported in
https://github.com/espressif/esp-idf/pull/258
2017-01-18 15:07:27 +08:00
Ivan Grokhotkov
557dafda07 Merge branch 'bugfix/high_timer_int' into 'master'
Delete option to select core timer 2 as a FreeRTOS tick source

Core timer 2 is unusable for FreeRTOS ticks because it triggers a high-level interrupt. This MR deletes the option to select it.

Ref https://github.com/espressif/esp-idf/issues/234

See merge request !418
2017-01-18 10:31:03 +08:00
Wu Jian Gang
0bbc60618b Merge branch 'feature/add_get_idf_version_api' into 'master'
Add get idf version API

This is same as IDF_VER.

See merge request !435
2017-01-18 09:44:53 +08:00
Tian Hao
5508826509 component/bt : fix gatts demo mistakes & unpeg notify bug 2017-01-17 20:13:25 +08:00
Tian Hao
799be9fa3a component/bt : fix gatt server table bugs
1. fix gatt server table bugs
2. fix blufi a minor bug
2017-01-17 18:42:11 +08:00
Wu Jian Gang
3c8235d40d lwip: Allow config TCP_MAXRTX & TCP_SYNMAXRTX in menuconfig 2017-01-17 17:44:25 +08:00
Wu Jian Gang
f4d5d151aa esp32: add get idf version api 2017-01-17 16:52:42 +08:00
Ivan Grokhotkov
df2dc908f0 Merge branch 'bugfix/btdm_flash_operation' into 'master'
component/bt : update bt lib to fix flash operation bug

update bt lib to fix flash write bug when bt interrupt happened.

See merge request !434
2017-01-17 15:12:23 +08:00
Ivan Grokhotkov
ce8ec337eb Merge branch 'bugfix/release_build' into 'master'
Release build related fixes

- Fix (non-)inlining issue with `spi_flash_guards_` functions in release mode
- Fix assert-related warnings generated in release mode by changing assert definition

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

See merge request !428
2017-01-17 14:24:14 +08:00
Tian Hao
f9ac7657e3 component/bt : update bt lib to fix flash operation bug 2017-01-17 13:51:44 +08:00
Deomid Ryabkov
71ab455c87 Allow writes to encrypted partitions
There is a size alignment requirement but it is checked by
spi_flash_write_encrypted. However, this check flat-out bans encrypted
writes.
2017-01-17 12:32:01 +08:00
Ivan Grokhotkov
7776d3e065 time: only define {get,set}_boot_time if FRC1 or RTC is used as time source
Fixes https://github.com/espressif/esp-idf/issues/238
2017-01-17 12:29:09 +08:00
Ivan Grokhotkov
8c25a0fd9d time: workaround for FRC_TIMER_INT_REG write issue
In some cases (when RTC register reads are performed from the APP CPU), a write to FRC_TIMER_INT_REG may be lost on the bus.
Writing to another DPORT register immediately before or after that works around the issue.
We write one dummy value to an address which doesn’t have any register associated with it.

Fixes https://github.com/espressif/arduino-esp32/issues/120
2017-01-17 12:29:09 +08:00
wangmengyang
49b68c38fa Merge branch 'master' into feature/btdm_avrc
# Conflicts:
#	components/bt/bluedroid/hci/packet_fragmenter.c
#	components/bt/bluedroid/stack/include/gatt_api.h
2017-01-17 10:36:26 +08:00
Dong Heng
905180667c components/openssl: refactor openssl debugging and assert function
1. add openssl option at menuconfig
2. remove SSL_ERR to reduce complexity
3. add more functions about debugging and assert

According these, our coders and customers may use and debug the OpenSSL code easily.
2017-01-17 10:15:26 +08:00
Ivan Grokhotkov
c47cc63489 newlib: change definition of assert for release builds
One common pattern of using assert function looks as follows:
    int ret = do_foo();
    assert(ret == 0);   // which reads as: “do_foo should never fail here, by design”
The problem with such code is that if ‘assert’ is removed by the preprocessor in release build,
variable ret is no longer used, and the compiler issues a warning about this.
Changing assert definition in the way done here make the variable used, from language syntax perspective.
Semantically, the variable is still unused at run time (as sizeof can be evaluated at compile time), so the compiler
can optimize things away if possible.
2017-01-17 00:49:38 +08:00
Ivan Grokhotkov
075446318d spi_flash: define spi_flash_guard_{start,stop} with IRAM_ATTR
These functions are marked as inline and are called from functions which are in IRAM.
In release (-Os) builds, the compiler may decide not to inline these functions.
Placing these functions into IRAM explicitly works around this.
2017-01-17 00:42:55 +08:00
Wu Jian Gang
dd8681d8fc Merge branch 'bug/fix_some_wifi_lib_bugs' into 'master'
update wifi lib: fix some wifi lib bugs

1. net80211: fix get ap info error(a4614877)

2. tw9358: sta mac same with softap(ea38d32c)

3. tw9221: scan channel error when connected(183d469c)

See merge request !425
2017-01-16 18:57:02 +08:00
XiaXiaotian
3684e6ddfd update wifi lib: fix some wifi lib bugs
1. net80211: fix get ap info error(a4614877)

2. tw9358: sta mac same with softap(ea38d32c)

3. tw9221: scan channel error when connected(183d469c)
2017-01-16 17:20:05 +08:00
shangke
53b0b03e63 esp_event: event stack overflow 2017-01-16 17:06:12 +08:00
Ivan Grokhotkov
0d00a1ba01 vfs: implement reading from UART 2017-01-16 11:33:32 +08:00
Ivan Grokhotkov
7f751fd0fe Merge branch 'bugfix/i2s_bootloader_random_disable' into 'master'
bootloader_random_disable: Restore all SARADC/I2S registers to defaults

Fix for issue with I2S0 not being usable after bootloader_random_enable()

See merge request !415
2017-01-16 10:40:58 +08:00
Ivan Grokhotkov
6538252552 Merge branch 'bugfix/panic_reset_hangs' into 'master'
Panic handler: Use same reset path as esp_restart(), disabling hardware

Closes #223 https://github.com/espressif/esp-idf/issues/223

See merge request !417
2017-01-16 10:40:47 +08:00
Ivan Grokhotkov
72da7aa53b Merge branch 'bugfix/fixes_from_github' into 'master'
fixes for github issues

This MR includes commits from several Github PRs, as well some fixes for issues reported on Github and on the forum.

- compile PHY-related code only when WiFi is enabled
- fix macOS setup instructions
- fix some of the Sphinx warnings
- update docs index, improve structure of the readme-
- wifi: fix typos, rename ESP_ERR_WIFI_NOT_START to ESP_ERR_WIFI_NOT_STARTED
- sdmmc: fix explanation of flash voltage regulator configuration efuses
- sdmmc: change idx num of example
- fix i2c_get_period name
- fix esp_log_level_set function name in docs

See merge request !420
2017-01-16 10:26:58 +08:00
Angus Gratton
ea19838d3a Build: Handle WiFi & BT enabled/disabled combos gracefully as possible
If using WIFI_INIT_CONFIG_DEFAULT, error message will point out lack
of WiFi. Otherwise linker errors on WiFi symbols should help give a
clue as to what is broken.

Piggy-backs on changes in !420, ref github #230 #237
2017-01-16 13:03:17 +11:00
Ivan Grokhotkov
27711b7c22 Merge branch 'bugfix/compact_panic' into 'master'
Fix panic register dump format

Fix misplaced a printf somewhere causing an enter to be printed after every register in the panic regdump instead of every 4th register.

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

See merge request !419
2017-01-16 09:28:40 +08:00
Ivan Grokhotkov
f20135af54 esp32: compile PHY-related code only when WiFi is enabled
Fixes https://github.com/espressif/esp-idf/issues/230, https://github.com/espressif/esp-idf/issues/237
2017-01-16 02:38:32 +08:00
Neil Kolban
3efbbab2cf wifi: fix typos, rename ESP_ERR_WIFI_NOT_START to ESP_ERR_WIFI_NOT_STARTED 2017-01-16 02:38:31 +08:00
devsaurus
d8fb30c930 i2c: fix i2c_get_period name
rename i2s_get_period to i2c_get_period
2017-01-16 02:37:10 +08:00
Lourens Naudé
a8b75ed974 log: fix esp_log_level_set function name in docs
Fix documentation and comments to reflect the new esp_log_level_set API (and not deprecated esp_log_set_level)
2017-01-16 02:37:10 +08:00
Jeroen Domburg
08f11e4c53 Fix panic register dump format 2017-01-15 16:49:18 +08:00
Jeroen Domburg
3168ad10e7 Core timer 2 is unusable for FreeRTOS ticks because it triggers a high-level interrupt. This commit deletes the option to select it. 2017-01-15 11:11:58 +08:00
me-no-dev
dd3f18d2d8 Initial mDNS component and example 2017-01-13 12:12:43 +02:00
Ivan Grokhotkov
ca9f62ad77 Merge branch 'feature/esp32_core_dump' into 'master'
esp32 core dump to flash

1.  menuconfig option to select where to store core dump: flash, uart or disable
2. Saving of core dump to flash
3. Partition table definitions files with core dump partition
4. Python scripts to support core dump generation from GDB command line

See merge request !341
2017-01-13 11:51:40 +08:00
Angus Gratton
e53d307814 Panic handler: Use same reset path as esp_restart(), disabling hardware
Closes #223 https://github.com/espressif/esp-idf/issues/223
2017-01-13 14:37:36 +11:00
Angus Gratton
7d40f17d1d bootloader_random: Restore all SARADC/I2S registers to reset values
Fix for issue with I2S0 not being usable after bootloader_random_enable()
2017-01-13 12:19:13 +11:00
Alexey Gerenkov
ad66fbe5ad esp32: Fixes issues discussed during code review of MR!341
The following issues mentioned during MR!341 review were fixed:
1) Core dump test application description
2) Usage of CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH and CONFIG_ESP32_ENABLE_COREDUMP_TO_UART
3) FLASH_GUARD_START macro usage is fixed in flash API
4) Core dump module logging facility
5) cache util functions doc updated
6) interactive delay before print core dump to uart
7) core dump partion support in build system
2017-01-12 19:38:19 +03:00
XiaXiaotian
6eedbfa9be tw9503: fix ets timer crash bug
1. tw9503: call ets_timer_disarm before calling ets_timer_setfn

2. change CHECK_AP_CONN to CHECK_STA_CONN
2017-01-12 20:43:59 +08:00
Wu Jian Gang
9052c6e9ee Merge branch 'bugfix/btdm_adv_stop' into 'master'
component/bt : fix adv stop bug

fix advertising cannot stop bug.

See merge request !412
2017-01-12 17:32:09 +08:00
Wu Jian Gang
ad1790fe3e Merge branch 'feature/btdm_attr_table' into 'master'
component bt:Added the create attribute table method to the new API

GATT Server service table APIs.
Have already modify the style and other things as @jeroen  suggestion in other MR(the MR have been closed)

See merge request !399
2017-01-12 17:31:39 +08:00
Tian Hao
1895460406 component/bt : fix adv stop bug 2017-01-12 16:29:07 +08:00
Tian Hao
fec2f534d5 component/bt : gatt server table fix uuid discovery bug 2017-01-12 16:25:09 +08:00
Tian Hao
142756615b component/bt : mv demo name
1. mv demo name
2. fix a docs
2017-01-12 14:44:26 +08:00
Ivan Grokhotkov
b24ac487cb newlib: use RTC_STORE registers to keep boot time instead of RTC_SLOW_MEM
This allows RTC_SLOW_MEM to be powered down in deep sleep if no other variables are placed into RTC_SLOW_MEM.
2017-01-12 14:43:34 +08:00
Ivan Grokhotkov
9aa0e29079 deep sleep: keep RTC_SLOW_MEM powered on if data is placed into RTC slow memory 2017-01-12 14:15:30 +08:00
Ivan Grokhotkov
e4811216ff deep sleep: fix regression due to moving ets_update_cpu_frequency into IRAM
Deep sleep stub may call ets_update_cpu_frequency, which has been moved from ROM to IRAM.
Restore the ROM version in the linker script, call it ets_update_cpu_frequency_rom, use it in the deep sleep stub.
2017-01-12 14:15:25 +08:00
Jiang Jiang Jian
d3a0580bef Merge branch 'bugfix/btdm_dualcore_tmp_solution' into 'master'
component/bt : modify bluedroid task to core0

use tmp solution to resolve the dual core bug.

Run bluedroid all task on core0.

See merge request !408
2017-01-12 11:50:18 +08:00
Jiang Jiang Jian
2126f6c8b7 Merge branch 'feature/wpa2_example' into 'master'
wpa2 enterprise: add example for wpa2 enterprise



See merge request !410
2017-01-12 11:49:52 +08:00
Island
9f151d745e component/bt : Optimize Gatt attr table and fix some bugs
1. Optimize GATT attribute table structure
2. fix read/write bugs
3. add docs
2017-01-12 11:49:15 +08:00
Ivan Grokhotkov
aece3d6fc6 Merge branch 'bugfix/mbedtls_tests' into 'master'
fix mbedtls unit tests, fix IDF_VER when building a project outside ESP-IDF tree

- mbedTLS test needs about 5% more time to run (in debug mode) when building with 5.2.0, compared to 4.8.5. Increase the timeout to let the test pass.
- when doing `git describe` in IDF_VER definition, `-C $(IDF_PATH)` is needed to get the version of ESP-IDF, and not the project being built (which may not even be in git)

See merge request !411
2017-01-12 09:47:15 +08:00
Alexey Gerenkov
50b3ce616f esp32: Adds documentation and comments to core dump feature files 2017-01-11 20:51:28 +03:00
Alexey Gerenkov
39ddc7b836 esp32: Fixes several issues in core dump feature
1) PS is fixed up to allow GDB backtrace to work properly
2) MR!341 discussion: in core dump module: esp_panicPutXXX was replaced by ets_printf.
3) MR!341 discussion: core dump flash magic number was changed.
4) MR!341 discussion: SPI flash access API was redesigned to allow flexible critical section management.
5) test app for core dump feature was added
6) fixed base64 file reading issues on Windows platform
7) now raw bin core file is deleted upon core loader failure by epscoredump.py
2017-01-11 20:51:28 +03:00
Alexey Gerenkov
23f836659d esp32: Add core dump printing to UART feature 2017-01-11 20:51:28 +03:00
Alexey Gerenkov
4a3e160888 esp32: Add core dump saving to flash feature
Complimentary changes:
1) Partition table definitions files with core dump partition
2) Special sub-type for core dump partition
3) Special version of spi_flash_xxx
4) espcoredump.py is script to get core dump from flash and print useful info
5) FreeRTOS API was extended to get tasks snapshots
2017-01-11 20:51:28 +03:00
XiaXiaotian
ff4a5a1406 wpa2 enterprise: add example for wpa2 enterprise 2017-01-11 21:56:17 +08:00
Ivan Grokhotkov
d6842e537c mbedtls: give SHA test slightly more time to run 2017-01-11 21:30:23 +08:00
Ivan Grokhotkov
5fbea86a9e Merge branch 'feature/config_wifi_bt' into 'master'
Clean up WiFi & Bluetooth config options

* Splits "WiFi" configuration out from ESP32 configuration submenu to its own menu.
* Renames "BT" to "Bluetooth", enabling Bluetooth is now in this option not the ESP32 submenu.

* Also disables compiling/linking of BT stack if Bluetooth is disabled, saves some build time.

See merge request !397
2017-01-11 18:38:30 +08:00
Ivan Grokhotkov
8eb9f947e8 Merge branch 'feature/toolchain_update' into 'master'
update toolchain version, rebuild newlib

- This MR updates the toolchain version used in the ESP-IDF
- Compiler version check and warning is added to project.mk
- Newlib is rebuilt to include wcsftime function
- libstdc++ build uses correct newlib headers (so we won't get undefined reference to `__impure_ptr` anymore)

See merge request !387
2017-01-11 18:37:45 +08:00
Wu Jian Gang
61da8595ca Merge branch 'bugfix/fix_remove_wifi_auto_reconnect' into 'master'
esp32: fixs about auto-reconnect and ap ssid configuration

1. Remove auto-reconnect
2. Use strnlen instead strlen to calculate ssid len in wifi lib

See merge request !407
2017-01-11 18:10:44 +08:00
XiaXiaotian
2d8a8bc141 esp32: fixs about auto-reconnect and ap ssid configuration
1. Remove auto-reconnect
2. Use strnlen instead strlen to calculate ssid len in wifi lib
2017-01-11 17:21:10 +08:00
Tian Hao
1eed54c7cd component/bt : modify bluedroid task to core0 2017-01-11 17:19:25 +08:00
Jeroen Domburg
8a2ff5a16d Merge branch 'bugfix/spi_inconsistencies' into 'master'
SPI: Some fixes to docs and flag naming

Kolban noticed the flags for a transaction are not named like the documentation states. The flags as mentioned in the docs are more consistent, so this MR renames them to that. Also some additions to the docs wrt the SPI signals

Ref http://www.esp32.com/viewtopic.php?f=13&t=919&p=3976#p3976 and http://www.esp32.com/viewtopic.php?f=13&t=921&p=3975#p3975

See merge request !398
2017-01-11 17:11:45 +08:00
Yulong
d512d6100c component bt:Added the create attribute table method to the new API 2017-01-11 16:57:19 +08:00
Jeroen Domburg
356e01545c Add test for spi clock, fix corner cases) 2017-01-11 16:13:33 +08:00
Jiang Jiang Jian
0c01ef68f1 Merge branch 'bugfix/id9562_unregistered_callback' into 'master'
component/bt: check for registration status of callback function before using it

Add checking of NULL function pointers when calling bluetooth callbacks, especially before the callback functions are registered

See merge request !406
2017-01-11 15:57:03 +08:00
Jiang Jiang Jian
478591b842 Merge branch 'feature/add_wpa2_set_id_api' into 'master'
add wpa2 set id api and modify null data tx description

1. wpa2: add wpa2 set id api

2. low rate: modify null data tx description

See merge request !402
2017-01-11 15:13:47 +08:00
Ivan Grokhotkov
f04e62e6cc cxx: add iostreams test
Checks that libstdc++ can use newlib IO functions
2017-01-11 15:03:14 +08:00
Ivan Grokhotkov
23448e7121 newlib: build with wcsftime function 2017-01-11 15:03:12 +08:00
Jiang Jiang Jian
63091a2358 Merge branch 'feature/ethernet_support_flow_control' into 'master'
ethernet: support flow control

(1) Only fullduplex mode support flow ctrl .

(2) Fix reboot exception which caused by not-reset EMAC hardware (such as DMA) when reset CPU.

See merge request !392
2017-01-11 14:51:43 +08:00
Jiang Jiang Jian
ae48cbd8c4 Merge branch 'bugfix/id9561_bt_status_check' into 'master'
component/bt: bug fix of lack of checking bluetooth stack status inside API functions

Add an API function for checking bluetooth stack status: whether it is uninitialized, initialized or enabled.
The function is intended to be used by users to check the bluetooth stack status, also, it is used inside bluetooth API functions to ensure the stack is in valid state.

See merge request !405
2017-01-11 14:38:43 +08:00
Jeroen Domburg
daa2b7cbc9 n, h and l actually are 6-bit; they go from 1 to 64. 2017-01-11 14:13:37 +08:00
wangmengyang
babeed4170 component/bt: change MACRO to inline function when invoking callbacks 2017-01-11 14:08:16 +08:00
wangmengyang
c592714679 component/bt: fix typos in "if" condition espressions 2017-01-11 13:36:48 +08:00
Jeroen Domburg
a98d07d650 Fix clock divider calculation 2017-01-11 13:01:48 +08:00
XiaXiaotian
b455b0246c add wpa2 set id api and modify null data tx description
1. wpa2: add wpa2 set id api

2. low rate: modify null data tx description
2017-01-11 12:13:11 +08:00
Ivan Grokhotkov
919bb747f8 Merge branch 'bugfix/crosscore_int_iram' into 'master'
Place cross-core interrupt into IRAM, sanity check handler address passed into esp_intr_alloc

Cross-core interrupt handler was not marked with IRAM_ATTR.

The reason why this caused an exception is probably due to some tasks running at highest priority (these are not blocked by spi_flash_disable_caches_interrupts_and_other_cpu mechanism).

This change puts the interrupt handler into IRAM and adds a sanity check into `esp_intr_alloc`.

Reported on Github: https://github.com/espressif/esp-idf/issues/211


See merge request !404
2017-01-11 12:07:43 +08:00
Ivan Grokhotkov
a2e0c2432e esp32: sanity check ISR handler address passed into esp_intr_alloc
Return ESP_ERR_INVALID_ARG if the handler is not in IRAM (or RTC fast memory)
2017-01-11 11:38:17 +08:00
Ivan Grokhotkov
8c26dd8d38 Merge branch 'feature/idf_version' into 'master'
build system: add IDF_VER environment variable and preprocessor define

This adds an `IDF_VER` preprocessor define which is obtained from `git describe`.

Looks like `v1.0-275-g0efaa4f` for non-release version or `v2.0` for a tagged (release) version.

See merge request !403
2017-01-11 11:34:28 +08:00
wangmengyang
0c31bdf643 component/bt: check for registration status of callback function before using it 2017-01-11 11:31:35 +08:00
Jeroen Domburg
ee59fa75f4 Rename SPI Master IO pins to more common terminology, add better explanation to queue_length initialization value 2017-01-11 11:25:56 +08:00
wangmengyang
59540eeae1 component/bt: bug fix of lack of checking bluetooth stack status inside API functions 2017-01-11 11:04:41 +08:00
Liu Han
6c86586e97 components/lwip: Set the ping target info
Add API for set the ping target info and get the ping result
2017-01-11 10:58:34 +08:00
Ivan Grokhotkov
833102cbf3 esp32: place cross-core interrupt handler into IRAM
esp_intr_alloc is called with ESP_INTR_FLAG_IRAM, so the ISR should be in IRAM.
2017-01-11 00:52:45 +08:00
Ivan Grokhotkov
89e0ecc272 build system: add IDF_VER environment variable and preprocessor define 2017-01-11 00:24:50 +08:00
shangke
2e06c6ba38 dhcp: fix dhcp err when wifi and ethernet coexist 2017-01-10 21:54:53 +08:00
shangke
0e701e1cac ethernet: support flow control 2017-01-10 15:19:18 +08:00
Jeroen Domburg
5eb8eb3855 SPI master: rename transaction flags from SPI_* to SPI_TRANS_*, like the documentation says. Also add some explanation about the SPI signals in the documentation 2017-01-10 14:41:12 +08:00
Jeroen Domburg
a3f6728797 Merge branch 'feature/watchpoint_on_stack_canary' into 'master'
Add option to automatically set a watchpoint at the end of the swapped-in task

This should make stack overflows easier to debug because it triggers a debug exception as soon as the stack is overwritten, not later when a context switch happens. Marked as a FreeRTOS debug feature because it doesn't give a nice error message and uses up a watchpoint.

See merge request !389
2017-01-10 14:01:07 +08:00
Wu Jian Gang
2927688eba Merge branch 'bugfix/tcpip_adapter_set_hostname' into 'master'
Fix tcpip_adapter_set_hostname issue

The default hostname for each interface is "espressif", users can call this API to change each interface's hostname.

See merge request !284
2017-01-10 13:59:22 +08:00
Angus Gratton
26d1a23308 config: Move WiFi & BT toggles to Components menu, same as Ethernet 2017-01-10 16:39:43 +11:00
Jeroen Domburg
881157e1ed Add documentation to panic handler functions, move watchpoint stuff from tasks.c to port.c, account for non-32-bytes-aligned stacks when setting watchpoint, add debug reason explanation to panic handler 2017-01-10 13:05:19 +08:00
Angus Gratton
2e78b397bc config: Simplify WiFi & Bluetooth config options
Removes redundant menu options, splits WiFi configuration out from
generic ESP32 configuration.
2017-01-10 16:04:04 +11:00
Ivan Grokhotkov
e9f8e03309 Merge branch 'feature/JSON_Float' into 'master'
Add float format process

Add float format process

See merge request !390
2017-01-10 13:01:43 +08:00
Liu Han
315b3f979f components/tcpip_adapter: Allow to set different hostname for each interface 2017-01-10 12:42:14 +08:00
Wu Jian Gang
fb70126bc8 Merge branch 'feature/openssl' into 'master'
examples/10_openssl_server: fixup SSL server with method of specific version

1. add method of any version supporting at OpenSSL and add API in header file
2. change OpenSSL server context method to be method of any version

Fixes http://esp32.com/viewtopic.php?f=14&t=696.

See merge request !369
2017-01-10 12:01:40 +08:00
Angus Gratton
c4b3f6bbbc Update esptool.py to v2.0-beta1
Minor bug fixes, no major functionality changes.
2017-01-10 14:04:54 +11:00
Angus Gratton
a54791846b coap: Initialise/update the libcoap submodule 2017-01-10 11:12:02 +11:00
Angus Gratton
b877216fef stdatomic.h: Include stdint.h, required for some limit types 2017-01-10 11:11:27 +11:00
Angus Gratton
433ff1474e WiFi software coexistence: Clarify KConfig description
Ref http://esp32.com/viewtopic.php?f=13&t=844&p=3576
2017-01-10 11:11:27 +11:00
Jiang Jiang Jian
f89de9c5af Merge branch 'feature/low_rate_change_ie' into 'master'
esp32:update wifi libs

1. low_rate: change low rate ie
2. modem sleep

See merge request !391
2017-01-09 21:14:40 +08:00
Wu Jian Gang
8615dbd486 Merge branch 'bugfix/autoip_enable_issue' into 'master'
lwip: fix compile issue when autoip option enabled



See merge request !383
2017-01-09 18:57:03 +08:00
qiyueixa
d5464074dd update wifi libs 2017-01-09 18:44:27 +08:00
Liu Han
5c1c6d2c32 cJSON:Add float format process 2017-01-09 17:51:48 +08:00
Jeroen Domburg
ca57a86f20 Add option to automatically set a watchpoint at the end of the swapped-in task 2017-01-09 16:42:45 +08:00
Jiang Jiang Jian
633cd49f88 Merge branch 'bugfix/detect_ocd_when_panic' into 'master'
Fix OpenOCD detection code

In the current master, detection of an attached OCD is broken. This fixes it.

I also snuck in two unrelated checks in intr_alloc which return from a function that is asserted earlier in the code. This makes the code behave better when they are called erroneously in a production build.

See merge request !377
2017-01-09 13:25:45 +08:00
Jeroen Domburg
11a994d5d8 Calling esp_intr_noniram_[en|dis]able twice is an error, so abort instead of doing an assert which disappears in non-debug mode 2017-01-09 12:04:21 +08:00
Jiang Jiang Jian
0106feeeda Merge branch 'feature/btdm_common_api' into 'master'
component/bt : add bt device api

1. add get bd_addr function

later, will add other functions reference with bluetooth device.

See merge request !380
2017-01-09 11:33:57 +08:00
Wu Jian Gang
9dd5f2a952 lwip: fix compile issue when autoip option enabled 2017-01-09 10:22:36 +08:00
Liu Zhi Fu
084c14f1e4 esp32: fix wifi timer thread-safe issue
Update wifi lib to fix a wifi timer thread-safe issue
2017-01-09 10:21:29 +08:00
Ivan Grokhotkov
3fba6f4392 Merge branch 'bugfix/bootloader_ets_cpu_update_freq' into 'master'
bootloader: export ets_update_cpu_frequency

MR !363 added linking librtc into bootloader. At the same time, MR !373 removed ets_update_cpu_frequency from ROM exports ld script, and replaced it with a dual CPU aware version. Combining these two MRs caused linker error in bootloader due to the unresolved `ets_update_cpu_frequency`.

One option to fix this is to move the definition of ets_update_cpu_frequency into bootloader_support component. This does however look a bit odd because this function is not something that is specifically needed for bootloader support.

Another option is to export the ROM version of ets_update_cpu_frequency for the bootloader only. This means that when bootloader changes CPU frequency, it only updates the tick period variable for PRO CPU. This isn't an issue though, because app startup code still calls the dual CPU aware version of ets_update_cpu_frequency early on, before any non-trivial code can run on the APP cpu.

This MR uses the second approach. Looking forward, we may move this definition of ets_update_cpu_frequency into the rtc_clk component, which will be used both by the bootloader and the app, and placing ets_update_cpu_frequency there would be logical.

See merge request !384
2017-01-09 10:14:00 +08:00
Ivan Grokhotkov
5b5a4355e7 Merge branch 'feature/sd_driver_new' into 'master'
SDMMC peripheral driver, SD protocol driver, FATFS library, VFS integration

This MR contains:
- SDMMC host peripheral driver
- SD protocol driver in sdmmc component (can be extended to support MMC/eMMC and SPI based hosts)
- ChaN's FATFS library v0.12b
- VFS integration
- FAT access via VFS is thread-safe (unless same file is read/written/unlinked/renamed from different tasks)
- Support for POSIX directory-related functions in VFS (and in vfs_fatfs.c)
- unit test for the above
- Example
- API documentation

Will be done in other MRs:
- Support for spi_flash IO driver for FatFs
- SPI host driver and support for SPI mode commands in sdmmc component
- MMC/eMMC support in sdmmc component
- Support for slightly higher 53/26.6MHz clocks (currently I'm using 20MHz for DS and 40MHz for HS, instead of 25MHz/50MHz per standard), and arbitrary low clocks (e.g. 4MHz).

See merge request !353
2017-01-09 06:48:25 +08:00
Ivan Grokhotkov
44ce833d76 fatfs: add vfs support 2017-01-09 05:54:04 +08:00
Ivan Grokhotkov
d418776982 fatfs: rename DIR to FF_DIR to avoid conflict with dirent.h 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
9398d1b1cc fatfs: add pluggable diskio layer, sdmmc implementation 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
1440c866fc fatfs: import version 0.12b 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
6fb430f45e vfs: add directory APIs 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
3f889de5ab vfs: implement vfs_unregister 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
edd924f273 sdmmc: add peripheral driver and protocol layer 2017-01-09 04:51:24 +08:00
Ivan Grokhotkov
c1b06bf0a2 bootloader: export ets_update_cpu_frequency 2017-01-09 03:08:24 +08:00
Wu Jian Gang
ecf720d3b3 Merge branch 'bugfix/fix_wifi_auth_fail_issue' into 'master'
esp32: fix wifi auth issue

Fix wifi auth failed issue by default phy mode to 11N

See merge request !382
2017-01-07 21:12:45 +08:00
Ivan Grokhotkov
b1c754bbb5 Merge branch 'feature/cplusplus' into 'master'
C++ support

This change adds necessary support for compiling C++ programs:
- linking against libstdc++
- implementation of static initialization guards using FreeRTOS primitives: since we don't have condition variables at our disposal, and we don't want to allocate a synchronization primitive for every guard variable generated by the compiler, we imitate condition variables using a combination of a mutex, counting semaphore, and a counter (based on [Microsoft Research paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2004/12/ImplementingCVs.pdf), albeit because we don't need *arbitrary* code to use these CVs, implementation gets simpler).

Note that libstdc++ also contains an implementation of `__cxa_guard_{acquire,release,abort}` functions. These implementations come from an `#ifndef GXX_THREADS` branch, i.e. are not aware of multthreading. There are three ways of replacing these libstdc++ functions with our implementation:

1. Move our code into gcc. Pros: cleanest solution. Cons: Such changes are unlikely to be merged by any upstream, so we end up maintaining our own forks of {gcc,crosstool-ng}.
2. Use library as it is built by crosstool, use `ar` to delete one object file (`guards.o`), add this library to ESP-IDF. Pros: easy to implement. Cons: libstdc++ is a 15MB binary 😯 
3. Keep using libstdc++ from crosstool, force our implementation to be linked using a `-u` linker flag. Pros: no impact on repo size, easy to implement. Cons: somewhat less clean than 1 (and about as hacky as 2).

For the reasons mentioned, option (3) looks like the best tradeoff.

Ref. TW6702

See merge request !364
2017-01-07 18:50:12 +08:00
Ivan Grokhotkov
5c4f707a33 Merge branch 'test/update_known_issues' into 'master'
CI: update know issue list for idf



See merge request !360
2017-01-07 18:47:17 +08:00
Ivan Grokhotkov
339267ffc9 Merge branch 'feature/bootloader_rng' into 'master'
Enable bootloader entropy source for RNG

Enables an entropy source when bootloader starts up, which both seeds the RNG for use before WiFi/BT stack is enabled and provides an adequate RNG for secure boot & flash encryption key generation.

A prerequisite was enabling 80MHz operation, so the CPU is now set to 80MHz as soon as second stage bootloader starts running.

See merge request !363
2017-01-07 18:46:10 +08:00
Ivan Grokhotkov
0efaa4f4b8 Merge branch 'feature/lwip-rcvbuf-option' into 'master'
add menuconfig option to enable SO_RCVBUF

This option is required by Arduino and enables netconn connection to be queried for amount of data available in the rx buffer.

See merge request !372
2017-01-07 18:45:37 +08:00
Ivan Grokhotkov
4f909b8ecc Merge branch 'bugfix/ets_delay_on_app_cpu' into 'master'
esp32: ets_update_cpu_frequency should set tick scale for both CPUs

ets_update_cpu_frequency ROM function updates g_ticks_per_us, which is has two copies, one for each CPU.
The APP CPU copy of g_ticks_per_us never got updated, resulting in shorter delays produced by ets_delay_us on the APP CPU.

This MR replaces ROM ets_update_cpu_frequency with a copy in IRAM which updates scaling factors on both of the CPUs.

So now we get expected delays (in microseconds):
```
ets_delay_us core=0 expected=50000 actual=50014
ets_delay_us core=1 expected=50000 actual=50015
vTaskDelay core=0 expected=50000 actual=49428
vTaskDelay core=1 expected=50000 actual=50000
```

Reported on the forum: http://esp32.com/viewtopic.php?f=2&t=713#p3722

See merge request !373
2017-01-07 18:45:14 +08:00
Jeroen Domburg
0bfe08578b Add sdkconfig include to cpu_util.h so CONFIG_ESP32_DEBUG_OCDAWARE actually resolves 2017-01-07 18:44:20 +08:00
Liu Zhi Fu
0e7f7a2112 esp32: fix wifi auth issue
Fix wifi auth failed issue by default phy mode to 11N
2017-01-07 16:32:03 +08:00
Liu Zhi Fu
a575b9e893 esp32: modify ld file to fix a crash issue 2017-01-07 16:12:07 +08:00
Tian Hao
9c630b759f component/bt : add bt device api
1. add get bd_addr function
2017-01-06 21:19:58 +08:00
Jiang Jiang Jian
f5b221b9fb Merge branch 'feature/btdm_blufi_version' into 'master'
component/bt : blufi add version

blufi add version and the android APK add version check, too.

See merge request !378
2017-01-06 18:55:05 +08:00
Tian Hao
e4b9563dac component/bt : blufi add version 2017-01-06 17:40:46 +08:00
Jeroen Domburg
718969f6ed Merge branch 'driver/spi' into 'master'
SPI master driver

This merge requests adds an SPI Master driver. This driver is (of course) multithread capable, has device abstraction, has command queueing, DMA support and all other sorts of nice things you'd expect from a SPI driver.


See merge request !332
2017-01-06 16:28:52 +08:00
Wu Jian Gang
a4c3f876ab Merge branch 'bugfix/ethernet_init' into 'master'
ethernet : fix sometimes ethernet init fail bug



See merge request !376
2017-01-06 16:26:40 +08:00
Wu Jian Gang
e387a16e51 Merge branch 'feature/Add_OTA_Demo' into 'master'
esp32 examples: Add OTA Demo

this demo would show you an OTA workflow and how to make it run.

See merge request !324
2017-01-06 16:15:14 +08:00
Ivan Grokhotkov
079138201d cxx: implement static initialization guards 2017-01-06 16:07:33 +08:00
Ivan Grokhotkov
a69a798878 Merge branch 'bugfix/tw9540_workaround_appdata_overwrite_bootdata' into 'master'
modify bootloader dram start address, swap app bss and data segments

Modify bootloader dram_seg from address 0x3ffc0000 to 0x3fff0000, len from 0x20000 to 0x10000.
Also put app .data before .bss, to reduce the chance .data collides with ROM bootloader stack.

See merge request !375
2017-01-06 15:59:22 +08:00
Wu Jian Gang
c943fabcda Merge branch 'feature/CoAP' into 'master'
Add CoAP feature

Add CoAP protocol, support client and server test demo.

See merge request !303
2017-01-06 15:37:09 +08:00
Ivan Grokhotkov
1cbc2fa046 esp32: ets_update_cpu_frequency should set tick scale for both CPUs 2017-01-06 15:00:17 +08:00
Ivan Grokhotkov
845cd09570 cxx: link against libstdc++, remove abi.cpp 2017-01-06 14:56:02 +08:00
Jeroen Domburg
23455de4c2 Add SPI Master driver, example, test and docs 2017-01-06 14:20:32 +08:00
shangke
489701eb2d ethernet : fix sometimes ethernet init fail bug 2017-01-06 13:49:42 +08:00
Ivan Grokhotkov
0b264f4f7b bootloader: update ld script comment 2017-01-06 13:47:53 +08:00
Ivan Grokhotkov
61c6ce86d2 esp32: put .data before .bss
This change reduces chances that a large .bss segment will push .data all the way into
0x3ffe1320 — 0x3ffe5320 range where the bootloader stack is, creating a problem when
bootloader will be loading application into memory.
With this change, .data would need to be at least 200k big to cause problems.
2017-01-06 13:46:06 +08:00
Liu Zhi Fu
1b38494df4 bootloader: modify bootloader dram start address to 0x3fff0000
Modify bootloader dram_seg from address 0x3ffc0000 to 0x3fff0000, len from
0x20000 to 0x10000. Please be notified that this is just a workaround for
fixing app data overwrite bootloader data issue!
2017-01-06 13:44:09 +08:00
Wu Jian Gang
e2d05d8592 Merge branch 'feature/wifi_deinit' into 'master'
wifi: add wifi rx buffer number config in menuconfig



See merge request !370
2017-01-06 13:32:25 +08:00
XiaXiaotian
7853893731 wifi: add wifi rx buffer number config in menuconfig 2017-01-06 10:12:27 +08:00
Ivan Grokhotkov
ded13ac8e6 Merge branch 'feature/btdm_blufi' into 'master'
Feature/btdm blufi

This is new BLUFI for config wifi connection through bluetooth.


See merge request !359
2017-01-05 21:54:45 +08:00
Tian Hao
9017c408ac component/bt : use new lib, optimize BT power 2017-01-05 20:41:15 +08:00
Wu Jian Gang
c9ef32a0f2 Merge branch 'feature/low_rate' into 'master'
add WiFi low rate feature



See merge request !358
2017-01-05 20:34:50 +08:00
Tian Hao
24af07fd13 component/bt : new blufi
1. new blufi protocol
2. new blufi demo
3. support security
4. support sta/ap/sta_ap
5. support wpa-enterprise
2017-01-05 20:22:35 +08:00
Wang Jia Lin
ad1d4500f9 Merge branch 'feature/ledc' into 'master'
driver: ledc update

1. add fading functions.
2. clear up ledc.h
3. update api doc.
4. add ledc example

See merge request !347
2017-01-05 20:05:13 +08:00
wangmengyang
2e7748d625 component/bt: modify bluetooth API
1. VHCI api and doxygen
2. Controller api and doxygen
3. bluedroid init/enable api and doxygen
4. cleanup demo codes
2017-01-05 20:02:06 +08:00
me-no-dev
0feb3633fc add menuconfig option to enable SO_RCVBUF 2017-01-05 13:17:52 +02:00
qiyueixa
7778273314 esp32: update wifi libs
1. add wifi low rate feature
2017-01-05 18:43:09 +08:00
qiyueixa
5677149833 esp32: add wifi low rate feature
1. add low_rate_enable flag to scan results to identify if AP low rate is enabled.
2. add WIFI_PROTOCOL_LR for users to enable low rate feature.
2017-01-05 18:22:07 +08:00
Wangjialin
6b5e734901 driver: ledc - update fading functions, add example and doc
1. add fading functions.
2. clear up ledc.c and ledc.h
3. update api doc.
4. add ledc example
5. edit ledc.rst and add readme for example code.
6. add s_ prefix for static global values.
7. add mutex for fade functions
8. minor changes according to the comments.
2017-01-05 17:57:52 +08:00
Tian Hao
d6fcec73b2 component/bt : add macro for adv_data_flag
1. add macro for adv data flag
2. add docs for doxygen
2017-01-05 17:53:33 +08:00
Tian Hao
daf58e3852 component/bt : fix advertising bug
1. adv data flag
2. default adv data not BR/EDR in demo
2017-01-05 17:53:33 +08:00
Ivan Grokhotkov
f867e0671e Merge branch 'feature/btdm_gatt_api' into 'master'
Feature/btdm gatt api

GATT upstream api changed. 
Actually, feature/btdm_blufi based on this branch.

See merge request !366
2017-01-05 16:43:01 +08:00
Dong Heng
8c7dfef317 examples/10_openssl_server: fixup SSL server with method of specific version
1. add method of any version supporting at OpenSSL and add API in header file
2. change OpenSSL server context method to be method of any version

Fixes http://esp32.com/viewtopic.php?f=14&t=696.
2017-01-05 15:57:25 +08:00
wangmengyang
44914c17bc component/bt: add AVRC controller example with simple PASSTHROUGH cmd 2017-01-05 15:43:44 +08:00
Tian Hao
ee318d42ae Merge branch 'master' into feature/btdm_gatt_api 2017-01-05 15:25:03 +08:00
Liu Zhi Fu
d98b99f4f0 lwip: rework according review comments 2017-01-05 12:22:49 +08:00
Liu Zhi Fu
be994740b4 Merge branch 'master' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into feature/throughput_optimization_phrase_1 2017-01-05 11:37:56 +08:00
Liu Zhi Fu
0fb2ab9f5c lwip/freertos/esp32: add throughput optimization related code
1. Update wifi lib which contains ampdu and other optimizations
2. Add throughput code debug code
3. Other misc modification about throughput optimization
2017-01-05 11:37:08 +08:00
Yinling
6c41080fd9 CI: update known issues 2017-01-04 19:27:58 +08:00
Angus Gratton
63e9806d85 esp_random: XOR the RNG register value several times before returning it
Probably unnecessary, but avoids returning internal RNG state as-is.
2017-01-04 17:07:12 +11:00
Angus Gratton
3922ce47b2 bootloader: Enable early boot RNG entropy source
This reverts commit ceb8566970.
2017-01-04 17:07:12 +11:00
Angus Gratton
83442526e0 bootloader: Allow custom baud rate on UART 0 2017-01-04 16:24:12 +11:00
Angus Gratton
2e3ca1c2f7 bootloader: Boost bootloader CPU to 80MHz
Partially needed to use RNG, also useful to improve boot performance.
2017-01-04 16:07:19 +11:00
Wang Jia Lin
bf3093feca Merge branch 'driver_merge_tmp/merge_i2c' into 'master'
driver: i2c code

1. add i2c master code
2. add i2c slave code
3. add i2c example code

See merge request !318
2017-01-03 16:44:08 +08:00
Yinling
b9a6d276a2 CI: update known issues 2017-01-03 14:06:50 +08:00
Yinling
c47bc43afd CI: fix bug that restore initial condition fail:
in STA+AP mode, when STA is reconnecting to external AP, its AP
interface is not connectable. do disconnect on STA interface first
2017-01-03 14:06:50 +08:00
Angus Gratton
2407faf6c6 Merge branch 'feature/print_halt_abort' into 'master'
panic handlers: Print the PC address where abort() was called, don't dump registers



See merge request !338
2017-01-03 13:44:34 +08:00
Angus Gratton
19fa6e254d Merge branch 'feature/make_monitor' into 'master'
Add 'make monitor' target as used in arduino-esp32



See merge request !355
2017-01-03 08:43:49 +08:00
Angus Gratton
5e96070c27 linker script: Remove KEEP from RAM-resident sections
Reduce RAM usage when not all data/bss sections in source files were used.
2017-01-03 11:02:12 +11:00
Angus Gratton
03551ec2da build system: Add 'make monitor' target from arduino-esp32
Originally added to arduino-esp32 by @me-no-dev. It's so useful, we
want it in esp-idf as well! :)
2017-01-03 10:59:10 +11:00
Angus Gratton
7883a5bae5 Merge branch 'feature/esptool_reset_options' into 'master'
esptool: Add new options to reset before/after, detect flash size

Also fixes bugs with reading MAC, chip id.

See merge request !331
2017-01-03 07:48:10 +08:00
Wangjialin
9c7cc86793 1. modify i2c_set_pin function
2. update example comments and other minor changes
3. rename API:  i2c_cmd_link_create/i2c_cmd_link_delete (+4 squashed commits)

Squashed commits:
[2e0ac3e] 1. coding style: add one space after condition key words.
2. modify i2c.h, use gpio_num_t instead of int, improve comments of return values
3. add i2c index in index.rst
4. add readme for i2c example
[4991d92] update i2c.doc
[88b672e] driver: i2c

1. add mux and spin lock to run in a thread-safe way.
2. modify example code
[4eb15fe] driver: i2c code

1. add i2c master code
2. add i2c slave code
3. add i2c example code
4. add DRAM_ATTR for I2C array
2017-01-03 00:57:19 +08:00
liuhan
d0b10ba2dd components/coap: Add libcoap port for ESP32 platform 2016-12-30 15:05:26 +08:00
liuhan
2b41c1b8b2 components/coap: Add libcoap library as submodule 2016-12-30 15:05:26 +08:00
Angus Gratton
3783e28f0e bootloader: Check all partitions fit inside configured flash size 2016-12-30 14:19:46 +11:00
Angus Gratton
76e61ded30 bootloader: Call esp_partition_table_basic_verify() as part of standard boot
Was previously only verified during flash encryption.
2016-12-30 14:19:46 +11:00
Angus Gratton
d245f016ea esptool: Add new options to reset before/after, detect flash size 2016-12-30 14:19:46 +11:00