Nordic nRF52840: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
I have 2 of the Nordic tiny dev boards in the USB form factor,
This MCU does Zigbee, I got them for that and of course have done nothing with so far.
[https://infocenter.nordicsemi.com/index.jsp?topic=/ug_nrf52840_dongle/UG/nrf52840_Dongle/getting_started.html NRF52840-DONGLE] from Digikey, about $10 each.


Nordic [https://infocenter.nordicsemi.com/index.jsp?topic=/ug_nrf52840_dongle/UG/nrf52840_Dongle/getting_started.html Getting started]guide
== Inventory ==


They can do Zigbee, which is why I got them and of course have done nothing with so far.
* nRF52840-DK developer board ($49)
* 2 Nordic tiny dev boards in the USB form factor, [https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle NRF52840-DONGLE] from Digikey, about $10 each.
* Seed Studio Xiao nrf52840 Sense


== Loading Circuit Python ==
== Loading Circuit Python ==
Line 10: Line 11:
The nrf52840 supports USB making it easy to program.  
The nrf52840 supports USB making it easy to program.  


I can put CircuitPython on it.
I can put CircuitPython on it. Install the dev tools: [https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Connect-for-desktop nRF Connect for desktop] Use that to install the [https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nc_programmer%2FUG%2Fnrf_connect_programmer%2Fncp_introduction.html programmer].
Install the dev tools: [https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Connect-for-desktop nRF Connect for desktop]
 
Use that to install the [https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nc_programmer%2FUG%2Fnrf_connect_programmer%2Fncp_introduction.html programmer].
I think it's now possible to use an Adafruit fork of the Nordic utility to get the Circuit Python bootloader installed.
 
The other option is to use either a very expensive Segger J-Link (+$800) or the $49 Nordic nRF52840-DK development board. I got one of the $49 boards, here we go. Alas it has a weird tiny connector so, another cable? Oy.
 
=== Install bootloader ===
 
https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md
 
conda create -n adafruit-nrf
conda activate adafruit-nrf
pip3 install adafruit-nrfutil
 
Download a bootloader from https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases
I used https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.6.4/mdk_nrf52840_dongle_bootloader-0.6.4_s140_6.1.1.zip
 
adafruit-nrfutil dfu serial -p com3 -pkg *hex


After getting the board to connect as a mass storage device then I can put
After getting the board to connect as a mass storage device then I can put
Line 27: Line 43:
Other ways I could do this: I could use a Adafruit RP2040 Feather for $10. I already got it going on an Adafruit Circuit Playground Express $25.  
Other ways I could do this: I could use a Adafruit RP2040 Feather for $10. I already got it going on an Adafruit Circuit Playground Express $25.  


It's about what's in my <s>junk drawer</s> inventory, not what it costs. The nRF is a handy form factor. A Pi Zero for $5 would work but I don't own one and it would require booting Linux so it would be too slow. I did try out the HID keyboard thing on a Pi Zero W. Too complicated. A $4 Pico would work but does it have a button?
It's about what's in my <s>junk drawer</s> inventory, not what it costs. The nRF is a handy form factor. A Pi Zero for $5 would work but I don't own one and it would require booting Linux so it would be too slow. I did try out the HID keyboard thing on a Pi Zero W. Too complicated. A $4 Pico would work but does it have a button? (No.)
 
== nRF52840 DK ==
https://nordicsemi.com/start52840dk
 
I followed along with a series of 5 videos published by Nordic to set up VS Code and the nRF tools. Here is part 1. https://youtu.be/EAJdOqsL9m8?si=xd3K52TBkHN84LRs
 
===== JTAG =====
The DK board has a Segger J-Link JTAG built in. The drivers install as part of the toolkit that's now installed on [[Pearl]]. They have a wiki for it here: [https://wiki.segger.com/ Segger wiki]
 
You need Openocd in order to use this, there is a binary version for Windows or you can build from source for Linux.
 
== Resources ==
 
https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK/GetStarted#infotabs
 
RIOT operating system https://doc.riot-os.org/group__boards__nrf52840-mdk-dongle.html
 
Nordic documentation https://docs.nordicsemi.com/
 
Nordic [https://infocenter.nordicsemi.com/index.jsp?topic=/ug_nrf52840_dongle/UG/nrf52840_Dongle/getting_started.html Getting started]guide for the dongle

Latest revision as of 05:33, 27 November 2024

This MCU does Zigbee, I got them for that and of course have done nothing with so far.

Inventory

  • nRF52840-DK developer board ($49)
  • 2 Nordic tiny dev boards in the USB form factor, NRF52840-DONGLE from Digikey, about $10 each.
  • Seed Studio Xiao nrf52840 Sense

Loading Circuit Python

The nrf52840 supports USB making it easy to program.

I can put CircuitPython on it. Install the dev tools: nRF Connect for desktop Use that to install the programmer.

I think it's now possible to use an Adafruit fork of the Nordic utility to get the Circuit Python bootloader installed.

The other option is to use either a very expensive Segger J-Link (+$800) or the $49 Nordic nRF52840-DK development board. I got one of the $49 boards, here we go. Alas it has a weird tiny connector so, another cable? Oy.

Install bootloader

https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md

conda create -n adafruit-nrf
conda activate adafruit-nrf
pip3 install adafruit-nrfutil

Download a bootloader from https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases I used https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.6.4/mdk_nrf52840_dongle_bootloader-0.6.4_s140_6.1.1.zip

adafruit-nrfutil dfu serial -p com3 -pkg *hex

After getting the board to connect as a mass storage device then I can put Circuit Python onto it. I think for this board, I will need to install their bootloader too.

My first project: HID Keyboard

When I got CircuitPython running I put the "Hello world" app on there and changed it to playback my long and complex password. That's it for this project!

It powers on and becomes an HID keyboard in about 2 seconds and then on each button press it plays my password. Ta-da!

Other ways I could do this: I could use a Adafruit RP2040 Feather for $10. I already got it going on an Adafruit Circuit Playground Express $25.

It's about what's in my junk drawer inventory, not what it costs. The nRF is a handy form factor. A Pi Zero for $5 would work but I don't own one and it would require booting Linux so it would be too slow. I did try out the HID keyboard thing on a Pi Zero W. Too complicated. A $4 Pico would work but does it have a button? (No.)

nRF52840 DK

https://nordicsemi.com/start52840dk

I followed along with a series of 5 videos published by Nordic to set up VS Code and the nRF tools. Here is part 1. https://youtu.be/EAJdOqsL9m8?si=xd3K52TBkHN84LRs

JTAG

The DK board has a Segger J-Link JTAG built in. The drivers install as part of the toolkit that's now installed on Pearl. They have a wiki for it here: Segger wiki

You need Openocd in order to use this, there is a binary version for Windows or you can build from source for Linux.

Resources

https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK/GetStarted#infotabs

RIOT operating system https://doc.riot-os.org/group__boards__nrf52840-mdk-dongle.html

Nordic documentation https://docs.nordicsemi.com/

Nordic Getting startedguide for the dongle