Search found 19 matches

by jame113
Tue Aug 10, 2021 11:18 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

我尝试在ff_raw_write中按照您说的方法操作, 但好像在write方法中, 不能进行read操作? 测试代码和日志错下: DRESULT ff_raw_write(BYTE pdrv, const BYTE *buff, DWORD sector, UINT count) { ESP_LOGV(TAG, "ff_raw_write - pdrv=%i, sector=%d, count=%d, char:%s", (unsigned int)pdrv, (unsigned int)sector, (unsigned int)count, buff); BYTE *buff4096 = ...
by jame113
Tue Aug 10, 2021 8:51 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

@ESP_igrr 大神, 我已按您建议的1,2,3修改了代码, 现在可以正常挂载,并且读取windows下拷贝的文件了。 但ff_raw_write函数写入部分,因为我水平太低, 并且对文件系统底层基本不懂, 我尝试了很多遍,都没写出来, 这个需求阻塞在我这快两个礼拜了, 能否帮实现一下ff_raw_write函数? 多谢。:) I think the reason why you can't mount the filesystem created by Windows is that the firmware code uses 4096 bytes as the sector size...
by jame113
Tue Aug 10, 2021 6:30 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

多谢, 我先试试mac或linux下格式化, 确认扇区大小为4096byte, 如果还是不行, 就按您的意见尝试修改代码。 I think the reason why you can't mount the filesystem created by Windows is that the firmware code uses 4096 bytes as the sector size. When you format the partition in Windows, it allows you to choose the cluster size , not sector size. W...
by jame113
Tue Aug 10, 2021 2:27 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

还是mount不了Windows下格式化的fat格式, 能否帮看看问题出在哪?谢谢。 使用IDF版本: v4.1.1-351-g935deb4082 编译环境:macOS mount时日志如下: I (8225) example: Initializing external SPI Flash I (8225) example: Pin assignments: I (8225) example: MOSI: 23 MISO: 19 SCLK: 18 CS: 5 D (8229) spi: SPI3 use iomux pins. V (8232) intr_alloc: esp_intr_a...
by jame113
Sun Aug 08, 2021 12:28 pm
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

收到, 非常感谢,我试试您说的办法。
我们因为有其他的第三方mcu需要与esp32一起读写flash, 所以官方的wear levelling中间层虽然很好, 但我们用不了;并且我们的写次数是非常有限的。
by jame113
Sun Aug 08, 2021 7:13 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

如上,补充说明:
使用esp_vfs_fat_rawflash_mount替换原来的esp_vfs_fat_spiflash_mount后,
如果是使用windows格式化的fat32,则不能mount成功;
如果先用esp_vfs_fat_spiflash_mount,进行格式化,然后在用esp_vfs_fat_rawflash_mount就可以挂载成功。
by jame113
Sun Aug 08, 2021 6:39 am
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

尝试修改官方的例子, 在mount时, 使用:esp_vfs_fat_rawflash_mount替换原来的esp_vfs_fat_spiflash_mount, 可以mount成功,也可以写入成功, 写入成功后立即读取, 读取到的内容与写入内容不符, 重启esp32后重新读取写入的文件,显示fresult=4, 查了下,好像是文件不存在的错误码。 I (6723) example: Mounting FAT filesystem 2 D (6728) vfs_fat_spiflash: using pdrv=0 V (6732) diskio_rawflash: ff_raw_ioctl: ...
by jame113
Sun Aug 08, 2021 4:33 am
Forum: ESP-IDF
Topic: Using FatFS without wear leveling
Replies: 1
Views: 4027

Re: Using FatFS without wear leveling

Have you found a way to solve this problem?
Thanks a lot
by jame113
Sat Aug 07, 2021 2:30 pm
Forum: ESP-IDF 中文讨论版
Topic: [已解决] 看门狗触发后如何重启esp32
Replies: 15
Views: 23197

Re: 看门狗触发后如何重启esp32

ESP_Gargamel wrote:
Tue Jul 13, 2021 6:37 am
你串口 log 可以在 PC 直接存到文件吗?不要等出问题了,再去查看。
@ESP_Gargamel 非常感谢。
使用Invoke panic handler on Task Watchdog timeout选项后, 系统虽然有出现上面的问题, 但均成功重启了,
加之这个问题属于偶发现象,所有重启选项已经可以确保系统无人值守的长期工作了。

至今没有抓到有价值的日志,可能是日志级别的问题。

再次感谢:)
by jame113
Fri Aug 06, 2021 3:37 pm
Forum: ESP-IDF 中文讨论版
Topic: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?
Replies: 11
Views: 11668

Re: 【求助】ESP32通过spi外接flash的fat格式与PC不能兼容?

Hi jame113, sorry for replying in English. ext_flash_fatfs example uses ESP-IDF wear_levelling library as an intermediate layer between FATFS and flash. The purpose of wear_levelling library is to reorder the sectors and distribute erase operations across the flash partition, effectively extending ...