Closed hongquan-prog closed 1 year ago
Hi @hongquan-prog! We appreciate you submitting your first issue for our open-source project. 🌟
Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙
Did you enable CONFIG_FS_FATFS_REENTRANT
?
The company develops based on version 3.3, the option does not exist in zephyr 3.3 yet, is there a patch for it?
No, you'd either have to move to 3.4 (if it has it) or main, or find the commit(s) and cherry-pick them
No, you'd either have to move to 3.4 (if it has it) or main, or find the commit(s) and cherry-pick them OK,thanks for your help
Describe the bug I have turned on the option to use files to save logs, this will cause the log thread to write logs to the SD card when the system is idle, when I read or write to the file in other threads, the fs_read function returns -5, with a message that it could not acquire the mutex lock(relative path: subsys/sd/sd_ops.c:card_read_blocks), here's the result I get after some simple debugging:
To Reproduce Steps to reproduce the behavior:
SDHC
CONFIG_SDHC=y CONFIG_IMX_USDHC=y CONFIG_IMX_USDHC_DAT3_PWR_TOGGLE=y CONFIG_IMX_USDHC_DMA_SUPPORT=y CONFIG_SDHC_BUFFER_ALIGNMENT=4 CONFIG_IMX_USDHC_DMA_BUFFER_SIZE=128 CONFIG_SDHC_INIT_PRIORITY=85 CONFIG_SDHC_SUPPORTS_UHS=y CONFIG_SDHC_SUPPORTS_NATIVE_MODE=y CONFIG_SDHC_LOG_LEVEL_INF=y CONFIG_SDHC_LOG_LEVEL=3
SDMMC STACK
CONFIG_SDMMC_STACK=y CONFIG_SD_STACK=y CONFIG_SD_LOG_LEVEL_INF=y CONFIG_SD_LOG_LEVEL=3 CONFIG_SD_INIT_TIMEOUT=1500 CONFIG_SD_RETRY_COUNT=10 CONFIG_SD_OCR_RETRY_COUNT=1000 CONFIG_SD_CMD_TIMEOUT=200 CONFIG_SD_DATA_TIMEOUT=10000 CONFIG_SD_BUFFER_SIZE=512 CONFIG_SD_DATA_RETRIES=3 CONFIG_SD_UHS_PROTOCOL=y CONFIG_MMC_RCA=2
FS LOGGING
CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=4096 CONFIG_DISK_ACCESS=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_LOG_BACKEND_FS=y CONFIG_LOG_BACKEND_FS_AUTOSTART=y CONFIG_LOG_BACKEND_FS_DIR="/SD:" CONFIG_LOG_BACKEND_FS_FILES_LIMIT=1000 CONFIG_LOG_BACKEND_FS_FILE_SIZE=20480 CONFIG_LOG_BACKEND_FS_FILE_PREFIX="log"