Skip to content

Commit 89d7e41

Browse files
valeriosettianangl
authored andcommitted
esb: fix CRC setup configuration
Set the CRC's register properly (16 bits, 8 bits, none) Signed-off-by: Valerio Setti <vsetti@baylibre.com>
1 parent 20e50c3 commit 89d7e41

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

doc/nrf/releases/release-notes-changelog.rst

+5
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ Zigbee
8383

8484
See `Zigbee samples`_ for the list of changes for the Zigbee samples.
8585

86+
ESB
87+
---
88+
89+
* Fixed the ``update_radio_crc()`` function in order to correctly configure the CRC's registers (8 bits, 16 bits, or none).
90+
8691
Applications
8792
============
8893

subsys/esb/esb.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -408,24 +408,23 @@ static bool update_radio_crc(void)
408408
case ESB_CRC_16BIT:
409409
NRF_RADIO->CRCINIT = 0xFFFFUL; /* Initial value */
410410
NRF_RADIO->CRCPOLY = 0x11021UL; /* CRC poly: x^16+x^12^x^5+1 */
411+
NRF_RADIO->CRCCNF = ESB_CRC_16BIT << RADIO_CRCCNF_LEN_Pos;
411412
break;
412413

413414
case ESB_CRC_8BIT:
414415
NRF_RADIO->CRCINIT = 0xFFUL; /* Initial value */
415416
NRF_RADIO->CRCPOLY = 0x107UL; /* CRC poly: x^8+x^2^x^1+1 */
417+
NRF_RADIO->CRCCNF = ESB_CRC_8BIT << RADIO_CRCCNF_LEN_Pos;
416418
break;
417419

418420
case ESB_CRC_OFF:
421+
NRF_RADIO->CRCCNF = ESB_CRC_OFF << RADIO_CRCCNF_LEN_Pos;
419422
break;
420423

421424
default:
422425
return false;
423426
}
424427

425-
NRF_RADIO->CRCINIT = 0xFFFFUL; /* Initial value */
426-
NRF_RADIO->CRCPOLY = 0x11021UL; /* CRC poly: x^16+x^12^x^5+1 */
427-
NRF_RADIO->CRCCNF = ESB_CRC_16BIT << RADIO_CRCCNF_LEN_Pos;
428-
429428
return true;
430429
}
431430

0 commit comments

Comments
 (0)