diff --git a/cpu/cc2538/radio/cc2538_rf_radio_ops.c b/cpu/cc2538/radio/cc2538_rf_radio_ops.c index 9640f68bcd..31e80be022 100644 --- a/cpu/cc2538/radio/cc2538_rf_radio_ops.c +++ b/cpu/cc2538/radio/cc2538_rf_radio_ops.c @@ -412,9 +412,9 @@ void cc2538_irq_handler(void) if (flags_f0 & RXPKTDONE) { handled_f0 |= RXPKTDONE; - /* CRC check */ - uint8_t pkt_len = rfcore_peek_rx_fifo(0); - if (rfcore_peek_rx_fifo(pkt_len) & CC2538_CRC_BIT_MASK) { + /* CRC_OK bit is in the last byte in the RX FIFO */ + uint8_t crc_loc = RFCORE_XREG_RXFIFOCNT - 1; + if (rfcore_peek_rx_fifo(crc_loc) & CC2538_CRC_BIT_MASK) { /* Disable RX while the frame has not been processed */ _disable_rx(); /* If AUTOACK is disabled or the ACK request bit is not set */