summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-26tests: Move native while test from pybnative to micropython.Damien George
And make it so this test can run on any target. LED and time testing has been removed from this test, that can now be tested using: ./run-tests.py --via-mpy --emit native. Signed-off-by: Damien George <damien@micropython.org>
2022-05-26tests/run-tests.py: Add rp2 test target.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-26tests/micropython: Make import_mpy_native test run on all architectures.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-26tests/micropython: Make import_mpy_native_gc run on ARMv6-M and above.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-26py/emitinlinethumb: Make float instruction use dynamically selectable.Damien George
This allows mpy-cross to dynamically select whether ARMv7-M float instructions are supported in @micropython.asm_thumb functions. Signed-off-by: Damien George <damien@micropython.org>
2022-05-26py/emitinlinethumb: Make ARMv7-M instruction use dynamically selectable.Damien George
This follows on from a5324a10747dfba921bb363ed904f05ebb6de010 and allows mpy-cross to dynamically select whether ARMv7-M instructions are supported in @micropython.asm_thumb functions. The config option MICROPY_EMIT_INLINE_THUMB_ARMV7M is no longer needed, it is now controlled by MICROPY_EMIT_THUMB_ARMV7M. Signed-off-by: Damien George <damien@micropython.org>
2022-05-26tools/mpy-tool.py: Remove obsolete unicode flag in .mpy header.Damien George
This was removed in c49d5207e9437755be364639632be31c001955a8 Signed-off-by: Damien George <damien@micropython.org>
2022-05-26teensy/mpconfigport.h: Remove obsolete macros.iabdalkader
2022-05-26extmod/network_ninaw10: Add support for socket events callback.iabdalkader
2022-05-25drivers/ninaw10: Update driver to support firmware 1.5.0.iabdalkader
* Firmware 1.5.0 introduces a new BSD-like sockets ABI, which improves the integration with MicroPython.
2022-05-25rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Enable webrepl.iabdalkader
2022-05-25rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Disable internal errno.iabdalkader
* Internal errno can't be used with Nina module due to an issue with esp-idf config.
2022-05-25rp2/mpconfigport.h: Allow boards to override internal errno config.iabdalkader
2022-05-25rp2/mpconfigport.h: Enable static scheduler nodes.iabdalkader
2022-05-25ports: Use default VFS config for import_stat and builtin_open.Damien George
For ports with MICROPY_VFS and MICROPY_PY_IO enabled their configuration can now be simplified to use the defaults for mp_import_stat and mp_builtin_open. This commit makes no functional change, except for the following minor points: - the built-in "open" is removed from the minimal port (it previously did nothing) - the duplicate built-in "input" is removed from the esp32 port - qemu-arm now delegates to VFS import/open Signed-off-by: Damien George <damien@micropython.org>
2022-05-25py/builtin: Clean up and simplify import_stat and builtin_open config.Damien George
The following changes are made: - If MICROPY_VFS is enabled then mp_vfs_import_stat and mp_vfs_open are automatically used for mp_import_stat and mp_builtin_open respectively. - If MICROPY_PY_IO is enabled then "open" is automatically included in the set of builtins, and points to mp_builtin_open_obj. This helps to clean up and simplify the most common port configuration. Signed-off-by: Damien George <damien@micropython.org>
2022-05-25Revert "stm32/rfcore: Intercept addr-resolution HCI cmd to work arou..."Damien George
This reverts commit 2668337f36deef7fdd97f35e2efc68a5d2102192. The issue with potential breaking of the BLE RX path in the radio is fixed since WS v1.12.0. Signed-off-by: Damien George <damien@micropython.org>
2022-05-25extmod/modusocket: Add sendall function.iabdalkader
2022-05-25extmod/modusocket: Add timeout and callback to socket object.iabdalkader
2022-05-25extmod/modusocket: Fix socket_make_new argument parsing.iabdalkader
2022-05-25extmod/modusocket: Add support for socket events callback.iabdalkader
Add support for the special sockopt 20.
2022-05-25extmod/modusocket: Add socket type print function.iabdalkader
2022-05-25extmod/modusocket: Fix errcode returned from socket read/write.iabdalkader
Drivers should ensure a positive errcode is returned from read/write.
2022-05-25extmod/modusocket: Bind unconnected socket to default NIC in setsockopt.iabdalkader
Bind socket to default NIC if setsockopt is called before the socket is bound, to allow setting SO_REUSEADDR before calling socket_bind(). Fixes issue #8653.
2022-05-25extmod/modusocket: Fix polling of a new socket.iabdalkader
New sockets should return HUP and WR when polled, following modlwip.
2022-05-25renesas-ra/modmachine: Add missing MP_REGISTER_MODULE for umachine.Takeo Takahashi
Fix the issue that umachine is not available. Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2022-05-24py/asmthumb: Provide implementations of clz/ctz for msvc.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-24tests/run-multitests.py: Use LAN for IP address if WLAN doesn't exist.robert-hh
This allows running the test on boards with just a LAN interface. Fixes issue #8681.
2022-05-24tests/multi_net: Fix TCP accept test when using system error numbers.iabdalkader
If a port is not using internal error numbers, which match both lwIP and Linux error numbers, ENTOCONN from standard libraries errno.h equals 128, not 107.
2022-05-24extmod/webrepl: Fix setting password in foreground mode and factor code.iabdalkader
The password was not being set when running in foreground mode. Duplicate code has been removed.
2022-05-24tests/extmod: Change expected errno code from 36 to 30 in VfsLfs2 test.Damien George
Errno 30 is EROFS, which is now the correct value reported by littlefs 2. Signed-off-by: Damien George <damien@micropython.org>
2022-05-24lib/littlefs: Remove assignment of variables to themselves.Damien George
To prevent compiler warnings (eg on clang). Signed-off-by: Damien George <damien@micropython.org>
2022-05-24lib/littlefs: Guard lfs2_file_rawopen with LFS2_NO_MALLOC.Damien George
To prevent warnings about this function being unused when malloc is disabled. Signed-off-by: Damien George <damien@micropython.org>
2022-05-24lib/littlefs: Update littlefs2 to v2.5.0.Damien George
At commit 40dba4a556e0d81dfbe64301a6aa4e18ceca896c Signed-off-by: Damien George <damien@micropython.org>
2022-05-24tests/run-tests.py: Enable `-X realtime` option for macOS tests.David Lechner
This enables the new `-X realtime` runtime option when running tests on macOS. This causes MicroPython to configure all threads to be high priority so that they are allowed to use high precision timers. This makes tests that depend on the passage of time more likely to succeed. CI tests that were disabled because of this are now enabled again. Signed-off-by: David Lechner <david@pybricks.com>
2022-05-24unix: Implement `-X realtime` command-line option on macOS.David Lechner
This adds a new command line option to the unix port `-X realtime` to enable realtime priority on threads. This enables high precision timers for applications that need more accurate timers. Related docs: https://developer.apple.com/library/archive/technotes/tn2169/_index.html Fixes issue #8621. Signed-off-by: David Lechner <david@pybricks.com>
2022-05-24ports: Rename thread_t to mp_thread_t.David Lechner
This adds the `mp_` prefix to the `thread_t` type. The name `thread_t` conflicts with the same in `mach/mach_types.h` on macOS. Signed-off-by: David Lechner <david@lechnology.com>
2022-05-24extmod: Revert accidental usocket->socket rename.Jim Mussared
The registration of the usocket module was accidentally changed to socket in moving to MP_REGISTER_MODULE in bb794f05b7fef75696118ea1eb03a769a9fac40d
2022-05-23py/dynruntime.mk: Add basic support for armv6m architecture.Damien George
The examples/natmod features0 and features1 examples now build and run on ARMv6-M platforms. More complicated examples are not yet supported because the compiler emits references to built-in functions like __aeabi_uidiv. Signed-off-by: Damien George <damien@micropython.org>
2022-05-23mpy-cross: Add armv6m architecture option.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/persistentcode: Select ARMV6M as maximum when __thumb2__ not defined.Damien George
If __thumb2__ is defined by the compiler then .mpy files marked as ARMV6M and above (up to ARMV7EMDP) are supported. If it's not defined then only ARMV6M .mpy files are supported. This makes sure that on CPUs like Cortex-M0+ (where __thumb2__ is not defined) only .mpy files marked as ARMV6M can be imported. Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/asmthumb: Make ARMv7-M instruction use dynamically selectable.Damien George
This commit adjusts the asm_thumb_xxx functions so they can be dynamically configured to use ARMv7-M instructions or not. This is available when MICROPY_DYNAMIC_COMPILER is enabled, and then controlled by the value of mp_dynamic_compiler.native_arch. If MICROPY_DYNAMIC_COMPILER is disabled the previous behaviour is retained: the functions emit ARMv7-M instructions only if MICROPY_EMIT_THUMB_ARMV7M is enabled. Signed-off-by: Damien George <damien@micropython.org>
2022-05-23tests/run-tests.py: Handle case where mpy-cross fails to compile script.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23tests/basics: Unlock heap if skipping nanbox small-int test.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/emitnative: Access qstr values using indirection table qstr_table.Damien George
This changes the native emitter to access qstr values using the qstr indirection table qstr_table, but only when generating native code that will be saved to a .mpy file. This makes the resulting native code fully static, ie it does not require any fix-ups or rewriting when it is imported. The performance of native code is more or less unchanged. Benchmark results on PYBv1.0 (using --via-mpy and --emit native) are: N=100 M=100 baseline -> this-commit diff diff% (error%) bm_chaos.py 407.16 -> 411.85 : +4.69 = +1.152% (+/-0.01%) bm_fannkuch.py 100.89 -> 101.20 : +0.31 = +0.307% (+/-0.01%) bm_fft.py 3521.17 -> 3441.72 : -79.45 = -2.256% (+/-0.00%) bm_float.py 6707.29 -> 6644.83 : -62.46 = -0.931% (+/-0.00%) bm_hexiom.py 55.91 -> 55.41 : -0.50 = -0.894% (+/-0.00%) bm_nqueens.py 5343.54 -> 5326.17 : -17.37 = -0.325% (+/-0.00%) bm_pidigits.py 603.89 -> 632.79 : +28.90 = +4.786% (+/-0.33%) core_qstr.py 64.18 -> 64.09 : -0.09 = -0.140% (+/-0.01%) core_yield_from.py 313.61 -> 311.11 : -2.50 = -0.797% (+/-0.03%) misc_aes.py 654.29 -> 659.75 : +5.46 = +0.834% (+/-0.02%) misc_mandel.py 4205.10 -> 4272.08 : +66.98 = +1.593% (+/-0.01%) misc_pystone.py 3077.79 -> 3128.39 : +50.60 = +1.644% (+/-0.01%) misc_raytrace.py 388.45 -> 393.71 : +5.26 = +1.354% (+/-0.01%) viper_call0.py 576.83 -> 566.76 : -10.07 = -1.746% (+/-0.05%) viper_call1a.py 550.39 -> 540.12 : -10.27 = -1.866% (+/-0.11%) viper_call1b.py 438.32 -> 432.09 : -6.23 = -1.421% (+/-0.11%) viper_call1c.py 442.96 -> 436.11 : -6.85 = -1.546% (+/-0.08%) viper_call2a.py 536.31 -> 527.37 : -8.94 = -1.667% (+/-0.04%) viper_call2b.py 378.99 -> 377.50 : -1.49 = -0.393% (+/-0.08%) Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/asm: Add ASM_LOAD16_REG_REG_OFFSET macro for load-u16 with offset.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/asmarm: Add asm_arm_ldrh_reg_reg_offset() helper func.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/asmthumb: Add asm_thumb_ldrh_reg_reg_i12_optimised() helper func.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-23py/asmthumb: Fix offset variable name in ldr, ldrh and strh functions.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-05-19py/emitnative: Provide dedicated local for exception unwind handler ptr.Damien George
This eliminates the need to save and restore the exception unwind handler pointer when calling nlr_push. Signed-off-by: Damien George <damien@micropython.org>