Commit graph

617 commits

Author SHA1 Message Date
Konstantin Kondrashov 2bd77056bb rmt/driver: Add module reset before enabling 2019-10-16 05:49:26 +00:00
Konstantin Kondrashov 4be011785e pcnt/driver: Add module reset before enabling 2019-10-16 05:49:26 +00:00
Konstantin Kondrashov 5ce96ab227 sdmmc_host/driver: Add module reset before enabling 2019-10-16 05:49:26 +00:00
Konstantin Kondrashov b8d4a53260 i2s/driver: Add module reset before enabling 2019-10-16 05:49:26 +00:00
Konstantin Kondrashov fc31437236 can/driver: Add module reset before enabling 2019-10-16 05:49:26 +00:00
Konstantin Kondrashov dc63c2e9cb uart/driver: Add module reset before enabling
This commit prevents infinite restarts caused due to an interrupt flag
was left uncleared.

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

Closes: IDF-188
2019-10-16 05:49:26 +00:00
Martin Thierer d56892b563 spi: Put argument of macro SPI_SWAP_DATA_TX/RX in parentheses
Close https://github.com/espressif/esp-idf/pull/3996
2019-09-16 17:40:40 +08:00
redchenjs 548844b5cc Bugfix(i2s): fixed i2s left/right channels swapped issue for release/v3.2.
The right channel data is in the high position, so the I2S_TX_MSB_RIGHT & I2S_RX_MSB_RIGHT bits should be set.
2019-08-26 14:02:27 +08:00
Ivan Grokhotkov 48e5dcd9b5 Merge branch 'power_management/i2s+i2c-v3.2' into 'release/v3.2'
Power management/i2s+i2c (backport v3.2)

See merge request espressif/esp-idf!5863
2019-08-22 23:29:52 +08:00
Sachin Parekh eeb9a0359c PM: I2S and I2C added in the Power Management docs
Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
2019-08-21 18:15:51 +05:30
Sachin Parekh 4cdf488de8 I2S: Enable Power Management locks
Acquires PM_APB_FREQ_MAX lock when carrying any transaction on I2S if
Power Management Framework is enabled.

Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
2019-08-21 18:15:41 +05:30
Sachin Parekh c56f147d48 I2C: Enable Power Management locks
Acquires PM_APB_FREQ_MAX lock when carrying any transaction on I2C if
Power Management Framework is enabled.

Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
2019-08-21 18:15:29 +05:30
Michael (XIAO Xufeng) a393bb6f1b sdio_slave: fix the send_flush infinite loop issue
Also add some helper functions.
2019-08-20 17:00:21 +08:00
Angus Gratton b7196d21c9 Merge branch 'bugfix/gpio_intr_enable_bug_v3.2' into 'release/v3.2'
bugfix(GPIO): Fixed GPIO  interrupts bug for v3.2

See merge request espressif/esp-idf!5651
2019-07-30 14:10:29 +08:00
kooho f6a9f76401 bugfix(GPIO): Fixed the bug that GPIO enables interrupts on one core,
but registers interrupt service routines on another core for release/v3.2
2019-07-29 19:22:59 +08:00
Vikram Dattu 13069ecb26 Changed log level for spi_master
There are lot of prints of `Allocate TX buffer for DMA`
Changed these from `ESP_LOGI` to `ESP_LOGD`

Signed-off-by: Vikram Dattu <vikram.dattu@espressif.com>
2019-07-19 10:08:39 +05:30
Mahavir Jain 376377ceca Merge branch 'bugfix/i2s_apll_clock_fix_v3.2' into 'release/v3.2'
driver/i2s: fix apll_clock_rate for different sample rates (v3.2)

See merge request espressif/esp-idf!5449
2019-07-12 11:36:01 +08:00
kooho 7e2465995f bugfix(UART): fixed two UART issues:
1. uart_wait_tx_done works incorrect when sending a byte of data.
2. uart_set_rx_timeout sets an incorrect rx timeout value when ref_tick is enabled.
2019-07-09 14:47:04 +08:00
redchenjs a4f2283384 i2s: fix a bug when calculating i2s apll parameters
Closes https://github.com/espressif/esp-idf/issues/2634
Closes https://github.com/espressif/esp-idf/issues/3380
Fixes https://github.com/espressif/esp-idf/issues/3407
2019-07-04 18:28:18 +05:30
Michael (XIAO Xufeng) f21762eeef spi: fix a possible concurrency issue 2019-06-19 12:38:31 +08:00
Michael (XIAO Xufeng) 325fca94c0 spi: fix the bug of connecting SPI peripheral to read-only pins
The requirements of pin capabilites is different for spi master and
slave.  The master needs CS, SCLK, MOSI to be output-able, while slave
needs MISO to be output-able.

Previous code is for master only.

This commit allows to place other 3 pins than MISO on input-only pins
for slaves. Refactoring for spi_common is also included.

Resolves https://github.com/espressif/esp-idf/issues/2455
2019-04-01 18:39:02 +08:00
Angus Gratton d99d92e170 Merge branch 'bugfix/fix_dig_gpio_unable_hold_bug_v3.2' into 'release/v3.2'
Bugfix/fix digital gpio unable hold bug  (backport v3.2)

See merge request idf/esp-idf!4355
2019-03-06 12:10:38 +08:00
Paul Abbott 929542d4fa driver(rmt): Fixed some RMT related issues.
1. Add missing get function to RMT API: rmt_get_idle_level().
2. Suppress error message from rmt_wait_tx_done() if wait_time==0 (allows for polling).
3. Remove the blank lines between parameter lists.

Merges https://github.com/espressif/esp-idf/pull/2666
2019-02-26 20:46:23 +08:00
kooho be49c8d841 driver(gpio): fixed digital gpio unable hold bug during deep-sleep for release/v3.2. 2019-02-26 20:20:25 +08:00
Wangjialin 553ba51924 bugfix(i2c): reduce speed of I2C master bus reset routine and release SDA
closes https://github.com/espressif/esp-idf/issues/2494
closes https://github.com/espressif/esp-idf/pull/2493
closes https://github.com/espressif/esp-idf/pull/2496

1. Change bus reset to handle interrupted READ sequences.
2. Slow down I2C to 100khz during reset
3. If a SLAVE device was in a read operation when the bus was interrupted, the SLAVE device is controlling SDA.The only bit during the 9 clock cycles of a byte READ the MASTER(ESP32) is guaranteed control over, is during the ACK bit period.
If the SLAVE is sending a stream of ZERO bytes, it will only release SDA during the ACK bit period. The master(ESP32) cannot generate a STOP unless SDA is HIGH. So, this reset code synchronizes the bit stream with, Either, the ACK bit, Or a 1 bit.
2019-01-22 11:43:55 +08:00
chuck todd 929d98538e 1. Slow down I2C to 100khz During Reset
I am stealing this delay coding from @jeremyherbert #2493 pr.

2. Change Bus Reset to handle interrupted READ sequences.

The current code does not handle interrupted READ cycles.

 If a SLAVE device was in a read operation when the bus was interrupted, the SLAVE device is controlling SDA.

The only bit during the 9 clock cycles of a byte READ the MASTER(ESP32) is guaranteed control over, is during the ACK bit period.

If the SLAVE is sending a stream of ZERO bytes, it will only release SDA during the ACK bit period. The master(ESP32) cannot generate a STOP unless SDA is HIGH.

So, this reset code synchronizes the bit stream with, Either, the ACK bit, Or a 1 bit.

3. fix typo

correct `sda_id` to `sda_io` in `i2c_master_clear_bus()` @ryan-ma found it.  This typo was generated when I manually edited this patch on GitHub, I should have done a Copy/Paste operation!
2019-01-22 11:43:40 +08:00
jeremy b810b32675 reduce speed of i2c master bus reset routine and release sda 2019-01-22 11:43:28 +08:00
Mahavir Jain 62eb0f4c12 i2s: add (optional) support to clear tx descriptor in underflow case
It has been observed that, in case of underflow (data unavailability) in
I2S transmission, previously filled up tx descriptors continue to get
transmitted on line, causing noise in case of audio use case.

This change adds optional `tx_desc_auto_clear` field during I2S driver intialization
than can zero initialize tx descriptor in case of underflow situation in
interrupt handler itself.

Closes: https://github.com/espressif/esp-idf/issues/1789
(cherry picked from commit 765bf674d0)
2018-12-31 13:42:26 +05:30
Jiang Jiang Jian bb47146710 Merge branch 'fix/spi_callback_in_iram_v3.2' into 'release/v3.2'
spi: fix the crash when callbacks are not in the IRAM (Backports v3.2)

See merge request idf/esp-idf!3884
2018-12-07 10:37:07 +08:00
Jiang Jiang Jian 4f805d558c Merge branch 'bugfix/fix_uart_read_bug_when_using_dual_core_v3.2' into 'release/v3.2'
driver(uart): fixed uart read error bug when using dual core (backport v3.2)

See merge request idf/esp-idf!3813
2018-12-07 10:35:17 +08:00
Michael (XIAO Xufeng) 44bd6f72bc spi: fix the crash when callbacks are not in the IRAM
Introduced in 9c23b8e5 and 4f87a62f. To get higher speed, menuconfig
options are added to put ISR and other functions into the IRAM.  The
interrupt flag ESP_INTR_FLAG_IRAM is also mistakenly set when the ISR is
put into the IRAM. However callbacks, which are wrote by the user, are
called in the master and slave ISR. The user may not be aware of that
these callbacks are not disabled during flash operations. Any cache miss
during flash operation will cause panic.

Essentially IRAM functions and intrrupt flag ESP_INTR_FLAG_IRAM are
different, the latter means not disabling the ISR during flash
operations.  New bus_config flag intr_flags is offered to help set the
interrupt attribute, including priority level, SHARED, IRAM (not
disabled during flash operations).  It introduced a small BREAK to
IDFv3.1 (but the same as IDFv3.0) that the user has to manually set IRAM
flag now (therefore he's aware of the IRAM thing) to void the ISR being
disabled during flash operations.
2018-12-04 21:35:20 +08:00
kooho bae0d8a313 driver(i2c): enable I2C master hardware filter by default for release/v3.2 2018-11-28 17:02:04 +08:00
kooho cfcc0edc33 driver(uart): fixed uart read error bug when using dual core for release/v3.2. 2018-11-28 16:37:59 +08:00
Konstantin Kondrashov 8bba348528 aes/sha/mpi: Bugfix a use of shared registers.
This commit resolves a blocking in esp_aes_block function.

Introduce:
The problem was in the fact that AES is switched off at the moment when he should give out the processed data. But because of the disabled, the operation can not be completed successfully, there is an infinite hang. The reason for this behavior is that the registers for controlling the inclusion of AES, SHA, MPI have shared registers and they were not protected from sharing.

Fix some related issue with shared using of AES SHA RSA accelerators.

Closes: https://github.com/espressif/esp-idf/issues/2295#issuecomment-432898137
2018-11-05 04:22:47 +00:00
Michael (XIAO Xufeng) 90d229eb6d spi_master: speed up polling performance by putting into IRAM 2018-10-25 12:31:45 +08:00
Michael (XIAO Xufeng) d0361a32d7 test: fix the IRAM type conflict issue using heap_caps_malloc 2018-10-25 12:31:44 +08:00
Angus Gratton 38bd836d05 Merge branch 'feature/cmake-unit-test' into 'master'
cmake: add unit tests build support

See merge request idf/esp-idf!3003
2018-10-22 16:29:15 +08:00
Anton Maklakov e3fce506b8 test_spi_slave: fix warnings about unused identifiers 2018-10-21 15:11:45 +08:00
Renz Bagaporo cc774111bf cmake: Add support for test build 2018-10-20 12:07:24 +08:00
Ivan Grokhotkov 0663ab7609 Merge branch 'feature/uart_rs485_test' into 'master'
driver: rs485 test support

See merge request idf/esp-idf!2701
2018-10-19 13:05:55 +08:00
Angus Gratton 159ff6e08e unit tests: Only initialise tcpip_adapter() when needed by the test
Prevents unexpected memory allocations when running tests which
don't require tcpip_adapter.
2018-10-17 22:53:46 +00:00
Alex Lisitsyn 5b7b64b946 driver: rs485 test support (remove timeout tag)
Adds test functionality with TEST_CASE_MULTIPLE_DEVICES() macro for RS485 test support.
2018-10-17 12:47:12 +02:00
Alex Lisitsyn 61bc733791 driver: rs485 test support
Adds test functionality with TEST_CASE_MULTIPLE_DEVICES() macro for RS485 test support.
2018-10-17 12:45:56 +02:00
Krzysztof Budzynski cd5f8bcf74 MCPWM API doc update 2018-10-10 08:15:23 +08:00
Angus Gratton 05c510b44e Merge branch 'test/spi_slave_psram_disable' into 'master'
test: disable the spi slave startup test when psram is enabled

See merge request idf/esp-idf!3373
2018-10-08 16:28:41 +08:00
michael 6b180f70ac test: modify the command/address test a bit to test the LSBFIRST feature 2018-10-04 15:03:26 +08:00
michael e5ed450d95 spi: move gpio direction config to common func for coinsistence
(MINOR CHANGE)
2018-10-04 14:57:31 +08:00
Michael (XIAO Xufeng) 2600f43822 spi_master: fix the command and address field when LSB_FIRST enabled
Resolves https://github.com/espressif/esp-idf/issues/2444.
2018-10-04 14:57:30 +08:00
michael f4d4183000 test: disable the spi slave startup test when psram is enabled 2018-09-26 17:55:37 +08:00
michael d4071a7c19 sdio_slave: fix the ret_queue crash issue when being reset by the master 2018-09-25 20:30:25 +08:00