Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Filesystem
littlefs包编译报错 error: expected ')' before 'PRIu32'
发布于 2020-04-04 00:49:47 浏览:2586
订阅该版
* 本帖最后由 pkokoc 于 2020-4-4 00:51 编辑 * 参照官方配置教程 : 在 STM32L4 上应用 littlefs 文件系统, [https://www.rt-thread.org/document/site/application-note/components/dfs/an0027-littlefs/](https://www.rt-thread.org/document/site/application-note/components/dfs/an0027-littlefs/) 在STM32F103VET6上配置littlefs,区别是使能外部flash采用的是SPI,而不是教程中的QSPI 编译出现如下错误。网络上查找了一下,给出的解决办法大都是在出现该错误的文件中需包含 下面这个头文件 #include
检查了一下仅lfs.c 文件中未包含,增加该头文件。其它有错误提示的文件中经检查均已经存在该头文件了。 不知还要更改哪里? 使用环境: OS: ubuntu16.04,vscode 1.43.2, rt-thread 4.0.3 不增加littlefs包前,程序都能正常编译运行 ```kou@aikou:~/kstm32/$ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... scons: building associated VariantDir targets: build CC build/packages/littlefs-v2.0.5/lfs.o In file included from packages/littlefs-v2.0.5/lfs_util.h:19, from packages/littlefs-v2.0.5/lfs.c:20: packages/littlefs-v2.0.5/lfs.c: In function 'lfs_alloc': packages/littlefs-v2.0.5/lfs.c:479:44: error: expected ')' before 'PRIu32' 479 | LFS_WARN("No more free space %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:27:32: note: in definition of macro 'LFS_WARN' 27 | rt_kprintf("lfs warn:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_dir_fetchmatch': packages/littlefs-v2.0.5/lfs.c:973:40: error: expected ')' before 'PRIu32' 973 | LFS_ERROR("Corrupted dir pair at %"PRIu32" %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:34:33: note: in definition of macro 'LFS_ERROR' 34 | rt_kprintf("lfs error:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_dir_compact': packages/littlefs-v2.0.5/lfs.c:1474:58: error: expected ')' before 'PRIu32' 1474 | LFS_DEBUG("Expanding superblock at rev %"PRIu32, dir->rev); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:1609:39: error: expected ')' before 'PRIu32' 1609 | LFS_DEBUG("Bad block at %"PRIu32, dir->pair[1]); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:1614:36: error: expected ')' before 'PRIu32' 1614 | LFS_WARN("Superblock %"PRIu32" has become unwritable", oldpair[1]); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:27:32: note: in definition of macro 'LFS_WARN' 27 | rt_kprintf("lfs warn:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:1632:33: error: expected ')' before 'PRIu32' 1632 | LFS_DEBUG("Relocating %"PRIu32" %"PRIu32" to %"PRIu32" %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_ctz_extend': packages/littlefs-v2.0.5/lfs.c:2201:35: error: expected ')' before 'PRIu32' 2201 | LFS_DEBUG("Bad block at %"PRIu32, nblock); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_file_relocate': packages/littlefs-v2.0.5/lfs.c:2486:35: error: expected ')' before 'PRIu32' 2486 | LFS_DEBUG("Bad block at %"PRIu32, nblock); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_file_flush': packages/littlefs-v2.0.5/lfs.c:2549:43: error: expected ')' before 'PRIu32' 2549 | LFS_DEBUG("Bad block at %"PRIu32, file->block); | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_mount': packages/littlefs-v2.0.5/lfs.c:3404:46: error: expected ')' before 'PRIu16' 3404 | LFS_ERROR("Invalid version %"PRIu16".%"PRIu16, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:34:33: note: in definition of macro 'LFS_ERROR' 34 | rt_kprintf("lfs error:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:3413:56: error: expected ')' before 'PRIu32' 3413 | LFS_ERROR("Unsupported name_max (%"PRIu32" > %"PRIu32")", | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:34:33: note: in definition of macro 'LFS_ERROR' 34 | rt_kprintf("lfs error:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:3424:56: error: expected ')' before 'PRIu32' 3424 | LFS_ERROR("Unsupported file_max (%"PRIu32" > %"PRIu32")", | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:34:33: note: in definition of macro 'LFS_ERROR' 34 | rt_kprintf("lfs error:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:3435:56: error: expected ')' before 'PRIu32' 3435 | LFS_ERROR("Unsupported attr_max (%"PRIu32" > %"PRIu32")", | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:34:33: note: in definition of macro 'LFS_ERROR' 34 | rt_kprintf("lfs error:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:3462:33: error: expected ')' before 'PRIu32' 3462 | LFS_DEBUG("Found move %"PRIu32" %"PRIu32" %"PRIu16, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_fs_relocate': packages/littlefs-v2.0.5/lfs.c:3634:38: error: expected ')' before 'PRIu32' 3634 | LFS_DEBUG("Relocating root %"PRIu32" %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_fs_demove': packages/littlefs-v2.0.5/lfs.c:3712:30: error: expected ')' before 'PRIu32' 3712 | LFS_DEBUG("Fixing move %"PRIu32" %"PRIu32" %"PRIu16, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c: In function 'lfs_fs_deorphan': packages/littlefs-v2.0.5/lfs.c:3760:44: error: expected ')' before 'PRIu32' 3760 | LFS_DEBUG("Fixing orphan %"PRIu32" %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ packages/littlefs-v2.0.5/lfs.c:3781:49: error: expected ')' before 'PRIu32' 3781 | LFS_DEBUG("Fixing half-orphan %"PRIu32" %"PRIu32, | ^~~~~~ packages/littlefs-v2.0.5/lfs_config.h:20:33: note: in definition of macro 'LFS_DEBUG' 20 | rt_kprintf("lfs debug:%d: " fmt "
", __LINE__, __VA_ARGS__) | ^~~ scons: *** [build/packages/littlefs-v2.0.5/lfs.o] Error 1 scons: building terminated because of errors. ```
查看更多
3
个回答
默认排序
按发布时间排序
aozima
2020-04-04
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
bsp目录下的cconfig.h删除一下,编译会重新生成看看。 编译器是哪个?
pkokoc
2020-04-04
这家伙很懒,什么也没写!
[i=s] 本帖最后由 pkokoc 于 2020-4-4 12:39 编辑 [/i] >bsp目录下的cconfig.h删除一下,编译会重新生成看看。 >编译器是哪个? --- 如此操作,问题依旧。 1、编译器是gcc ,版本 gcc-arm-none-eabi-9-2019-q4-major,具体版本如下 ``` kou@aikou:~/kstm32/gcc-arm-none-eabi-9-2019-q4-major/bin$ arm-none-eabi-gcc -v Using built-in specs. COLLECT_GCC=arm-none-eabi-gcc COLLECT_LTO_WRAPPER=/home/kou/kstm32/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/lto-wrapper Target: arm-none-eabi Configured with: /mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/src/gcc/configure --target=arm-none-eabi --prefix=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native --libexecdir=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/lib --infodir=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/install-native/arm-none-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/build-native/host-libs/usr --with-mpfr=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/build-native/host-libs/usr --with-mpc=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/build-native/host-libs/usr --with-isl=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/build-native/host-libs/usr --with-libelf=/mnt/workspace/workspace/GCC-9-pipeline/jenkins-GCC-9-pipeline-100_20191030_1572397542/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for Arm Embedded Processors 9-2019-q4-major' --with-multilib-list=rmprofile Thread model: single gcc version 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] (GNU Tools for Arm Embedded Processors 9-2019-q4-major) ``` 2、删除bsp下的cconfig.h ,重新scons 编译,发现会自动生成一个 cconfig.h 文件。其容与删除前的该同名文件相同,如下。 ``` #ifndef CCONFIG_H__ #define CCONFIG_H__ /* Automatically generated file; DO NOT EDIT. */ /* compiler configure file for RT-Thread in GCC*/ #define HAVE_NEWLIB_H 1 #define LIBC_VERSION "newlib 3.1.0" #define HAVE_SYS_SIGNAL_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_PTHREAD_H 1 #define HAVE_FDSET 1 #define HAVE_SIGACTION 1 #define HAVE_SIGEVENT 1 #define HAVE_SIGINFO 1 #define HAVE_SIGVAL 1 #define GCC_VERSION "9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]" #define STDC "2011" #endif ```
pkokoc
2020-04-04
这家伙很懒,什么也没写!
又看了下,在 lfs_config.h 前面增加下面几个宏定义,上述错误消除 ``` #define LFS_NO_WARN #define LFS_NO_DEBUG #define LFS_NO_ERROR #define LFS_NO_INFO ```
撰写答案
登录
注册新账号
关注者
0
被浏览
2.6k
关于作者
pkokoc
这家伙很懒,什么也没写!
提问
20
回答
125
被采纳
4
关注TA
发私信
相关问题
1
字库除了SD卡和http还有别的方式导入吗
2
如何同时使用RTT文件系统于NAND Flash 和 SD卡,针对Realboard4088?
3
EasyFlash好棒
4
SD卡挂在的SPI总线又要加个DA设备
5
sd卡与flash 同时挂载 挂载路径shell怎么区分 访问
6
请教ramfs使用方法
7
rtt stable2.0.x版本 sd卡及文件系统
8
nandflash文件系统UFFS请教
9
关于SD卡挂载文件系统的问题(已解决)
10
Yaffs采用GPL2许可
推荐文章
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
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
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
WIZnet_W5500
UART
ota在线升级
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
ulog
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
a1012112796
13
个答案
2
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
7
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
3
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部