← index #6344PR #14142
Related · high · value 0.602
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

nrf/main: Fix build of microbit when SD is used.

mergedby andrewleechopened 2024-03-20updated 2024-03-26
port-nrf

Building microbit with SD enabled currently fails:

 make -C ports/nrf BOARD=MICROBIT SD=s110

main.c: In function '_start':
main.c:265:5: error: 'ret' undeclared (first use in this function)
  265 |     ret = pyexec_file_if_exists("boot.py");
      |     ^~~

ret is only defined #if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE which is disabled by:

#if defined(NRF51822)
#if defined(BLUETOOTH_SD)
// If SoftDevice is used there is less flash/ram available for application
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_MINIMUM)

This PR switches the call to capture return value in a more closely defined variable that's always available and appropriate for this use.

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