Quality RTOS & Embedded Software

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


Serial -> lwIP Embedded WEB Server Demo

Posted by Nobody/Anonymous on March 19, 2007
I'm using the lwIP Embedded WEB Server Demo using GCC on an AT91SAM7X256.
Now I like to communicate via the comport. So I need serial.c and serialISR.c
Anybody knows where I can find these files? Regards, Rick

RE: Serial -> lwIP Embedded WEB Server Demo

Posted by Allure99 on September 6, 2007
yes i have the same problem. I can find serial.h in(full & minimal) folder but i just can't find serial.c and SerialISR.c.
can any one contribute?

RE: Serial -> lwIP Embedded WEB Server Demo

Posted by Dave on September 6, 2007
The SAM7S IAR demo has these files. Start with these then convert them to use the GCC syntax for the interrupt handler.

RE: Serial -> lwIP Embedded WEB Server Demo

Posted by Allure99 on September 7, 2007
Thanks Dave,

I Manage to get the serial working with the ISR in Normal mode.

I am developing code for interfacing the serial with GPRS modem and i will need the serial in Modem or Hardware Mode.

I define my USART mode as follow the it doesn't work:
// Define the USART mode
//serCOM0->US_MR = AT91C_US_USMODE_NORMAL | /* Normal Mode */
//serCOM0->US_MR = AT91C_US_USMODE_MODEM | /* Modem Mode */
serCOM0->US_MR = AT91C_US_USMODE_HWHSH| /* Hardware Handshaking*/
AT91C_US_CLKS_CLOCK | /* Clock = MCK */
AT91C_US_CHRL_8_BITS | /* 8-bit Data */
AT91C_US_PAR_NONE | /* No Parity */
AT91C_US_NBSTOP_1_BIT; /* 1 Stop Bit */

Is this the right setting? or i will need more to get the MODEM or HWHSH mode working?


RE: Serial -> lwIP Embedded WEB Server Demo

Posted by Allure99 on September 7, 2007
//According to the AT91SAM7x256 datasheet (page316-317),
hardware handshaking mode (RTS/CTS flow control).

I used the Hyperterminal to test it but failed.

//My code is as follows:

void Usart_init ( void )


AT91C_BASE_PIOA, // PIO controller base address
((unsigned int) AT91C_PA5_RXD0 ) |
((unsigned int) AT91C_PA8_CTS0 ) |
((unsigned int) AT91C_PA7_RTS0 ) |
((unsigned int) AT91C_PA6_TXD0 ), // Peripheral A
0); // Peripheral B ;

AT91F_PMC_EnablePeriphClock ( AT91C_BASE_PMC, 1<<AT91C_ID_US0 ) ;

// Usart Configure
//I defined AT91C_US_ASYNC_MODE_HW in library

// Enable usart

COM0->US_RPR = (unsigned int)receive;
COM0->US_RCR = 8;

void main(void)



AT91F_US_ReceiveFrame (COM0, receive, 8, 0,0 );
while (AT91F_PDC_IsRxEmpty (AT91C_BASE_PDC_US0)==0){}

AT91F_US_SendFrame(COM0, receive,8,0,0);
while (AT91F_PDC_IsTxEmpty (AT91C_BASE_PDC_US0)==0){}

//This code is basically to receive a data buffer from Hyperterminal and echo back.

//The Hyperterminal is set in Hardware Flow Control mode.

//However, the UART could not receive anything from PC after I typed some characters in the Hyperterminal window. I probed the RTS0 pin (PA3) using oscilloscope and found that this pin was low (which was active). RTS low indicated to the remote device that it could start transmitting. So the UART was supposed to receive the buffer. Moreover, I used the PDC channel for reception as the datasheet stated.

//I have no idea why it does not work! All followed the datasheet. Anyone knows the RTS/CTS flow control can give me some hints?

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists