NRF24L01 Troubleshooting Guide for M5 Core2 Users
Thanks for bringing this up! The “NRF24 not detected” message usually points to a wiring, power, or SPI initialization issue. While detailed documentation for NRF24L01 specifically paired with M5 Core2 is limited, here’s a comprehensive set of checks to help you isolate the problem.
- Verify SPI Wiring
The NRF24L01 relies on proper SPI mapping. Make sure the following pins align with the Core2’s hardware SPI bus:
MOSI → GPIO 23
MISO → GPIO 38
SCK → GPIO 18
CSN (CS) → GPIO 5 or GPIO 26
CE → Any free GPIO (commonly GPIO 4 or 5 depending on your setup)
VCC → 3.3V (never 5V)
GND → Ground
⚠ Tip: Loose CSN or CE wiring is one of the most common causes of NRF24 initialization failure.
- Power Stability Check
The NRF24L01 is notoriously sensitive to voltage noise.
Ensure a clean 3.3V feed (not exceeding 3.6V).
Add a 0.1µF ceramic capacitor close to the module’s VCC/GND pins.
Prefer a separate 3.3V regulator if you are using the PA+LNA high-powered version.
The module may draw up to ~100mA during TX, so confirm your supply can deliver this reliably.
- Library & Firmware Setup
Make sure the correct software environment is in place:
Install TMRh20’s RF24 library via Arduino IDE → Library Manager.
Update your M5Core2 library from GitHub.
Use a fresh example sketch from the RF24 library to confirm base connectivity.
- Example Initialization Code
Adjust pins depending on your wiring:
#include <SPI.h>
#include <RF24.h>
RF24 radio(4, 5); // CE pin, CSN pin
void setup() {
Serial.begin(115200);
if (!radio.begin()) {
Serial.println("NRF24 module NOT detected!");
return;
}
Serial.println("NRF24 module initialized.");
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(0, 0xAABBCCDDEEULL);
radio.startListening();
}
void loop() {}
If this fails, the wiring or hardware is almost certainly the issue.
- Hardware Integrity Checks
Before assuming software issues, confirm physical reliability:
Inspect solder joints and header pins.
Use a multimeter to confirm continuity on MOSI/MISO/SCK/CSN/CE lines.
Try a second NRF24 module if available, these modules can fail easily.
Swap CSN/CE to alternate GPIOs if conflicts exist.