簡體   English   中英

代碼編寫器-仍存在未解析的符號

[英]code composer - unresolved symbols remain

我嘗試讀取陀螺儀數據。 構建時,總是會出現一些鏈接錯誤。 我的輸出如下:

****項目mpu6050_v1的配置調試的構建****

“ C:\\ ti \\ ccsv7 \\ utils \\ bin \\ gmake” -k -j 4全部-O'構建文件:../main.c''調用:ARM編譯器'“ C:/ ti / ccsv7 / tools / compiler /ti-cgt-arm_16.9.4.LTS/bin/armcl“ -mv7M4 --code_state = 16 --float_support = FPv4SPD16 -me --include_path =” C:/ Users / yilmaz / workspace_v7 / mpu6050_v1“ --include_path =” C:/ti/TivaWare_C_Series-2.1.4.178“ --include_path =” C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include“ --define = ccs =” ccs“- define = PART_TM4C123GH6PM -g --gcc --diag_warning = 225 --diag_wrap = off --display_error_number --abi = eabi --preproc_with_compile --preproc_dependency =“ main.d_raw”“ ../main.c”'完成的建築物: ../main.c''''構建目標:mpu6050_v1.out''調用:ARM Linker'“ C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl”- mv7M4 --code_state = 16 --float_support = FPv4SPD16 -me --define = ccs =“ ccs” --define = PART_TM4C123GH6PM -g --gcc --diag_warning = 225 --diag_wrap = off --display_error_number --abi = eabi -z -m“ mpu6050_v1.map” --heap_size = 0 --stack_size = 512 -i“ C:/ ti / ccsv7 / tools / compiler / t i-cgt-arm_16.9.4.LTS / lib“ -i” C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.4.LTS/include“ --reread_libs --diag_wrap = off --display_error_number- -warn_sections --xml_link_info =“ mpu6050_v1_linkInfo.xml” --rom_model -o“ mpu6050_v1.out”“ ./main.obj”“ ./tm4c123gh6pm_startup_ccs.obj”“ ../tm4c123gh6pm.cmd” -llibc.a -l“ C:/ti/TivaWare_C_Series-2.1.4.178/driverlib/ccs/Debug/driverlib.lib”

文件中未定義的第一個引用符號--------- ---------------- MPU6050DataAccelGetFloat ./main.obj MPU6050DataGyroGetFloat ./main.obj MPU6050DataRead ./main.obj MPU6050Init ./main.obj MPU6050ReadModifyWrite ./main.obj

錯誤#10234-D:仍存在未解析的符號錯誤#10010:鏈接期間遇到的錯誤; 未建立“ mpu6050_v1.out”

編譯失敗makefile:143:目標'mpu6050_v1.out'的配方失敗gmake [1]: * [mpu6050_v1.out]錯誤1 makefile:139:目標'all'的配方失敗gmake:* [all]錯誤2

****構建完成****

我的代碼如下。

#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include "sensorlib/i2cm_drv.h"
#include "sensorlib/mpu6050.h"
#include "sensorlib/hw_mpu6050.h"


//
// A boolean that is set when a MPU6050 command has completed.
//
volatile bool g_bMPU6050Done;

void MPU6050Callback(void *pvCallbackData, uint_fast8_t ui8Status);
void MPU6050Example(void);


/**
 * main.c
 */
int main(void)
{



MPU6050Example();


    return 0;
}

//
// The function that is provided by this example as a callback when MPU6050
// transactions have completed.
//
void MPU6050Callback(void *pvCallbackData, uint_fast8_t ui8Status)
{
    //
    // See if an error occurred.
    //
    if(ui8Status != I2CM_STATUS_SUCCESS)
    {
    //
    // An error occurred, so handle it here if required.
    //
    }
    //
    // Indicate that the MPU6050 transaction has completed.
    //
    g_bMPU6050Done = true;
}

//
// The MPU6050 example.
//
void MPU6050Example(void)
{
    float fAccel[3], fGyro[3];
    tI2CMInstance sI2CInst;
    tMPU6050 sMPU6050;

    //
    // Initialize the MPU6050. This code assumes that the I2C master instance
    // has already been initialized.
    //
    g_bMPU6050Done = false;
    MPU6050Init(&sMPU6050, &sI2CInst, 0x68, MPU6050Callback, 0);

    while(!g_bMPU6050Done);

    //
    // Configure the MPU6050 for +/- 4 g accelerometer range.
    //
    g_bMPU6050Done = false;
    MPU6050ReadModifyWrite(&sMPU6050, MPU6050_O_ACCEL_CONFIG, ~MPU6050_ACCEL_CONFIG_AFS_SEL_M,
    MPU6050_ACCEL_CONFIG_AFS_SEL_4G, MPU6050Callback, 0);

    while(!g_bMPU6050Done);

    //
    // Loop forever reading data from the MPU6050. Typically, this process
    // would be done in the background, but for the purposes of this example,
    // it is shown in an infinite loop.
    //
    while(1)
    {
        //
        // Request another reading from the MPU6050.
        //
        g_bMPU6050Done = false;
        MPU6050DataRead(&sMPU6050, MPU6050Callback, 0);

        while(!g_bMPU6050Done);

        //
        // Get the new accelerometer and gyroscope readings.
        //
        MPU6050DataAccelGetFloat(&sMPU6050, &fAccel[0], &fAccel[1], &fAccel[2]);
        MPU6050DataGyroGetFloat(&sMPU6050, &fGyro[0], &fGyro[1], &fGyro[2]);
        //
        // Do something with the new accelerometer and gyroscope readings.
        //
    }
}

請幫助我,任何建議。 我已經嘗試了好幾天。

我添加了mpu6050.c和i2cm_drv.c作為鏈接文件。 項目->添加文件->鏈接到文件,確定。

感謝幫助。 我解決了問題,如評論

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM