OpenEdv-开源电子网
标题:
混编遇到问题
[打印本页]
作者:
pathfinder
时间:
2016-8-21 18:35
标题:
混编遇到问题
在C程序中加入了
#pragam asm
MOV R1, 0X12;
#pragam endasm
同样
作者:
正点原子
时间:
2016-8-21 18:35
参考这个:
[mw_shl_code=cpp,true]//设置栈顶地址
//addr:栈顶地址
__asm void MSR_MSP(u32 addr)
{
MSR MSP, r0 //set Main Stack value
BX r14
}[/mw_shl_code]
作者:
pathfinder
时间:
2016-8-21 18:36
error: #11-D: unrecognized preprocessing directive #pragam asm ..\src\main.c(92): error: #20: identifier "MOV" is undefined MOV R1, 0X12; ..\src\main.c(92): error: #40: expected an identifier MOV R1, 0X12; ..\src\main.c(93): error: #11-D: unrecognized preprocessing directive #pragam endasm ..\src\main.c: 0 warnings, 4 errors ".\STM32303C-EVAL\STM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s). Target not created
作者:
pathfinder
时间:
2016-8-21 18:36
Build target 'STM32303C-EVAL'
compiling main.c...
..\src\main.c(90): error: #11-D: unrecognized preprocessing directive
#pragam asm
..\src\main.c(92): error: #20: identifier "MOV" is undefined
MOV R1, 0X12;
..\src\main.c(92): error: #40: expected an identifier
MOV R1, 0X12;
..\src\main.c(93): error: #11-D: unrecognized preprocessing directive
#pragam endasm
..\src\main.c: 0 warnings, 4 errors
".\STM32303C-EVAL\STM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s).
Target not created
作者:
pathfinder
时间:
2016-8-21 18:37
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
..\src\main.c: 0 warnings, 4 errors
".\STM32303C-EVAL\STM32303C-EVAL.axf" - 4 Error(s), 0 Warning(s).
Target not created
作者:
mcu369
时间:
2016-8-22 00:20
兄弟,是“pragma”好吧?低级错误哦!
作者:
shikihane
时间:
2016-8-22 13:46
你不会在STM32上写51的汇编把?那肯定没用的
作者:
pathfinder
时间:
2016-8-22 19:28
不是,是在C程序中嵌入汇编程序
作者:
mcu369
时间:
2016-8-23 12:09
到底解决了没有啊兄弟???
作者:
shikihane
时间:
2016-8-23 13:47
pathfinder 发表于 2016-8-22 19:28
不是,是在C程序中嵌入汇编程序
我记得只有51的混编能这样写,32的要用别的办法
作者:
pathfinder
时间:
2016-8-26 12:15
Build target 'Demo'
作者:
pathfinder
时间:
2016-8-26 12:20
@ 正点原子 加入的代码:
__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
".\Demo\Demo.axf" - 2 Error(s), 2 Warning(s).
Target not created
欢迎光临 OpenEdv-开源电子网 (http://openedv.com/)
Powered by Discuz! X3.4