← index #6344PR #3137
Related · high · value 0.600
QUERY · ISSUE

nRF microbit (nRF51822) issues

openby rcolisteteopened 2020-08-17updated 2020-12-03

I've built the ports/nrf for microbit with default configuration :

[nrf]$ make BOARD=microbit clean
[nrf]$ make -j8 BOARD=microbit

and using $ screen /dev/ttyACM0 115200 to access REPL, but have some issues :

  • file system microbitfs is not accessible via ufs or Mu Editor. How to externally acess the internal file system ? With official MicroPython for BBC micro:bit ufs and Mu Editor can access the files;
  • Ctrl+d in REPL freezes, as well as machine.soft_reset();
  • deepsleep() and lightsleep() don't work. It seems that __WFIand __WFE are not working on microbit/nRF51822;
  • unstable I2C scan reading.

And building with Bluetooth :

[nrf]$ make BOARD=microbit clean
[nrf]$ make -j8 BOARD=microbit SD=s110

then REPL is not accessible at all via $ screen /dev/ttyACM0 115200.

Not issues, but features lacking with respect to official MicroPython for BBC Micro:bit :

About the buttons A and B, it is simple to read via machine.Pin :

from machine import Pin
button_a = Pin(Pin.cpu.P17, Pin.IN, Pin.PULL_UP)
button_b = Pin(Pin.cpu.P26, Pin.IN, Pin.PULL_UP)
button_a.value()   # button A not pressed
    1
button_a.value()   # button A pressed
    0
CANDIDATE · PULL REQUEST

Nordic port for nrf51822, nrf52832 and nrf52840

closedby tralamazzaopened 2017-06-09updated 2018-07-19

This is an initial port for the nRF series including nrf51822, nrf52832 and nrf52840 support.

Modules currently supported:

  • UART
  • LED
  • Pin
  • ADC
  • PWM (nrf52)
  • SPI
  • I2C

Additional micropython modules:

  • music - backport of micro:bit music module for both nrf51 and nrf52 (+ ticker and softpwm drivers)
  • Temperature
  • RTC (Real time counter - low-power counter)
  • ubluepy - Bluetooth LE module using existing python library, bluepy, as API template. (Extended to also act as a peripheral role)

Additional features:

  • Bluetooth LE REPL

Current target boards supported by nrf51822:

  • BBC micro:bit
  • pca10000 (dongle)
  • pca10001 (dev-kit)
  • pca10028 (dev-kit)
  • pca10032 (dongle)

Current target boards supported by nrf52832:

  • Bluefruit nRF52 Feather
  • BL652 & DVK from Laird
  • pca10040

Current target board supported by nrf52840: pca10056

The port introduces a new HAL written from scratch to make it license compatible with micropython for redistribution. Header files for individual chips (Nordic Semi MDK) are distributed, as it uses a compatible BSD license. Hence, no dependency on any other 3rd party for HAL or libraries.
All targets, except for the nrf52840, have Bluetooth LE support using Nordic Semiconductor Bluetooth Stacks (Softdevice) downloaded directly from Nordic's website using the provided script.

Some modules are not be 100% aligned with current micropython machine API. However, the port is functional and gives a good base to start writing micropython code on the nrf5x devices with or without Bluetooth LE.

Subsequent patches are expected to get the port up to date to the new machine module APIs, adding new HAL drivers and modules, adding new target boards and optimizing flash/ram footprint (specially on the nrf51 targets).

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied