Hello all
I’m testing Mesh Routing in Tinyos-2.x.
During the test, nodes send a lot of broadcast message. All node receive
and send it then TX underflow takes place
The node which has TX underflow fails to send messages.
Therefore, I included in /opt/tinyos-
2.x/tos/chips/cc2420/CC2420TransmitP.nc as follows
void loadTXFIFO() {
uint8_t status;
cc2420_header_t* header = call CC2420Packet.getHeader( m_msg );
uint8_t tx_power = (call CC2420Packet.getMetadata( m_msg ))->tx_power;
if ( !tx_power ) {
// If our packet's tx_power wasn't configured to anything but 0,
// send it using the default RF power. This assumes the
// packet's metadata is all set to 0's on boot.
tx_power = CC2420_DEF_RFPOWER;
}
call CSN.clr();
if ( m_tx_power != tx_power ) {
call TXCTRL.write( ( 2 << CC2420_TXCTRL_TXMIXBUF_CUR ) |
( 3 << CC2420_TXCTRL_PA_CURRENT ) |
( 1 << CC2420_TXCTRL_RESERVED ) |
( (tx_power & 0x1F) << CC2420_TXCTRL_PA_LEVEL ) );
}
m_tx_power = tx_power;
status = call TXFIFO.write( (uint8_t*)header, header->length - 1 );
if(status & 0x20) { <<----------------------------from
atomic {
call CSN.clr();
call SFLUSHTX.strobe();
call CSN.set();
}
} <---------------------------------------------- to
}
But, sending process isn’t recovered
I know TX underflow can solve through TX flush
If you know the answer, please let me know it
Thanks
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help