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.

[参考译文] TM4C123GH6PM:CCS 并为步进功能的特定电路板构建 M4F 内核

Guru**** 2539500 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1553456/tm4c123gh6pm-ccs-and-building-around-m4f-cores-for-specific-boards-for-stepper-functions

器件型号:TM4C123GH6PM


工具/软件:

您好:

又来了一次。 我正在尝试从 TI.com 和制造中了解如何使用 M4F 芯片构建特定的步进电机控制器。 和优势。 我有另一个主板用于将数据中继到 TM4C123 开发板上的 M4F、但我看到了判断中的错误、需要一些注意事项。

[21] undefined    first referenced
[22]  symbol          in file     
[23] ---------    ----------------
[24] SysTick_Init ./stepper.obj   
[25] SysTick_Wait ./stepper.obj   
 
[26]error #10234-D: unresolved symbols remain
[27]error #10010: errors encountered during linking; "Stepper_4C123.out" not built
 
[28]>> Compilation failure
[29]gmake: *** [makefile:138: Stepper_4C123.out] Error 1
[30]gmake: Target 'all' not remade because of errors.

[31]**** Build Finished 

此源代码是否意味着在我的构建设备中有两个提到的文件不是为所需的 Sys Tick_Init 和 Sys Tick_Wait 调用标记类或函数?

Seth

P.S.我开始快速地弄清楚事情、即、因为我对这些类型的用例有一定的经验。 不管怎样、如果您看到我遗漏的内容、请跳转。  

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

    因此、由于某种原因、“Stepper _4C123.out“不在其各自的位置。 我目前正在查看.map 文件中的当前想法。 报告中指出某个位置应该有一个名为“Stepper_4C123.out"的“的.out 文件、但我认为这是通过 Makefile 创建的、而不是通过 CCS 格式的方法生成的文件。

    无论如何、.map 文件会调用以获取在特定位置标记的.out 文件。 请发送指导。

    Seth

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

    您好、  

     Systick_Init 和 Systick_Wait 这两个功能在哪里? 您需要确保将包含这两个函数的源文件编译到其目标文件中、以便链接器可以将它们链接到最终的.out 文件中。

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

    问得好。 我会看,你是对的。 我对这个构建失去了组织。 好的。 我将确保这两个函数与目标文件一起编译。 这样、链接器就可以正常工作。 我正在使用一些旧的源代码,从一些书籍的 TexasWare 从大学的几位教授。  

    总之、我认为 TI 人员雇佣了他们、或者学校里有机会操纵一些董事会来推动调查。 我会继续寻找。 同时、我想我们可以解决这个问题、因为它与我的不良组织技能之外的任何问题无关。

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

    另一个想法是、我有两个文件:

    1.我已经减缓了围绕这个建设的努力时间。

    2.我发现 Systick_Init 和 Systick_Wait 来自/inc/.文件下的另一组文件

    3.现在、我需要将这些文件推送到 CCS 调试器/IDE 中、看看是否可以进行构建。

    但是,我第一次的组织技能是有点偏离这一时间。 很抱歉给你的小伙子们。 嗯、我们可以结束这项工作、如果您想通过 e2e 平台继续交谈、也可以。

    我终于找到了我在 RUT 的位置。 /inc/让我迷路了一点。 别拉。

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

    此外、

    我使用一组用于 Keil 的文件、它使用 ARM Cross_Compilers 版本 5.x.x  

    这是我更新的旧版本、用于尝试一些步进电机运动。 我了解了 TM4C123 的构建过程和 TI 人员提供的源代码。 我下载了它,目前正在试图通过它所有.

    我安装了用于 CCS 2020、从而将整个源代码集单独移植到 CCS 中。 现在,闪光和建设仍然是困难的。 这是我的最新努力,我认为是有点误,因为我得到了错误,而不仅仅是警告。

    [0]**** Build of configuration Debug for project Stepper_4C123 ****
    [1]"C:\\ti\\ccs2020\\ccs\\utils\\bin\\gmake" -k all 
     
    [2]Building file: "../stepper.c"
    [3]Invoking: ARM Compiler
    [4]"C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/ti-cgt-arm_18.12.2.LTS/include" -g --c99 --gcc --define=ccs="ccs" --define=PART_TM4C123GH6PM --diag_warning=225 --diag_wrap=off --display_error_number --c_src_interlist --asm_listing --preproc_with_compile --preproc_dependency="stepper.d_raw"  "../stepper.c"
     
    [5]>> Compilation failure
    [6]"..\tm4c123gh6pm.h", line 9: error #171: expected a declaration
    [7]"..\tm4c123gh6pm.h", line 45: warning #12-D: parsing restarts here after previous syntax error
    [8]"../stepper.c", line 79: error #20: identifier "SYSCTL_RCGCGPIO_R" is undefined
    [9]"../stepper.c", line 84: error #20: identifier "GPIO_PORTD_AMSEL_R" is undefined
    [10]"../stepper.c", line 85: error #20: identifier "GPIO_PORTD_PCTL_R" is undefined
    [11]"../stepper.c", line 86: error #20: identifier "GPIO_PORTD_DIR_R" is undefined
    [12]"../stepper.c", line 87: error #20: identifier "GPIO_PORTD_AFSEL_R" is undefined
    [13]"../stepper.c", line 88: error #20: identifier "GPIO_PORTD_DR8R_R" is undefined
    [14]"../stepper.c", line 89: error #20: identifier "GPIO_PORTD_DEN_R" is undefined
    [15]8 errors detected in the compilation of "../stepper.c".
    [16]gmake: *** [subdir_rules.mk:11: stepper.obj] Error 1
    [17]gmake: Target 'all' not remade because of errors.
    [18]**** Build Finished 

    这是相关的文件 steperve.c、但首先我将展示移植到 Keil 所需的 Sys Tick_Init 和 Sys Tick_Wait 文件、以及我尝试在结合使用 M4F 和 CCS 的不同编译器做的事情:

    #include "../inc/systick.h"

    这里是整个文件、当我运行 build 然后清理 build 时、输出端会出现一些奇怪的行为。  

    // Stepper.c
    // Runs on LM4F120/TM4C123
    // Provide functions that step the motor once clockwise, step
    // once counterclockwise, and initialize the stepper motor
    // interface.
    // Daniel Valvano
    // September 12, 2013
    
    /* This example accompanies the book
       "Embedded Systems: Real Time Interfacing to ARM Cortex M Microcontrollers",
       ISBN: 978-1463590154, Jonathan Valvano, copyright (c) 2015
       Example 4.1, Programs 4.4, 4.5, and 4.6
       Hardware circuit diagram Figure 4.27
    
     Copyright 2015 by Jonathan W. Valvano, valvano@mail.utexas.edu
        You may use, edit, run or distribute this file
        as long as the above copyright notice remains
     THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
     OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
     VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
     OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
     For more information about my classes, my research, and my books, see
     users.ece.utexas.edu/.../
     */
    
    // PD3 connected to driver for stepper motor coil A
    // PD2 connected to driver for stepper motor coil A'
    // PD1 connected to driver for stepper motor coil B
    // PD0 connected to driver for stepper motor coil B'
    
    #include <stdint.h>
    #include "../inc/tm4c123gh6pm.h"
    #include "../inc/systick.h"
    struct State {
      uint8_t Out;           // Output
      const struct State *Next[2]; // CW/CCW
    };
    typedef const struct State StateType;
    typedef StateType *StatePtr;
    #define clockwise 0        // Next index
    #define counterclockwise 1 // Next index
    StateType fsm[4]={
      {10,{&fsm[1],&fsm[3]}},
      { 9,{&fsm[2],&fsm[0]}},
      { 5,{&fsm[3],&fsm[1]}},
      { 6,{&fsm[0],&fsm[2]}}
    };
    uint8_t Pos;     // between 0 and 199
    const struct State *Pt;// Current State
    
    #define STEPPER  (*((volatile uint32_t *)0x4000703C))
    // Move 1.8 degrees clockwise, delay is the time to wait after each step
    void Stepper_CW(uint32_t delay){
      Pt = Pt->Next[clockwise];     // circular
      STEPPER = Pt->Out; // step motor
      if(Pos==199){      // shaft angle
        Pos = 0;         // reset
      }
      else{
        Pos++; // CW
      }
      SysTick_Wait(delay);
    }
    // Move 1.8 degrees counterclockwise, delay is wait after each step
    void Stepper_CCW(uint32_t delay){
      Pt = Pt->Next[counterclockwise]; // circular
      STEPPER = Pt->Out; // step motor
      if(Pos==0){        // shaft angle
        Pos = 199;       // reset
      }
      else{
        Pos--; // CCW
      }
      SysTick_Wait(delay); // blind-cycle wait
    }
    // Initialize Stepper interface
    void Stepper_Init(void) {
      SYSCTL_RCGCGPIO_R |= 0x08; // 1) activate port D
      SysTick_Init();
      Pos = 0;                   
      Pt = &fsm[0]; 
                                        // 2) no need to unlock PD3-0
      GPIO_PORTD_AMSEL_R &= ~0x0F;      // 3) disable analog functionality on PD3-0
      GPIO_PORTD_PCTL_R &= ~0x0000FFFF; // 4) GPIO configure PD3-0 as GPIO
      GPIO_PORTD_DIR_R |= 0x0F;   // 5) make PD3-0 out
      GPIO_PORTD_AFSEL_R &= ~0x0F;// 6) disable alt funct on PD3-0
      GPIO_PORTD_DR8R_R |= 0x0F;  // enable 8 mA drive
      GPIO_PORTD_DEN_R |= 0x0F;   // 7) enable digital I/O on PD3-0 
    }
    
    // Turn stepper motor to desired position
    // (0 <= desired <= 199)
    // time is the number of bus cycles to wait after each step
    void Stepper_Seek(uint8_t desired, uint32_t time) {
    short CWsteps;
      if((CWsteps = (desired-Pos))<0){
        CWsteps+=200;
      } // CW steps is 0 to 199
      if(CWsteps > 100){
        while(desired != Pos){
          Stepper_CCW(time);
        }
      }
      else{
        while(desired != Pos){
          Stepper_CW(time);
        }
      }
    }
    

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

    还可以...

    南 /inc/位于 CCS 文件资源管理器中、包含从 STEPer.c 文件调用所需的文件、并且收到了相同的错误。 由于某种原因、我无法让 CCS 识别/inc/中的文件。  

    此外、我还有一些.s 文件和.asm 文件。 这些项目是否需要特定的库?

    以下是有关.s 和错误的详细信息:

    s encountered during linking

    此外、似乎无法将.h 文件链接到当前 STEPPER 文件、因此会在输出端错误。

    Seth

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

    我知道发生了什么(我想)。

    我是新朋友。 打扰一下。 Windows 不接受像 Linux 这样的相同命名文件的大写、因此、我现在一直在管理名称。

    我认为这就是文件没有通过预处理器指令正确定位的原因。

    Seth