data abort after rtems_bsdnet_initialize_network ()

Lionel TOCZE lionel.tocze at crf.canon.fr
Tue Nov 13 16:14:53 UTC 2007


Hi Joël,

I think we encounter same "crashing" problem with network.
It appears it is due to some alignment problem of tcp-ip structure.
To avoid such problem, we try to "pack" some structure like follow in :
/cpukit/libnetworking/netinet/ip_var.h
struct ipovly {
....
} __attribute__ ((packed));


/cpukit/libnetworking/netinet/tcpip.h
struct tcpiphdr {
...
} __attribute__ ((packed));

struct full_tcpiphdr {
...
}__attribute__ ((packed));

It then modify the behaviour. You could test if it solves your problem.
Nevertheless, regarding older thread, it seems packing is not a "so 
good" solution.

Lionel T.

Rochat Joël wrote:
> Think you for your answer
> 
> Here is the complete networkconfig.h I use :
> 
> /*
>  * Network configuration
>  * 
>  ************************************************************
>  * EDIT THIS FILE TO REFLECT YOUR NETWORK CONFIGURATION     *
>  * BEFORE RUNNING ANY RTEMS PROGRAMS WHICH USE THE NETWORK! * 
>  ************************************************************
>  *
>  *  $Id: networkconfig.h,v 1.8 2001/08/31 18:11:43 joel Exp $
>  */
> 
> #ifndef _RTEMS_NETWORKCONFIG_H_
> #define _RTEMS_NETWORKCONFIG_H_
> 
> /*
>  *  The following will normally be set by the BSP if it supports
>  *  a single network device driver.  In the event, it supports
>  *  multiple network device drivers, then the user's default
>  *  network device driver will have to be selected by a BSP
>  *  specific mechanism.
>  */
> 
> #ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
> #warning "RTEMS_BSP_NETWORK_DRIVER_NAME is not defined"
> #define RTEMS_BSP_NETWORK_DRIVER_NAME "no_network1"
> #endif
> 
> #ifndef RTEMS_BSP_NETWORK_DRIVER_ATTACH
> #warning "RTEMS_BSP_NETWORK_DRIVER_ATTACH is not defined"
> #define RTEMS_BSP_NETWORK_DRIVER_ATTACH 0
> #endif
> 
> /* #define RTEMS_USE_BOOTP */
> 
> #include <bsp.h>
> 
> /*
>  * Define RTEMS_SET_ETHERNET_ADDRESS if you want to specify the
>  * Ethernet address here.  If RTEMS_SET_ETHERNET_ADDRESS is not
>  * defined the driver will choose an address.
>  */
> #define RTEMS_SET_ETHERNET_ADDRESS
> #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
> /* static char ethernet_address[6] = { 0x08, 0x00, 0x3e, 0x12, 0x28, 0xb1 }; */
> static char ethernet_address[6] = { 0x00, 0x00, 0x17, 0xae, 0x30, 0x00 };
> 
> #endif
> 
> #ifdef RTEMS_USE_LOOPBACK 
> /*
>  * Loopback interface
>  */
> extern void rtems_bsdnet_loopattach();
> static struct rtems_bsdnet_ifconfig loopback_config = {
> 	"lo0",				/* name */
> 	rtems_bsdnet_loopattach,	/* attach function */
> 
> 	NULL,				/* link to next interface */
> 
> 	"127.0.0.1",			/* IP address */
> 	"255.0.0.0",			/* IP net mask */
> };
> #endif
> 
> /*
>  * Default network interface
>  */
> static struct rtems_bsdnet_ifconfig netdriver_config = {
> 	RTEMS_BSP_NETWORK_DRIVER_NAME,		/* name */
> 	RTEMS_BSP_NETWORK_DRIVER_ATTACH,	/* attach function */
> 
> #ifdef RTEMS_USE_LOOPBACK 
> 	&loopback_config,		/* link to next interface */
> #else
> 	NULL,				/* No more interfaces */
> #endif
> 
> #if (defined (RTEMS_USE_BOOTP))
> 	NULL,				/* BOOTP supplies IP address */
> 	NULL,				/* BOOTP supplies IP net mask */
> #else
> 	"153.109.5.209",		/* IP address */
> 	"255.255.255.0",		/* IP net mask */
> #endif /* !RTEMS_USE_BOOTP */
> 
> #if (defined (RTEMS_SET_ETHERNET_ADDRESS))
> 	ethernet_address,               /* Ethernet hardware address */
> #else
> 	NULL,                           /* Driver supplies hardware address */
> #endif
> 	0				/* Use default driver parameters */
> };
> 
> /*
>  * Network configuration
>  */
> struct rtems_bsdnet_config rtems_bsdnet_config = {
> 	&netdriver_config,
> 
> #if (defined (RTEMS_USE_BOOTP))
> 	rtems_bsdnet_do_bootp,
> #else
> 	NULL,
> #endif
> 
> 	5,			/* Default network task priority */
> 	128*1024,			/* Default mbuf capacity */
> 	256*1024,			/* Default mbuf cluster capacity */
> 
> #if (!defined (RTEMS_USE_BOOTP))
> 	"rtems_host",		/* Host name */
> 	"nodomain.com",		/* Domain name */
> 	"153.109.5.1",	/* Gateway */
> 	"153.109.5.1",	/* Log host */
> 	{"212.101.0.10" },	/* Name server(s) */
> 	{"212.101.3.211", "193.138.215.60", "134.34.3.18" },	/* NTP server(s) */
> 
> 	/*
> 	 *  A real example -- DO NOT USE THIS YOURSELF!!!
> 	 */
> 
> #if 0
> 	"dy4",			/* Host name */
> 	"NOT_oarcorp.com",	/* Domain name */
> 	"192.168.1.2",   	/* Gateway */
> 	"192.168.1.2", 		/* Log host */
> 	{"192.168.1.2" },	/* Name server(s) */
> 	{"192.168.1.2" },	/* NTP server(s) */
> #endif
> #endif /* !RTEMS_USE_BOOTP */
> 
> };
> 
> /*
>  * For TFTP test application
>  */
> #if (defined (RTEMS_USE_BOOTP))
> #define RTEMS_TFTP_TEST_HOST_NAME "BOOTP_HOST"
> #define RTEMS_TFTP_TEST_FILE_NAME "BOOTP_FILE"
> #else
> #define RTEMS_TFTP_TEST_HOST_NAME "XXX.YYY.ZZZ.XYZ"
> #define RTEMS_TFTP_TEST_FILE_NAME "tftptest"
> #endif
> 
> #endif /* _RTEMS_NETWORKCONFIG_H_ */
> 
> The console print this message after calling the function
> rtems_bsdnet_initialize_network () but this function don't return any error
> 
> data_abort at address 0x2012c108, instruction: 0xe5863000,   spsr = 0x20000013
> active thread thread 0x0a010002
> Previous sp=0x20150b38 lr=0x00000014 and actual cpsr=20000097
>  0x00000000 0x00000000 0x0200c045 0x0000aea7 0x97ad111e 0x01056d99
>  0xff056d99 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
>  0x2013dfb4 0x20229100 0x2020880e 0x2013df48 0x2013df44 0x00000000
>  0x00000000 0x00000000 0x20108a00 0x00000000 0x00000014 0x00000000
>  0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
>  0x00000000 0x00000000 0x20229100 0x00040004 0x2013e358 0x20150c0c
>  0x2013e474 0x20150c0c 0x2020880e 0x2013dfb4 0x2013dfb4 0x00000000
>  0x2013dc24 0x20150c0c 0x00000000 0x00000000 0x00000000 0x201091e8
> 
> When I call this function to configure the network :
> 
> rtems_at91rm9200_emac_attach (&netdriver_config, 0) ;
> 
> There is no crash anymore but I'm not able to ping the target.
> 
> I hop you can help me !
> 
> Have a nice day
> 
> Joel R.
> 
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users





More information about the users mailing list