diff --git a/qemu-arm/Makefile b/qemu-arm/Makefile index 31ba6baa26..6a25eb9311 100644 --- a/qemu-arm/Makefile +++ b/qemu-arm/Makefile @@ -40,19 +40,28 @@ SRC_C = \ SRC_TEST_C = \ test_main.c \ +STM_SRC_C = $(addprefix stmhal/,\ + pybstdio.c \ + ) + SRC_S = \ OBJ = OBJ += $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) +OBJ += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o)) OBJ_TEST = OBJ_TEST += $(PY_O) OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_TEST_C:.c=.o)) OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) +OBJ_TEST += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o)) OBJ_TEST += $(BUILD)/tinytest.o +# List of sources for qstr extraction +SRC_QSTR += $(SRC_C) $(SRC_TEST_C) $(STM_SRC_C) + all: run run: $(BUILD)/firmware.elf diff --git a/qemu-arm/memory.h b/qemu-arm/memory.h new file mode 100644 index 0000000000..f3777b0e39 --- /dev/null +++ b/qemu-arm/memory.h @@ -0,0 +1,2 @@ +// this is needed for extmod/crypto-algorithms/sha256.c +#include diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h index 1f23148c2a..b8806405bc 100644 --- a/qemu-arm/mpconfigport.h +++ b/qemu-arm/mpconfigport.h @@ -20,9 +20,18 @@ #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_BUILTINS_FROZENSET (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) -#define MICROPY_PY_IO (0) +#define MICROPY_PY_IO (1) #define MICROPY_PY_SYS_EXIT (1) #define MICROPY_PY_SYS_MAXSIZE (1) +#define MICROPY_PY_UERRNO (1) +#define MICROPY_PY_UBINASCII (1) +#define MICROPY_PY_URANDOM (1) +#define MICROPY_PY_UCTYPES (1) +#define MICROPY_PY_UZLIB (1) +#define MICROPY_PY_UJSON (1) +#define MICROPY_PY_URE (1) +#define MICROPY_PY_UHEAPQ (1) +#define MICROPY_PY_UHASHLIB (1) #define MICROPY_USE_INTERNAL_PRINTF (0) // type definitions for the specific machine diff --git a/qemu-arm/mphalport.h b/qemu-arm/mphalport.h index 4bd8276f34..d996402ae4 100644 --- a/qemu-arm/mphalport.h +++ b/qemu-arm/mphalport.h @@ -1 +1,2 @@ -// empty file +#define mp_hal_stdin_rx_chr() (0) +#define mp_hal_stdout_tx_strn_cooked(s, l) write(1, (s), (l)) diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py index 091c1b065f..bab937135f 100755 --- a/tools/tinytest-codegen.py +++ b/tools/tinytest-codegen.py @@ -46,8 +46,15 @@ testgroup_member = ( ## XXX: may be we could have `--without ` argument... # currently these tests are selected because they pass on qemu-arm -test_dirs = ('basics', 'micropython', 'inlineasm') # 'float', 'import', 'io', 'misc') -exclude_tests = ('inlineasm/asmfpaddsub.py', 'inlineasm/asmfpcmp.py', 'inlineasm/asmfpldrstr.py', 'inlineasm/asmfpmuldiv.py', 'inlineasm/asmfpsqrt.py',) +test_dirs = ('basics', 'micropython', 'extmod', 'inlineasm') # 'float', 'import', 'io', 'misc') +exclude_tests = ( + 'inlineasm/asmfpaddsub.py', 'inlineasm/asmfpcmp.py', 'inlineasm/asmfpldrstr.py', 'inlineasm/asmfpmuldiv.py', 'inlineasm/asmfpsqrt.py', + 'extmod/time_ms_us.py', + 'extmod/ujson_dumps_float.py', 'extmod/ujson_loads_float.py', + 'extmod/uctypes_native_float.py', 'extmod/uctypes_le_float.py', + 'extmod/machine_pinbase.py', 'extmod/machine_pulse.py', + 'extmod/vfs_fat_ramdisk.py', +) output = []