Problem in RTEMS Network initialization for MVME162 VME CPU Board
AJAI KUMAR MEDHAVI
akmedhavi at rrcat.gov.in
Mon Dec 3 10:19:35 UTC 2012
Hi
I have developed an Application using RTEMS on MVME162 VME CPU Board. The
Application consists of 4 Tasks with Priorities from 101 to 104.
I have to test my RTEMS Application with another application running on
Another PC through Ethernet (10 Mbps). Both the CPU board and another PC
are
interconnected though Hub.
In RTEMS Init Task, I used the function
rtems_bsdnet_initialize_network() to Initialize Networking. When I run my
application on MVME162 CPU board, it hangs during Network Initialization.
Printf is not working inside rtems_bsdnet_initialize_network().
Please find the code for The RTEMS INIT Task , rtems_bsdnet_ifconfig &
rtems_bsdnet_config structures initialization as given below :
rtems_task Init(rtems_task_argument argument)
{
rtems_status_code status;
puts("\nRTEMS INIT TASK : Creating Application Resources .......\n" );
/*-----Network initialization--------------------------------------------*/
puts("\nNetwork initializing..........\n");
rtems_bsdnet_initialize_network();
puts("\nNetwork initialized!\n");
/*------------------------------------------------------------------------*/
/*-----Create Application Tasks Names------------------------------------*/
APPINIT_TASK_NAME = rtems_build_name( 'T', 'A', '1', ' ' );
RECV_TASK_NAME = rtems_build_name( 'T', 'A', '2', ' ' );
RecvProcessTask_NAME = rtems_build_name( 'T', 'A', '3', ' ' );
PeriodicReadTask_NAME = rtems_build_name( 'T', 'A', '4', ' ' );
/*-----Create Application Semaphores / Message Queues
Names------------------------------------*/
ioread_sema_NAME = rtems_build_name( 'S', 'E', '1', ' ' );
RecvProcessTask_msgQ_NAME = rtems_build_name( 'M', 'Q', '1', ' ' );
PeriodicReadTask_msgQ_NAME = rtems_build_name( 'M', 'Q', '2', ' ' );
/*-----Create Application Resources--------------------------------------*/
create_app_tasks();
create_app_msgqueues();
create_app_sema();
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
For Network Initialization, I have set my CPU Board IP address as
100.100.100.100 and configured following structures as given below :
static struct rtems_bsdnet_ifconfig Appnetdriver_config = {
RTEMS_BSP_NETWORK_DRIVER_NAME,
RTEMS_BSP_NETWORK_DRIVER_ATTACH,
NULL, /* link to next interface */
"100.100.100.100", /* IP address */
"255.255.255.0", /* IP net mask */
NULL, /* hardware_address */
0,
0,
0,
0,
0,
0,
0,
NULL
};
struct rtems_bsdnet_config rtems_bsdnet_config = {
&Appnetdriver_config, /* Network interface */
NULL, /* Not use BOOTP to get network configuration */
NETWORK_TASK_PRIORITY, /* Network task priority */
0, /* MBUF space */
0, /* MBUF cluster space */
"rtems_host", /* Host name */
0, /* Domain name */
0, /* Gateway */
"100.100.100.111", /* Log host */
0, /* Name server(s) */
0, /* NTP server(s) */
0,
0,
0,
0,
0
};
The RTEMS_BSP_NETWORK_DRIVER_NAME and RTEMS_BSP_NETWORK_DRIVER_ATTACH has
been defined in mvme16x_hw.h (in /c/src/lib/libbsp/m68k/shared/mvme/)as
given below :
struct rtems_bsdnet_ifconfig;
int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig, int attaching );
#define RTEMS_BSP_NETWORK_DRIVER_NAME "uti1"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH uti596_attach
Please note that there is no problem if configure above two structures for
Loopback test and loopback tests run perfectly.
For RTEMS INIT task have also included following network files :
#include <rtems/rtems_bsdnet.h>
#include <rtems/error.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
Also defined :
/*-------Init Task---------------------------------------------------*/
#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024)
#define CONFIGURE_INIT_TASK_PRIORITY 50
#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
RTEMS_NO_TIMESLICE | \
RTEMS_NO_ASR | \
RTEMS_INTERRUPT_LEVEL(0))
/*-------Network Task Priorities----------*/
#define NETWORK_TASK_PRIORITY 100
/*-------Application Task Priorities------*/
#define APPINIT_TASK_PRIORITY 101
#define RecvProcessTask_PRIORITY 102
#define Recv_Task_PRIORITY 103
#define PeriodicReadTask_PRIORITY 104
/*-------------- configuration
information-------------------------------------------------------------------
*/
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024)
#define CONFIGURE_MAXIMUM_SEMAPHORES 20
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20
#define CONFIGURE_MAXIMUM_PERIODS 1
#define CONFIGURE_MAXIMUM_TASKS 20
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MICROSECONDS_PER_TICK 10000 /*--- Changed
from 1000 to 10000 on July 11, 2012 ----------*/
#define CONFIGURE_MAXIMUM_DRIVERS 10
#define CONFIGURE_MAXIMUM_DEVICES 20
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 50
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
Now I have to know following :
1. How to in initializing rtems_bsdnet_ifconfig & rtems_bsdnet_config
structures ( MVME162 CPU Board IP address is 100.100.100.100 and This has
to receive/send messages from/to another application running on Another PC
through Ethernet (10 Mbps). Both the CPU board and another PC are
interconnected though Hub )
2. Is there something wrong in the initialization of bsdnet config
structures, I have done. If yes what will be proper values.
3.Whether I have to register Ethernet device driver in my application. If
yes, the how ?
4.How to enable "Printf" inside rtems_bsdnet_initialize_network() just for
debugging. The code inside "rtems_bsdnet_initialize_network()" have
multiple printfs and probably has been disabled by some flag/Macros. I
have not found the way how to enable printf and which
file/makefile/configure file need to changed.
Any suggestions/solutions at the earliest.
Thanks in advance
Best regards
AJAI KUMAR MEDHAVI
SCIENTIFIC OFFICER
RAJA RAMMANNA CENTRE FOR ADVANCED TECHNOLGY
DEPARTMENT OF ATOMIC ENERGY, GOV. OF INDIA,
PO : CAT, INDORE-452013, INDIA
PH. 91-731-2488052
Email : akmedhavi at rrcat.gov.in , akmedhavi at rediffmail.com
--
More information about the users
mailing list