Commit Graph

117 Commits

Author SHA1 Message Date
Xiao Xufeng
df7e887d18 test(sdmmc): support power down card on S3 emmc board 2023-07-26 15:44:45 +08:00
sonika.rathi
b8c3a3aeee Added support for write protection polarity for SDCard
Closes https://github.com/espressif/esp-idf/issues/11208
2023-06-28 13:20:36 +02:00
KonstantinKondrashov
e72061695e all: Removes unnecessary newline character in logs
Closes https://github.com/espressif/esp-idf/issues/11465
2023-06-09 03:31:21 +08:00
Ivan Grokhotkov
c94853786f
sdmmc: implement card power control for esp32c3 sdmmc breakout board 2023-06-01 11:01:19 +02:00
Adam Múdry
e5d0e3c676 Merge branch 'bugfix/sdmmc_driver_vtaskdelay_slowdown' into 'master'
sdmmc: incrementally increase delay of vTaskDelay

Closes IDF-7361

See merge request espressif/esp-idf!23765
2023-05-19 18:22:51 +08:00
Adam Múdry
f13c9f746f sdmmc: incrementally increase delay of vTaskDelay
Prevents unnecessary slowdown in polling functions
2023-05-18 05:33:25 +02:00
Martin Vychodil
61e694d2f3 Merge branch 'fix/cd_input_sd_mode_fails' into 'master'
CI: sdcard tests fail fix

Closes IDFCI-1700

See merge request espressif/esp-idf!23505
2023-05-15 17:37:29 +08:00
Armando
01a3d79b6f sdmmc: support tuning input delay on esp32s3 2023-05-11 12:25:22 +00:00
Adam Múdry
fa16ed3898 CI: sdcard tests fail fix 2023-05-10 16:48:03 +02:00
Ivan Grokhotkov
3775ce8bd8 Merge branch 'feature/sdmmc_test_app' into 'master'
sdmmc: new component test app

Closes IDF-7108

See merge request espressif/esp-idf!19699
2023-05-03 03:07:06 +08:00
Adam Múdry
84bac4e38f sdmmc: sdio combination cards correct setup
Co-authored-by: Mau Abata <mauabata@gmail.com>
Closes https://github.com/espressif/esp-idf/issues/9822
Closes https://github.com/espressif/esp-idf/issues/10280
2023-04-24 17:03:09 +02:00
Armando
2225087756 emmc: temporarily removed esp32 emmc ut_017 2023-04-18 10:11:36 +08:00
Adam Múdry
381d0fe032 sdmmc: add vTaskDelay to loops to prevent potential WDT trigger
Also change timeout to 120 seconds in fatfs sdcard pytest to prevent failing during formatting.
2023-04-11 11:06:56 +00:00
Chip Weinberger
74d6215b7f [SDMMC] add reasonable timeouts to all while loops
Closes: https://github.com/espressif/esp-idf/pull/10532
2023-04-11 11:06:56 +00:00
Ivan Grokhotkov
7524f40b21
sdmmc: keep clock enabled for the duration of ACMD41
SD specification requires that card clock is not disabled until the
card is idle, following ACMD41 command.
2023-03-27 14:09:02 +02:00
Ivan Grokhotkov
cc0cac4da2
sdmmc: new component test app
- split test cases into separate files
- added a component with information about dev. boards
- added a console application to run the tests
- added commands for lower level hacking/experimentation
2023-03-24 13:38:38 +01:00
Ivan Grokhotkov
bfc39e845e
sdmmc: also set card->real_freq_khz for probing frequency 2023-03-23 23:28:54 +01:00
Adam Múdry
415e785135 sdmmc: read/write/erase return early on sector count == 0
Closes https://github.com/espressif/esp-idf/issues/10593
2023-03-06 15:45:04 +01:00
Cao Sen Miao
94120b82c2 esp32h2: add build test 2023-01-17 10:29:04 +08:00
Song Ruo Jing
1575b9e43a ci: Disable all currently failed target tests for esp32c6 2022-11-28 12:09:08 +08:00
Alexey Gerenkov
47c2c13de5 build: Adds support for universal Clang toolchain 2022-11-23 13:25:16 +03:00
Martin Vychodil
56f2001317 sdmmc/sdspi: allow custom setup of SD card frequency
In order to allow flexible setup of SD card frequency, sdmmc_host_t.max_freq_khz is used as a limit

Closes https://github.com/espressif/arduino-esp32/issues/6225
2022-09-12 17:08:36 +02:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
Matus Fabo
384d61f156 remove: sdspi_host deprecated api
add: migration guide documentation
2022-06-12 20:07:27 +00:00
Martin Vychodil
16a4ee7c36 Merge branch 'bugfix/spi_mode_status_check' into 'master'
sdmmc, sdspi: fixes related to status checks, R1b response support, erase fix for SPI mode, fix for erase timeout calculation

Closes IDF-4728

See merge request espressif/esp-idf!17727
2022-06-10 13:15:47 +08:00
Michael (XIAO Xufeng)
6a8aed12ee ci: partially enable ut tests for esp32c2
Disabled test cases are tracked in:

 IDF-4465, IDF-5045, IDF-5057, IDF-5058, IDF-5059, IDF-5060, IDF-5061, IDF-5131

- test_fatfs: IDF-5136

- test_pm: IDF-5053

- test_cache_mmu: IDF-5138

- test_partitions: IDF-5137

- test_vfs: IDF-5139

- test_freertos: IDF-5140

- test_wpa_supplicant: IDF-5046

- test_mbedtls: IDF-5141

- test_pthread: IDF-5142

- test_protocomm: IDF-5143

- test_lightsleep: IDF-5053

- test_taskwdt: IDF-5055

- test_tcp_transport: IDF-5144

- test_app_update: IDF-5145

- test_timer: IDF-5052

- test_spi: IDF-5146

- test_rtc_clk: IDF-5060

- test_heap: IDF-5167

ci: fixed issues for tests of libgcc, ets_timer, newlib

test_pm: support on C2
2022-06-02 14:23:35 +08:00
Ivan Grokhotkov
79659e3096
sdmmc: better calculation of erase timeout
Previous version of the code used a fixed constant (500 ms) for the
erase timeout and added 1 ms for each sector erased.
This commit improves timeouts calculation:
- For SD cards, check if erase timeout information is present in the
  SSR register. If yes, use it for erase timeout calculation.
  Otherwise assume 250ms per erase block, same as Linux does.
- For eMMC assume 250ms per erase block (but no less than 1 second).
  This has to be improved later to use the erase timeout info in the
  extended CSD register.
2022-05-30 15:39:02 +02:00
Ivan Grokhotkov
36e3043306
sdmmc: check card status in SPI mode after sdmmc_erase_sectors
Same as for write operation, some errors are reported only via CMD13.
Without the R1b response support in sdspi driver, this check would
fail. Now that R1b support is implemented, erase command response is
zero (success) on all cards under test.
Also remove the now-unnecessary card reset after erase in the test
case.
2022-05-30 15:39:01 +02:00
Ivan Grokhotkov
bb11f49c74
sdmmc: check for errors reported by card in sdmmc_write_sectors_dma
During write operation (CMD24 or CMD25), the card can report some of
the errors in the 1-byte response tokens. Other types of errors are
not reported, the host has to get them by issuing CMD13.
This commit adds CMD13 request at the end of write operations and
reports error to the user if the card status isn't zero.
2022-05-30 15:39:01 +02:00
Ivan Grokhotkov
c4c7e7c82b
sdmmc: support sdmmc_send_cmd_send_status in SPI mode
SPI mode uses different response format (2-byte R2) compared to SD mode.
2022-05-30 15:39:01 +02:00
Ivan Grokhotkov
da47bebdd8
sdmmc: sdmmc_init_sd_ssr: use correct command name
Numerical value of MMC_SEND_STATUS is the same as SD_APP_SD_STATUS,
so there is no functional change. Just making this consistent with the
sdmmc_send_app_cmd call later on.
2022-05-30 15:39:01 +02:00
Vamshi Gajjela
f116228cd6 Add high speed mode switch validation check for MMC. 2022-04-28 15:23:21 +02:00
Vamshi Gajjela
0e366db603 sdmmc: Bugfix sdmmc_erase_sectors cmd38 argument validation
Unit test cases added to verify -ve test, for sdmmc_erase_sectors to
return ESP_ERR_NOT_SUPPORTED

Closes https://github.com/espressif/esp-idf/issues/8704
2022-04-11 15:36:45 +00:00
songruojing
bdb5b11b39 unit test: move unit-test_app test_utils_task_delete API to be a utils API (unity_utils_task_delete) in unity component 2022-03-30 15:11:08 +08:00
Vamshi Gajjela
ffdbeee9f6 sdmmc: Add erase command-38. Support erase/trim/discard/sanitize
options.

Erase command (38) for SD cards allows option for erase/dicard/fule
operation at block level and for MMC cards supports option for
discard/trim at block level. When Sanitize is executed only the
portion of data that was unmapped by a Discard command shall be
removed by the Sanitize command.

Unit test cases added to verify ERASE feature in SD/SDSPI mode.
TRIM/DISCARD/SANITIZE tests for eMMC devices.

Closes https://github.com/espressif/esp-idf/pull/7635
Closes https://github.com/espressif/esp-idf/issues/7623
2022-03-05 16:02:01 +05:30
morris
869bed1bb5 soc: don't expose unstable soc header files in public api 2022-01-06 23:10:22 +08:00
intern
467525f846 docs: fix typo in header files 2021-12-13 13:17:17 +08:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Jan Procházka
fb22c1f182 fatfs: Implementation of disk_status nad disk_initialize for SD/MMC card
FATFS provides a disk status and disk initialize callback which were not
implemented. Implementation has very low impact on SD/MMC speed and
fixes issues, when trying to open file when SD card was removed from
slot and not deinited.

If disk_status returns STA_NOINIT, it will always continue with
disk_initialize. If that returns 0, it will continue like everything is
working normally. So there has to be the same check as in disk_status.
Return of disk_initialize is always checked like this for STA_NOINIT or
STA_PROTECT so if command fails, we return the STA_NOINIT.

stat = disk_initialize(pdrv);
if (stat & STA_NOINIT) return FR_NOT_READY;
if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;

Closes IDF-4125
2021-11-01 15:11:40 +08:00
SalimTerryLi
92e337a38c
sdspi: enable UT & ExampleTest for C3/S2
Closes https://github.com/espressif/esp-idf/issues/7389

(1)     "MMC_RSP_BITS" [sd]                                                             [Y]
(2)     "probe SD in SPI mode" [sd][test_env=UT_T1_SPIMODE]                             [Y]
(3)     "probe SD in SPI mode, slot 0" [sd][ignore]                                     [N]
(4)     "SDMMC performance (SPI mode)" [sdspi][test_env=UT_T1_SPIMODE]                  [Y]
(5)     "SDMMC test read/write with offset (SPI mode)" [sdspi][test_env=UT_T1_SPIMODE]  [Y]
(6)     "CD input works in SPI mode" [sd][test_env=UT_T1_SPIMODE]                       [Y]
(7)     "WP input works in SPI mode" [sd][test_env=UT_T1_SPIMODE]                       [Y]
2021-09-24 15:17:18 +08:00
Marius Vikhammer
80acc1a002 CI: add S3 default_2 unit test config 2021-07-08 18:39:57 +08:00
Michael (XIAO Xufeng)
6d1eddb9c0 sd_test: refactor the test case 2021-06-19 14:27:44 +08:00
Michael (XIAO Xufeng)
bad9ab052d ci: add log output for the sdmmc performance test 2021-06-19 14:12:22 +08:00
Michael (XIAO Xufeng)
cfa4beb661 test_sd: merge emmc SDR/DDR test cases of 4-bit mode 2021-04-26 09:55:39 +08:00
Michael (XIAO Xufeng)
02970813b8 sdmmc_host: add unit tests and improve documents about using eMMC in 4-line SDR mode 2021-04-25 18:34:37 +08:00
raldone01
6e2dc5d291 Fix minor documentation issue
Merges https://github.com/espressif/esp-idf/pull/6192

Signed-off-by: yiying <yiying@MacBook-Air-Cindy.local>
2020-12-25 15:46:36 +08:00
Angus Gratton
690dc5d023 sdmmc: Temporarily disable sd_spi test cases
From internal commit 6d894813
2020-12-24 14:18:01 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Michael (XIAO Xufeng)
1966f00f0b soc: updates caps usage
We should define caps as 1 if true. When use the caps macros, #if and
 #if ! should be used instead of #ifdef/#ifndef.
2020-10-17 16:10:17 +08:00
Jakob Hasse
20c068ef3b cmock: added cmock as component
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
2020-09-02 16:38:37 +08:00