Thursday, December 6, 2012

Remove cc2420 software CRC check

1*. Modify CC2420TinyosNetworkP.nc in /opt/tinyos/tos/chips/CC2420/lowpan

line 160 -163:

//if(!(call CC2420PacketBody.getMetadata(msg))->crc) {
// return msg;
//}

2. Modify CC2420ReceiveP.nc in /opt/tinyos/tos/chips/CC2420/receive

line 644 -652:

// We may have received an ack that should be processed by Transmit
// buf[rxFrameLength] >> 7 checks the CRC
if (rx_buf ) {
uint8_t type = ( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7;
signal CC2420Receive.receive( type, m_p_rx_buf );
post receiveDone_task();
return;
}

3. 2. Modify CC2420ReceiveP.nc in /opt/tinyos/tos/chips/CC2420/receive

line 381:

if( (header.fcf & (1 << IEEE154_FCF_SECURITY_ENABLED)) && (crc << 7) ){

to

if( header.fcf & (1 << IEEE154_FCF_SECURITY_ENABLED) ){