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.

Uart module 4 doesn't produce a signal

Hello,

I am trying to use UART4 for one of my applications, but can't make it work. 

I don't receive any data trough the terminal. Scoping the signal I notice that the TX pin level is constant high.

Here is my code:

#include <stdint.h>
#include <stdbool.h>
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/gpio.c"
#include "driverlib/pin_map.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "utils/uartstdio.c"
#include "driverlib/uart.c"

void UartSetup(void);

int main ()
{
	int i;
	SysCtlClockSet(SYSCTL_SYSDIV_5| SYSCTL_USE_PLL | SYSCTL_OSC_INT | SYSCTL_XTAL_16MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

	UartSetup();

	while(1)
	{
		for (i = 0; i < 1000; i++)
		{
			UARTprintf("\rHello Riko %d!", i);
			SysCtlDelay(40000);
		}
	}
}

void UartSetup(void)
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    SysCtlDelay(3);

    GPIOPinConfigure(GPIO_PC4_U4RX);
    GPIOPinConfigure(GPIO_PC5_U4TX);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
    SysCtlDelay(3);

    GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);
    UARTClockSourceSet(UART4_BASE, UART_CLOCK_PIOSC);
    UARTStdioConfig(4, 9600, 16000000);
}

It compiles but I don't get the output. I tried with UART0 and it worked just fine, but with UART4 don't have same outcome.

Please help. Thank you!

  • Might it be that function UARTStdioConfig() does not support UART 4?  Your report of "working" on lower order UARTs supports such conclusion...

    Your review of the source code - w/in UARTStdioConfig() - should guide you to an answer...

    I see nothing - otherwise missing - w/your code blurb.

    You may attempt to "extend" UARTStdioConfig() to accept UART4 or may employ the more standard UART functions (which do not so discriminate) w/in the API to better enable UART 4.

  • Hello cb1

    Indeed, there is a post as well, where one of the form members did extend it...

    Regards
    Amit
  • Hi Amit,

    This week - we've issued mutual VOC's.  (good that)

    As you surely know - potential problem lurks - with any modification of a standard code module.   Unless poster (carefully) renames that code file - his "next generation" of TivaWare will "eat" his extension.  I recall you warning clients about this issue too.

    If it's possible to "bump against" a code limitation - poster's will do it - and land here.  In this case - poster provided adequate detail so that we were able to diagnose - and that, "DOES Work!"