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/EK-TM4C123GXL:查看 UART 输出问题

Guru**** 2473260 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/681979/ccs-ek-tm4c123gxl-viewing-uart-output-issue

器件型号:EK-TM4C123GXL

工具/软件:Code Composer Studio

你(们)好  

我无法看到串行终端(Putty 或 CoolTerm)中显示的字符。 我使用 UARTCharPut 函数的基本示例进行了尝试、结果非常好、但现在我想尝试使用 UARTprintf。 我使用了为电路板 TM4C123GXL 提供的示例代码(如下所示)、但使用这些代码、我无法在终端中看到任何内容。 该端子配置如下:115、200、8-N-1

我已包含 UARTSTUDIO 文件 b、但我认为这不是问题、因为无法编译它。  任何线索都值得赞赏。  

此致  

#include 
#include 
include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/fpu.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#def_driesidio.32_uide"
#include "driverlib_udit_uarth #idio.ide"




#include "u.idio.ide"#include "u.idio.ide"#include "u.idt_u.idu.idu.ide"#include "u.idu.idu.ide"#include "u.idu.idu.32_u.idu.u.u.u.u.u.u.u.idu.idu.idu.











SysCtlPeripheralEnable (SYSCTL_Periph_GPIOA);


SysCtlPeripheralEnable (SYSCTL_Periph_UART0);

//
//为 UART 模式配置 GPIO 引脚。
//
GPIOPinConfigure (GPIO_PA0_U0RX);
GPIOPinConfigure (GPIO_PA1_U0TX);
GPIOPinTypeUART (GPIO_Porta_base、GPIO_PIN_0 | GPIO_PIN_1);

//
//使用内部16MHz 振荡器作为 UART 时钟源。
//
UARTClockSourceSet (UART0_BASE、UART_CLOCK_PIOSC);

//
//初始化控制台 I/O 的 UART
//
UARTStdioConfig (0、115200、16000000);
}

//*********
//
//打印"Hello World!" 连接到评估板上的 UART。
////
*****************
int
main (void)
{

SysCtlClockSet (SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHz |
SYSCTL_OSC_MAIN);

//
//启用用于板载 LED 的 GPIO 端口。
//
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOF);

//
//为 LED 启用 GPIO 引脚(PF2 & PF3)。
//
GPIOPinTypeGPIOOutput (GPIO_PORTF_BASE、GPIO_PIN_2);

//
//初始化 UART。
//
ConfigureUART();

//
//您好!
//
UARTprintf ("Hello、world!\n");

//
//我们已完成。 四处闲逛、什么也不做。
//
while (1)
{
//
//打开蓝色 LED。
//
GPIOPinWrite (GPIO_PORTF_BASE、GPIO_PIN_2、GPIO_PIN_2);

//
//延迟一位。
//
SysCtlDelay (SysCtlClockGet ()/ 10 / 3);

//
//关闭蓝色 LED。
//
GPIOPinWrite (GPIO_PORTF_BASE、GPIO_PIN_2、0);

//
//延迟一位。
//
SysCtlDelay (SysCtlClockGet ()/ 10 / 3);
}
}

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

    您发布的代码看起来与"hello"示例直接相关。 是否确定已将串行终端连接到正确的端口? 在器件管理器中、端口应显示为"Stellaris 虚拟串行端口"、然后显示 COM 端口号、如下所示:

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    是的、这是一个准确的示例、因为我希望尽可能简单、是的、我连接到了 Rig 端口。 正如我之前所说的、我在 UARTChar 发送字符时使用了它(工作簿中的一个回显示例)。

    我是否可能遗漏了什么? 我认为该示例应该准备好运行、但可能我错了。