完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:6676 load:0x40078000,len:14848 ho 0 tail 12 room 4 load:0x40080400,len:3792 0x40080400: _init at ??:? entry 0x40080694 I (29) boot: ESP-IDF v4.4.1-405-g6c5fb29c2c 2nd stage bootloader I (29) boot: compile time 20:27:28 I (29) boot: chip revision: 3 I (33) boot_comm: chip revision: 3, min. bootloader chip revision: 0 I (40) boot.esp32: SPI Speed : 40MHz I (45) boot.esp32: SPI Mode : DIO I (50) boot.esp32: SPI Flash Size : 2MB I (54) boot: Enabling RNG early entropy source... I (60) boot: Partition Table: I (63) boot: ## Label Usage Type ST Offset Length I (70) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (85) boot: 2 factory factory app 00 00 00010000 00100000 I (93) boot: End of partition table I (97) boot_comm: chip revision: 3, min. application chip revision: 0 I (104) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=293c4h (168900) map I (174) esp_image: segment 1: paddr=000393ec vaddr=3ffb0000 size=03a1ch ( 14876) load I (180) esp_image: segment 2: paddr=0003ce10 vaddr=40080000 size=03208h ( 12808) load I (185) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a31b4h (668084) map I (430) esp_image: segment 4: paddr=000e31dc vaddr=40083208 size=12c4ch ( 76876) load I (462) esp_image: segment 5: paddr=000f5e30 vaddr=50000000 size=00010h ( 16) load I (473) boot: Loaded app from partition at offset 0x10000 I (473) boot: Disabling RNG early entropy source... I (484) cpu_start: Pro cpu up. I (485) cpu_start: Starting app cpu, entry point is 0x4008137c 0x4008137c: call_start_cpu1 at /home/ssr-zenan/esp/esp-idf/components/esp_system/port/cpu_start.c:160 I (0) cpu_start: App cpu up. I (501) cpu_start: Pro cpu start user code I (501) cpu_start: cpu freq: 160000000 I (501) cpu_start: Application information: I (505) cpu_start: Project name: active-ap I (510) cpu_start: App version: 1 I (515) cpu_start: Compile time: Nov 16 2022 14:16:40 I (521) cpu_start: ELF file SHA256: 3bf09510a1c68176... I (527) cpu_start: ESP-IDF: v4.4.1-405-g6c5fb29c2c I (533) heap_init: Initializing. RAM available for dynamic allocation: I (540) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (546) heap_init: At 3FFB8DC8 len 00027238 (156 KiB): DRAM I (553) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (559) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (565) heap_init: At 40095E54 len 0000A1AC (40 KiB): IRAM I (573) spi_flash: detected chip: generic I (576) spi_flash: flash io: dio W (580) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (598) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. ----------------------- ESP32 CSI Tool Settings ----------------------- PROJECT_NAME: ACTIVE_AP CONFIG_ESPTOOLPY_MONITOR_BAUD: 115200 CONFIG_ESP_CONSOLE_UART_BAUDRATE: 115200 IDF_VER: v4.4.1-405-g6c5fb29c2c ----------------------- WIFI_CHANNEL: 4 ESP_WIFI_SSID: myssid ESP_WIFI_PASSWORD: mypassword SHOULD_COLLECT_CSI: 1 SHOULD_COLLECT_ONLY_LLTF: 1 SEND_CSI_TO_SERIAL: 1 SEND_CSI_TO_SD: 1 ----------------------- E (748) vfs_fat_sdmmc: slot init failed (0x103). E (749) sd.h: Failed to initialize the card (ESP_ERR_INVALID_STATE). If you do not have an SD card attached, please ignore this message. Make sure SD card lines have pull-up resistors in place. I (765) wifi:wifi driver task: 3ffc1aa0, prio:23, stack:6656, core=0 I (768) system_api: Base MAC address is not set I (772) system_api: read default base MAC address from EFUSE I (787) wifi:wifi firmware version: 84ed08c I (787) wifi:wifi certification version: v7.0 I (787) wifi:config NVS flash: enabled I (790) wifi:config nano formating: disabled I (795) wifi:Init data frame dynamic rx buffer num: 32 I (799) wifi:Init management frame dynamic rx buffer num: 32 I (805) wifi:Init management short buffer num: 32 I (809) wifi:Init dynamic tx buffer num: 32 I (813) wifi:Init static rx buffer size: 2212 I (817) wifi:Init static rx buffer num: 10 I (821) wifi:Init dynamic rx buffer num: 32 I (825) wifi_init: rx ba win: 6 I (828) wifi_init: tcpip mbox: 32 I (832) wifi_init: udp mbox: 6 I (836) wifi_init: tcp mbox: 6 I (840) wifi_init: tcp tx win: 5744 I (844) wifi_init: tcp rx win: 5744 I (848) wifi_init: tcp mss: 1440 I (852) wifi_init: WiFi IRAM OP enabled I (857) wifi_init: WiFi RX IRAM OP enabled I (868) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07 I (980) wifi:mode : softAP (3c:e9:0e:10:1d:45) I (984) wifi:Total power save buffer number: 16 I (985) wifi:Init max length of beacon: 752/752 I (986) wifi:Init max length of beacon: 752/752 I (989) wifi:Set ps type: 0 代码如下:Code: Select all #ifndef ESP32_CSI_SD_COMPONENT_H#define ESP32_CSI_SD_COMPONENT_H#include #include #include #include #include "esp_err.h"#include "esp_log.h"#include "esp_vfs_fat.h"#include "driver/sdmmc_host.h"#include "driver/sdspi_host.h"#include "sdmmc_cmd.h"#define PIN_NUM_MISO 2#define PIN_NUM_MOSI 15#define PIN_NUM_CLK 14#define PIN_NUM_CS 13FILE *f;char filename[24] = {0};void _sd_pick_next_file() { int i = -1; struct stat st; while (true) { i++; printf("Checking %i.csvn", i); sprintf(filename, "/sdcard/%i.csv", i); if (stat(filename, &st) != 0) { break; } printf("File size: %lin", st.st_size); }}void sd_init() {#ifdef CONFIG_SEND_CSI_TO_SD sdmmc_host_t host = SDSPI_HOST_DEFAULT(); sdspi_slot_config_t slot_config = SDSPI_SLOT_CONFIG_DEFAULT(); slot_config.gpio_miso = (gpio_num_t) PIN_NUM_MISO; slot_config.gpio_mosi = (gpio_num_t) PIN_NUM_MOSI; slot_config.gpio_sck = (gpio_num_t) PIN_NUM_CLK; slot_config.gpio_cs = (gpio_num_t) PIN_NUM_CS; esp_vfs_fat_sdmmc_mount_config_t mount_config = { .format_if_mount_failed = false, .max_files = 1, .allocation_unit_size = 16 * 1024 }; sdmmc_card_t *card; esp_err_t ret = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, &card); if (ret != ESP_OK) { if (ret == ESP_FAIL) { ESP_LOGE("sd.h", "Failed to mount filesystem. " " If you want the card to be formatted, set format_if_mount_failed = true." ); } else { ESP_LOGE("sd.h", "Failed to initialize the card (%s). " " If you do not have an SD card attached, please ignore this message." " Make sure SD card lines have pull-up resistors in place.", esp_err_to_name(ret)); } return; } else { sdmmc_card_print_info(stdout, card); _sd_pick_next_file(); f = fopen(filename, "a"); }#endif}/* * Printf for both serial AND sd card (if available and configured) */void outprintf(const char *format, ...) { va_list args; va_start(args, format);#ifdef CONFIG_SEND_CSI_TO_SERIAL vprintf(format, args);#endif#ifdef CONFIG_SEND_CSI_TO_SD if (f != NULL) { vfprintf(f, format, args); }#endif va_end(args);}void sd_flush() {#ifdef CONFIG_SEND_CSI_TO_SD fflush(f); fclose(f); f = fopen(filename, "a");#endif}#endif //ESP32_CSI_SD_COMPONENT_H SD卡模块如下图,SD卡:Sandisk SDHC 32G |
|
相关推荐
1个回答
|
|
要解决ESP32-WROVER-IE写入数据到SD卡时无法初始化SD卡的问题,请按照以下步骤操作:
1. 检查硬件连接:确保SD卡模块与ESP32-WROVER-IE之间的连接正确。通常,SD卡模块的CS(片选)引脚连接到ESP32的某个GPIO引脚,D0、D1、D2和D3引脚分别连接到ESP32的相应SPI引脚。 2. 检查电源:确保SD卡模块的电源连接正确,并且电源电压在SD卡的工作范围内。 3. 更新ESP-IDF:您当前使用的ESP-IDF版本是4.4.1,可以尝试更新到最新版本,以获取可能的bug修复和性能改进。 4. 检查SPI配置:确保您的代码中正确配置了SPI接口。例如,设置正确的GPIO引脚,以及SPI模式和时钟速率。 5. 初始化SD卡:在您的代码中,确保在尝试写入数据之前,已经成功初始化了SD卡。您可以使用以下示例代码来初始化SD卡: ```c #include "driver/sdmmc_host.h" #include "driver/sdspi_host.h" #include "sdmmc_cmd.h" #define SD_CS_GPIO 5 // 将SD卡模块的CS引脚连接到ESP32的GPIO 5 void app_main() { sdmmc_host_t host = SDMMC_HOST_DEFAULT(); sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); esp_err_t ret = esp_sdspi_host_init(); if (ret != ESP_OK) { printf("Failed to initialize SD SPI host!n"); return; } gpio_set_direction(SD_CS_GPIO, GPIO_MODE_OUTPUT); gpio_set_level(SD_CS_GPIO, 1); esp_sdspi_slot_config_t sdspi_slot_config = { .gpio_cs = SD_CS_GPIO, .gpio_cd = GPIO_NUM_NC, .gpio_wp = GPIO_NUM_NC, .gpio_int = GPIO_NUM_NC, }; ret = esp_sdspi_host_init_device(&host, &sdspi_slot_config); if (ret != ESP_OK) { printf("Failed to initialize SD card!n"); return; } // 现在可以开始使用SD卡进行读写操作 } ``` 6. 检查错误代码:如果SD卡初始化失败,检查返回的错误代码,以便了解具体的问题所在。 7. 检查SD卡:确保您使用的SD卡是好的,没有损坏或故障。 按照这些步骤操作,您应该能够解决ESP32-WROVER-IE写入数据到SD卡时无法初始化SD卡的问题。如果问题仍然存在,请提供更多详细信息,以便进一步分析和解决问题。 |
|
|
|
只有小组成员才能发言,加入小组>>
1153 浏览 1 评论
584浏览 6评论
480浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
465浏览 5评论
466浏览 4评论
441浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 21:13 , Processed in 0.809919 second(s), Total 80, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号