RTEMS BSD Net on Atmel SAM Board

Isaac Gutekunst isaac.gutekunst at vecna.com
Wed Jun 1 18:06:32 UTC 2016


A brief update: I've updated my configuration from a different example to be a bit more complete. It looks like it can't communicate with the PHY.

#if (defined (RTEMS_SET_ETHERNET_ADDRESS))
   static char ethernet_address[6] = { 0x00, 0x04, 0x9F, 0x00, 0x5B, 0x21 };
#endif


static struct rtems_bsdnet_ifconfig netdriver_config = {
         RTEMS_BSP_NETWORK_DRIVER_NAME,          /* name */
         RTEMS_BSP_NETWORK_DRIVER_ATTACH,        /* attach function */
         NULL,                           /* No more interfaces */
#if (defined (RTEMS_USE_BOOTP))
         NULL,                           /* BOOTP supplies IP address */
         NULL,                           /* BOOTP supplies IP net mask */
#else
         "192.168.0.140",                /* 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 */
         0,                              /* mtu */
         0,                              /* rbuf_count */
         0,                              /* xbuf_count */
         0,                              /* port */
         39                               /* irq */
};



struct rtems_bsdnet_config rtems_bsdnet_config = {
         &netdriver_config,
         NULL,
         0,                              /* Default network task priority */
         16 * 1024,                     /* Default mbuf capacity */
         16 * 1024,                     /* Default mbuf cluster capacity */
         "rtems",                /* Host name */
         "nodomain.com",         /* Domain name */
         "192.168.0.14",         /* Gateway */
         "192.168.0.1",          /* Log host */
         {"192.168.0.1"  },      /* Name server(s) */
         {"192.168.0.1"  },      /* NTP server(s) */
         0,                      /* efficiency */
         0,                      /* udp TX buffer */
         0,                      /* udp RX buffer */
         0,                      /* tcp TX buffer */
         0,                      /* tcp RX buffer */
};


I also added the network shell commands and can ping myself on 192.168.0.140. ifconfig atsamv0 shows:

***** atsam0 *****
Ethernet Address: 48:11:40:20:45:01
Address:192.168.0.140   Broadcast Address:192.168.0.255   Net mask:255.255.255.0
Flags: Up Broadcast Running Simplex Multicast
Send queue limit:50   length:0    Dropped:0
-E- TimeOut ReadPhy


This matches the slow blinking of both LEDs at about 0.5Hz.

Isaac

On 06/01/2016 11:46 AM, Isaac Gutekunst wrote:
> Hi All,
>
> I'm trying to bring up tHE Atmel SAMV71 Explained Ultra board with networking, and can't figure out how to. Does anyone have any quick pointers?
>
>
>
> Isaac
>
>
>
> To limit potential email traffic, this is my setup as of now:
>
> I've compiled the BSP with --enable-networking, verified by sprinkling #error messages in the generated header files that it really was compiled with --enable-networkinG.
>
>
> I've copied the following from the networking supplement:
>
> static struct rtems_bsdnet_ifconfig netdriver_config = {
>   RTEMS_BSP_NETWORK_DRIVER_NAME,
>   RTEMS_BSP_NETWORK_DRIVER_ATTACH
> };
>
> struct rtems_bsdnet_config rtems_bsdnet_config = {
>   &netdriver_config,
>   NULL,
> };
>
>
>
> In Init, I call
>
> rtems_bsdnet_initialize_network ();
>
>
> My overall configuration #defines are as follows:
>
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>
> #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS   64
> #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK    512
> #define CONFIGURE_MAXIMUM_DRIVERS                  20
>
> #define CONFIGURE_SWAPOUT_TASK_PRIORITY            2
>
> #define CONFIGURE_INIT_TASK_STACK_SIZE           RTEMS_MINIMUM_STACK_SIZE
> #define CONFIGURE_EXTRA_TASK_STACKS              RTEMS_MINIMUM_STACK_SIZE
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> #define CONFIGURE_MAXIMUM_TASKS                  rtems_resource_unlimited (20)
> #define CONFIGURE_MAXIMUM_BARRIERS               rtems_resource_unlimited (10)
> #define CONFIGURE_MAXIMUM_SEMAPHORES             rtems_resource_unlimited (20)
> #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES         rtems_resource_unlimited (4)
> #define CONFIGURE_MAXIMUM_PARTITIONS             rtems_resource_unlimited (2)
> #define CONFIGURE_MAXIMUM_USER_EXTENSIONS            8
> #define CONFIGURE_MAXIMUM_TIMERS                     8
> #define CONFIGURE_UNIFIED_WORK_AREAS
>
> #if 1
> #define CONFIGURE_MAXIMUM_POSIX_KEYS                 16
> #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS      16
> #define CONFIGURE_MAXIMUM_POSIX_THREADS              10
> #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  20
> #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              40
> #endif
>
> #define CONFIGURE_MICROSECONDS_PER_TICK              1000
>
>
> #define CONFIGURE_UNIFIED_WORK_AREAS
> #define CONFIGURE_UNLIMITED_OBJECTS
>
> #define CONFIGURE_INIT
>
> #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK 1
>
> #include <rtems/confdefs.h>
>
> #include <rtems/shell.h>
> #define CONFIGURE_SHELL_COMMANDS_INIT
> #define CONFIGURE_SHELL_COMMANDS_ALL
> #include <rtems/shellconfig.h>
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list