完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有一个 ESP-Prog 连接到 TTGO T8 ESP32 板(仅限 JTAG 接口)。一旦我初始化 sd 卡,我就无法调试应用程序。
以下是有效的日志(无 SD 卡): 代码:全选 $ openocd -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:47) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 20000 kHz Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling" Info : clock speed 20000 kHz Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : starting gdb server for esp32.cpu0 on 3333 Info : Listening on port 3333 for gdb connections Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Info : [esp32.cpu1] Debug controller was reset. Info : [esp32.cpu1] Core was reset. Info : [esp32.cpu0] Target halted, PC=0x4008C192, debug_reason=00000000 Info : [esp32.cpu0] Reset cause (1) - (Power on reset) Info : [esp32.cpu1] Target halted, PC=0x4008C192, debug_reason=00000000 Info : [esp32.cpu1] Reset cause (14) - (CPU1 reset by CPU0) 我也试过代码:全选 $ openocd -f board/esp32-wrover-kit-3.3v.cfg - 相同的故事。 然后我添加 代码:全选 sdcard_mount_mmc(); 在main函数中重新编译并通过USB刷机,看到如下openocd日志: 代码:全选 Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Info : [esp32.cpu1] Debug controller was reset. Info : [esp32.cpu1] Core was reset. Info : [esp32.cpu0] Target halted, PC=0x4000942F, debug_reason=00000000 Info : [esp32.cpu0] Reset cause (1) - (Power on reset) Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Info : [esp32.cpu0] Target halted, PC=0x40064AE0, debug_reason=00000000 Info : [esp32.cpu0] Reset cause (1) - (Power on reset) Error: [esp32.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32.cpu1] Unexpected OCD_ID = 00000000 Error: [esp32.cpu1] Unexpected OCD_ID = 00000000 Info : [esp32.cpu1] Debug controller was reset. Info : [esp32.cpu1] Core was reset. Info : [esp32.cpu1] Target halted, PC=0x40008547, debug_reason=00000000 Info : [esp32.cpu1] Reset cause (14) - (CPU1 reset by CPU0) Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Error: [esp32.cpu0] DSR (FFFFFFFF) indicates target still busy! Error: [esp32.cpu0] DSR (FFFFFFFF) indicates DIR instruction generated an exception! Error: [esp32.cpu0] DSR (FFFFFFFF) indicates DIR instruction generated an overrun! Info : [esp32.cpu0] Target halted, PC=0xFFFFFFFF, debug_reason=00000000 Error: [esp32.cpu1] Unexpected OCD_ID = ffffffff Info : Set GDB target to 'esp32.cpu0' Info : [esp32.cpu0] Disabling LDDR32.P/SDDR32.P Info : [esp32.cpu0] Disabling LDDR32.P/SDDR32.P Warn : [esp32.cpu0] Failed writing 4 bytes at address 0x3ff5f048 Error: Failed to write ESP32_TIMG0WDT_CFG0 (-4)! Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Info : [esp32.cpu0] Target halted, PC=0x00000000, debug_reason=00000000 Info : [esp32.cpu0] Reset cause (63) - (Unknown reset cause) Error: [esp32.cpu1] Unexpected OCD_ID = 00000000 Info : [esp32.cpu0] Disabling LDDR32.P/SDDR32.P Warn : [esp32.cpu0] Failed writing 4 bytes at address 0x3ff5f048 Error: Failed to write ESP32_TIMG0WDT_CFG0 (-4)! Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Error: [esp32.cpu0] Timed out waiting for CPU to be reset, target state=0 Error: [esp32.cpu0] Failed to wait for target halt to read reset cause (0)! Polling target esp32.cpu0 failed, trying to reexamine Error: [esp32.cpu0] Unexpected OCD_ID = 00000000 Examination failed, GDB will be halted. Polling again in 100ms Polling target esp32.cpu0 failed, trying to reexamine Error: [esp32.cpu0] Unexpected OCD_ID = 00000000 Examination failed, GDB will be halted. Polling again in 100ms Polling target esp32.cpu0 failed, trying to reexamine Info : [esp32.cpu0] Debug controller was reset. Info : [esp32.cpu0] Core was reset. Error: [esp32.cpu0] Timed out waiting for CPU to be reset, target state=1 Error: [esp32.cpu0] Failed to wait for target halt to read reset cause (0)! Polling target esp32.cpu0 failed, trying to reexamine 重新启动 openocd 没有帮助: 代码:全选 Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling" Info : clock speed 20000 kHz Error: JTAG scan chain interrogation failed: all zeroes Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: esp32.cpu0: IR capture error; saw 0x00 not 0x01 Warn : Bypassing JTAG setup events due to errors Error: [esp32.cpu0] Unexpected OCD_ID = 00000000 Warn : target esp32.cpu0 examination failed Error: [esp32.cpu1] Unexpected OCD_ID = 00000000 Warn : target esp32.cpu1 examination failed Info : starting gdb server for esp32.cpu0 on 3333 Info : Listening on port 3333 for gdb connections 我注意到一个有趣的行为:当我列出 sdcard 并尝试同时启动 openocd 服务器时,openocd 日志是: 代码:全选 Info : TAP esp32.cpu0 does not have valid IDCODE (idcode=0xf8000000) Info : TAP esp32.cpu1 does not have valid IDCODE (idcode=0xfc000000) Info : TAP auto0.tap does not have valid IDCODE (idcode=0xfe000000) Info : TAP auto1.tap does not have valid IDCODE (idcode=0xff000000) Info : TAP auto2.tap does not have valid IDCODE (idcode=0xff800000) Info : TAP auto3.tap does not have valid IDCODE (idcode=0xffc00000) Info : TAP auto4.tap does not have valid IDCODE (idcode=0xffe00000) Info : TAP auto5.tap does not have valid IDCODE (idcode=0xfff00000) Info : TAP auto6.tap does not have valid IDCODE (idcode=0xfff80000) Info : TAP auto7.tap does not have valid IDCODE (idcode=0xfffc0000) Info : TAP auto8.tap does not have valid IDCODE (idcode=0xfffe0000) Info : TAP auto9.tap does not have valid IDCODE (idcode=0x7fff0000) Info : TAP auto10.tap does not have valid IDCODE (idcode=0x3fff8000) Info : TAP auto11.tap does not have valid IDCODE (idcode=0x1fffc000) Info : TAP auto12.tap does not have valid IDCODE (idcode=0xfffe000) Info : TAP auto13.tap does not have valid IDCODE (idcode=0x7fff000) Info : TAP auto14.tap does not have valid IDCODE (idcode=0x3fff800) Info : TAP auto15.tap does not have valid IDCODE (idcode=0x1fffc00) Info : TAP auto16.tap does not have valid IDCODE (idcode=0xfffe00) Info : TAP auto17.tap does not have valid IDCODE (idcode=0x7fff00) Info : TAP auto18.tap does not have valid IDCODE (idcode=0x3fff80) Warn : Unexpected idcode after end of chain: 21 0x001fffc0 Warn : Unexpected idcode after end of chain: 53 0x00000000 Warn : Unexpected idcode after end of chain: 85 0x00000000 Warn : Unexpected idcode after end of chain: 117 0x00000000 Warn : Unexpected idcode after end of chain: 149 0x00000000 Warn : Unexpected idcode after end of chain: 181 0x07fff800 Warn : Unexpected idcode after end of chain: 213 0x00000000 Warn : Unexpected idcode after end of chain: 245 0x00000000 Warn : Unexpected idcode after end of chain: 277 0x00000000 Warn : Unexpected idcode after end of chain: 309 0x00000000 Warn : Unexpected idcode after end of chain: 341 0xffff0000 Warn : Unexpected idcode after end of chain: 373 0x00000000 Warn : Unexpected idcode after end of chain: 405 0x00000000 Warn : Unexpected idcode after end of chain: 437 0x00000000 Warn : Unexpected idcode after end of chain: 469 0x00000000 Warn : Unexpected idcode after end of chain: 501 0xffe00000 Warn : Unexpected idcode after end of chain: 533 0x0000001f Warn : Unexpected idcode after end of chain: 565 0x00000000 Warn : Unexpected idcode after end of chain: 597 0x00000000 Warn : Unexpected idcode after end of chain: 629 0x00000000 尝试了 SD MMC 和 SPI 接口。相同的故事。函数“sdcard_mount_mmc”本身: 代码:全选 static void sdcard_mount_finish(esp_err_t err) { if (err == ESP_OK) { ESP_LOGI(TAG, "SD card mounted at %s", sdcard_mount_point); sdmmc_card_print_info(stdout, m_card); /* Print free memory size info */ printf("Free: %lluMBn", sdcard_get_free_bytes() / (1 << 20)); } else { ESP_LOGW(TAG, "sdcard_mount failed (%s)", esp_err_to_name(err)); } } /** * Initialize and mount the SD card with MMC interface * * @return err code */ esp_err_t sdcard_mount_mmc() { ESP_LOGI(TAG, "Mounting SD MMC..."); esp_vfs_fat_sdmmc_mount_config_t mount_config = SDCARD_MOUNT_CONFIG_DEFAULT(); sdmmc_host_t host = SDMMC_HOST_DEFAULT(); host.max_freq_khz = SDMMC_FREQ_HIGHSPEED; // This initializes the slot without card detect (CD) and write protect (WP) signals. // Modify slot_config.gpio_cd and slot_config.gpio_wp if your board has these signals. sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT(); // Use 1-line SD mode slot_config.width = 1; // Enable internal pullups on enabled pins. The internal pullups // are insufficient however, please make sure 10k external pullups are // connected on the bus. This is for debug / example purpose only. slot_config.flags |= SDMMC_SLOT_FLAG_INTERNAL_PULLUP; esp_err_t err = esp_vfs_fat_sdmmc_mount(sdcard_mount_point, &host, &slot_config, &mount_config, &m_card); sdcard_mount_finish(err); return err; } 添加其他代码块、I2C 东西、WiFI 等似乎对 openocd 没有影响(它不会被破坏)。只有 SD 卡很重要。 有什么线索吗? |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
733 浏览 1 评论
552浏览 6评论
461浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
445浏览 5评论
446浏览 4评论
417浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 16:31 , Processed in 0.641683 second(s), Total 46, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号