完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
参考这个:
[C++] 纯文本查看 复制代码 //设置栈顶地址//addr:栈顶地址__asm void MSR_MSP(u32 addr) {MSR MSP, r0 //set Main Stack valueBX r14} |
|
|
|
error: #11-D: unrecognized preprocessing directive #pragam asm ..srcmain.c(92): error: #20: identifier "MOV" is undefined MOV R1, 0X12; ..srcmain.c(92): error: #40: expected an identifier MOV R1, 0X12; ..srcmain.c(93): error: #11-D: unrecognized preprocessing directive #pragam endasm ..srcmain.c: 0 warnings, 4 errors ".STM32303C-EVALSTM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s). Target not created
|
|
|
|
Build target 'STM32303C-EVAL'
compiling main.c... ..srcmain.c(90): error: #11-D: unrecognized preprocessing directive #pragam asm ..srcmain.c(92): error: #20: identifier "MOV" is undefined MOV R1, 0X12; ..srcmain.c(92): error: #40: expected an identifier MOV R1, 0X12; ..srcmain.c(93): error: #11-D: unrecognized preprocessing directive #pragam endasm ..srcmain.c: 0 warnings, 4 errors ".STM32303C-EVALSTM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s). Target not created |
|
|
|
error: #11-D: unrecognized preprocessing directive
#pragam asm error: #20: identifier "MOV" is undefined MOV R1, 0X12; error: #40: expected an identifier MOV R1, 0X12; error: #11-D: unrecognized preprocessing directive #pragam endasm ..srcmain.c: 0 warnings, 4 errors ".STM32303C-EVALSTM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s). Target not created |
|
|
|
兄弟,是“pragma”好吧?低级错误哦!
|
|
|
|
你不会在STM32上写51的汇编把?那肯定没用的
|
|
|
|
不是,是在C程序中嵌入汇编程序
|
|
|
|
到底解决了没有啊兄弟???
|
|
|
|
我记得只有51的混编能这样写,32的要用别的办法
|
|
|
|
Build target 'Demo'
|
|
|
|
@ 发烧友 加入的代码:
__asm void ASM_Test((uint32_t addr_A)) { MSR MSP, r0 //set Main Stack value BX r14 } 出现以下错误! Build target 'Demo' compiling main.c... ..main.c(70): error: #79: expected a type specifier __asm void ASM_Test((uint32_t addr_A)) ..main.c(70): error: #141-D: unnamed prototyped parameters not allowed when body is present __asm void ASM_Test((uint32_t addr_A)) ..main.c(264): warning: #1035-D: single-precision operand implicitly converted to double-precision fCosRoll = sqrt(1.0-(fSinRoll * fSinRoll)); ..main.c(266): warning: #1035-D: single-precision operand implicitly converted to double-precision fCosPitch = sqrt(1.0-(fSinPitch * fSinPitch)); ..main.c: 2 warnings, 2 errors ".DemoDemo.axf" - 2 Error(s), 2 Warning(s). Target not created |
|
|
|
只有小组成员才能发言,加入小组>>
3310 浏览 9 评论
2991 浏览 16 评论
3492 浏览 1 评论
9055 浏览 16 评论
4086 浏览 18 评论
1174浏览 3评论
603浏览 2评论
const uint16_t Tab[10]={0}; const uint16_t *p; p = Tab;//报错是怎么回事?
596浏览 2评论
用NUC131单片机UART3作为打印口,但printf没有输出东西是什么原因?
2333浏览 2评论
NUC980DK61YC启动随机性出现Err-DDR是为什么?
1894浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 19:59 , Processed in 1.401084 second(s), Total 98, Slave 79 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号