bug
Posted isupersun
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bug相关的知识,希望对你有一定的参考价值。
1 168: s[cur] = (Fmin+Acceleration*t[cur]/2.0)*t[cur]; //s = vt + a*t*t/2 = (v+a*t/2)t 2 0x0800144A 499D LDR r1,[pc,#628] ; @0x080016C0 3 0x0800144C F8510024 LDR r0,[r1,r4,LSL #2] 4 0x08001450 F004FEDA BL.W __aeabi_f2d (0x08006208) 5 0x08001454 E9CD0108 STRD r0,r1,[sp,#0x20] 6 0x08001458 4899 LDR r0,[pc,#612] ; @0x080016C0 7 0x0800145A F8501024 LDR r1,[r0,r4,LSL #2] 8 0x0800145E 4658 MOV r0,r11 9 0x08001460 F005F86E BL.W __aeabi_fmul (0x08006540) 10 0x08001464 9001 STR r0,[sp,#0x04] 11 0x08001466 F004FECF BL.W __aeabi_f2d (0x08006208) 12 0x0800146A 4607 MOV r7,r0 13 0x0800146C 2200 MOVS r2,#0x00 14 0x0800146E F04F4380 MOV r3,#0x40000000 15 0x08001472 F004FB5F BL.W __aeabi_ddiv (0x08005B34) 16 0x08001476 E9CD0104 STRD r0,r1,[sp,#0x10] 17 0x0800147A 4628 MOV r0,r5 18 0x0800147C F004FCC9 BL.W __aeabi_ui2d (0x08005E12) 19 0x08001480 E9CD0102 STRD r0,r1,[sp,#0x08] 20 0x08001484 E9DD2304 LDRD r2,r3,[sp,#0x10] 21 0x08001488 F004FAAC BL.W __aeabi_dadd (0x080059E4) 22 0x0800148C E9CD0106 STRD r0,r1,[sp,#0x18] 23 0x08001490 E9DD2308 LDRD r2,r3,[sp,#0x20] 24 0x08001494 F004FCD0 BL.W __aeabi_dmul (0x08005E38) 25 0x08001498 E9CD010A STRD r0,r1,[sp,#0x28] 26 0x0800149C F005F992 BL.W __aeabi_d2ulz (0x080067C4) 27 0x080014A0 4A89 LDR r2,[pc,#548] ; @0x080016C8 28 0x080014A2 EB0202C4 ADD r2,r2,r4,LSL #3 29 0x080014A6 C203 STM r2!,{r0-r1}
1 167: s[cur] =(Fmin*t[cur]+Acceleration*t[cur]*t[cur]/2.0); //s = vt + a*t*t/2 = (v+a*t/2)t 2 168: //s[cur] =(Fmin+Acceleration*t[cur]/2.0)*t[cur]; //s = vt + a*t*t/2 = (v+a*t/2)t 3 0x0800144A 48A0 LDR r0,[pc,#640] ; @0x080016CC 4 0x0800144C F8501024 LDR r1,[r0,r4,LSL #2] 5 0x08001450 9809 LDR r0,[sp,#0x24] 6 0x08001452 F004FFBF BL.W __aeabi_fmul (0x080063D4) 7 0x08001456 9001 STR r0,[sp,#0x04] 8 0x08001458 489C LDR r0,[pc,#624] ; @0x080016CC 9 0x0800145A F8501024 LDR r1,[r0,r4,LSL #2] 10 0x0800145E 9801 LDR r0,[sp,#0x04] 11 0x08001460 F004FFB8 BL.W __aeabi_fmul (0x080063D4) 12 0x08001464 4683 MOV r11,r0 13 0x08001466 F004FE19 BL.W __aeabi_f2d (0x0800609C) 14 0x0800146A 4607 MOV r7,r0 15 0x0800146C 2200 MOVS r2,#0x00 16 0x0800146E F04F4380 MOV r3,#0x40000000 17 0x08001472 F004FB65 BL.W __aeabi_ddiv (0x08005B40) 18 0x08001476 E9CD0104 STRD r0,r1,[sp,#0x10] 19 0x0800147A 4628 MOV r0,r5 20 0x0800147C F004FF96 BL.W __aeabi_ui2f (0x080063AC) 21 0x08001480 4680 MOV r8,r0 22 0x08001482 4892 LDR r0,[pc,#584] ; @0x080016CC 23 0x08001484 F8501024 LDR r1,[r0,r4,LSL #2] 24 0x08001488 4640 MOV r0,r8 25 0x0800148A F004FFA3 BL.W __aeabi_fmul (0x080063D4) 26 0x0800148E 4607 MOV r7,r0 27 0x08001490 F004FE04 BL.W __aeabi_f2d (0x0800609C) 28 0x08001494 E9CD0102 STRD r0,r1,[sp,#0x08] 29 0x08001498 E9DD2304 LDRD r2,r3,[sp,#0x10] 30 0x0800149C F004FAA8 BL.W __aeabi_dadd (0x080059F0) 31 0x080014A0 E9CD0106 STRD r0,r1,[sp,#0x18] 32 0x080014A4 F005F8D8 BL.W __aeabi_d2ulz (0x08006658) 33 0x080014A8 4A8A LDR r2,[pc,#552] ; @0x080016D4 34 0x080014AA EB0202C4 ADD r2,r2,r4,LSL #3 35 0x080014AE C203 STM r2!,{r0-r1}
为了提高运行,想化简公式,结果发现化简公式后,伺服电机电动时,时转时不转。而后一点一点修改代码,发现问题出在上面的语句中,截图了程序的汇编代码以作参考。
以上是关于bug的主要内容,如果未能解决你的问题,请参考以下文章