Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
esp32
SFUD
文件系统
ESP32使用文件系统时找不到头文件
发布于 2024-11-04 20:15:21 浏览:132
订阅该版
dfs,libc和SFUD都已经打开了,但编译时产生如下错误: ```c scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/kernel/components/dfs/dfs_v1/filesystems/devfs/devfs.o In file included from /home/lzx/myrtt/rt-thread/components/dfs/dfs_v1/filesystems/devfs/devfs.c:14: /home/lzx/myrtt/rt-thread/components/dfs/dfs_v1/include/dfs.h:21:10: fatal error: sys/statfs.h: No such file or directory 21 | #include
| ^~~~~~~~~~~~~~ compilation terminated. scons: *** [build/kernel/components/dfs/dfs_v1/filesystems/devfs/devfs.o] Error ``` 之后我将头文件改成绝对路径的方式可以编译这行代码,但产生新的错误: ```c CC build/kernel/components/dfs/dfs_v1/filesystems/devfs/devfs.o /home/lzx/myrtt/rt-thread/components/dfs/dfs_v1/filesystems/devfs/devfs.c: In function 'dfs_device_fs_getdents': /home/lzx/myrtt/rt-thread/components/dfs/dfs_v1/filesystems/devfs/devfs.c:363:12: error: 'struct dirent' has no member named 'd_namlen'; did you mean 'd_name'? 363 | d->d_namlen = RT_NAME_MAX; | ^~~~~~~~ | d_name /home/lzx/myrtt/rt-thread/components/dfs/dfs_v1/filesystems/devfs/devfs.c:364:10: error: 'struct dirent' has no member named 'd_reclen' 364 | d->d_reclen = (rt_uint16_t)sizeof(struct dirent); | ^~ ``` 我怀疑是工具链的问题,文件系统的工具链并没有适配到scons构建系统,但不太确定,希望大佬指点 我的部分配置如下: ```c /* DFS: device virtual file system */ #define RT_USING_DFS #define DFS_USING_POSIX #define DFS_USING_WORKDIR #define DFS_FD_MAX 16 #define RT_USING_DFS_V1 #define DFS_FILESYSTEMS_MAX 4 #define DFS_FILESYSTEM_TYPES_MAX 4 #define RT_USING_DFS_ELMFAT /* elm-chan's FatFs, Generic FAT Filesystem Module */ #define RT_DFS_ELM_CODE_PAGE 437 #define RT_DFS_ELM_WORD_ACCESS #define RT_DFS_ELM_USE_LFN_3 #define RT_DFS_ELM_USE_LFN 3 #define RT_DFS_ELM_LFN_UNICODE_0 #define RT_DFS_ELM_LFN_UNICODE 0 #define RT_DFS_ELM_MAX_LFN 255 #define RT_DFS_ELM_DRIVES 2 #define RT_DFS_ELM_MAX_SECTOR_SIZE 4096 #define RT_DFS_ELM_REENTRANT #define RT_DFS_ELM_MUTEX_TIMEOUT 3000 /* end of elm-chan's FatFs, Generic FAT Filesystem Module */ #define RT_USING_DFS_DEVFS /* end of DFS: device virtual file system */ /* Device Drivers */ #define RT_USING_DEVICE_IPC #define RT_UNAMED_PIPE_NUMBER 64 #define RT_USING_SYSTEM_WORKQUEUE #define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048 #define RT_SYSTEM_WORKQUEUE_PRIORITY 23 #define RT_USING_SERIAL #define RT_USING_SERIAL_V1 #define RT_SERIAL_RB_BUFSZ 64 #define RT_USING_SPI #define RT_USING_SFUD #define RT_SFUD_USING_SFDP #define RT_SFUD_USING_FLASH_INFO_TABLE #define RT_SFUD_SPI_MAX_HZ 50000000 #define RT_USING_PIN #define RT_USING_KTIME /* end of Device Drivers */ /* C/C++ and POSIX layer */ /* ISO-ANSI C layer */ /* Timezone and Daylight Saving Time */ #define RT_LIBC_USING_LIGHT_TZ_DST #define RT_LIBC_TZ_DEFAULT_HOUR 8 #define RT_LIBC_TZ_DEFAULT_MIN 0 #define RT_LIBC_TZ_DEFAULT_SEC 0 /* end of Timezone and Daylight Saving Time */ /* end of ISO-ANSI C layer */ /* POSIX (Portable Operating System Interface) layer */ #define RT_USING_POSIX_FS #define RT_USING_POSIX_DEVIO #define RT_USING_POSIX_STDIO #define RT_USING_POSIX_POLL #define RT_USING_POSIX_SELECT #define RT_USING_POSIX_EVENTFD #define RT_USING_POSIX_TIMERFD #define RT_USING_POSIX_SOCKET #define RT_USING_POSIX_TERMIOS #define RT_USING_POSIX_AIO #define RT_USING_POSIX_DELAY ```
查看更多
1
个回答
默认排序
按发布时间排序
qq1078249029
2024-11-05
这家伙很懒,什么也没写!
目前修改Cmake可以让 `sys/statfs.h` 文件被系统识别,但出现了新的错误 ```c -- Configuring done -- Generating done -- Build files have been written to: /home/lzx/myrtt/rt-thread/bsp/ESP32_C3 Consolidate compiler generated dependencies of target rtt_DeviceDrivers [ 0%] Building C object CMakeFiles/rtt_DeviceDrivers.dir/home/lzx/myrtt/rt-thread/components/drivers/core/device.c.obj In file included from /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../components/libc/compilers/common/include/sys/select.h:17, from /opt/riscv32-esp-elf/riscv32-esp-elf/sys-include/sys/types.h:50, from /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../include/rttypes.h:20, from /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../include/rtsched.h:14, from /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../include/rtdef.h:68, from /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../include/rtthread.h:32, from /home/lzx/myrtt/rt-thread/components/drivers/core/device.c:18: /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../components/libc/compilers/common/include/sys/time.h:55:5: error: unknown type name 'time_t' 55 | time_t tv_sec; /* seconds */ | ^~~~~~ /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../components/libc/compilers/common/include/sys/time.h:56:5: error: unknown type name 'suseconds_t' 56 | suseconds_t tv_usec; /* and microseconds */ | ^~~~~~~~~~~ /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../components/libc/compilers/common/include/sys/time.h:107:17: error:unknown type name 'time_t' 107 | int stime(const time_t *t); | ^~~~~~ /home/lzx/myrtt/rt-thread/bsp/ESP32_C3/../../components/libc/compilers/common/include/sys/time.h:108:1: error: unknown type name 'time_t'; did you mean 'size_t'? 108 | time_t timegm(struct tm * const t); | ^~~~~~ | size_t make[2]: *** [CMakeFiles/rtt_DeviceDrivers.dir/build.make:76: CMakeFiles/rtt_DeviceDrivers.dir/home/lzx/myrtt/rt-thread/components/drivers/core/device.c.obj] Error 1 make[1]: *** [CMakeFiles/Makefile2:107: CMakeFiles/rtt_DeviceDrivers.dir/all] Error 2 ``` 我猜测是文件系统需要用到时间戳,而时间戳依赖RTC框架,但ESP32的RTC驱动并没有移植,这就导致了系统找不到time_t,不知道想得对不对
撰写答案
登录
注册新账号
关注者
0
被浏览
132
关于作者
qq1078249029
这家伙很懒,什么也没写!
提问
2
回答
7
被采纳
0
关注TA
发私信
相关问题
1
【分享】如何使用 SFUD 库来操作 SPI Flash 设备
2
SFUD怎么使用
3
请教大家一下关于 SFUD 的的问题
4
移植sfud
5
使用SFUD操作FLASH
6
env使用easyflash不是3.2.4版本,而且没有type插件?
7
新增了W25X32设备成功,无法格式化
8
easyflash随着数据存储量增加,耗费时间加长
9
关于SFDP的问题
10
spi nand flash 能使用SFUD驱动吗
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
简单两步配置RTT源码阅读环境 vsc+clangd
2
恩智浦[FRDM-MCXN947]初探 之 ADC与DAC
3
LVGL使用字库IC芯片显示中文
4
基于STM32H750和Rt-Thread的CANFD通信实现的记录(一)
5
freemodbus主机在freertos的适配,参考rtthread例程
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
UART
WIZnet_W5500
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
编译报错
Debug
SFUD
msh
rt_mq_消息队列_msg_queue
keil_MDK
ulog
MicroPython
C++_cpp
本月问答贡献
出出啊
1517
个答案
342
次被采纳
小小李sunny
1443
个答案
289
次被采纳
张世争
805
个答案
174
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
4
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
1
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部