Thanks for tip.
I have another question on native code execution:
When I enable `MICROPY_DYNAMIC_COMPILER` in py/mpconfig.h
Code: Select all
// Whether the compiler is dynamically configurable (ie at runtime)
// This will disable the ability to execute native/viper code
#ifndef MICROPY_DYNAMIC_COMPILER
#define MICROPY_DYNAMIC_COMPILER (1)
#endif
I get the following linker error:
Code: Select all
LINK build-BLACK_F407VE/firmware.elf
build-BLACK_F407VE/py/compile.o:(.rodata.emit_asm_table+0x24): undefined reference to `emit_inline_xtensa_method_table'
build-BLACK_F407VE/py/compile.o:(.rodata.emit_native_table+0x4): undefined reference to `emit_native_x86_method_table'
build-BLACK_F407VE/py/compile.o:(.rodata.emit_native_table+0x8): undefined reference to `emit_native_x64_method_table'
build-BLACK_F407VE/py/compile.o:(.rodata.emit_native_table+0xc): undefined reference to `emit_native_arm_method_table'
build-BLACK_F407VE/py/compile.o:(.rodata.emit_native_table+0x24): undefined reference to `emit_native_xtensa_method_table'
build-BLACK_F407VE/py/persistentcode.o: In function `load_raw_code':
persistentcode.c:(.text.load_raw_code+0x394): undefined reference to `mp_fun_table'
Makefile:510: recipe for target 'build-BLACK_F407VE/firmware.elf' failed
My py/mpconfig.h:
Code: Select all
// Whether to support loading of persistent code
#ifndef MICROPY_PERSISTENT_CODE_LOAD
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#endif
// Whether to support saving of persistent code
#ifndef MICROPY_PERSISTENT_CODE_SAVE
#define MICROPY_PERSISTENT_CODE_SAVE (0)
#endif
// Whether generated code can persist independently of the VM/runtime instance
// This is enabled automatically when needed by other features
#ifndef MICROPY_PERSISTENT_CODE
#define MICROPY_PERSISTENT_CODE (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE || MICROPY_MODULE_FROZEN_MPY)
#endif
// Whether to emit x64 native code
#ifndef MICROPY_EMIT_X64
#define MICROPY_EMIT_X64 (0)
#endif
// Whether to emit x86 native code
#ifndef MICROPY_EMIT_X86
#define MICROPY_EMIT_X86 (0)
#endif
// Whether to emit thumb native code
#ifndef MICROPY_EMIT_THUMB
#define MICROPY_EMIT_THUMB (1)
#endif
// Whether to enable the thumb inline assembler
#ifndef MICROPY_EMIT_INLINE_THUMB
#define MICROPY_EMIT_INLINE_THUMB (1)
#endif
// Whether to enable ARMv7-M instruction support in the Thumb2 inline assembler
#ifndef MICROPY_EMIT_INLINE_THUMB_ARMV7M
#define MICROPY_EMIT_INLINE_THUMB_ARMV7M (1)
#endif
// Whether to enable float support in the Thumb2 inline assembler
#ifndef MICROPY_EMIT_INLINE_THUMB_FLOAT
#define MICROPY_EMIT_INLINE_THUMB_FLOAT (1)
#endif
// Whether to emit ARM native code
#ifndef MICROPY_EMIT_ARM
#define MICROPY_EMIT_ARM (0)
#endif
// Whether to emit Xtensa native code
#ifndef MICROPY_EMIT_XTENSA
#define MICROPY_EMIT_XTENSA (0)
#endif
// Whether to enable the Xtensa inline assembler
#ifndef MICROPY_EMIT_INLINE_XTENSA
#define MICROPY_EMIT_INLINE_XTENSA (0)
#endif
In ports/stmp32/mpconfigport.h, I have:
Code: Select all
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#ifndef MICROPY_EMIT_THUMB
#define MICROPY_EMIT_THUMB (1)
#endif
#ifndef MICROPY_EMIT_INLINE_THUMB
#define MICROPY_EMIT_INLINE_THUMB (1)
#endif