Hopefully, this will fix that issue and allow support for buffered stdio.
Normally, buffered stdio is optioned in the ./port/nrf/mpconfigport.h file as shown below.
Code: Select all
#define MICROPY_PY_SYS_STDFILES (1)
#define MICROPY_PY_SYS_STDIO_BUFFER (1)
The problem is that the GEN genhdr pre-processing for nRF does not include all the necessary directories when scanning for QSTR definitions.
The fix bellow is modeled after other ports' Makefiles (stm32 for example) are constructed.
This has been successfully tested on a PCA10040 board.
Code: Select all
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 80110f9..2ff01b7 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -158,6 +158,7 @@ SRC_LIB += $(addprefix lib/,\
utils/pyexec.c \
utils/interrupt_char.c \
timeutils/timeutils.c \
+ utils/sys_stdio_mphal.c \
)
ifeq ($(MICROPY_FATFS), 1)
@@ -304,7 +305,7 @@ $(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
$(Q)$(SIZE) $@
# List of sources for qstr extraction
-SRC_QSTR += $(SRC_C) $(DRIVERS_SRC_C) $(SRC_BOARD_MODULES)
+SRC_QSTR += $(SRC_C) $(DRIVERS_SRC_C) $(SRC_LIB) $(SRC_BOARD_MODULES)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR