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.

TM4C1294 Launchpad - "Hello World" example code

Other Parts Discussed in Thread: EK-TM4C1294XL, TM4C1294NCPDT

Hello 

I'm new to the launchpad and as a newbie I'm trying to execute the example codes given at " ti\TivaWare_C_Series-2.1.1.71\examples\boards\ek-tm4c1294xl ".

The code " blinky " worked fine.

but when I started executing " Hello " , build operation is successful but when I downloaded the code onto board nothing is coming on the serial monitor.

I'm using Keil IDE.

Later I found that " tm4c1294ncpdt.h " is not included in the code. only the below mentioned files are include.

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"

Is it not necessary to include "tm4c1294ncpdt.h" ?

but when I included this files lots of errors and warnings came out.

Could you please explain how I can execute the example codes ?

  • Hi,

    Hello example program should work without modifications. Try to see the serial output using Tera Term or Putty.

    - kel
  • I'm executing the program without modifications only and that using Putty but nothing is coming on the output screen

    The example code given is ......

    //*****************************************************************************
    //
    // hello.c - Simple hello world example.
    //
    // Copyright (c) 2013-2015 Texas Instruments Incorporated. All rights reserved.
    // Software License Agreement
    //
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    //
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // 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. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    // DAMAGES, FOR ANY REASON WHATSOEVER.
    //
    // This is part of revision 2.1.1.71 of the EK-TM4C1294XL Firmware Package.
    //
    //*****************************************************************************

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "drivers/pinout.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"

    //*****************************************************************************
    //
    //! \addtogroup example_list
    //! <h1>Hello World (hello)</h1>
    //!
    //! A very simple ``hello world'' example. It simply displays ``Hello World!''
    //! on the UART and is a starting point for more complicated applications.
    //!
    //! Open a terminal with 115,200 8-N-1 to see the output for this demo.
    //
    //*****************************************************************************

    //*****************************************************************************
    //
    // System clock rate in Hz.
    //
    //*****************************************************************************
    uint32_t g_ui32SysClock;

    //*****************************************************************************
    //
    // The error routine that is called if the driver library encounters an error.
    //
    //*****************************************************************************
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
    }
    #endif

    //*****************************************************************************
    //
    // Configure the UART and its pins. This must be called before UARTprintf().
    //
    //*****************************************************************************
    void
    ConfigureUART(void)
    {
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Enable UART0
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Configure GPIO Pins for UART mode.
    //
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, g_ui32SysClock);
    }

    //*****************************************************************************
    //
    // Print "Hello World!" to the UART on the Intelligent UART Module.
    //
    //*****************************************************************************
    int
    main(void)
    {
    //
    // Run from the PLL at 120 MHz.
    //
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);

    //
    // Configure the device pins.
    //
    PinoutSet(false, false);

    //
    // Enable the GPIO pins for the LED D1 (PN1).
    //
    ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_1);

    //
    // Initialize the UART.
    //
    ConfigureUART();

    //
    // Hello!
    //
    UARTprintf("Hello, world!\n");

    //
    // We are finished. Hang around flashing D1.
    //
    while(1)
    {
    //
    // Turn on D1.
    //
    LEDWrite(CLP_D1, 1);

    //
    // Delay for a bit.
    //
    SysCtlDelay(g_ui32SysClock / 10 / 3);

    //
    // Turn off D1.
    //
    LEDWrite(CLP_D1, 0);

    //
    // Delay for a bit.
    //
    SysCtlDelay(g_ui32SysClock / 10 / 3);
    }
    }
  • Hi,

    You need to set correct baud rate and com port at putty, so that you can see the output. Set baud rate at 115200.

    - kel
  • Hi Parag,

    If you already made it to work, "Verify Answer" this post to mark it as "Answered". I recommend going through the workbook pdf from the link below if you are starting to learn about Tiva Connected Launchpad.

    processors.wiki.ti.com/.../Creating_IoT_Solutions_with_the_TM4C1294XL_Connected_LaunchPad_Workshop

    - kel