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.

[参考译文] TM4C1294NCPDT:TM4C1294

Guru**** 2349370 points
Other Parts Discussed in Thread: EK-TM4C1294XL
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1120441/tm4c1294ncpdt-tm4c1294

器件型号:TM4C1294NCPDT
Thread 中讨论的其他器件:EK-TM4C1294XL

尊敬的 TI 支持:

我有 EK-TM4C1294XL 评估套件。 我下载了 SPMA072 (用于 TM4C129x 的串行转以太网转换器)。

我能够使用 CCS 11.2.0进行编译。 应用程序运行正常、我能够打开 Web 服务器并更改串行端口0设置。

串行端口0使用 UART4。 我的应用要求我改用 UART0。 在应用报告之后、我修改了 config.h 并切换到 UART0。

我还修改了启动文件中的中断矢量、使其指向 UART0。

代码编译时没有错误、但启动后会立即生成故障中断并停止。

请提供建议吗?

谢谢

Felix Valladares

   

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

    您好!

     您很可能在启用某些外设之前访问它们。  

     我有几点意见。

     -您是否只搜索 UART4并将其替换为 UART0? 如果是这种情况、那么这还不够。 请参阅 config.h 中的以下代码 它不仅仅是将 UART4更改为 UART0。 如果您看看  S2E_PORT0_RX_Periph 、您将需要从 SYSCTL_Periph_GPIOK 更改为 SYSCTL_Periph_GPIOA、同样、对于#define 的其余部分也需要如此。  

    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_PERIPH SYSCTL_PERIPH_UART4
    
    //*****************************************************************************
    //
    //! The port on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_PORT UART4_BASE
    
    //*****************************************************************************
    //
    //! The interrupt on which the Port 0 UART resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_UART_INT INT_UART4
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 RX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_PIN GPIO_PIN_0
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 RX pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_RX_CONFIG GPIO_PK0_U4RX
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 TX pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_PIN GPIO_PIN_1
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 TX pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_TX_CONFIG GPIO_PK1_U4TX
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 RTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_PIN GPIO_PIN_2
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 RTS pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_RTS_CONFIG GPIO_PK2_U4RTS
    
    //*****************************************************************************
    //
    //! The peripheral on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PERIPH SYSCTL_PERIPH_GPIOK
    
    //*****************************************************************************
    //
    //! The GPIO port on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PORT GPIO_PORTK_BASE
    
    //*****************************************************************************
    //
    //! The GPIO pin on which the Port 0 CTS pin resides.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_PIN GPIO_PIN_3
    
    //*****************************************************************************
    //
    //! The GPIO pin configuration for Port 0 CTS pin.
    //
    //*****************************************************************************
    #define S2E_PORT0_CTS_CONFIG GPIO_PK3_U4CTS

     如果你已经正确地完成了上述所有工作,那么我认为还有一件事需要改变。 如果您查看 enet_s2e.c 文件、您将看到以下代码片段。 所有 UARTLprintitf 当前都指向 UART0。 它将干扰您的 S2E 端口0的新设置。 如果要查看通过管道传递到终端窗口的 UARTprintf、则需要将其重定向到 UART2。  

    #ifndef DK_TM4C129X
        PinoutSet(true, false);
    #else
        PinoutSet();
    #endif
    
        //
        // Configure Debug UART.
        //
        UARTStdioConfig(0, 115200, g_ui32SysClock);
    
        //
        // Clear the terminal and print banner.
        //
        UARTprintf("\033[2J\033[H");
        UARTprintf("Serial to Ethernet Example\n\n");
    
        //
        // Tell the user what we are doing now.
        //
        UARTprintf("Waiting for IP.\n");
    

     -要将 UARTprintf 重定向到 UART2而不是 UART0,您需要更改:

    发自:

    UARTStdioConfig (0、115200、g_ui32SysClock);

    至:

    UARTStdioConfig (2、115200、g_ui32SysClock);

     -我之所以可以将 UARTprintf 从 UART0重定向到 UART2,是因为在 EK-TM4C1294XL LaunchPad 上,UART0和 UART2 都可以 通过跳线路由到 COM 端口。 要使用 UART2、必须将 JP4和 JP5跳线从水平位置更改为垂直 位置。 请参阅 LaunchPad 用户指南。 如果您有定制板、则可以重定向到其他 UART 以用于 COM 端口、前提是您有 FDTI USB 转串行适配器。  

     -如果要将 UART2用于 COM 端口,还必须确保正确配置用于 UART 功能的所有引脚。 如果您看到上述代码,PinoutSet()函数将配置 UART0引脚,但不配置 UART2。 我建议您尝试 hello 示例、并尝试将所有 UARTprintf 重定向到 UART0、了解其工作原理、然后针对 S2E 项目进行相同的调整。  

     可能目前,您可以删除或注释掉所有 UARTprintf 和 UARTStdioConfig,以查看您是否遇到了故障。

     -最后、本应用手册应非常有助于诊断故障原因。 https://www.ti.com/lit/pdf/spma043

     

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

    非常感谢 Charles。 我将调试 UART 从 UART0重定向到 uART2、以避免干扰串行端口0。 这解决了该问题。 我不再获得故障中断。 感谢您的大力支持。

    Felix