-
Can someone please give me advice/instructions on how to load Micropython onto the Adafruit Feather nRF52840? There are no instructions at https://micropython.org/download/FEATHER52/. I've used urf2conv.py / uf2families.json and the nrf/FEATERH52 micropython v1.23.0 hex to make a uf2-compatible file, firmware.uf2.zip. But when I dragged it onto the UF2 bootloader folder, it failed. The board serial port disappeared, and when I rebooted it, I saw that this method erased the SoftDevice. The UF2 Bootloader version is 0.9.0. I needed to re-load the SoftDevice (S140 6.1.1) using the Arduino IDE onto the board to flash Circuitpython onto it. But I'd like to load it with Micropython instead. I'd appreciate instructions/advice. I'm using a Mac OS 12.6. Thank you, Jay |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 6 replies
-
Yes the nrf port hasn't had as much development as some others so gaps in docs like this are common. Many of the default builds for nrf generally don't include SD support at all so flash straight over it looks you saw. It can be recompiled for SD at which point the SD can be flashed automatically too: It would certainly be helpful if the uf2 conversion could be done automatically for boards like this that need it by default, that would be a worthwhile addition to the Makefile. |
Beta Was this translation helpful? Give feedback.
-
I had the same/similar problem. See this discussion. |
Beta Was this translation helpful? Give feedback.
-
If the board uses the Adafruit UF2 Bootloader with SoftDevice (S140 6.1.1) and you convert the firmware.hex with urf2conv.py If uf2conv.py does not report 0x26000 linking is not correct. I had a similar problem with a Supermini nrf52840 an solved it by adding |
Beta Was this translation helpful? Give feedback.
-
Thank you for all the suggestions! It is taking me a while to digest them, as I do not have experience in making micropython binary. I have worked primarily with micropython on the ESP32 and relied on the kind micropython builds made by others and their easy loading using esptool. These are my first tentative steps in building micropython using the Mac... Thank you, jkorte-dev! I tried your suggestion - the Adafruit Feather nRF2 express board has a UF2 Bootloader 0.9.0 with SoftDevice S140 6.1.1 - using the indicated uf2conv.py instruction with the FEATHER52-20240602-v1.23.0.hex build. But Terminal reported the resulting uf2 start address at 0x0 and not 0x26000. So the linking is probably not correct as you indicated. By any chance, can I have a zip copy of your firmware.uf2 file just to test whether it can load onto the device? If it does, then I'll do a deep dive into how to build microsoft with the instructions you all mentioned. |
Beta Was this translation helpful? Give feedback.
-
The micropython firmware you tried is for the nRF528320 version of the Feather (Adafruit Feather nRF52). I have overseen that. Here you can find a build for a nrRF52840 board using UF2 Bootloader 0.9.0 with SoftDevice S140: |
Beta Was this translation helpful? Give feedback.
-
Thank you! You are right, its a nRF52840 version of the feather - https://www.adafruit.com/product/4062 . |
Beta Was this translation helpful? Give feedback.
-
I am happy to hear that you had success loading the firmware. The Neopixel Pin on your board is P0.16 which resolves to CPU Pin 16. |
Beta Was this translation helpful? Give feedback.
-
Thank you, jkorte. I can toggle the blue led but I am unable to fire the neopixel or toggle the red led on the Adafruit nRF52840 express. Below is my script and I've attached the pin mappings for the board. Do you have suggestions? Should I more this to a new discussion? J # Test NeoPixel illumination on Adafruit nRF52840 Express Feather
# running v1.24.0-preview.51.g91717a4f9.dirty
from machine import Pin
from neopixel import NeoPixel
import time
# ESP8226-style
# docs.micropython.org/en/latest/esp8266/tutorial/neopixel.html
pixel = NeoPixel(Pin(16, Pin.OUT), 1)
pixel[0] = (255, 0, 0)
pixel.write()
# latest style
# docs.micropython.org/en/latest/library/neopixel.html#output-methods
# bbp is 3 for RGB LEDs
# timing is 1 for 800kHz LEDs
pixel1 = NeoPixel(Pin(16, Pin.OUT), bpp=3, timing=1)
pixel1[0] = (255, 0, 0)
pixel1.write()
# Result: No illumination
# timing is 1 for 400kHz LEDs
pixel2 = NeoPixel(Pin(16, Pin.OUT), 3, 0)
pixel2[0] = (255, 0, 0)
pixel2.write()
# Result: No illumination
# Test Blue LED illumination
# Pin 42 / P1.10
blue_led = Pin(42, Pin.OUT)
blue_led.value(1)
time.sleep(4)
blue_led.value(0)
# Result: blue led illuminates
# Test Red LED illumination
# Pin 47 / P1.15
red_led = Pin(47, Pin.OUT)
red_led.value(1)
time.sleep(4)
red_led.value(0)
# Result: ValueError: not a valid pin identifier |
Beta Was this translation helpful? Give feedback.
Thank you, jkorte-dev - I was able to load your uf2 build onto the nRF52! I was successful after reloading the bootloader using the Arduino IDE. I can now get to REPL via Terminal and Thonny. I appreciate you letting me borrow your code to test this. This is great - now I will learn how to build the hex on the Mac, incorporating your tips, generating the uf2 using your instructions, and see if I can do it myself.