-
Notifications
You must be signed in to change notification settings - Fork 2.1k
lwIP: not able to receive #5394
Copy link
Copy link
Closed
Labels
Area: driversArea: Device driversArea: Device driversArea: networkArea: NetworkingArea: NetworkingArea: pkgArea: External package portsArea: External package portsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
For some reason a node with tests/lwip flashed isn't able to receive any packets on samr21-xpro (the interrupt for reception on driver level isn't even fired). With bisecting I was able to pin-point it to #5261. With the help of @OlegHahm I was able to see that the pending_tx counter never actually reached 0, but I don't know why.
Here's patch for checking pending_tx's value:
diff --git a/drivers/at86rf2xx/at86rf2xx.c b/drivers/at86rf2xx/at86rf2xx.c
index 1dc0bec..fb19c36 100644
--- a/drivers/at86rf2xx/at86rf2xx.c
+++ b/drivers/at86rf2xx/at86rf2xx.c
@@ -44,6 +44,7 @@ void at86rf2xx_setup(at86rf2xx_t *dev, const at86rf2xx_params_t *params)
memcpy(&dev->params, params, sizeof(at86rf2xx_params_t));
dev->idle_state = AT86RF2XX_STATE_TRX_OFF;
dev->state = AT86RF2XX_STATE_SLEEP;
+ printf("%s():%d Initializing pending_tx with 0\n", __func__, __LINE__);
dev->pending_tx = 0;
/* initialise SPI */
spi_init_master(dev->params.spi, SPI_CONF_FIRST_RISING, params->spi_speed);
@@ -105,9 +106,7 @@ void at86rf2xx_reset(at86rf2xx_t *dev)
at86rf2xx_set_option(dev, AT86RF2XX_OPT_CSMA, true);
at86rf2xx_set_option(dev, AT86RF2XX_OPT_TELL_RX_START, false);
at86rf2xx_set_option(dev, AT86RF2XX_OPT_TELL_RX_END, true);
-#ifdef MODULE_NETSTATS_L2
at86rf2xx_set_option(dev, AT86RF2XX_OPT_TELL_TX_END, true);
-#endif
/* set default protocol */
#ifdef MODULE_GNRC_SIXLOWPAN
dev->netdev.proto = GNRC_NETTYPE_SIXLOWPAN;
@@ -186,6 +185,8 @@ void at86rf2xx_tx_prepare(at86rf2xx_t *dev)
{
uint8_t state;
+ printf("%s():%d Incrementing pending_tx to %u\n", __func__, __LINE__,
+ dev->pending_tx + 1);
dev->pending_tx++;
/* make sure ongoing transmissions are finished */
do {
diff --git a/drivers/at86rf2xx/at86rf2xx_netdev.c b/drivers/at86rf2xx/at86rf2xx_netdev.c
index 582d44c..b7573c3 100644
--- a/drivers/at86rf2xx/at86rf2xx_netdev.c
+++ b/drivers/at86rf2xx/at86rf2xx_netdev.c
@@ -624,7 +624,10 @@ static void _isr(netdev2_t *netdev)
/* check for more pending TX calls and return to idle state if
* there are none */
assert(dev->pending_tx != 0);
+ printf("%s():%d Decrementing pending_tx to %u\n", __func__, __LINE__,
+ dev->pending_tx - 1);
if ((--dev->pending_tx) == 0) {
+ printf("%s():%d => going IDLE\n", __func__, __LINE__);
at86rf2xx_set_state(dev, dev->idle_state);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: driversArea: Device driversArea: Device driversArea: networkArea: NetworkingArea: NetworkingArea: pkgArea: External package portsArea: External package portsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)