This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/MSP432P401R:编译工程时出现问题(未解析的符号)

Guru**** 2595805 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/743448/ccs-msp432p401r-issues-compiling-the-project-unresolved-symbols

器件型号:MSP432P401R

工具/软件:Code Composer Studio

您好!

我叫 David Fosca。 我使用使用使用 driverlib 的代码在 MSP432P401R (driverlib_empty_project_from _source_MSP_EXP432P401R_nortos_CCS)中运行 MSPWare empty 优化。  

每当我检查代码时、有关 arm.math.h 库中未解析的符号会出现一些错误。  

请、我是否遗漏了一些内容?

错误示例:"说明资源路径位置类型
未解析的符号 ARM_fir_init_Q15、首先在./main.obj driverlib_empty_project_fin_source_MSP_EXP432P401R_nortos_CCS C/C++ problem 中引用

#include 
#include 
#include 
#include 
#include 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    尊敬的 David:

    您没有运行 driverlib_empty_project_from _source_MSP_EXP432P401R_nortos_ccs。
    您进行了一些修改、您的问题与这些更改相关。
    您需要链接正在使用的库。
    您需要链接 CMSIS DSP 库、并且可能是更多内容。
    如果您无法解决问题、请发布您的代码更改和控制台日志。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    好的、感谢您的回答!但我从下图中了解到 arm.math.h 和 arm_const_structs.h 已安装。 我是否必须以不同的方式安装它?

    谢谢、

    David。

    #include 
    #include 
    #include 
    #include 
    #include 
    
    静态 DMA_ControlTable MSP_EXP432P401RLP_DMAControlTable[32];
    // DMA 控制表*/
    #if defined (__TI_Compiler_version__)
    #pragma DATA_ALIGN (MSP_EXP432P401RLP_DMAControlTable,1024)
    #Elif defined (__IAR_SYSTEMS_VERSIONSION-1024
    
    
    )#pragma (_CC_1024)
    
    
    
    
    - 241024_(_ENCO_ENCOD_) 变量一般------ //
    const char digits[]={'0'、'1'、'2'、'3'、'4'、'5'、'6'、'7'、'8'、'9'、'A'、'B'、'C'、'D'、'E'、'F'};
    #define SAMPLE_FREQUENCY 1000
    #define SMCLK_FREQUENCY 48000000
    静态易失性 uint16_t dma_counter = 0;
    静态易失性 uint16_t adc_counter = 0;
    静态易失性 uint16_t UART_counter = 0;
    易失性 int 模式= 1;
    易失性 int 大小= 0;
    易失性 int change_array = 0;
    //--- FFT parámetros --- //
    #define N_Muestras 1024
    uint32_t fftSize = N_Muestras;
    uint32_t ifftFlag = 0;
    uint32_t BitReverse = 1;
    uint32_t max_freq_bin = 0;
    volatile ARM_STATUS 状态;
    //---- Inicialización DE 缓冲器--- //
    浮点汉明[N_Muestrats];
    int16_t DATA_buffer1[N_Muestrats];
    int16_t DATA_buffer2[N_Muestrats];
    int16_t DATA_FFT[N_Muestras *2];
    int16_t DATA_OUT[N_Muestrats];
    int16_t prueba[N_MuestrA];
    
    int main (void)
    {
    //------ funciones de configuración e inicialización ó n del sistema ---- //
    //Parar el reloj WDT。
    MAP_WDT_A_HOLDTimer();
    MAP_Interrupt_disableMaster();
    Clock_Config();
    GPIO_Config();
    UART_Config();
    Timer_Config();
    ADC_Config ();
    DMA_Config();
    MAP_Interrupt_enableMaster();
    MAP_DMA_enableChannel (7);
    MAP_ADC14_enableConversion();
    
    //Inicializar Filtro FIR de tipo 汉明窗口:
    //referencia:www.allaboutcircuits.com/.../
    int n;
    对于(n = 0;n < N_Muestras;n++)
    {
    汉明[n]= 0.5 - 0.5 * cosf ((2 * PI * n)/(N_Muestras - 1));
    }
    
    while (1)
    {
    //Duerme hasta la interrupción ó n del DMA。
    //Medido con el Ociloscoipo:se envía el buffer de datos cada 1000ms。
    //P1->OUT = BIT0;
    MAP_PCM_gotoLPM0 ();
    //P1->OUT &=~BIT0;
    int i = 0;
    
    开关(模式)
    {
    案例1:
    {
    大小= N_Muestras;
    /*for (i=0;i OUT = BIT0;
    对于(I = 0;I < N_Muestras;I++)
    {
    data_buffer1[i]=(int16_t)(汉明[i]* data_buffer1[i]);
    }
    //P1->OUT &=~BIT0;
    arm_rfft_instance_q15实例;
    status = arm_rfft_init_Q15 (&instance、fftSize、ifftFlag、BitReverse);
    //Medido el Pulso con ociloscopio:5.4ms
    //P1->OUT = BIT0; // pin a osciloscopio para ver frecuencia de muestreo
    arm_rfft_q15 (&instance、data_buffer1、data_FFT);
    //P1->OUT &=~BIT0;
    }
    其他
    {
    对于(I = 0;I < N_Muestras;I++)
    {
    data_buffer2[i]=(int16_t)(汉明[i]* data_buffer2[i]);
    }
    arm_rfft_instance_q15实例;
    status = arm_rfft_init_Q15 (&instance、fftSize、ifftFlag、BitReverse);
    arm_rfft_q15 (&instance、data_buffer2、data_FFT);
    }
    //calcular magnitude de la FFT del buffer en cuestión è re。
    // El arreglo de salida tiene el doble de tamaño ó n que el de entrada por que se incluye la parte real e 想象力。 n=Real、n+1=想象力。
    //Medido el Pulso con ociloscopio:2.620ms
    //P1->OUT = BIT0;
    for (i = 0;i <(N_Muestras *2);i = i+2)
    {
    DATA_OUT[I/2]=(int16_t)(sqrtf ((DATA_FFT[i]* DATA_FFT[i])+(DATA_FFT[I+1]* DATA_FFT[I+1])));
    }
    DATA_OUT[0]= 0;
    DATA_OUT[1]=0;
    //P1->OUT &=~BIT0;
    //Q15_t maxValue;
    //uint32_t maxIndex = 0;
    //calcular máximo pico de magnitud de la FFT。
    //arm_max_q15 (data_output、fftSize、&maxValue、&maxIndex);
    //max_freq_bin = maxIndex;
    //transmitir máximo pico de magnitude de la FFT。
    //TransmiirDatos (max_freq_bin);
    //transmitir toda la FFT。
    //Medido el Pulso con ociloscopio si se envia 1024 datos:448ms
    //para enviar FFT (50数据):42.8ms
    //P1->OUT = BIT0;
    尺寸= 50;
    TransmitirDatos();
    //P1->OUT &=~BIT0;
    中断;
    }
    }
    
    }
    
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我已要求您发布控制台日志、但您没有发布。
    真遗憾。 我需要帮助您进行一些假设和猜测。

    [引述 user="David Fosca">好的、感谢您的回答!但从下图中我了解到 arm.math.h 和 arm_const_structs.h 已安装。 [/报价]

    是的、 arm.math.h 和 arm_const_structs.h 已经安装、更重要的是、您的编译器具有访问这些头文件的正确路径。
    编译编译单元时需要使用标头。  
    看不到您的控制台日志、我知道您的 main.c 已正确编译。  

    您的问题不是编译而是链接。  
    您需要告诉链接器构建输出文件需要哪些库以及在哪里查找这些库。  
    我猜、您将在下图中找到所需的内容:  

    预定义符号应如下所示:  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    通过查看 CMSIS DSP 示例和相关的 projectSpec、还可以深入了解设置:

    compilerBuildOptions="-i${project_root}-DARM_MATH_CM4 -D_FPU_Present=1 -i${com_TI_SIMPLELINK_MSP432_SDK_INSTALL_DIR}/source/third_party/CMSIS/Include -i${com_TI_SIMPLELINK_SDK_INSTALL_DIR}-sp32_sp430_subsection=v_superve_dsp -40r_subsection_subsi-f_subse-d_subsection=-40r_subsi-f_subsection=-40r_si-f_bot_subsi-f_-40r_bot_si-display_-m4_-m4_subsi-f_subsi-f_bot_subsection=-40r_-m4_-m4_bot_subsi-f=-m4_subsi-f_bot_bot_subsi-f=-40r_-m4_bot_-
    linkerBuildOptions="-l${com_TI_SIMPLELINK_MSP432_SDK_INSTALL_DIR}/source/third_party/CMSIS/DSP_Lib/lib/ccs/m4f/arm_cortexM4lf_math.a --stack_size=512 -i${com_TI_SIMPLELINK_MSP432_SDK_INSTALL_DIR}/source -LTI/display/display.aem4f -lmfs/lib_drivers/sp4c/dlfs/lib_drivers/mfat/dlfs/lib_lib/mfs/dlfs/dlfs/dlfs/mfs/mfs/dlfs/mf_/dlf_/dlfs/dlf_/dlfs/mfs/dlf_/dlf_/dlfs/dlf_/dlfs/dlf_/dlfs/dlfs/dlfs/dl/dlfs/dlfs/dlf_/dl/dlfs/dlfs/dlf_/dl/dlf_/dlfs/dlfs/dlfs/dl/dlfs/dl/dlfs/dlfs/dl/dlfs/dlfs/dl/dlfs/dlfs/dl/dlfs/dl/ip_drivers/
    

    e2e.ti.com/.../cmsis_5F00_dsplib_5F00_vibration_5F00_msp432p401r_5F00_MSP_5F00_EXP432P401R_5F00_nortos_5F00_ccs.projectspec

    此致、

    Chris