TSCH: move platform-specific configuration flags to platform configuration files

This commit is contained in:
Simon Duquennoy 2017-09-08 18:17:07 +02:00
parent 5f2b3c2fcb
commit 1a8f04effc
9 changed files with 32 additions and 58 deletions

View File

@ -57,6 +57,10 @@ typedef uint32_t rtimer_clock_t;
*/
#define TSCH_CONF_BASE_DRIFT_PPM -977
#endif
#if MAC_CONF_WITH_TSCH
#define TSCH_CONF_HW_FRAME_FILTERING 0
#endif /* MAC_CONF_WITH_TSCH */
/*---------------------------------------------------------------------------*/
/**
* \name Serial Boot Loader Backdoor configuration

View File

@ -122,8 +122,15 @@ typedef uint64_t rtimer_clock_t;
#define UIP_ARCH_IPCHKSUM 1
#if NETSTACK_CONF_WITH_IPV6
#endif /* NETSTACK_CONF_WITH_IPV6 */
#if MAC_CONF_WITH_TSCH
#define COOJA_CONF_SIMULATE_TURNAROUND 0
/* A bug in cooja causes many EBs to be missed at scan. Increase EB
frequency to shorten the join process */
#undef TSCH_CONF_EB_PERIOD
#define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
#undef TSCH_CONF_MAX_EB_PERIOD
#define TSCH_CONF_MAX_EB_PERIOD (4 * CLOCK_SECOND)
#endif /* MAC_CONF_WITH_TSCH */
/* Turn off example-provided putchars */
#define SLIP_BRIDGE_CONF_NO_PUTCHAR 1

View File

@ -251,8 +251,8 @@ typedef uint32_t clock_time_t;
/* Shall we calibrate the DCO periodically? */
#ifndef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 1
#endif
#define DCOSYNCH_CONF_ENABLED (!(MAC_CONF_WITH_TSCH))
#endif /* DCOSYNCH_CONF_ENABLED */
/* How often shall we attempt to calibrate DCO?
* PS: It should be calibrated upon temperature changes,

View File

@ -96,6 +96,10 @@ typedef uint32_t rtimer_clock_t;
*/
#define TSCH_CONF_BASE_DRIFT_PPM -977
#endif
#if MAC_CONF_WITH_TSCH
#define TSCH_CONF_HW_FRAME_FILTERING 0
#endif /* MAC_CONF_WITH_TSCH */
/*---------------------------------------------------------------------------*/
/**
* \name Serial Boot Loader Backdoor configuration

View File

@ -99,8 +99,14 @@ typedef long off_t;
/* DCO speed resynchronization for more robust UART, etc. */
#ifndef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 1
#define DCOSYNCH_CONF_ENABLED (!(MAC_CONF_WITH_TSCH)) /* TSCH needs timerB
for SFD timestamping */
#endif /* DCOSYNCH_CONF_ENABLED */
#ifndef CC2420_CONF_SFD_TIMESTAMPS
#define CC2420_CONF_SFD_TIMESTAMPS (MAC_CONF_WITH_TSCH) /* TSCH needs SFD timestamping */
#endif /* CC2420_CONF_SFD_TIMESTAMPS */
#ifndef DCOSYNCH_CONF_PERIOD
#define DCOSYNCH_CONF_PERIOD 30
#endif /* DCOSYNCH_CONF_PERIOD */

View File

@ -94,6 +94,10 @@ typedef uint32_t rtimer_clock_t;
*/
#define TSCH_CONF_BASE_DRIFT_PPM -977
#endif
#if MAC_CONF_WITH_TSCH
#define TSCH_CONF_HW_FRAME_FILTERING 0
#endif /* MAC_CONF_WITH_TSCH */
/*---------------------------------------------------------------------------*/
/**
* \name Serial Boot Loader Backdoor configuration

View File

@ -58,15 +58,6 @@
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/* Needed for CC2538 platforms only */
/* For TSCH we have to use the more accurate crystal oscillator
* by default the RC oscillator is activated */
#undef SYS_CTRL_CONF_OSC32K_USE_XTAL
#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1
#undef TSCH_CONF_HW_FRAME_FILTERING
#define TSCH_CONF_HW_FRAME_FILTERING 0
/*******************************************************/
/******************* Configure TSCH ********************/
/*******************************************************/

View File

@ -68,12 +68,6 @@
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/* Needed for CC2538 platforms only */
/* For TSCH we have to use the more accurate crystal oscillator
* by default the RC oscillator is activated */
#undef SYS_CTRL_CONF_OSC32K_USE_XTAL
#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1
#if WITH_SHELL
/* Needed for CC2538 platforms, for serial */
#define USB_SERIAL_CONF_ENABLE 1
@ -86,14 +80,6 @@
#endif /* WITH_SHELL */
/* Needed for cc2420 platforms only */
/* Disable DCO calibration (uses timerB) */
#undef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 0
/* Enable SFD timestamps (uses timerB) */
#undef CC2420_CONF_SFD_TIMESTAMPS
#define CC2420_CONF_SFD_TIMESTAMPS 1
/*******************************************************/
/******************* Configure TSCH ********************/
/*******************************************************/
@ -136,22 +122,6 @@
/************* Other system configuration **************/
/*******************************************************/
#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 */
#if CONTIKI_TARGET_COOJA
#define COOJA_CONF_SIMULATE_TURNAROUND 0
/* A bug in cooja causes many EBs to be missed at scan. Increase EB
frequency to shorten the join process */
#undef TSCH_CONF_EB_PERIOD
#define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
#undef TSCH_CONF_MAX_EB_PERIOD
#define TSCH_CONF_MAX_EB_PERIOD (4 * CLOCK_SECOND)
#endif /* CONTIKI_TARGET_COOJA */
/* Logging */
#define LOG_CONF_LEVEL_RPL LOG_LEVEL_INFO
#define LOG_CONF_LEVEL_TCPIP LOG_LEVEL_WARN

View File

@ -103,18 +103,6 @@ If you are running with RPL, it is recommended to enable the `tsch-rpl` module w
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
```
On CC2420-based platforms, enable SFD timestamps with:
```
/* Disable DCO calibration (uses timerB) */
#undef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 0
/* Enable SFD timestamps (uses timerB) */
#undef CC2420_CONF_SFD_TIMESTAMPS
#define CC2420_CONF_SFD_TIMESTAMPS 1
```
To configure TSCH, see the macros in `.h` files under `os/net/mac/tsch/` and redefine your own in your `project-conf.h`.
## Using TSCH with Security
@ -132,7 +120,7 @@ To include TSCH standard-compliant security, set the following:
#define LLSEC802154_CONF_USES_FRAME_COUNTER 0
```
The keys can be configured in `net/mac/tsch/tsch-security.h`.
The keys can be configured in `os/net/mac/tsch/tsch-security.h`.
Nodes handle security level and keys dynamically, i.e. as specified by the incoming frame header rather that compile-time defined.
By default, when including security, the PAN coordinator will transmit secured EBs.
@ -147,7 +135,7 @@ Likewise, set `TSCH_JOIN_MY_PANID_ONLY` to force joining networks with a specifi
By default (see `TSCH_SCHEDULE_WITH_6TISCH_MINIMAL`), our implementation runs a 6TiSCH minimal schedule, which emulates an always-on link on top of TSCH.
The schedule consists in a single shared slot for all transmissions and receptions, in a slotframe of length `TSCH_SCHEDULE_DEFAULT_LENGTH`.
As an alternative, we provide Orchestra (under `apps/orchestra`), an autonomous scheduling solution for TSCH where nodes maintain their own schedule locally, solely based on their local RPL state.
As an alternative, we provide Orchestra (under `os/services/orchestra`), an autonomous scheduling solution for TSCH where nodes maintain their own schedule locally, solely based on their local RPL state.
Orchestra can be simply enabled and should work out-of-the-box with its default settings as long as RPL is also enabled.
See `apps/orchestra/README.md` for more information.