-
应该是对的,这个格式和ARM的IP格式是一样的!
-
我的意思是:
开始是这样写的,不行!
#define ip_PC {192,168,1,101}
static const unsigned char pcIPAddress[]=ip_PC;
IP4_ADDR(&pIPAddress,pcIPAddress[3],pcIPAddress[2],pcIPAddress[1],pcIPAddress[0]);
这样再通过pIPAddress进行传递,这样写不可以!
新的程序是可以的!
IP4_ADDR(&pIPAddress,192,168,1,101);
再通过pIPAddress进行传递PC机的IP,这样是可以的!
-
我感觉两种写法一样啊。。位置好像没错吧!
-
找了很久没发现问题,可上位机就是收不到东西,能不能麻烦你帮忙再看看啊?谢谢!
-
非常感谢!
-
改了之后好多了,虽然还不能接受到,可是可以ping得通了。。谢谢!请问为什么要这样改呢。还有其他地方有什么问题吗?非常感谢!
-
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
//*****************************************************************************
//
// ---------- Stellaris / lwIP Port Options ----------
//
//*****************************************************************************
#define HOST_TMR_INTERVAL 100 // default is 0
//#define DHCP_EXPIRE_TIMER_MSECS (60 * 1000)
//#define INCLUDE_HTTPD_SSI
//#define INCLUDE_HTTPD_CGI
#define DYNAMIC_HTTP_HEADERS
//#define INCLUDE_HTTPD_DEBUG
//*****************************************************************************
//
// ---------- Platform specific locking ----------
//
//*****************************************************************************
#define SYS_LIGHTWEIGHT_PROT 1 // default is 0
#define NO_SYS 1 // default is 0
//#define MEMCPY(dst,src,len) memcpy(dst,src,len)
//#define SMEMCPY(dst,src,len) memcpy(dst,src,len)
//*****************************************************************************
//
// ---------- Memory options ----------
//
//*****************************************************************************
//#define MEM_LIBC_MALLOC 0
#define MEM_ALIGNMENT 4 // default is 1
#define MEM_SIZE (22 * 1024) // default is 1600, was 16K
//#define MEMP_OVERFLOW_CHECK 0
//#define MEMP_SANITY_CHECK 0
//#define MEM_USE_POOLS 0
//#define MEMP_USE_CUSTOM_POOLS 0
//*****************************************************************************
//
// ---------- Internal Memory Pool Sizes ----------
//
//*****************************************************************************
#define MEMP_NUM_PBUF 24 // Default 16, was 16
//#define MEMP_NUM_RAW_PCB 4
//#define MEMP_NUM_UDP_PCB 4
#define MEMP_NUM_TCP_PCB 16 // Default 5, was 12
//#define MEMP_NUM_TCP_PCB_LISTEN 8
//#define MEMP_NUM_TCP_SEG 16
//#define MEMP_NUM_REASSDATA 5
//#define MEMP_NUM_ARP_QUEUE 30
//#define MEMP_NUM_IGMP_GROUP 8
//#define MEMP_NUM_SYS_TIMEOUT 3
//#define MEMP_NUM_NETBUF 2
//#define MEMP_NUM_NETCONN 4
//#define MEMP_NUM_TCPIP_MSG_API 8
//#define MEMP_NUM_TCPIP_MSG_INPKT 8
#define PBUF_POOL_SIZE 24 // Default 16, was 36
//*****************************************************************************
//
// ---------- ARP options ----------
//
//*****************************************************************************
//#define LWIP_ARP 1
//#define ARP_TABLE_SIZE 10
//#define ARP_QUEUEING 1
//#define ETHARP_TRUST_IP_MAC 1
//*****************************************************************************
//
// ---------- IP options ----------
//
//*****************************************************************************
//#define IP_FORWARD 0
//#define IP_OPTIONS_ALLOWED 1
#define IP_REASSEMBLY 0 // default is 1
#define IP_FRAG 0 // default is 1
//#define IP_REASS_MAXAGE 3
//#define IP_REASS_MAX_PBUFS 10
//#define IP_FRAG_USES_STATIC_BUF 1
//#define IP_FRAG_MAX_MTU 1500
//#define IP_DEFAULT_TTL 255
//*****************************************************************************
//
// ---------- ICMP options ----------
//
//*****************************************************************************
//#define LWIP_ICMP 1
//#define ICMP_TTL (IP_DEFAULT_TTL)
//*****************************************************************************
//
// ---------- RAW options ----------
//
//*****************************************************************************
//#define LWIP_RAW 1
//#define RAW_TTL (IP_DEFAULT_TTL)
//*****************************************************************************
//
// ---------- DHCP options ----------
//
//*****************************************************************************
#define LWIP_DHCP 1 // default is 0
//#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
//*****************************************************************************
//
// ---------- UPNP options ----------
//
//*****************************************************************************
//#define LWIP_UPNP 0
//*****************************************************************************
//
// ---------- PTPD options ----------
//
//*****************************************************************************
//#define LWIP_PTPD 0
//*****************************************************************************
//
// ---------- AUTOIP options ----------
//
//*****************************************************************************
#define LWIP_AUTOIP 1 // default is 0
#define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))
// default is 0
#define LWIP_DHCP_AUTOIP_COOP_TRIES 5 // default is 9
//*****************************************************************************
//
// ---------- SNMP options ----------
//
//*****************************************************************************
//#define LWIP_SNMP 0
//#define SNMP_CONCURRENT_REQUESTS 1
//#define SNMP_TRAP_DESTINATIONS 1
//#define SNMP_PRIVATE_MIB 0
//#define SNMP_SAFE_REQUESTS 1
//*****************************************************************************
//
// ---------- IGMP options ----------
//
//*****************************************************************************
//#define LWIP_IGMP 0
//*****************************************************************************
//
// ---------- DNS options -----------
//
//*****************************************************************************
//#define LWIP_DNS 0
//#define DNS_TABLE_SIZE 4
//#define DNS_MAX_NAME_LENGTH 256
//#define DNS_MAX_SERVERS 2
//#define DNS_DOES_NAME_CHECK 1
//#define DNS_USES_STATIC_BUF 1
//#define DNS_MSG_SIZE 512
//*****************************************************************************
//
// ---------- UDP options ----------
//
//*****************************************************************************
//#define LWIP_UDP 1
//#define LWIP_UDPLITE 0
//#define UDP_TTL (IP_DEFAULT_TTL)
//*****************************************************************************
//
// ---------- TCP options ----------
//
//*****************************************************************************
//#define LWIP_TCP 1
//#define TCP_TTL (IP_DEFAULT_TTL)
#define TCP_WND 4096 // default is 2048
//#define TCP_MAXRTX 12
//#define TCP_SYNMAXRTX 6
//#define TCP_QUEUE_OOSEQ 1
#define TCP_MSS 1500 // default is 128
//#define TCP_CALCULATE_EFF_SEND_MSS 1
#define TCP_SND_BUF (4 * TCP_MSS)
// default is 256, was 6 *
//#define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS))
//#define TCP_SNDLOWAT (TCP_SND_BUF/2)
//#define TCP_LISTEN_BACKLOG 0
//#define TCP_DEFAULT_LISTEN_BACKLOG 0xff
//*****************************************************************************
//
// ---------- API options ----------
//
//*****************************************************************************
//#define LWIP_EVENT_API 0
//#define LWIP_CALLBACK_API 1
//*****************************************************************************
//
// ---------- Pbuf options ----------
//
//*****************************************************************************
#define PBUF_LINK_HLEN 16 // default is 14
#define PBUF_POOL_BUFSIZE 256
// default is LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)
#define ETH_PAD_SIZE 2 // default is 0
//*****************************************************************************
//
// ---------- Network Interfaces options ----------
//
//*****************************************************************************
//#define LWIP_NETIF_HOSTNAME 0
//#define LWIP_NETIF_API 0
//#define LWIP_NETIF_STATUS_CALLBACK 0
//#define LWIP_NETIF_LINK_CALLBACK 0
//#define LWIP_NETIF_HWADDRHINT 0
//*****************************************************************************
//
// ---------- LOOPIF options ----------
//
//*****************************************************************************
//#define LWIP_HAVE_LOOPIF 0
//#define LWIP_LOOPIF_MULTITHREADING 1
//*****************************************************************************
//
// ---------- Thread options ----------
//
//*****************************************************************************
//#define TCPIP_THREAD_NAME "tcpip_thread"
//#define TCPIP_THREAD_STACKSIZE 0
//#define TCPIP_THREAD_PRIO 1
//#define TCPIP_MBOX_SIZE 0
//#define SLIPIF_THREAD_NAME "slipif_loop"
//#define SLIPIF_THREAD_STACKSIZE 0
//#define SLIPIF_THREAD_PRIO 1
//#define PPP_THREAD_NAME "pppMain"
//#define PPP_THREAD_STACKSIZE 0
//#define PPP_THREAD_PRIO 1
//#define DEFAULT_THREAD_NAME "lwIP"
//#define DEFAULT_THREAD_STACKSIZE 0
//#define DEFAULT_THREAD_PRIO 1
//#define DEFAULT_RAW_RECVMBOX_SIZE 0
//#define DEFAULT_UDP_RECVMBOX_SIZE 0
//#define DEFAULT_TCP_RECVMBOX_SIZE 0
//#define DEFAULT_ACCEPTMBOX_SIZE 0
//*****************************************************************************
//
// ---------- Sequential layer options ----------
//
//*****************************************************************************
//#define LWIP_TCPIP_CORE_LOCKING 0
#define LWIP_NETCONN 0 // default is 1
//*****************************************************************************
//
// ---------- Socket Options ----------
//
//*****************************************************************************
#define LWIP_SOCKET 0 // default is 1
//#define LWIP_COMPAT_SOCKETS 1
//#define LWIP_POSIX_SOCKETS_IO_NAMES 1
//#define LWIP_TCP_KEEPALIVE 0
//#define LWIP_SO_RCVTIMEO 0
//#define LWIP_SO_RCVBUF 0
//#define SO_REUSE 0
//*****************************************************************************
//
// ---------- Statistics options ----------
//
//*****************************************************************************
//#define LWIP_STATS 1
//#define LWIP_STATS_DISPLAY 0
//#define LINK_STATS 1
//#define ETHARP_STATS (LWIP_ARP)
//#define IP_STATS 1
//#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG)
//#define ICMP_STATS 1
//#define IGMP_STATS (LWIP_IGMP)
//#define UDP_STATS (LWIP_UDP)
//#define TCP_STATS (LWIP_TCP)
//#define MEM_STATS 1
//#define MEMP_STATS 1
//#define SYS_STATS 1
//*****************************************************************************
//
// ---------- PPP options ----------
//
//*****************************************************************************
//#define PPP_SUPPORT 0
//#define PPPOE_SUPPORT 0
//#define PPPOS_SUPPORT PPP_SUPPORT
#if PPP_SUPPORT
//#define NUM_PPP 1
//#define PAP_SUPPORT 0
//#define CHAP_SUPPORT 0
//#define MSCHAP_SUPPORT 0
//#define CBCP_SUPPORT 0
//#define CCP_SUPPORT 0
//#define VJ_SUPPORT 0
//#define MD5_SUPPORT 0
//#define FSM_DEFTIMEOUT 6
//#define FSM_DEFMAXTERMREQS 2
//#define FSM_DEFMAXCONFREQS 10
//#define FSM_DEFMAXNAKLOOPS 5
//#define UPAP_DEFTIMEOUT 6
//#define UPAP_DEFREQTIME 30
//#define CHAP_DEFTIMEOUT 6
//#define CHAP_DEFTRANSMITS 10
//#define LCP_ECHOINTERVAL 0
//#define LCP_MAXECHOFAILS 3
//#define PPP_MAXIDLEFLAG 100
//#define PPP_MAXMTU 1500
//#define PPP_DEFMRU 296
#endif
//*****************************************************************************
//
// ---------- checksum options ----------
//
//*****************************************************************************
//#define CHECKSUM_GEN_IP 1
//#define CHECKSUM_GEN_UDP 1
//#define CHECKSUM_GEN_TCP 1
//#define CHECKSUM_CHECK_IP 1
//#define CHECKSUM_CHECK_UDP 1
//#define CHECKSUM_CHECK_TCP 1
//*****************************************************************************
//
// ---------- Debugging options ----------
//
//*****************************************************************************
#if 0
#define U8_F "c"
#define S8_F "c"
#define X8_F "x"
#define U16_F "u"
#define S16_F "d"
#define X16_F "x"
#define U32_F "u"
#define S32_F "d"
#define X32_F "x"
extern void UARTprintf(const char *pcString, ...);
#define LWIP_PLATFORM_DIAG(x) {UARTprintf x;}
#define LWIP_DEBUG
#endif
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_WARNING
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_SERIOUS
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_SEVERE
//#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH)
//#define ETHARP_DEBUG LWIP_DBG_ON // default is OFF
//#define NETIF_DEBUG LWIP_DBG_ON // default is OFF
//#define PBUF_DEBUG LWIP_DBG_OFF
//#define API_LIB_DEBUG LWIP_DBG_OFF
//#define API_MSG_DEBUG LWIP_DBG_OFF
//#define SOCKETS_DEBUG LWIP_DBG_OFF
//#define ICMP_DEBUG LWIP_DBG_OFF
//#define IGMP_DEBUG LWIP_DBG_OFF
//#define INET_DEBUG LWIP_DBG_OFF
//#define IP_DEBUG LWIP_DBG_ON // default is OFF
//#define IP_REASS_DEBUG LWIP_DBG_OFF
//#define RAW_DEBUG LWIP_DBG_OFF
//#define MEM_DEBUG LWIP_DBG_OFF
//#define MEMP_DEBUG LWIP_DBG_OFF
//#define SYS_DEBUG LWIP_DBG_OFF
//#define TCP_DEBUG LWIP_DBG_OFF
//#define TCP_INPUT_DEBUG LWIP_DBG_OFF
//#define TCP_FR_DEBUG LWIP_DBG_OFF
//#define TCP_RTO_DEBUG LWIP_DBG_OFF
//#define TCP_CWND_DEBUG LWIP_DBG_OFF
//#define TCP_WND_DEBUG LWIP_DBG_OFF
//#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
//#define TCP_RST_DEBUG LWIP_DBG_OFF
//#define TCP_QLEN_DEBUG LWIP_DBG_OFF
//#define UDP_DEBUG LWIP_DBG_ON // default is OFF
//#define TCPIP_DEBUG LWIP_DBG_OFF
//#define PPP_DEBUG LWIP_DBG_OFF
//#define SLIP_DEBUG LWIP_DBG_OFF
//#define DHCP_DEBUG LWIP_DBG_ON // default is OFF
//#define AUTOIP_DEBUG LWIP_DBG_OFF
//#define SNMP_MSG_DEBUG LWIP_DBG_OFF
//#define SNMP_MIB_DEBUG LWIP_DBG_OFF
//#define DNS_DEBUG LWIP_DBG_OFF
#endif /* __LWIPOPTS_H__ */
这是lwipopts.h
自己找了很就没找出错误,麻烦你了!谢谢
-
;******************************************************************************
;
; Stack Size (in Bytes)
;
;******************************************************************************
Stack EQU 0x00000100
;******************************************************************************
;
; Heap Size (in Bytes)
;
;******************************************************************************
Heap EQU 0x00000000
;******************************************************************************
;
; Allocate space for the stack.
;
;******************************************************************************
AREA STACK, NOINIT, READWRITE, ALIGN=3
StackMem
SPACE Stack
__initial_sp
;******************************************************************************
;
; Allocate space for the heap.
;
;******************************************************************************
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
HeapMem
SPACE Heap
__heap_limit
;******************************************************************************
;
; Indicate that the code in this file preserves 8-byte alignment of the stack.
;
;******************************************************************************
PRESERVE8
;******************************************************************************
;
; Place code into the reset code section.
;
;******************************************************************************
AREA RESET, CODE, READONLY
THUMB
;******************************************************************************
;
; External declarations for the interrupt handlers used by the application.
;
;******************************************************************************
EXTERN lwIPEthernetIntHandler
EXTERN SysTickIntHandler
;******************************************************************************
;
; The vector table.
;
;******************************************************************************
EXPORT __Vectors
__Vectors
DCD StackMem + Stack ; Top of Stack
DCD Reset_Handler ; Reset Handler
DCD NmiSR ; NMI Handler
DCD FaultISR ; Hard Fault Handler
DCD IntDefaultHandler ; MPU Fault Handler
DCD IntDefaultHandler ; Bus Fault Handler
DCD IntDefaultHandler ; Usage Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD IntDefaultHandler ; SVCall Handler
DCD IntDefaultHandler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD IntDefaultHandler ; PendSV Handler
DCD SysTickIntHandler ; SysTick Handler
DCD IntDefaultHandler ; GPIO Port A
DCD IntDefaultHandler ; GPIO Port B
DCD IntDefaultHandler ; GPIO Port C
DCD IntDefaultHandler ; GPIO Port D
DCD IntDefaultHandler ; GPIO Port E
DCD IntDefaultHandler ; UART0
DCD IntDefaultHandler ; UART1
DCD IntDefaultHandler ; SSI
DCD IntDefaultHandler ; I2C
DCD IntDefaultHandler ; PWM Fault
DCD IntDefaultHandler ; PWM Generator 0
DCD IntDefaultHandler ; PWM Generator 1
DCD IntDefaultHandler ; PWM Generator 2
DCD IntDefaultHandler ; Quadrature Encoder
DCD IntDefaultHandler ; ADC Sequence 0
DCD IntDefaultHandler ; ADC Sequence 1
DCD IntDefaultHandler ; ADC Sequence 2
DCD IntDefaultHandler ; ADC Sequence 3
DCD IntDefaultHandler ; Watchdog
DCD IntDefaultHandler ; Timer 0A
DCD IntDefaultHandler ; Timer 0B
DCD IntDefaultHandler ; Timer 1A
DCD IntDefaultHandler ; Timer 1B
DCD IntDefaultHandler ; Timer 2A
DCD IntDefaultHandler ; Timer 2B
DCD IntDefaultHandler ; Comp 0
DCD IntDefaultHandler ; Comp 1
DCD IntDefaultHandler ; Comp 2
DCD IntDefaultHandler ; System Control
DCD IntDefaultHandler ; Flash Control
DCD IntDefaultHandler ; GPIO Port F
DCD IntDefaultHandler ; GPIO Port G
DCD IntDefaultHandler ; GPIO Port H
DCD IntDefaultHandler ; UART2 Rx and Tx
DCD IntDefaultHandler ; SSI1 Rx and Tx
DCD IntDefaultHandler ; Timer 3 subtimer A
DCD IntDefaultHandler ; Timer 3 subtimer B
DCD IntDefaultHandler ; I2C1 Master and Slave
DCD IntDefaultHandler ; Quadrature Encoder 1
DCD IntDefaultHandler ; CAN0
DCD IntDefaultHandler ; CAN1
DCD IntDefaultHandler ; CAN2
DCD lwIPEthernetIntHandler ; Ethernet
DCD IntDefaultHandler ; Hibernate
DCD IntDefaultHandler ; USB0
DCD IntDefaultHandler ; PWM Generator 3
DCD IntDefaultHandler ; uDMA Software Transfer
DCD IntDefaultHandler ; uDMA Error
;******************************************************************************
;
; This is the code that gets called when the processor first starts execution
; following a reset event.
;
;******************************************************************************
EXPORT Reset_Handler
Reset_Handler
;
; Call the C library enty point that handles startup. This will copy
; the .data section initializers from flash to SRAM and zero fill the
; .bss section.
;
IMPORT __main
B __main
;******************************************************************************
;
; This is the code that gets called when the processor receives a NMI. This
; simply enters an infinite loop, preserving the system state for examination
; by a debugger.
;
;******************************************************************************
NmiSR
B NmiSR
;******************************************************************************
;
; This is the code that gets called when the processor receives a fault
; interrupt. This simply enters an infinite loop, preserving the system state
; for examination by a debugger.
;
;******************************************************************************
FaultISR
B FaultISR
;******************************************************************************
;
; This is the code that gets called when the processor receives an unexpected
; interrupt. This simply enters an infinite loop, preserving the system state
; for examination by a debugger.
;
;******************************************************************************
IntDefaultHandler
B IntDefaultHandler
;******************************************************************************
;
; Make sure the end of this section is aligned.
;
;******************************************************************************
ALIGN
;******************************************************************************
;
; Some code in the normal code section for initializing the heap and stack.
;
;******************************************************************************
AREA |.text|, CODE, READONLY
;******************************************************************************
;
; The function expected of the C library startup code for defining the stack
; and heap memory locations. For the C library version of the startup code,
; provide this function so that the C library initialization code can find out
; the location of the stack and heap.
;
;******************************************************************************
IF :DEF: __MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, =HeapMem
LDR R1, =(StackMem + Stack)
LDR R2, =(HeapMem + Heap)
LDR R3, =StackMem
BX LR
ENDIF
;******************************************************************************
;
; Make sure the end of this section is aligned.
;
;******************************************************************************
ALIGN
;******************************************************************************
;
; Tell the assembler that we're done.
;
;******************************************************************************
END
这是startup.s
-
有没有图片转换方面的教程?
-
已经注册了
-
无法编译哎。。keil完全破解了!
-
谢谢。。我已经弄清楚了!
-
哦哦。。能详细解释一下吗?谢谢
-
哦。。这个MAC地址是我自己写进去的?那怎么能保证mac地址的唯一性呢?
-
可以了,那MAC地址放在哪个里面?
-
具体应该怎么办?还是没能解决!
-
多谢分享!
-
KEIL已经和谐了。。。我放外边存储器试试看。。谢谢各位!
-
while(1)
{
//
// Process any messages from or for the widgets.
//
WidgetMessageQueueProcess();
}
}
这里面加了个延迟
-
哦。。我是想用LCD显示一张图片的,直接用pnmtoc转换过来的,有没有什么方法可以将程序变小!