Skip to content

Commit 3225c1b

Browse files
agattidpgeorge
authored andcommitted
qemu: Disable native emitter for the MICROBIT board.
The Micro:Bit machine definition in Qemu has soft MMU support enabled, which is currently not compatible with the way MicroPython generates code that needs to call back into non-emitted code. As a stop-gap solution, the native code emitter for the MICROBIT board is turned off. Signed-off-by: Alessandro Gatti <[email protected]>
1 parent 1232a83 commit 3225c1b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ports/qemu/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ MICROPY_ROM_TEXT_COMPRESSION ?= 1
2020

2121
ifeq ($(QEMU_ARCH),arm)
2222
MICROPY_HEAP_SIZE ?= 122880
23+
ifeq ($(BOARD),MICROBIT)
24+
FROZEN_MANIFEST ?= "require('unittest'); freeze('test-frzmpy', ('frozen_const.py'))"
25+
else
2326
FROZEN_MANIFEST ?= "require('unittest'); freeze('test-frzmpy', ('frozen_asm_thumb.py', 'frozen_const.py', 'frozen_viper.py', 'native_frozen_align.py'))"
2427
endif
28+
endif
2529
ifeq ($(QEMU_ARCH),riscv32)
2630
MICROPY_HEAP_SIZE ?= 122880
2731
FROZEN_MANIFEST ?= "require('unittest'); freeze('test-frzmpy', ('frozen_asm_rv32.py', 'frozen_const.py', 'frozen_viper.py', 'native_frozen_align.py'))"

ports/qemu/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
#define MICROPY_EMIT_ARM (1)
3535
#define MICROPY_EMIT_INLINE_THUMB (1)
3636
#elif defined(__ARM_ARCH_ISA_THUMB)
37+
#if !defined(QEMU_SOC_NRF51)
3738
#define MICROPY_EMIT_THUMB (1)
3839
#define MICROPY_EMIT_INLINE_THUMB (1)
40+
#endif
3941
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))
4042
#elif defined(__riscv)
4143
#define MICROPY_EMIT_RV32 (1)

0 commit comments

Comments
 (0)