Commit graph

3403 commits

Author SHA1 Message Date
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 80486240c6 unity: log error codes as hex
Error codes are normally defined as hex numbers in header files, so
changing the assert macro to print them as hex as well.
2017-08-29 08:35:23 +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 2554f61f05 doc(spi master): documents updated for several limitations. 2017-08-26 02:15:32 +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