diff --git a/platform/stk500/Makefile b/platform/stk500/Makefile deleted file mode 100644 index 3e1094a59..000000000 --- a/platform/stk500/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: contiki-stk500-main.out -upload: contiki-stk500-main.u - -CONTIKI=../.. -TARGET=stk500 - -include $(CONTIKI)/Makefile.include diff --git a/platform/stk500/Makefile.stk500 b/platform/stk500/Makefile.stk500 deleted file mode 100644 index 3d8fdc645..000000000 --- a/platform/stk500/Makefile.stk500 +++ /dev/null @@ -1,19 +0,0 @@ -CONTIKI_TARGET_DIRS = . dev apps loader -CONTIKI_TARGET_MAIN = contiki-stk500-main.o - -CONTIKI_SOURCEFILES += rs232.c contiki-stk500-main.c - -CONTIKI_NO_NET=1 -CONTIKIAVR=$(CONTIKI)/cpu/avr -CONTIKIBOARD=. - -//MCU=atmega8 -MCU=atmega8515 -//MCU=atmega644 -//MCU=atmega328p -//MCU=atmega16 -//MCU=atmega32 - -CONTIKI_PLAT_DEFS = -DF_CPU=8000000UL -DAUTO_CRC_PADDING=2 - -include $(CONTIKIAVR)/Makefile.avr diff --git a/platform/stk500/contiki-conf.h b/platform/stk500/contiki-conf.h deleted file mode 100644 index 6bb4a00a8..000000000 --- a/platform/stk500/contiki-conf.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef __CONTIKI_CONF_H__ -#define __CONTIKI_CONF_H__ - -#include - -/* Platform name, type, and MCU clock rate */ -#define PLATFORM_NAME "STK500" -#define PLATFORM_TYPE STK500 -#ifndef F_CPU -#define F_CPU 8000000UL -#endif - -#define CCIF -#define CLIF - -/* The AVR tick interrupt usually is done with an 8 bit counter around 128 Hz. - * 125 Hz needs slightly more overhead during the interrupt, as does a 32 bit - * clock_time_t. - */ - /* Clock ticks per second */ -#define CLOCK_CONF_SECOND 125 -#if 1 -/* 16 bit counter overflows every ~10 minutes */ -typedef unsigned short clock_time_t; -#define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0) -#define INFINITE_TIME 0xffff -#define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */ -#define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */ -#else -typedef unsigned long clock_time_t; -#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0) -#define INFINITE_TIME 0xffffffff -#endif -/* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */ -void clock_delay_msec(uint16_t howlong); -void clock_adjust_ticks(clock_time_t howmany); - -#define SLIP_PORT 0 - -#if UIP_CONF_IPV6 -#define RIMEADDR_CONF_SIZE 8 -#define UIP_CONF_ICMP6 1 -#define UIP_CONF_UDP 1 -#define UIP_CONF_TCP 1 -//#define UIP_CONF_IPV6_RPL 0 - -/* See uip-ds6.h */ -#define NBR_TABLE_CONF_MAX_NEIGHBORS 20 -#define UIP_CONF_DS6_DEFRT_NBU 2 -#define UIP_CONF_DS6_PREFIX_NBU 3 -#define UIP_CONF_MAX_ROUTES 20 -#define UIP_CONF_DS6_ADDR_NBU 3 -#define UIP_CONF_DS6_MADDR_NBU 0 -#define UIP_CONF_DS6_AADDR_NBU 0 - -#define NETSTACK_CONF_NETWORK sicslowpan_driver -#define NETSTACK_CONF_MAC nullmac_driver -#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 -#define NETSTACK_CONF_RDC sicslowmac_driver -#define NETSTACK_CONF_FRAMER framer_802154 -#define NETSTACK_CONF_RADIO rf230_driver -#define CHANNEL_802_15_4 26 -/* AUTOACK receive mode gives better rssi measurements, even if ACK is never requested */ -#define RF230_CONF_AUTOACK 1 -/* Request 802.15.4 ACK on all packets sent (else autoretry). This is primarily for testing. */ -#define SICSLOWPAN_CONF_ACK_ALL 0 -/* Number of auto retry attempts 0-15 (0 implies don't use extended TX_ARET_ON mode with CCA) */ -#define RF230_CONF_AUTORETRIES 2 -#define SICSLOWPAN_CONF_FRAG 1 -/* Most browsers reissue GETs after 3 seconds which stops fragment reassembly so a longer MAXAGE does no good */ -#define SICSLOWPAN_CONF_MAXAGE 3 -/* How long to wait before terminating an idle TCP connection. Smaller to allow faster sleep. Default is 120 seconds */ -#define UIP_CONF_WAIT_TIMEOUT 5 - -#else -/* ip4 should build but is largely untested */ -#define RIMEADDR_CONF_SIZE 2 -#define NETSTACK_CONF_NETWORK rime_driver -#endif /* UIP_CONF_IPV6 */ - -typedef unsigned short uip_stats_t; - -/* These names are deprecated, use C99 names. */ -typedef uint8_t u8_t; -typedef int8_t s8_t; -typedef uint16_t u16_t; -typedef int16_t s16_t; -typedef uint32_t u32_t; -typedef int32_t s32_t; - -#endif /* __CONTIKI_CONF_H__ */ diff --git a/platform/stk500/contiki-stk500-main.c b/platform/stk500/contiki-stk500-main.c deleted file mode 100644 index 54169f19e..000000000 --- a/platform/stk500/contiki-stk500-main.c +++ /dev/null @@ -1,236 +0,0 @@ - -/* Copyright (c) 2008, Daniel Willmann - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This file is part of the Contiki OS - * - * - */ - -#include "contiki.h" -#include "dev/rs232.h" - -#include -#include -#include -#include - -#define PRINTA(FORMAT,args...) printf_P(PSTR(FORMAT),##args) -#define DEBUG 0 -#if DEBUG -#define PRINTD PRINTA -#else -#define PRINTD(...) -#endif - -/* Test rtimers, also stack monitor and time stamps */ -#define TESTRTIMER 1 -#if TESTRTIMER -#define STAMPS 30 -#define STACKMONITOR 128 - -uint8_t rtimerflag=1; -uint16_t rtime; -struct rtimer rt; -void rtimercycle(void) {rtimerflag=1;} -#endif /* TESTRTIMER */ - -#if defined (__AVR_ATmega8__) -FUSES = - { - .low = 0xe0, - .high = 0xd9, - }; -#elif defined (__AVR_ATmega16__) -FUSES = - { - .low = 0xe0, - .high = 0x99, - }; -#elif defined (__AVR_ATmega644__) -FUSES = - { - .low = 0xe0, - .high = 0x99, - .extended = 0xff, - }; - -//MCU=atmega8515 -//MCU=atmega328p -//MCU=atmega32 -#endif - - -PROCESS(led_process, "LED process"); -PROCESS_THREAD(led_process, ev, data) -{ - static struct etimer etimer; - - PROCESS_BEGIN(); - while (1) { - PRINTD("LED1\r\n"); - PORTB |= (1< %d bytes\n",p-(uint16_t)&__bss_end); - break; - } - p+=4; - } while (p - * - * @(#)$$ - */ -#include "contiki-stk501.h" - -void -init_lowlevel(void) -{ - /* Configure default slip port with 115200 baud */ - rs232_init(RS232_PORT_0, USART_BAUD_115200, USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); - - /* Second rs232 port for debugging */ - rs232_init(RS232_PORT_1, USART_BAUD_9600, USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); - - /* Redirect stdout to second port */ - rs232_redirect_stdout (RS232_PORT_1); -} diff --git a/platform/stk501/contiki-stk501-default-init-net.c b/platform/stk501/contiki-stk501-default-init-net.c deleted file mode 100644 index 037edfb07..000000000 --- a/platform/stk501/contiki-stk501-default-init-net.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2006, Technical University of Munich - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * Author: Simon Barner - * - * @(#)$$ - */ - -#include "contiki-stk501.h" - -#if UIP_CONF_IPV6 -#warning ********Explcit IPV4 code bypassed*********** -#else - -static struct uip_fw_netif slipif = - {UIP_FW_NETIF(10,100,0,0, 255,255,0,0, slip_send)}; -#endif - -void -init_net(void) -{ -#if !UIP_CONF_IPV6 - uip_ipaddr_t hostaddr; - - rs232_set_input (SLIP_PORT, slip_input_byte); - process_start(&slip_process, NULL); - - uip_ipaddr(&hostaddr, 10, 100, 0, 2); - uip_sethostaddr(&hostaddr); - - uip_fw_register(&slipif); - // uip_fw_default(&slipif); -#endif /* UIP_CONF_IPV6 */ -} diff --git a/platform/stk501/contiki-stk501-main.c b/platform/stk501/contiki-stk501-main.c deleted file mode 100644 index 3223bbfae..000000000 --- a/platform/stk501/contiki-stk501-main.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2006, Technical University of Munich - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * @(#)$$ - */ - -/** - * \file - * Sample Contiki kernel for STK 501 development board - * - * \author - * Simon Barner -#include -#include "net/uip_arp.h" - -#include "contiki-stk501.h" -//#include "../core/cfs/cfs-eeprom.h" -#include "cfs/cfs.h" -#include "dev/eeprom.h" -#include "lib/mmem.h" -#include "loader/symbols-def.h" -#include "loader/symtab.h" -#include "../apps/codeprop/codeprop.h" -#include "sys/mt.h" - -/* Uncomment to enable demonstration of multi-threading libary */ -/* #define MT_DEMO */ - -#define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args) - -//TODO: What happened to cfs_eeprom_process? -//PROCINIT(&etimer_process, &tcpip_process, &uip_fw_process, &cfs_eeprom_process); -#if UIP_CONF_IPV6 -PROCINIT(&etimer_process, &tcpip_process); -#else -PROCINIT(&etimer_process, &tcpip_process, &uip_fw_process); -#endif - -#ifdef MT_DEMO -static struct mt_thread threads[3]; - -static -void thread_handler1 (void* data) { - while (1) { - PRINTF ("Thread 1. Data: 0x%x, %d\n", data, *(uint8_t*)data ); - mt_yield (); - } -} - -static -void thread_handler2 (void* data) { - while (1) { - PRINTF ("Thread 2. Data: 0x%x, %d\n", data, *(uint8_t*)data ); - mt_yield (); - } -} -#endif - -PROCESS(contiki_stk501_main_init_process, "Contiki STK501 init process"); -PROCESS_THREAD(contiki_stk501_main_init_process, ev, data) -{ - PROCESS_BEGIN(); - - /* Network support (uIP) */ - init_net(); - - /* Initalize heap allocator */ - mmem_init (); - - /* Code propagator */ - /* TODO: The core elfloader-avr.c has 16/32 bit pointer problems so this won't build */ -//process_start(&codeprop_process, NULL); - - /* Multi-threading support */ -#ifdef MT_DEMO - mt_init (); -#endif - - PROCESS_END(); -} - -#ifdef MT_DEMO -static uint8_t d1=1, d2=2, d3=3; -#endif - -int -main(void) -{ - /* - * GCC depends on register r1 set to 0. - */ - asm volatile ("clr r1"); - - /* Initialize hardware */ - init_lowlevel(); - - /* Clock */ - clock_init(); - - /* Process subsystem */ - process_init(); - - /* Register initial processes */ - procinit_init(); - - /* Perform rest of initializations */ - process_start(&contiki_stk501_main_init_process, NULL); - - PRINTF("Initialized.\n"); - -#ifdef MT_DEMO - mt_start (&threads[0], thread_handler1, &d1); - mt_start (&threads[1], thread_handler2, &d2); - mt_start (&threads[2], thread_handler2, &d3); - - uint8_t i; -#endif - - /* Main scheduler loop */ - while(1) { - - process_run(); - -#ifdef MT_DEMO - for (i=0; i<3; ++i) { - mt_exec (&threads[i]); - } -#endif - } - - return 0; -} diff --git a/platform/stk501/contiki-stk501.h b/platform/stk501/contiki-stk501.h deleted file mode 100644 index 17a2bc98d..000000000 --- a/platform/stk501/contiki-stk501.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2006, Technical University of Munich - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * @(#)$$ - */ - -/** - * \file - * Sample Contiki kernel for STK 501 development board - * - * \author - * Simon Barner - */ -#include -#include "dev/rs232.h" -#include "contiki.h" - -PROCESS(test_process1, "Test process"); -PROCESS_THREAD(test_process1, ev, data) -{ - static struct etimer etimer; - - PROCESS_BEGIN(); - - rs232_print (RS232_PORT_1, "test_process 1 starting\n"); - - while(1) { - etimer_set(&etimer, CLOCK_SECOND); - PROCESS_WAIT_UNTIL(etimer_expired(&etimer)); - rs232_print (RS232_PORT_1, "Tick\n"); - etimer_set(&etimer, CLOCK_SECOND); - PROCESS_WAIT_UNTIL(etimer_expired(&etimer)); - rs232_print (RS232_PORT_1, "Tack\n"); - } - - PROCESS_END(); -} - -const struct process *autostart_processes[] = {&test_process1};