QUERY · ISSUE
Bug: Build Error on NRF Board, Undeclared Variable 'MP_QSTR___del___'
bug
I encountered an error while building Micropython on the Nordic pca10056 nrf board. Below is the error message:
..\micropython\ports\nrf>make BOARD=pca10056
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build-pca10056/genhdr/mpversion.h
CC ../../py/gc.c
../../py/gc.c: In function 'gc_sweep':
../../py/gc.c:393:72: error: 'MP_QSTR___del__' undeclared (first use in this function); did you mean 'MP_QSTR___new__'?
393 | mp_load_method_maybe(MP_OBJ_FROM_PTR(obj), MP_QSTR___del__, dest);
| ^~~~~~~~~~~~~~~
| MP_QSTR___new__
../../py/gc.c:393:72: note: each undeclared identifier is reported only once for each function it appears in
See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
make: *** [../../py/mkrules.mk:83: build-pca10056/py/gc.o] Error 1
I'm using the following environment:
- micropython commit: b525f1c
- OS: Windows 10
- Python: Python 3.10.11
- Toolchain: GNU Arm Embedded Toolchain 10-2020-q4-major
- Board: pca10056 (nRF52840-DK)
Please let me know if you need any further information to resolve this issue. Thank you for your help!
CANDIDATE · PULL REQUEST
nrf/main: Fix build of microbit when SD is used.
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.