<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false"><div><div>Good Morning,</div><div><br></div><div>I seem to be having an issue with RTEMS 5.1 Release Libbsd networking when I include my own 'rtems_bsd_get_mac_address' function as described in rtemsbsd/include/rtems/bsd/bsd.h. I'm running on a Xilinx Microzed using xilinx_zynq_zedboard BSP and have a minimal RTEMS console application (source code included below). The rc.conf file configures the cgem0 interface and starts FTP and telnet daemons.</div><div><br></div><div>If I include the 'rtems_bsd_get_mac_address' function, the mac address is set but RTEMS doesn't respond to any pings and doesn't allow any connections. However, a ping to an external device from RTEMS is successful. I have run tcpdump filtering on ICMP messages and RTEMS sees them.</div><div><br></div><div>If I comment out the 'rtems_bsd_get_mac_address' function, it has the default mac address and everything works as expected.</div><div><br></div><div>All guidance and help are greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Rick</div><div><br></div><div><br></div><div>//</div><div>// RTEMS_Main.c</div><div>//</div><div>#include <bsp.h></div><div>#include <assert.h></div><div>#include <stdlib.h></div><div>#include <stdio.h></div><div>#include <unistd.h></div><div>#include <rtems/ramdisk.h></div><div>#include <rtems/printer.h></div><div>#include <rtems/stackchk.h></div><div>#include <rtems/bsd/bsd.h></div><div>#include <rtems/media.h></div><div>#include <machine/rtems-bsd-rc-conf.h></div><div>#include <rtems/ftpd.h></div><div><br></div><div>#include <rtems/console.h></div><div>#include <rtems/shell.h></div><div><br></div><div>#include <stdint.h></div><div><br></div><div>void rtems_bsd_get_mac_address(const char* name, int unit, uint8_t mac_addr[6])</div><div>{</div><div> mac_addr[0] = 0x0f;</div><div> mac_addr[1] = 0xc0;</div><div> mac_addr[2] = 0xcb;</div><div> mac_addr[3] = 0x6f;</div><div> mac_addr[4] = 0xcb;</div><div> mac_addr[5] = 0x22;</div><div>}</div><div><br></div><div>static void start_console(void)</div><div>{</div><div> rtems_status_code sc = rtems_shell_init(</div><div> "SHLL",</div><div> 32 * 1024,</div><div> 1,</div><div> CONSOLE_DEVICE_NAME,</div><div> true,</div><div> true,</div><div> NULL</div><div> );</div><div> assert(sc == RTEMS_SUCCESSFUL);</div><div>}</div><div><br></div><div>static void network_init(void)</div><div>{</div><div> printf("BSD\n");</div><div> rtems_status_code sc = rtems_bsd_initialize();</div><div> assert(sc == RTEMS_SUCCESSFUL);</div><div><br></div><div> sc = rtems_task_wake_after( 1000 );</div><div> assert(sc == RTEMS_SUCCESSFUL);</div><div> </div><div> printf("Config\n");</div><div> // configure bsd networking by specifying configuration file, wait forever, verbose = true</div><div> rtems_bsd_run_rc_conf("/media/mmcsd-0-0/rc.conf", 0, true);</div><div>}</div><div><br></div><div>void *main_thread(void *arg)</div><div>{</div><div> printf("Media Server\n");</div><div> rtems_media_server_initialize(</div><div> 25,</div><div> 32 * 1024,</div><div> RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_ASR | RTEMS_INTERRUPT_LEVEL(0),</div><div> RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL );</div><div> </div><div> rtems_status_code sc = rtems_task_wake_after( 1000 );</div><div> assert(sc == RTEMS_SUCCESSFUL);</div><div><br></div><div> network_init();</div><div> </div><div> sc = rtems_task_wake_after( 1000 );</div><div> assert(sc == RTEMS_SUCCESSFUL);</div><div> </div><div> start_console();</div><div><br></div><div> assert(0);</div><div>}</div><div><br></div><div>/*</div><div> * Configure LibBSD.</div><div> */</div><div>#define RTEMS_BSD_CONFIG_NET_PF_UNIX</div><div>#define RTEMS_BSD_CONFIG_NET_IF_BRIDGE</div><div>#define RTEMS_BSD_CONFIG_NET_IF_LAGG</div><div>#define RTEMS_BSD_CONFIG_NET_IF_VLAN</div><div>#define LIBBSP_ARM_XILINX_ZYNQ_BSP_H</div><div>#define RTEMS_BSD_CONFIG_BSP_CONFIG</div><div>#define RTEMS_BSD_CONFIG_SERVICE_TELNETD</div><div>#define RTEMS_BSD_CONFIG_SERVICE_FTPD</div><div>#define RTEMS_BSD_CONFIG_INIT</div><div><br></div><div>#include <machine/rtems-bsd-config.h></div><div><br></div><div>/*</div><div> * Configure Shell</div><div> */</div><div>#define CONFIGURE_SHELL_COMMANDS_INIT</div><div><br></div><div>#include <bsp/irq-info.h></div><div><br></div><div>#include <rtems/netcmds-config.h></div><div><br></div><div>#ifdef RTEMS_BSD_MODULE_USER_SPACE_WLANSTATS</div><div> #define SHELL_WLANSTATS_COMMAND &rtems_shell_WLANSTATS_Command,</div><div>#else</div><div> #define SHELL_WLANSTATS_COMMAND</div><div>#endif</div><div><br></div><div>#ifdef RTEMS_BSD_MODULE_USR_SBIN_WPA_SUPPLICANT</div><div> #define SHELL_WPA_SUPPLICANT_COMMAND &rtems_shell_WPA_SUPPLICANT_Command,</div><div>#else</div><div> #define SHELL_WPA_SUPPLICANT_COMMAND</div><div>#endif</div><div><br></div><div>#define CONFIGURE_SHELL_USER_COMMANDS \</div><div> SHELL_WLANSTATS_COMMAND \</div><div> SHELL_WPA_SUPPLICANT_COMMAND \</div><div> &bsp_interrupt_shell_command, \</div><div> &rtems_shell_ARP_Command, \</div><div> &rtems_shell_HOSTNAME_Command, \</div><div> &rtems_shell_PING_Command, \</div><div> &rtems_shell_ROUTE_Command, \</div><div> &rtems_shell_NETSTAT_Command, \</div><div> &rtems_shell_IFCONFIG_Command, \</div><div> &rtems_shell_TCPDUMP_Command, \</div><div> &rtems_shell_SYSCTL_Command, \</div><div> &rtems_shell_VMSTAT_Command</div><div><br></div><div>#define CONFIGURE_SHELL_COMMANDS_ALL</div><div><br></div><div>#include <rtems/shellconfig.h></div><div><br></div><div>/*</div><div> * Configure RTEMS.</div><div> */</div><div>#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER</div><div>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER</div><div><br></div><div>#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK</div><div><br></div><div>#define CONFIGURE_FILESYSTEM_DEVFS</div><div>#define CONFIGURE_FILESYSTEM_DOSFS</div><div>#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 32</div><div><br></div><div>#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1</div><div><br></div><div>#define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 32</div><div>#define CONFIGURE_UNLIMITED_OBJECTS</div><div>#define CONFIGURE_UNIFIED_WORK_AREAS</div><div><br></div><div>#define CONFIGURE_STACK_CHECKER_ENABLED</div><div><br></div><div>#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE (64 * 1024)</div><div>#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 4</div><div>#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE (1 * 1024 * 1024)</div><div><br></div><div>#define CONFIGURE_MAXIMUM_POSIX_THREADS 20</div><div>#define CONFIGURE_POSIX_INIT_THREAD_TABLE</div><div>#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT main_thread</div><div><br></div><div>#define CONFIGURE_MAXIMUM_PROCESSORS 2</div><div>#define CONFIGURE_MICROSECONDS_PER_TICK 1000</div><div>#define CONFIGURE_TICKS_PER_TIMESLICE 50</div><div><br></div><div>#define CONFIGURE_SCHEDULER_PRIORITY_SMP</div><div><br></div><div>#define CONFIGURE_INIT</div><div><br></div><div>#include <rtems/confdefs.h></div><div><br></div></div><br></div></div></body></html>