From 6dfd358821e32dc9c9df1464667c2ab06931b31d Mon Sep 17 00:00:00 2001 From: Sumankumar Panchal Date: Sun, 12 Jun 2016 20:46:17 +0530 Subject: [PATCH] TSCH port for CC2538 based platforms. --- core/net/mac/tsch/README.md | 5 +++-- examples/ipv6/rpl-tsch/project-conf.h | 6 ++++++ platform/cc2538dk/contiki-conf.h | 2 -- platform/openmote-cc2538/contiki-conf.h | 6 ++++++ platform/zoul/contiki-conf.h | 2 -- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/net/mac/tsch/README.md b/core/net/mac/tsch/README.md index 0b7c54ef3..97b433e4b 100644 --- a/core/net/mac/tsch/README.md +++ b/core/net/mac/tsch/README.md @@ -38,6 +38,7 @@ It has been tested on the following platforms: * Zolertia Z1 (`z1`, tested in cooja only) * CC2538DK (`cc2538dk`, tested on hardware) * Zolertia Zoul (`zoul`, tested on hardware) + * OpenMote-CC2538 (`openmote-cc2538`, tested on hardware) * CC2650 (`srf06-cc26xx`, tested on hardware) This implementation was present at the ETSI Plugtest @@ -79,7 +80,7 @@ Orchestra is implemented in: A simple TSCH+RPL example is included under `examples/ipv6/rpl-tsch`. To use TSCH, first make sure your platform supports it. -Currently, `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul` and `srf06-cc26xx` are the supported platforms. +Currently, `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul`, `openmote-cc2538`, and `srf06-cc26xx` are the supported platforms. To add your own, we refer the reader to the next section. To add TSCH to your application, first include the TSCH module from your makefile with: @@ -165,7 +166,7 @@ Finally, one can also implement his own scheduler, centralized or distributed, b ## Porting TSCH to a new platform Porting TSCH to a new platform requires a few new features in the radio driver, a number of timing-related configuration paramters. -The easiest is probably to start from one of the existing port: `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul`, `srf06-cc26xx`. +The easiest is probably to start from one of the existing port: `jn516x`, `sky`, `z1`, `cc2538dk`, `zoul`, `openmote-cc2538`, `srf06-cc26xx`. ### Radio features required for TSCH diff --git a/examples/ipv6/rpl-tsch/project-conf.h b/examples/ipv6/rpl-tsch/project-conf.h index 8ac0a93b6..36f4a8a72 100644 --- a/examples/ipv6/rpl-tsch/project-conf.h +++ b/examples/ipv6/rpl-tsch/project-conf.h @@ -164,4 +164,10 @@ #endif /* CONTIKI_TARGET_Z1 */ +#if CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL || \ + CONTIKI_TARGET_OPENMOTE_CC2538 +#define TSCH_CONF_HW_FRAME_FILTERING 0 +#endif /* CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL \ + || CONTIKI_TARGET_OPENMOTE_CC2538 */ + #endif /* __PROJECT_CONF_H__ */ diff --git a/platform/cc2538dk/contiki-conf.h b/platform/cc2538dk/contiki-conf.h index c6f0e2b6a..d1a10811f 100644 --- a/platform/cc2538dk/contiki-conf.h +++ b/platform/cc2538dk/contiki-conf.h @@ -40,8 +40,6 @@ typedef uint32_t rtimer_clock_t; #define RTIMER_CLOCK_DIFF(a,b) ((int32_t)((a)-(b))) /** @} */ /*---------------------------------------------------------------------------*/ -#define TSCH_CONF_HW_FRAME_FILTERING 0 - /* 352us from calling transmit() until the SFD byte has been sent */ #define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(352)) /* 192us as in datasheet but ACKs are not always received, so adjusted to 250us */ diff --git a/platform/openmote-cc2538/contiki-conf.h b/platform/openmote-cc2538/contiki-conf.h index 87b58f299..543d3a5e5 100644 --- a/platform/openmote-cc2538/contiki-conf.h +++ b/platform/openmote-cc2538/contiki-conf.h @@ -79,6 +79,12 @@ typedef uint32_t rtimer_clock_t; #define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b))) /** @} */ /*---------------------------------------------------------------------------*/ +/* 352us from calling transmit() until the SFD byte has been sent */ +#define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(352)) +/* 192us as in datasheet but ACKs are not always received, so adjusted to 250us */ +#define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(250)) +#define RADIO_DELAY_BEFORE_DETECT 0 +/*---------------------------------------------------------------------------*/ /** * \name Serial Boot Loader Backdoor configuration * diff --git a/platform/zoul/contiki-conf.h b/platform/zoul/contiki-conf.h index 59463f691..6bdae897a 100644 --- a/platform/zoul/contiki-conf.h +++ b/platform/zoul/contiki-conf.h @@ -77,8 +77,6 @@ typedef uint32_t rtimer_clock_t; #define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b))) /** @} */ /*---------------------------------------------------------------------------*/ -#define TSCH_CONF_HW_FRAME_FILTERING 0 - /* 352us from calling transmit() until the SFD byte has been sent */ #define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(352)) /* 192us as in datasheet but ACKs are not always received, so adjusted to 250us */