TI论坛
直播中

梁艳

7年用户 262经验值
私信 关注
[问答]

DSP程序跑飞

ti的各位专家大家好:
      第一次发帖,请多多包涵。本人使用的是F28027 C2000 Piccolo LaunchPad进行无刷电机开发,开发环境是CCS5.5,无刷电机使用的例程版本是motorware_1_01_00_16。在调试例程中不断出现了程序跑飞的很问题,还请专家们帮忙解答,问题具体描述如下:
这是例程的C语言代码,出现在例程user.c文件 void USER_setParams(USER_Params *pUserParams) 函数当中
pUserParams->motor_Rr = USER_MOTOR_Rr;
pUserParams->motor_Rs = USER_MOTOR_Rs;
pUserParams->motor_Ls_d = USER_MOTOR_Ls_d;pUserParams->motor_Ls_q = USER_MOTOR_Ls_q;
if(((float_t)(pUserParams->motor_Rr) >(float_t)0)&&((float_t)pUserParams->motor_Rs > (float_t)0.0))
[
    pUserParams->powerWarpGain = sqrt((float_t)1.0 + (pUserParams->motor_Rr)/(pUserParams->motor_Rs));
]
else
[
    pUserParams->powerWarpGain = USER_POWERWARP_GAIN;
]
if语句翻译的汇编代码如下:
if(((float_t)(pUserParams->motor_Rr) >(float_t)0)&&((float_t)pUserParams->motor_Rs > (float_t)0.0))
3f27e0: 9A00 MOVB AL, #0x0
3f27e1: 9B00 MOVB AH, #0x0
3f27e2: 1E42 MOVL *-SP[2], ACC
3f27e3: 8A44 MOVL XAR4, *-SP[4]
3f27e4: D038 MOVB XAR0, #0x38
3f27e5: 0694 MOVL ACC, *+XAR4[AR0]
3f27e6: 767FDF2B LCR 0x3fdf2b
3f27e8: 5200 CMPB AL, #0x0
3f27e9: 651F SB C$L3, LEQ
3f27ea: 9A00 MOVB AL, #0x0
3f27eb: 9B00 MOVB AH, #0x0
3f27ec: 1E42 MOVL *-SP[2], ACC
3f27ed: 8A44 MOVL XAR4, *-SP[4]
3f27ee: D03A MOVB XAR0, #0x3a
3f27ef: 0694 MOVL ACC, *+XAR4[AR0]
3f27f0: 767FDF2B LCR 0x3fdf2b
3f27f2: 5200 CMPB AL, #0x0
3f27f3: 6515 SB C$L3, LEQ
汇编代码第7行出现:3f27e6: 767FDF2B LCR 0x3fdf2b,能麻烦专家帮我解释下为什么会有这样一句长跳转指令,长跳转指令的执行结果是:
3fdf2b:   ???? Memory map prevented reading 0x3FDF2B@Program [code=0x20000]。
然后程序就跑飞了。多次重复调试均会出现同样问题,导致电机开发工作无法进展,还请各位帮忙解决,感激不尽!

回帖(3)

梁艳

2018-12-3 16:11:46
终于找到答案,好悲催!给大家分享一下:
We are seeing poor behavior with MotorWare projects being built in the latest CCSv5.5. We have already tracked one issue down to a build options level difference from 5.4 to 5.5 (which causes projects not to build thankfully) but there are other issues happening where the projects build successfully yet the performance is quite poor (motor doesn't start-up, ID doesn't work, currents look terrible).  Sometimes it's dramatic, sometimes you may not notice.
Please do NOT use Compiler 6.2.0, 6.2.1, or 6.2.2 until this is resovled.
Please revert to the MotorWare tested Compiler 6.1.5, and if possible back to CCS5.4.0
Our hope is we are able to patch the MotorWare projects so that they work correctly with 5.5/6.2.1 for the next release (Version _10 in November).
 
举报

凌章致

2018-12-3 16:26:46
引用: 60user76 发表于 2018-12-3 06:08
终于找到答案,好悲催!给大家分享一下:
We are seeing poor behavior with MotorWare projects being built in the latest CCSv5.5. We have already tracked one issue down to a build options level difference from 5.4 to 5.5 (which causes projects not to build thankfully) but there are other issues happen ...


TI官方文档给出的说法是6.2.0-6.2.2包含IQMath 编译bug~
为了避免不必要的麻烦还是推荐CCS V6或升级编译器版本。
升级编译器版本:CCS5.5 Help 》 Check for Updates。
在进行项目编译时:build>>properties>>General>>Advance settings>> compiler Verision>>选择高版本编译器
只有升级完成后才会后高版本编译器的选项。
举报

胡红枚

2018-12-3 16:32:40
引用: 60user76 发表于 2018-12-3 06:08
终于找到答案,好悲催!给大家分享一下:
We are seeing poor behavior with MotorWare projects being built in the latest CCSv5.5. We have already tracked one issue down to a build options level difference from 5.4 to 5.5 (which causes projects not to build thankfully) but there are other issues happen ...

感谢分享     能找到这样的解释不容易
举报

更多回帖

发帖
×
20
完善资料,
赚取积分