Nordic nRF24 Users Advised to "Get Ready to Upgrade," as New RF24 Core Release Fixes a Big Bug
Stability problems with a particular function have now been addressed in RF24 v1.5.0.
Pseudonymous developer "TMRh20" has announced an important new release for the RF24 driver and related projects, designed for those looking to program Nordic Semiconductor's popular nRF24 family of wireless systems-on-chips (SoCs) and transceivers β fixing a bug with a big impact on stability.
"We've identified and fixed a major bug affecting the RF24 Core Library that affects anyone using the Dynamic Payload functionality," TMRh20 explains of the update. "This means it affects RF24, RF24Network, RF24Mesh, RF24Ethernet, & RF24Gateway libraries. Get ready to upgrade, this will fix some very frustrating issues."
The RF24 library is an optimized fork of Nordic Semiconductor's official nRF24 driver, and the heart of a range of related libraries. A problem in that library, then, affects a number of other projects β including libraries used to program the semiconductors from the Arduino IDE, PlatformIO, and Python.
"The issue comes into play when the getDynamicPayloadSize() function is called," TMRh20 explains of the bug. "Previously, this function would check for out of bounds payload sizes (>32 bytes) and flush the RX buffers per the datasheet instructions. We found out the hard way that the register involved can also return 0, and requires a flush of the RX buffers to regain functionality.
"The issue occurs seemingly randomly, on a perfectly working device, it can take months, weeks, days or hours. I don't exactly know why this happens, but it seems related to 0 length payloads, possibly auto-ack[nowledge] payloads getting mixed in with real payloads. The issue can be detected when the getDynamicPayloadSize() function returns 0."
The fix is already available in the project's GitHub repository, as part of the recently-tagged v1.5.0 release. "We are still working diligently on a new release for Arduino, Platform IO, and Python users," TMRh20 says, "which should be available in the next 24 hours." Additional information is available in TMRh20's Reddit post.