From: sdhsdh Date: Thu, 17 Sep 2009 18:20:13 +0000 (+0000) Subject: - tickle watchdog and timeouts for good base performance X-Git-Tag: rc_6_tinyos_2_1_1~253 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=8d83c89e661646d194c9bd03bc7a8204ae2dcf9c - tickle watchdog and timeouts for good base performance --- diff --git a/apps/IPBaseStation/BaseStationP.nc b/apps/IPBaseStation/BaseStationP.nc index dfe80cd4..fc7df4ee 100644 --- a/apps/IPBaseStation/BaseStationP.nc +++ b/apps/IPBaseStation/BaseStationP.nc @@ -303,7 +303,7 @@ implementation bool reflectToken = FALSE; CHECK_NODE_ID msg; dbg("base", "uartreceive len %i of 0x%x\n", len, call SerialAMPacket.destination(msg)); -#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC) +#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)) WDTCTL = WDT_ARST_1000; #endif atomic @@ -397,7 +397,7 @@ implementation uint8_t len) { config_cmd_t *cmd; uint8_t error = CONFIG_ERROR_OK; -#if defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC) +#if defined(BLIP_WATCHDOG) && (defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)) WDTCTL = WDT_ARST_1000; #endif diff --git a/apps/IPBaseStation/Makefile b/apps/IPBaseStation/Makefile index 3bf89893..1d8c459b 100644 --- a/apps/IPBaseStation/Makefile +++ b/apps/IPBaseStation/Makefile @@ -15,6 +15,10 @@ CFLAGS += -DIEEE154FRAMES_ENABLED # when using IEEE154Frames, the maximum payload size is 2 larger, # since the header is two smaller. BLIP_L2_MTU = 104 + +# if you're worried about your interface mote crashing, enable this to +# turn on a hardware watchdog that will reset it if it does. CFLAGS +# += -DBLIP_WATCHDOG # # debugging # diff --git a/support/sdk/c/blip/driver/serial_tun.c b/support/sdk/c/blip/driver/serial_tun.c index 9992aa99..90c97a10 100644 --- a/support/sdk/c/blip/driver/serial_tun.c +++ b/support/sdk/c/blip/driver/serial_tun.c @@ -398,19 +398,22 @@ void send_fragments (struct split_ip_msg *msg, ieee154_saddr_t dest) { // if this is sent too fast, the base station can't keep up. The effect of this is // we send incomplete fragment. 25ms seems to work pretty well. - // usleep(30000); // 6-9-08 : SDH : this is a bad fix that does not address the // problem. // at the very least, the serial ack's seem to be // working, so we should be retrying if the ack is failing // because the hardware cannot keep up. + // 9-17-09 : SDH : it seems we've tracked this down to packets + // arriving too fast to enqueue, especially at higher baud rates + // (115200). reenabled to prevent retries, which are very slow. #ifdef __TARGET_mips__ usleep(50000); +#else + usleep(25000); #endif - log_dump_serial_packet(serial, PKTLEN(radioPacket)); result = write_pan_packet(serial, PKTLEN(radioPacket)); - if (result != 0) + if (result != 0) result = write_pan_packet(serial, PKTLEN(radioPacket)); debug("send_fragments: result: 0x%x len: 0x%x\n", result, frag_len);