Allow non-ipv6 build, e.g. Hello World

This commit is contained in:
dak664 2010-11-12 17:15:00 +00:00
parent 3f73d7dae0
commit 9e94ba9803
6 changed files with 37 additions and 25 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile.avr,v 1.25 2010/09/17 21:59:09 dak664 Exp $
# $Id: Makefile.avr,v 1.26 2010/11/12 17:15:00 dak664 Exp $
### Check if we are running under Windows
@ -133,7 +133,7 @@ $(OBJECTDIR)/%.o: %.c
%.elf: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a symbols.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out %.a,$^) $(filter %.a,$^) $(LDLIBS)
### avr-size -C --mcu=$(MCU) $@
avr-size -C --mcu=$(MCU) $@
%.hex: %.out
$(OBJCOPY) $^ -O ihex $@

View file

@ -1,5 +1,11 @@
#Note to AVR Raven users: Output goes to UART1, not the LCD. To see it,
#make TARGET=avr-raven hello-world.elf
#Load the .elf in AVR Studio and connect a hapsim terminal to the 1284p simulation.
CONTIKI_PROJECT = hello-world
all: $(CONTIKI_PROJECT)
#UIP_CONF_IPV6=1
CONTIKI = ../..
include $(CONTIKI)/Makefile.include

View file

@ -73,9 +73,18 @@
#define RIMEADDR_CONF_SIZE 8
//define UIP_CONF_IPV6 1 //Let the makefile do this, allows hello-world to compile
#if UIP_CONF_IPV6
#define UIP_CONF_ICMP6 1
#define UIP_CONF_UDP 1
#define UIP_CONF_TCP 1
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#else
#define NETSTACK_CONF_NETWORK rime_driver
#endif
/* RF230BB must be used with low power protocols */
/* The new NETSTACK interface requires RF230BB */
#if RF230BB
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1 //for barebones driver, sicslowpan calls radio->read function
#undef PACKETBUF_CONF_HDR_SIZE //RF230BB takes the packetbuf default for header size
@ -88,7 +97,7 @@
#if 1 /* Network setup */
/* No radio cycling */
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_RDC sicslowmac_driver
#define NETSTACK_CONF_FRAMER framer_802154
@ -103,7 +112,6 @@
#elif 0
/* Contiki-mac radio cycling */
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_RDC contikimac_driver
#define NETSTACK_CONF_FRAMER framer_802154
@ -113,7 +121,6 @@
#elif 0
/* cx-mac radio cycling */
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_RDC cxmac_driver
#define NETSTACK_CONF_FRAMER framer_802154
@ -149,7 +156,6 @@
#define UIP_CONF_IP_FORWARD 0
#define UIP_CONF_FWCACHE_SIZE 0
#define UIP_CONF_IPV6 1
#define UIP_CONF_IPV6_CHECKS 1
#define UIP_CONF_IPV6_QUEUE_PKT 1
#define UIP_CONF_IPV6_REASSEMBLY 0
@ -157,12 +163,8 @@
#define UIP_CONF_ND6_MAX_PREFIXES 3
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
#define UIP_CONF_ICMP6 1
#define UIP_CONF_UDP 1
#define UIP_CONF_UDP_CHECKSUMS 1
#define UIP_CONF_TCP 1
#define UIP_CONF_TCP_SPLIT 1
#if 0 /* RPL */

View file

@ -189,7 +189,9 @@ void initialize(void)
memset(&addr, 0, sizeof(rimeaddr_t));
get_mac_from_eeprom(addr.u8);
memcpy(&uip_lladdr.addr, &addr.u8, 8);
#if UIP_CONF_IPV6
memcpy(&uip_lladdr.addr, &addr.u8, 8);
#endif
rf230_set_pan_addr(
get_panid_from_eeprom(),
get_panaddr_from_eeprom(),

View file

@ -123,7 +123,9 @@ init_lowlevel(void)
eeprom_read_block ((void *)&addr.u8, &mac_address, 8);
AVR_LEAVE_CRITICAL_REGION();
memcpy(&uip_lladdr.addr, &addr.u8, 8);
#if UIP_CONF_IPV6
memcpy(&uip_lladdr.addr, &addr.u8, 8);
#endif
rf230_set_pan_addr(IEEE802154_PANID, 0, (uint8_t *)&addr.u8);
rf230_set_channel(24);

View file

@ -73,7 +73,14 @@
#define RIMEADDR_CONF_SIZE 8
#define PACKETBUF_CONF_HDR_SIZE 0
/* RF230BB must be used with low power protocols */
//define UIP_CONF_IPV6 1 //Let the makefile do this, allows hello-world to compile
#if UIP_CONF_IPV6
#define UIP_CONF_ICMP6 1
#define UIP_CONF_UDP 1
#define UIP_CONF_TCP 1
#endif
/* The new NETSTACK interface requires RF230BB */
#if RF230BB
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1 //for barebones driver, sicslowpan calls radio->read function
@ -81,7 +88,11 @@
#define UIP_CONF_LLH_LEN 0
/* No radio cycling */
#if UIP_CONF_IPV6
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#else
#define NETSTACK_CONF_NETWORK rime_driver
#endif
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_RDC sicslowmac_driver
#define NETSTACK_CONF_FRAMER framer_802154
@ -112,7 +123,6 @@
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
#define SICSLOWPAN_CONF_FRAG 1
#define UIP_CONF_LL_802154 1
#define UIP_CONF_MAX_CONNECTIONS 2
@ -122,24 +132,14 @@
#define UIP_CONF_IP_FORWARD 0
#define UIP_CONF_FWCACHE_SIZE 0
#define UIP_CONF_IPV6 1
#define UIP_CONF_IPV6_CHECKS 1
#define UIP_CONF_IPV6_QUEUE_PKT 0
#define UIP_CONF_IPV6_REASSEMBLY 0
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
#define UIP_CONF_ND6_MAX_PREFIXES 3
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
#define UIP_CONF_ICMP6 1
#define UIP_CONF_UDP 1
#define UIP_CONF_UDP_CHECKSUMS 1
#define UIP_CONF_TCP 1
#define UIP_CONF_TCP_SPLIT 1