This is, admittedly, a little tricky and a lot annoying to perform before every program, but it's the
trade-off we get for not programming via expensive JTAG programmers. Once you've entered the
bootloader, you can upload code to the chip via Arduino's "Upload" button.
Upload Blink
Try loading up a basic blink example – setting the blinking pin to the on-board LED on pin 7 – and
uploading. Here's some code to copy paste:
Copy Code
const int ledPin = 7; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(led
Pin, HIGH); delay(500); digitalWrite(ledPin, LOW); delay(500); }
const int ledPin = 7; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin,
HIGH); delay(500); digitalWrite(ledPin, LOW); delay(500); }
LED Polarity – The blue LED, attached to pin 7, is active-low. Writing the pin LOW will turn the
LED on, and writing it HIGH will turn it off.
Troubleshooting
If you get an upload error like this:
Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Possible causes:
- bootloader, SoftDevice or application on target does not match the requirements in the DFU
package.
- baud rate or flow control is not the same as in the target bootloader.
- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release
both to enter DFU mode.
Make sure your nRF52832 Breakout's LED is blinking in a ticking-timebomb pattern – ensuring that
it's in bootloader mode. If the chip is in the bootloader and still not accepting code, try cycling
power to the breakout by disconnecting and reconnecting the FTDI Basic.
BLEPeriphial Arduino Library
The nRF5 board definitions will allow you to program the nRF52832 and toggle its GPIO, but it
doesn't include any Bluetooth support. For that, we recommend grabbing the
BLEPeripheral Arduino
library.
The BLEPeripheral library can be installed from Arduino's Library Manager. Simply go to Sketch >
Include Library > Manage Libraries.... In the search box, type "BLEPeripheral", select it, and click
"Install."
Need help?
Do you have a question about the nRF52832 and is the answer not in the manual?
Questions and answers