MicroBlaze demo now building with lwIP included - but will not link until the Ethernetif file is implemented.

pull/4/head
Richard Barry 14 years ago
parent 12a722bf36
commit a176b54de5

@ -40,8 +40,6 @@
</option>
<option id="xilinx.gnu.compiler.dircategory.includes.788537379" name="Include Paths" superClass="xilinx.gnu.compiler.dircategory.includes" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/lwIP_Apps}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Demo_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/MicroBlaze}&quot;"/>
@ -105,7 +103,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="serial.c|src/testperiph.c|ParTest.c|src/xuartlite_selftest_example.c|src/xtmrctr_selftest_example.c|src/xtmrctr_intr_example.c|src/xintc_tapp_example.c|src/xgpio_tapp_example.c|src/xgpio_intr_tapp_example.c|src/xemaclite_polled_example.c|src/xemaclite_intr_example.c|Demo_Source|RegisterTests.c|main-full.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="lwIP|lwIP/lwIP_Apps/apps/httpserver_raw/fsdata.c|serial.c|src/testperiph.c|ParTest.c|src/xuartlite_selftest_example.c|src/xtmrctr_selftest_example.c|src/xtmrctr_intr_example.c|src/xintc_tapp_example.c|src/xgpio_tapp_example.c|src/xgpio_intr_tapp_example.c|src/xemaclite_polled_example.c|src/xemaclite_intr_example.c|Demo_Source|RegisterTests.c|main-full.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@ -1014,6 +1012,11 @@
</option>
<option id="xilinx.gnu.compiler.dircategory.includes.1539819216" name="Include Paths" superClass="xilinx.gnu.compiler.dircategory.includes" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/netif/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/lwIP_Apps/apps/httpserver_raw}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/lwIP_Apps}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lwIP/include/ipv4}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Demo_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/MicroBlaze}&quot;"/>
@ -1077,8 +1080,11 @@
</tool>
</toolChain>
</folderInfo>
<fileInfo id="xilinx.gnu.mb.exe.debug.1890710697.1391169017.1608696955" name="fsdata.c" rcbsApplicability="disable" resourcePath="lwIP/lwIP_Apps/apps/httpserver_raw/fsdata.c" toolsToInvoke="xilinx.gnu.mb.c.toolchain.compiler.debug.1610218702.1428026378">
<tool id="xilinx.gnu.mb.c.toolchain.compiler.debug.1610218702.1428026378" name="MicroBlaze gcc compiler" superClass="xilinx.gnu.mb.c.toolchain.compiler.debug.1610218702"/>
</fileInfo>
<sourceEntries>
<entry excluding="src/xuartlite_selftest_example.c|src/xtmrctr_selftest_example.c|src/xtmrctr_intr_example.c|src/xintc_tapp_example.c|src/xgpio_tapp_example.c|src/xgpio_intr_tapp_example.c|src/xemaclite_polled_example.c|src/xemaclite_intr_example.c|src/testperiph.c|main-blinky.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry excluding="lwIP/lwIP_Apps/apps/httpserver_raw/fsdata.c|src/xuartlite_selftest_example.c|src/xtmrctr_selftest_example.c|src/xtmrctr_intr_example.c|src/xintc_tapp_example.c|src/xgpio_tapp_example.c|src/xgpio_intr_tapp_example.c|src/xemaclite_polled_example.c|src/xemaclite_intr_example.c|src/testperiph.c|main-blinky.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>

@ -83,12 +83,11 @@
#define configMAX_PRIORITIES ( 6 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 64 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 0
#define configGENERATE_RUN_TIME_STATS 0
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1
@ -132,6 +131,45 @@ to exclude the API function. */
#define configASSERT( x ) if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); for( ;; ); }
/* Run time stats gathering definitions. The conditional compilation is to
prevent the C syntax being included in assembly files. */
#ifndef __ASSEMBLER__
unsigned long ulMainGetRunTimeCounterValue( void );
void vMainConfigureTimerForRunTimeStats( void );
#endif
#define configGENERATE_RUN_TIME_STATS 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats()
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
#define configLWIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
/* MAC address configuration. */
#define configMAC_ADDR0 0x00
#define configMAC_ADDR1 0x12
#define configMAC_ADDR2 0x13
#define configMAC_ADDR3 0x10
#define configMAC_ADDR4 0x15
#define configMAC_ADDR5 0x11
/* IP address configuration. */
#define configIP_ADDR0 192
#define configIP_ADDR1 168
#define configIP_ADDR2 0
#define configIP_ADDR3 200
/* Gateway IP address configuration. */
#define configGW_IP_ADDR0 192
#define configGW_IP_ADDR1 168
#define configGW_IP_ADDR2 0
#define configGW_IP_ADDR3 3
/* Netmask configuration. */
#define configNET_MASK0 255
#define configNET_MASK1 255
#define configNET_MASK2 255
#define configNET_MASK3 0
#endif /* FREERTOS_CONFIG_H */

@ -2218,7 +2218,7 @@ lwip_setsockopt_internal(void *arg)
case IPPROTO_UDPLITE:
switch (optname) {
case UDPLITE_SEND_CSCOV:
if ((*(int*)optval != 0) && ((*(int*)optval < 8)) || (*(int*)optval > 0xffff)) {
if ( ( (*(int*)optval != 0) && ((*(int*)optval < 8)) ) || (*(int*)optval > 0xffff)) {
/* don't allow illegal values! */
sock->conn->pcb.udp->chksum_len_tx = 8;
} else {
@ -2228,7 +2228,7 @@ lwip_setsockopt_internal(void *arg)
s, (*(int*)optval)) );
break;
case UDPLITE_RECV_CSCOV:
if ((*(int*)optval != 0) && ((*(int*)optval < 8)) || (*(int*)optval > 0xffff)) {
if ( ((*(int*)optval != 0) && ((*(int*)optval < 8)) ) || (*(int*)optval > 0xffff)) {
/* don't allow illegal values! */
sock->conn->pcb.udp->chksum_len_rx = 8;
} else {

@ -139,7 +139,6 @@ static struct igmp_group *igmp_lookup_group(struct netif *ifp, ip_addr_t *addr);
static err_t igmp_remove_group(struct igmp_group *group);
static void igmp_timeout( struct igmp_group *group);
static void igmp_start_timer(struct igmp_group *group, u8_t max_time);
static void igmp_stop_timer(struct igmp_group *group);
static void igmp_delaying_member(struct igmp_group *group, u8_t maxresp);
static err_t igmp_ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, struct netif *netif);
static void igmp_send(struct igmp_group *group, u8_t type);
@ -706,16 +705,6 @@ igmp_start_timer(struct igmp_group *group, u8_t max_time)
group->timer = (LWIP_RAND() % (max_time - 1)) + 1;
}
/**
* Stop a timer for an igmp_group
*
* @param group the igmp_group for which to stop the timer
*/
static void
igmp_stop_timer(struct igmp_group *group)
{
group->timer = 0;
}
/**
* Delaying membership report for a group if necessary

@ -51,6 +51,9 @@
licensing and training services.
*/
/* Standard includes. */
#include <string.h>
/* lwIP core includes */
#include "lwip/opt.h"
#include "lwip/sys.h"
@ -71,21 +74,21 @@
/* applications includes */
#include "apps/httpserver_raw/httpd.h"
#include "apps/httpserver/httpserver-netconn.h"
#include "apps/netio/netio.h"
#include "apps/netbios/netbios.h"
#include "apps/ping/ping.h"
#include "apps/rtp/rtp.h"
#include "apps/sntp/sntp.h"
#include "apps/chargen/chargen.h"
#include "apps/shell/shell.h"
#include "apps/tcpecho/tcpecho.h"
#include "apps/udpecho/udpecho.h"
#include "apps/tcpecho_raw/echo.h"
#include "apps/socket_examples/socket_examples.h"
/* include the port-dependent configuration */
#include "lwipcfg_msvc.h"
#define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 )
#define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), configGW_IP_ADDR0, configGW_IP_ADDR1, configGW_IP_ADDR2, configGW_IP_ADDR3 )
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), configNET_MASK0,configNET_MASK1,configNET_MASK2,configNET_MASK3)
/* remember to change this MAC address to suit your needs!
the last octet will be increased by netif->num for each netif */
#define LWIP_MAC_ADDR_BASE { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 }
/* configuration for applications */
#define LWIP_CHARGEN_APP 0
#define LWIP_DNS_APP 0
#define LWIP_HTTPD_APP 1
static struct netif netif;
@ -128,13 +131,6 @@ extern err_t ethernetif_init( struct netif *netif );
netif_set_default(netif_add(&netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, tcpip_input));
#if LWIP_NETIF_STATUS_CALLBACK
netif_set_status_callback(&netif, status_callback);
#endif /* LWIP_NETIF_STATUS_CALLBACK */
#if LWIP_NETIF_LINK_CALLBACK
netif_set_link_callback(&netif, link_callback);
#endif /* LWIP_NETIF_LINK_CALLBACK */
netif_set_up( &netif );
apps_init();
http_set_ssi_handler( uslwIPAppsSSIHandler, pccSSITags, sizeof( pccSSITags ) / sizeof( char * ) );
@ -146,64 +142,11 @@ static void apps_init( void )
{
/* Taken from the lwIP example code. */
#if LWIP_DNS_APP && LWIP_DNS
/* wait until the netif is up (for dhcp, autoip or ppp) */
sys_timeout(5000, dns_dorequest, NULL);
#endif /* LWIP_DNS_APP && LWIP_DNS */
#if LWIP_CHARGEN_APP && LWIP_SOCKET
chargen_init();
#endif /* LWIP_CHARGEN_APP && LWIP_SOCKET */
#if LWIP_PING_APP && LWIP_RAW && LWIP_ICMP
ping_init();
#endif /* LWIP_PING_APP && LWIP_RAW && LWIP_ICMP */
#if LWIP_NETBIOS_APP && LWIP_UDP
netbios_init();
#endif /* LWIP_NETBIOS_APP && LWIP_UDP */
#if LWIP_HTTPD_APP && LWIP_TCP
{
#ifdef LWIP_HTTPD_APP_NETCONN
http_server_netconn_init();
#else /* LWIP_HTTPD_APP_NETCONN */
httpd_init();
#endif /* LWIP_HTTPD_APP_NETCONN */
httpd_init();
}
#endif /* LWIP_HTTPD_APP && LWIP_TCP */
#if LWIP_NETIO_APP && LWIP_TCP
netio_init();
#endif /* LWIP_NETIO_APP && LWIP_TCP */
#if LWIP_RTP_APP && LWIP_SOCKET && LWIP_IGMP
rtp_init();
#endif /* LWIP_RTP_APP && LWIP_SOCKET && LWIP_IGMP */
#if LWIP_SNTP_APP && LWIP_SOCKET
sntp_init();
#endif /* LWIP_SNTP_APP && LWIP_SOCKET */
#if LWIP_SHELL_APP && LWIP_NETCONN
shell_init();
#endif /* LWIP_SHELL_APP && LWIP_NETCONN */
#if LWIP_TCPECHO_APP
#if LWIP_NETCONN && defined(LWIP_TCPECHO_APP_NETCONN)
tcpecho_init();
#else /* LWIP_NETCONN && defined(LWIP_TCPECHO_APP_NETCONN) */
echo_init();
#endif
#endif /* LWIP_TCPECHO_APP && LWIP_NETCONN */
#if LWIP_UDPECHO_APP && LWIP_NETCONN
udpecho_init();
#endif /* LWIP_UDPECHO_APP && LWIP_NETCONN */
#if LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET
socket_examples_init();
#endif /* LWIP_SOCKET_EXAMPLES_APP && LWIP_SOCKET */
}
/*-----------------------------------------------------------*/
@ -221,11 +164,11 @@ extern char *pcMainGetTaskStatusMessage( void );
switch( iIndex )
{
case ssiTASK_STATS_INDEX :
vTaskList( pcBuffer );
vTaskList( ( signed char * ) pcBuffer );
break;
case ssiRUN_TIME_STATS_INDEX :
vTaskGetRunTimeStats( pcBuffer );
vTaskGetRunTimeStats( ( signed char * ) pcBuffer );
break;
}

@ -1,46 +1,15 @@
/**
* Additional settings for the win32 port.
* Copy this to lwipcfg_msvc.h and make the config changes you need.
*/
/* configuration for this port */
#define PPP_USERNAME "Admin"
#define PPP_PASSWORD "pass"
/** Define this to the GUID of the windows network adapter to use
* or NOT define this if you want PACKET_LIB_ADAPTER_NR to be used */
/*#define PACKET_LIB_ADAPTER_GUID "00000000-0000-0000-0000-000000000000"*/
/*#define PACKET_LIB_GET_ADAPTER_NETADDRESS(addr) IP4_ADDR((addr), 192,168,1,0)*/
/*#define PACKET_LIB_QUIET*/
#define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), configIP_ADDR0,configIP_ADDR1,configIP_ADDR2,configIP_ADDR3)
#define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), 192,168,0,3)
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), 255,255,255,0)
#define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 )
#define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), configGW_IP_ADDR0, configGW_IP_ADDR1, configGW_IP_ADDR2, configGW_IP_ADDR3 )
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), configNET_MASK0,configNET_MASK1,configNET_MASK2,configNET_MASK3)
/* remember to change this MAC address to suit your needs!
the last octet will be increased by netif->num for each netif */
#define LWIP_MAC_ADDR_BASE {0x00,0x01,0x02,0x03,0x04,0x05}
#define LWIP_MAC_ADDR_BASE { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 }
/* configuration for applications */
#define LWIP_CHARGEN_APP 0
#define LWIP_DNS_APP 0
#define LWIP_HTTPD_APP 1
/* Set this to 1 to use the netconn http server,
* otherwise the raw api server will be used. */
/*#define LWIP_HTTPD_APP_NETCONN */
#define LWIP_NETBIOS_APP 0
#define LWIP_NETIO_APP 0
#define LWIP_PING_APP 0
#define LWIP_RTP_APP 0
#define LWIP_SHELL_APP 0
#define LWIP_SNTP_APP 0
#define LWIP_SOCKET_EXAMPLES_APP 0
#define LWIP_TCPECHO_APP 0
/* Set this to 1 to use the netconn tcpecho server,
* otherwise the raw api server will be used. */
/*#define LWIP_TCPECHO_APP_NETCONN */
#define LWIP_UDPECHO_APP 0

@ -43,9 +43,9 @@
#define LWIP_SOCKET (NO_SYS==0)
#define LWIP_NETCONN (NO_SYS==0)
#define LWIP_IGMP 1
#define LWIP_IGMP 0
#define LWIP_ICMP 1
#define LWIP_SNMP 1
#define LWIP_SNMP 0
#define LWIP_DNS 1

@ -51,9 +51,9 @@
licensing and training services.
*/
/* WinPCap includes. */
#define HAVE_REMOTE
#include "pcap.h"
#if 0
//_RB_
/* FreeRTOS includes. */
#include "FreeRTOS.h"
@ -594,3 +594,5 @@ unsigned long ulNetMask;
xTaskCreate( prvInterruptSimulator, ( signed char * ) "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, configMAC_ISR_SIMULATOR_PRIORITY, NULL );
}
#endif

@ -86,8 +86,7 @@ typedef u32_t sys_prot_t;
#define SZT_F U32_F
/* Compiler hints for packing structures */
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_USE_INCLUDES
#define PACK_STRUCT_STRUCT __attribute__( (packed) )
/* Plaform specific diagnostic output */
#define LWIP_PLATFORM_DIAG(x) do { printf x; } while(0)

@ -1,45 +0,0 @@
/**
* Additional settings for the win32 port.
* Copy this to lwipcfg_msvc.h and make the config changes you need.
*/
/* configuration for this port */
#define PPP_USERNAME "Admin"
#define PPP_PASSWORD "pass"
/** Define this to the index of the windows network adapter to use */
#define PACKET_LIB_ADAPTER_NR 2
/** Define this to the GUID of the windows network adapter to use
* or NOT define this if you want PACKET_LIB_ADAPTER_NR to be used */
/*#define PACKET_LIB_ADAPTER_GUID "00000000-0000-0000-0000-000000000000"*/
/*#define PACKET_LIB_GET_ADAPTER_NETADDRESS(addr) IP4_ADDR((addr), 192,168,1,0)*/
/*#define PACKET_LIB_QUIET*/
#define LWIP_PORT_INIT_IPADDR(addr) IP4_ADDR((addr), 192,168,0,200)
#define LWIP_PORT_INIT_GW(addr) IP4_ADDR((addr), 192,168,0,3)
#define LWIP_PORT_INIT_NETMASK(addr) IP4_ADDR((addr), 255,255,255,0)
/* remember to change this MAC address to suit your needs!
the last octet will be increased by netif->num for each netif */
#define LWIP_MAC_ADDR_BASE {0x00,0x01,0x02,0x03,0x04,0x05}
/* configuration for applications */
#define LWIP_CHARGEN_APP 0
#define LWIP_DNS_APP 0
#define LWIP_HTTPD_APP 1
/* Set this to 1 to use the netconn http server,
* otherwise the raw api server will be used. */
/*#define LWIP_HTTPD_APP_NETCONN */
#define LWIP_NETBIOS_APP 0
#define LWIP_NETIO_APP 0
#define LWIP_PING_APP 0
#define LWIP_RTP_APP 0
#define LWIP_SHELL_APP 0
#define LWIP_SNTP_APP 0
#define LWIP_SOCKET_EXAMPLES_APP 0
#define LWIP_TCPECHO_APP 0
/* Set this to 1 to use the netconn tcpecho server,
* otherwise the raw api server will be used. */
/*#define LWIP_TCPECHO_APP_NETCONN */
#define LWIP_UDPECHO_APP 0

@ -597,7 +597,7 @@ int result;
*---------------------------------------------------------------------------*/
sys_prot_t sys_arch_protect(void)
{
vPortEnterCritical();
taskENTER_CRITICAL();
return 1;
}

@ -533,3 +533,8 @@ unsigned long ulCSR;
}
/*-----------------------------------------------------------*/
/* These functions are not used by the Blinky build configuration. However,
they need to be defined because the Blinky and Full build configurations share
a FreeRTOSConifg.h configuration file. */
void vMainConfigureTimerForRunTimeStats( void ) {}
unsigned long ulMainGetRunTimeCounterValue( void ) { return 1; }

@ -573,3 +573,30 @@ static void prvSetupHardware( void )
}
/*-----------------------------------------------------------*/
void vMainConfigureTimerForRunTimeStats( void )
{
unsigned long ulRunTimeStatsDivisor;
/* How many times does the counter counter increment in 10ms? */
ulRunTimeStatsDivisor = 0UL / 1000UL; //_RB_
}
/*-----------------------------------------------------------*/
unsigned long ulMainGetRunTimeCounterValue( void )
{
unsigned long ulReturn, ulCurrentCount;
ulCurrentCount = 0UL;
ulReturn = 0UL;
return ulReturn;
}
/*-----------------------------------------------------------*/
char *pcMainGetTaskStatusMessage( void )
{
return ( char * ) pcStatusMessage;
}

Loading…
Cancel
Save