2016-08-25 36 views
0

私はのSourcery CodeBench IDE、STM32F10XでのプログラミングにCでの作業、そして私はこのコードをコンパイルするとき、私はそれを実行するとビルドに失敗しましたC STM32F10X

int main(void){ 

RCC_Configuration(); 

/* NVIC configuration */ 
NVIC_Configuration(); 

/* GPIO configuration */ 
GPIO_Configuration(); 

SysTick_Configuration(); 

Timer_Configuration(); 

dxl_initialize(0, 1); 
USART_Configuration(USART_PC, Baudrate_PC); 

GoalPos1[0]= 333; 
GoalPos1[1]= 333; 
GoalPos2[0]=690; 
GoalPos2[1]=690; 
GoalPos5[0]=412; 
GoalPos5[1]=412; 
GoalPos6[0]=611; 
GoalPos6[1]=611; 
GoalPos7[0]=355; 
GoalPos7[1]=355; 
GoalPos8[0]=664; 
GoalPos8[1]=664; 
double t = 1.0; 

while(1) 
{ 
    bMoving = dxl_read_byte(id, P_MOVING); 
    CommStatus = dxl_get_result(); 
    if(CommStatus == COMM_RXSUCCESS) 
    { 
     if(bMoving == 0) 
     { 
      if(t<=2){GoalPos3[0]=(int)(-1.5*t+300.7);GoalPos3[1]=(int)(-1.5*t+300.7);}else{GoalPos3[0]=298;GoalPos3[1]=298;}if(t<=2){GoalPos4[0]=(int)(1.5*t+721.0);GoalPos4[1]=(int)(1.5*t+721.0);}else{GoalPos4[0]=724;GoalPos4[1]=724;}GoalPos9[0]=(int)(0.0001661*t*t*t*t*t*t+0.0006153*t*t*t*t*t-0.1318*t*t*t*t+1.254*t*t*t+2.925*t*t-43.64*t+527.9);GoalPos9[1]=GoalPos9[0];GoalPos10[0]=(int)(0.0003296*t*t*t*t*t*t-0.01189*t*t*t*t*t+0.2032*t*t*t*t-2.895*t*t*t+27.86*t*t-109.9*t+613.8);GoalPos10[1]=GoalPos10[0];GoalPos11[0]=(int)(-0.006659*t*t*t*t*t*t+0.2862*t*t*t*t*t-4.584*t*t*t*t+33.35*t*t*t-105.1*t*t+102.1*t+379.3);GoalPos11[1]=GoalPos11[0];GoalPos12[0]=(int)(0.000823*t*t*t*t*t*t-0.01887*t*t*t*t*t-0.09102*t*t*t*t+5.247*t*t*t-44.36*t*t+130.7*t+528.9);GoalPos12[1]=GoalPos12[0];GoalPos13[0]=(int)(-0.003788*t*t*t*t*t*t+0.1389*t*t*t*t*t-1.64*t*t*t*t+5.74*t*t*t+7.459*t*t-24.55*t+297.2);GoalPos13[1]=GoalPos13[0];GoalPos14[0]=(int)(0.002975*t*t*t*t*t*t-0.1283*t*t*t*t*t+2.114*t*t*t*t-16.1*t*t*t+50.88*t*t-38.08*t+744.6);GoalPos14[1]=GoalPos14[0];GoalPos15[0]=(int)(-0.007288*t*t*t*t*t*t+0.3476*t*t*t*t*t-6.384*t*t*t*t+55.4*t*t*t-219.1*t*t+301.6*t+492.8);GoalPos15[1]=GoalPos15[0];GoalPos16[0]=(int)(0.001997*t*t*t*t*t*t-0.07483*t*t*t*t*t+0.881*t*t*t*t-2.857*t*t*t-5.658*t*t+27.76*t+378.4);GoalPos16[1]=GoalPos16[0];GoalPos17[0]=(int)(-0.0002364 *t*t*t*t*t*t+0.02187*t*t*t*t*t-0.5432 *t*t*t*t+4.617*t*t*t-6.029*t*t-49.48*t+537.6);GoalPos17[1]=GoalPos17[0];GoalPos18[0]=(int)(0.000729*t*t*t*t*t*t-0.03161*t*t*t*t*t+0.5943 *t*t*t*t-7.041*t*t*t+52.96*t*t-183.3*t+664.7); GoalPos18[1]=GoalPos18[0]; 
      Posicao(); 
     } 

     PrintErrorCode(); 

     // Read present position 
     wPresentPos = dxl_read_word(id, P_PRESENT_POSITION_L); 
     TxDWord16(GoalPos[INDEX]); 
     TxDString(" "); 
     TxDWord16(wPresentPos); 
     TxDByte_PC('\r'); 
     TxDByte_PC('\n'); 
    } 
    else 
     PrintCommStatus(CommStatus); 
    t = t + 0.01; 
} 
return 0;} 

、このメッセージを出してるの組み込みDXL READ_WRITE/APP/src/main.c:179:未定義の参照__aeabi_dcmple' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C:\ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c:179:未定義の参照__aeabi_dadd' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_d2iz 'このファイルは、C:¥Users¥Gilmar¥Dropbox¥L008 - Bloco Delta¥Trabalho¥pdpd¥PDPD LIBS¥CM530¥09 DXL READ_WRITE/APP/src/main.c:179:未定義の参照__aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dadd ' C:\ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c:179:未定義の参照__aeabi_d2iz' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C:\ Users \ Gilmar \ Dropbox \ L008 - blocoデルタ\ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c:179:未定義の参照__aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C:\ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c:179:未定義参照__aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' APP/src/main.o:C:\ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c:179:さらに未定義の参照t o `__aeabi_dmul 'に従います

どうすればこの問題を解決できますか?私がt = t + 0.01の行にコメントすると、コードは動作しますが、0.01を追加する必要があります。私はすでにフロート、ダブルとint、任意の数で私は孤独、作品を入れて試してみました、私の問題は合計です。

+1

[定義されていない参照/未解決の外部シンボルエラーとは何か、それを修正する方法は?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-外部記号エラーと方法i-fix) – Olaf

+0

あなたは確かにこのコードを実行していません**!サイドノート:そのアーチに浮動小数点の 'double 'を使用しないでください!整数での固定小数点演算を使用します。 (注:それはまた、あなたの問題の理由です、欠けているシンボルの名前を理解しよう!) – Olaf

+0

そして "埋め込まれたC"はありません。 – Olaf

答えて

1

コンパイラには、浮動小数点演算を処理するためのソフトフロートライブラリの実装が必要です。未定義のシンボルは、コンパイラがソフトフロートの実装に対してリンクしていないことを示します。

倍精度が必要かどうかわかりませんが、可能であればそれを使用しないようにアドバイスします。単精度浮動小数点数は、アーキテクチャーにとっては苦労しません。コンパイラが適切な浮動小数点ABIを使用するように設定されており、適切なソフトフロートの実装が利用可能であることを確認する必要があります。 Cortex M3にはハードウェア浮動小数点ユニットはありません。

+1

コードを読んでください!とにかくフロートの必要はありません。 – Olaf

関連する問題