This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HelloWorld on LM3S6911

Hi there:

A newbie question... I was able to use the HelloWorld example that was provided with the Keil for ARM compiler. I am now trying to do the same thing, only this time, instead of using LPC2106 I am trying to use LM3S6911 from Luminary Micro. Unfortunately, the way to do this, from what I can tell, is very different.

This is my code so far:

#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/rom.h"
#include "driverlib/sysctl.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.
//!
//! UART0, connected to the FTDI virtual COM port and running at 115,200,
//! 8-N-1, is used to display messages from this application.
//
//*****************************************************************************

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



int main(void)
{

    //
    // Set the system clock to run at 8 MHz from the main oscillator.
    //
    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC |
                   SYSCTL_XTAL_8MHZ | SYSCTL_OSC_MAIN);

    //
    // Enable the peripherals used by this example.
    //
    //SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
        //SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);


    //
    // UART0: Set GPIO A0 and A1 as UART.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);


    //
    // Initialize UART0 as a console for text I/O.
    //
    UARTStdioInit(0);

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

        UARTwrite("test",4);



    //
    // Print hello message to user.
    //
        while(1)
        {
            UARTprintf( "\nHello, world!\n" );
                //printf("change!\n");
        }

}

Now, this compiles, links and executes without any error or warning, but I don't have any IO being shown. I am using the simulator (that is all I have for now).

I tried to SLOG >> out.txt, opened up all the UART windows, but the data does not seem to go anywhere, yet when I am executing under the control of the debugger, it seems to work fine.

I have several questions, many of which could be newbies:

1- I noticed that I am not including lm3s6911.h anywhere in there, yet it compiles fine. The defines in that header do not seem to be used anywhere. Is this normal?

2- Could it be that the simulator cannot do a HelloWorld program but the board could?

3- I am using all the latest StellarisWare includes and libraries.

If someone out there knows something about this and why I am failing, please let me know! I really gave it my best shot, and keep failing.

Steve

Parents
  • Also, here is my build output. I turned on all the warnings.

    Build target 'Target 1'
    assembling Startup.s...
    compiling uartstdio.c...
    compiling main.c...
    linking...
    Program Size: Code=2456 RO-data=236 RW-data=8 ZI-data=256
    "HelloWorld.axf" - 0 Error(s), 0 Warning(s).
    

    Not sure if this is helpful. Just says what I am linking and that there is no error of any kind.

Reply
  • Also, here is my build output. I turned on all the warnings.

    Build target 'Target 1'
    assembling Startup.s...
    compiling uartstdio.c...
    compiling main.c...
    linking...
    Program Size: Code=2456 RO-data=236 RW-data=8 ZI-data=256
    "HelloWorld.axf" - 0 Error(s), 0 Warning(s).
    

    Not sure if this is helpful. Just says what I am linking and that there is no error of any kind.

Children