Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Luminary LM3S6965 rev. C UART

Posted by Xasthur on May 28, 2008
In using the demo board with the FreeRTOS Webserver Demo along with the libdriver interface provided by Luminary, We added the following code to main.c:

Init code--

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable( SYSCTL_PERIPH_UART1 );

GPIOPinTypeUART(GPIO_PORTD_BASE, (GPIO_PIN_2 | GPIO_PIN_3));

UARTStdioInit(1);


Main Code--

UARTprintf(pcstring);

--or--

int i;
int j=0;
for (i=0;i<10;i++)/* set and clear pin 10 times */
{
UARTBool = UARTCharPutNonBlocking(UART1_BASE, '1');/* send '1' */
if (UARTBool == false) {
while(1); //We never get to this....
}/* wait here on failure */
UARTBool = UARTCharPutNonBlocking(UART1_BASE, '0');/* send '0' */
if (UARTBool == false) {
while (UARTSpaceAvail(UART1_BASE) == false) ;
while(1); //we always hit this....
}/* wait here on failure */
j++;
}


It seems that we are able to both fill and clear the FIFO, but nothing came out of UART1, or UART2 (When we changed the code for that). The tx pin does get configured as an output and remains high.

Any ideas?


--Ian

RE: Luminary LM3S6965 rev. C UART

Posted by Dave on May 28, 2008
Does your code work in the absence of FreeRTOS? I'm trying to understand if it is FreeRTOS that is stopping it from working, or whether the code just does not work for some reason anyway.

RE: Luminary LM3S6965 rev. C UART

Posted by David Gesswein on May 29, 2008
This is what I use for talking to the UART that is attached to the USB interface chip. I also have rev C with webserver demo. Not sure why yours isn't working. The UART peripheral enable is in UARTStdioInit but the extra call shouldn't hurt anything. I have the following code in prvSetupHardware after the SysCtlClockSet and portf initialization.

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
/* Configure the UART pins appropriately. */
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTStdioInit(0);

UARTprintf("UART is initialized\n\r");

RE: Luminary LM3S6965 rev. C UART

Posted by Xasthur on May 29, 2008
@ davedoors:
Using the example code that is provided with the libdriver (Without FreeRTOS), the UART seems to work. A quick comparison shows that the code I added to the FreeRTOS Demo is no different but seems to not work.

@ djg:
That's interesting. I'm attempting to get it to work via port g, out of a "real" serial port.
It seems like a nice way to do some printf's for debugging.
I will take another look at my code and see if I can tidy it up a bit, but this has been an ongoing problem.

--Ian

RE: Luminary LM3S6965 rev. C UART

Posted by Xasthur on May 29, 2008
(Correcting myself)

Port G is the end goal, but we'd tried switching ports as port G didn't SEEM to work.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS