We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I have a problem. PPP connection from MCB2130 evaluation board to PC or to another board can not be established (the connection has been made through the serial interface).
I have tried to establish PPP connection by calling function 'ppp_connect' from RLT-ARM.
I have used MCB2130 board which has been connected to PC via COM1 port by serial cable.
Source code
/*---------------------------------------------------------------------------- * R T L P P P C O N N E C T E x a m p l e *---------------------------------------------------------------------------- * Name: SimplePPP.C *----------------------------------------------------------------------------*/ #include <RTL.h> #include <LPC213x.H> /* LPC213x definitions */ /*--------------------------- init ------------------------------------------*/ void init () { IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */ /* Enable RxD1 and TxD1 pins. */ PINSEL0 &= ~0x000F0000; PINSEL0 |= 0x00050000; U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit*/ U0DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */ U0LCR = 0x03; /* DLAB = 0 */ } /*--------------------------- sendchar --------------------------------------*/ int sendchar (int ch) { /* Debug output to serial port. */ if (ch == '\n') { while (!(U0LSR & 0x20)); U0THR = '\r'; /* output CR */ } while (!(U0LSR & 0x20)); return (U0THR = ch); } /*---------------------------------------------------------------------------*/ void tick_timer (void) __task { os_itv_set (10); while (1) { os_itv_wait (); /* Timer tick every 100 ms */ timer_tick (); } } /*---------------------------------------------------------------------------*/ void tcp_poll_task (void) __task { while (1) { main_TcpNet(); os_tsk_pass(); } } void test_task (void) __task { init(); init_TcpNet (); //ppp_listen ("Keil", "test"); ppp_connect (NULL, "Keil", "test"); //slip_connect(NULL); os_tsk_create (tick_timer, 2); os_tsk_create (tcp_poll_task, 1); /* Init done, terminate this task. */ os_tsk_delete_self(); } int main (void) { os_sys_init (test_task); } /*--------------------------- init_serial -----------------------------------*/ void init_serial (void) { /* Initialize the serial interface */ rbuf.in = 0; rbuf.out = 0; tbuf.in = 0; tbuf.out = 0; tx_active = __FALSE; /* Enable RxD1 and TxD1 pins. */ PINSEL0 &= ~0x000F0000; PINSEL0 |= 0x00050000; /* 8-bits, no parity, 1 stop bit */ U1LCR = 0x83; U1DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */ U1LCR = 0x03; /* Enable FIFO with 8-byte trigger level. */ U1FCR = 0x87; /* Enable RDA and THRE interrupts. */ U1IER = 0x03; VICDefVectAddr = (U32)def_interrupt; /* Enable UART1 interrupts. */ VICVectAddr14 = (U32)handler_UART1; VICVectCntl14 = 0x27; VICIntEnable |= (1 << 7); }
I have used WinXP SP2 on PC, created the Incoming Connection in 'Network Connections'. User: 'Keil' Password 'test' . The login information was added to WinXP and is selected as user allowed connecting.
Connection has not been established.
Also, connection was not established if function 'slip_connect' had been used.
But, connection was established successfully when I used the function 'ppp_listen' on the MCB2130 board side and PC connected to MCB2130 board.
Moreover, I need to establish connection between to MCB2130 boards via serial cable. I use Null-Modem Male-Male cable. I run application which calls 'ppp_listen' on first board. I run application which calls 'ppp_connect' on another board. PPP connection is not established.
Hello Andy Neil,
First of all, thank you very much for fast reply.
It is my first experience in embedded programming.
I have done follow debugging procedures:
1) I registered log of ppp protocol. I defined
#define DBG_PPP 2
in Net_Debug.c file.
Function '__error__' has not been called. Function '__debug__' has been called 6 times. Follow messages have been printed.
Initialize PPP interface Initailize PPP-LCP Initailize PPP-RAP Initailize PPP-IPCP
Dialing number: (rubbish in memory) Hex dump of this log message: 44 69 61 6c 69 6e 67 20 6e 75 6d 62 65 72 3a 20 18 f0 9f e5 18 f0 9f e5 18 f0 9f e5 18 f0 9f e5 18 f0 9f e5 80 5f 20 b9 f0 ff 1f e5 18 f0 9f e5 54 0a 00
Username: 'Keil', Password: 'test'
2) I have used 'HyperTerminal' application from WinXP. I have chosen command 'Wait for Call'. Text
RING
has been showed in HyperTerminal window.
3) I have added calling of function 'ppp_is_up' to my code
void test_task (void) __task { init(); init_TcpNet (); //ppp_listen ("Keil", "test"); ppp_connect (NULL, "Keil", "test"); //slip_connect(NULL); os_tsk_create (tick_timer, 2); os_tsk_create (tcp_poll_task, 1); IOSET1 = 0x00200000; while(!ppp_is_up()); IOSET1 = 0x000f0000; /* Init done, terminate this task. */ os_tsk_delete_self(); }
LED indicators had to show ppp connection status. I could see that connection has not been established.