aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-12travis: Add tests for building and importing dynamic native modules.Damien George
2019-12-12examples/natmod: Add features1 and features2 examples.Damien George
2019-12-12tests: Add script to run dynamic-native-module tests.Damien George
2019-12-12tools/mpy-tool.py: Raise exception if trying to freeze relocatable mpy.Damien George
2019-12-12tests/import: Add test for importing viper code with additional flags.Damien George
2019-12-12py/dynruntime: Add support for float API to make/get floats.Damien George
We don't want to add a feature flag to .mpy files that indicate float support because it will get complex and difficult to use. Instead the .mpy is built using whatever precision it chooses (float or double) and the native glue API will convert between this choice and what the host runtime actually uses.
2019-12-12py/nativeglue: Add float new/get functions with both single and double.Damien George
2019-12-12py/persistentcode: Make ARM Thumb archs support multiple sub-archs.Damien George
2019-12-12examples/natmod: Add ure example.Damien George
2019-12-12examples/natmod: Add framebuf example.Damien George
2019-12-12examples/natmod: Add uzlib example.Damien George
2019-12-12examples/natmod: Add uheapq example.Damien George
2019-12-12examples/natmod: Add btree example.Damien George
2019-12-12extmod: Add dynamic-runtime guards to btree/framebuf/uheapq/ure/uzlib.Damien George
So they can be built as dynamic native modules, as well as existing static native modules.
2019-12-12extmod/modbtree: Use mp_printf instead of printf.Damien George
2019-12-12tools/mpy_ld.py: Add new mpy_ld.py tool and associated build files.Damien George
This commit adds a new tool called mpy_ld.py which is essentially a linker that builds .mpy files directly from .o files. A new header file (dynruntime.h) and makefile fragment (dynruntime.mk) are also included which allow building .mpy files from C source code. Such .mpy files can then be dynamically imported as though they were a normal Python module, even though they are implemented in C. Converting .o files directly (rather than pre-linked .elf files) allows the resulting .mpy to be more efficient because it has more control over the relocations; for example it can skip PLT indirection. Doing it this way also allows supporting more architectures, such as Xtensa which has specific needs for position-independent code and the GOT. The tool supports targets of x86, x86-64, ARM Thumb and Xtensa (windowed and non-windowed). BSS, text and rodata sections are supported, with relocations to all internal sections and symbols, as well as relocations to some external symbols (defined by dynruntime.h), and linking of qstrs.
2019-12-12tools/mpy-tool.py: Add ability to merge multiple .mpy files into one.Damien George
Usage: mpy-tool.py -o merged.mpy --merge mod1.mpy mod2.mpy The constituent .mpy files are executed sequentially when the merged file is imported, and they all use the same global namespace.
2019-12-12py/nativeglue: Add funcs/types to native glue table for dynamic runtime.Damien George
These allow discovery of symbols by native code that is loaded dynamically.
2019-12-12py/nativeglue: Add new header file with native function table typedef.Damien George
2019-12-12py/persistentcode: Add ability to relocate loaded native code.Damien George
Implements text, rodata and bss generalised relocations, as well as generic qstr-object linking. This allows importing dynamic native modules on all supported architectures in a unified way.
2019-12-10docs/library/uos: Add notes and links about littlefs failures.Damien George
2019-12-10docs/library/ubluetooth: Add note about API being under development.Damien George
2019-12-09stm32/main: Fix SKIPSD file detection so SD card is mounted by default.Jim Mussared
The condition for skipping was accidentally inverted in 7723dac3371ccf081c2490b33b69492dc42818bd Fixes issue #5400.
2019-12-09py/objenumerate: Check for valid args in enumerate constructor.Emil Renner Berthing
For the case where MICROPY_CPYTHON_COMPAT is disabled. This fix makes basics/fun_error2.py pass and not crash the interpreter.
2019-12-09mpy-cross/README.md: Add notes about -march and -O.Jim Mussared
2019-12-09docs/reference/filesystem: Add note and example about using filesystem.Damien George
2019-12-09docs/reference/filesystem: Fix typo in block device code example.Daniel Mizyrycki
2019-12-09nrf/boards/particle_xenon: Enable USB CDC on Particle Xenon board.Daniel Mizyrycki
2019-12-09stm32/boards/xxx_WB55: Enable littlefs2 on WB55 boards.Damiano Mazzella
2019-12-05nrf/main: Execute boot.py/main.py frozen modules without a file system.Andrej Krejcir
When the file system is not enabled, the boot.py and main.py modules will still be executed, if they are frozen.
2019-12-05stm32/uart: Add support for UART4/5 on L0 MCUs.Chris Mason
2019-12-05esp32/boards: Enable ULP in base sdk configuration.Andrew Leech
Fixes issue #5159.
2019-12-05extmod/modbluetooth: Allow setting ringbuf size via BLE.config(rxbuf=).Damien George
The size of the event ringbuf was previously fixed to compile-time config value, but it's necessary to sometimes increase this for applications that have large characteristic buffers to read, or many events at once. With this commit the size can be set via BLE.config(rxbuf=512), for example. This also resizes the internal event data buffer which sets the maximum size of incoming data passed to the event handler.
2019-12-04extmod/modbluetooth: Add optional 4th arg to gattc_write for write mode.Damien George
This allows the user to explicitly select the behaviour of the write to the remote peripheral. This is needed for peripherals that have characteristics with WRITE_NO_RESPONSE set (instead of normal WRITE). The function's signature is now: BLE.gattc_write(conn_handle, value_handle, data, mode=0) mode=0 means write without response, while mode=1 means write with response. The latter was the original behaviour so this commit is a change in behaviour of this method, and one should specify 1 as the 4th argument to get back the old behaviour. In the future there could be more modes supported, such as long writes.
2019-12-04docs: Add littlefs docs and a filesystem tutorial.Jim Mussared
2019-12-04docs/library: Add docs for pyb.Flash class.Jim Mussared
2019-12-04docs/reference: Add docs describing use of pyboard.py.Jim Mussared
2019-12-04docs: Remove spaces on lines that are empty.Damien George
2019-12-04stm32/mpconfigport.h: Use IRQ_PRI_PENDSV to protect bluetooth ringbuf.Damien George
The default protection for the BLE ringbuf is to use MICROPY_BEGIN_ATOMIC_SECTION, which disables all interrupts. On stm32 it only needs to disable the lowest priority IRQ, pendsv, because that's the IRQ level at which the BLE stack is driven.
2019-12-03mpy-cross: Support armv7em, armv7emsp, armv7emdp architectures.Damien George
2019-12-02extmod/modbluetooth: Remove limit on data coming from gattc data input.Damien George
This removes the limit on data coming in from a BLE.gattc_read() request, or a notify with payload (coming in to a central). In both cases the data coming in to the BLE callback is now limited only by the available data in the ringbuf, whereas before it was capped at (default hard coded) 20 bytes.
2019-12-02extmod/modbluetooth: Simplify how BLE IRQ callback is scheduled.Damien George
Instead of enqueue_irq() inspecting the ringbuf to decide whether to schedule the IRQ callback (if ringbuf is empty), maintain a flag that knows if the callback is on the schedule queue or not. This saves about 150 bytes of code (for stm32 builds), and simplifies all uses of enqueue_irq() and schedule_ringbuf().
2019-11-28tools/mpy-tool.py: Support qstr linking when freezing Xtensa native mpy.Damien George
2019-11-27stm32/main: Fix auto creation of pyb.Flash on boot with kw-only args.Damien George
2019-11-27stm32/boards/NUCLEO_L073RZ: Skip board-pin names for CPU only pins.Damien George
This board doesn't have much flash and removing these unneeded names saves about 900 bytes of code size.
2019-11-27stm32/qstrdefsport.h: Remove unused qstrs and make USB ones conditional.Damien George
qstrs in this file are always included in all builds, even if not used anywhere. So remove those that are never needed, and make USB names conditional on having USB enabled.
2019-11-26py: Remove 3 obsolete commented-out lines from header files.Damien George
2019-11-26stm32/storage: Make start/len args of pyb.Flash keyword only.Damien George
To allow the future possibility of initial positional args, like flash id.
2019-11-26py/objstringio: Slightly optimize stringio_copy_on_write for code size.Yonatan Goldschmidt
With the memcpy() call placed last it avoids the effects of registers clobbering. It's definitely effective in non-inlined functions, but even here it is still making a small difference. For example, on stm32, this saves an extra `ldr` instruction to load `o->vstr` after the memcpy() returns.
2019-11-26tests/stress: Add test for maximum length limit of qstrs.Damien George