aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-07-01extmod/uos_dupterm: Add mp_uos_dupterm_poll to poll all dupterms.Damien George
2019-07-01lib/utils/sys_stdio_mphal: Add support to poll sys.stdin and sys.stdout.Damien George
A port must provide the following function for this to work: uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags);
2019-07-01stm32/boards: Optimise flash and RAM allocation for L4 boards.Chris Mason
Optimisations are: - Remove FLASH_ISR section since devices with a small flash sector erase size don't need special FLASH_ISR handling. This reduces flash image by approx 1.5k. - Make SRAM2 contiguous with SRAM1 where possible. - Simplify configuration of 2k RAM buffer used for flash filesystem. RAM changes with this commit: - L432: stack 6k -> 10k, bss + heap 42k -> 52k - L476: stack 16k -> 30k, bss + heap 80k -> 96k - L496: stack 206k -> 16k, bss + heap 112k -> 302k
2019-06-28travis: Enable performance benchmark tests on standard unix build.Damien George
2019-06-28tests/perf_bench: Add some viper performance benchmarks.Damien George
To test raw viper function call overhead: function entry, exit and conversion of arguments to/from objects.
2019-06-28tests/perf_bench: Add some miscellaneous performance benchmarks.Damien George
misc_aes.py and misc_mandel.py are adapted from sources in this repository. misc_pystone.py is the standard Python pystone test. misc_raytrace.py is written from scratch.
2019-06-28tests/perf_bench: Add some benchmarks from python-performance.Damien George
From https://github.com/python/pyperformance commit 6690642ddeda46fc5ee6e97c3ef4b2f292348ab8
2019-06-28tests: Add performance benchmarking test-suite framework.Damien George
This benchmarking test suite is intended to be run on any MicroPython target. As such all tests are parameterised with N and M: N is the approximate CPU frequency (in MHz) of the target and M is the approximate amount of heap memory (in kbytes) available on the target. When running the benchmark suite these parameters must be specified and then each test is tuned to run on that target in a reasonable time (<1 second). The test scripts are not standalone: they require adding some extra code at the end to run the test with the appropriate parameters. This is done automatically by the run-perfbench.py script, in such a way that imports are minimised (so the tests can be run on targets without filesystem support). To interface with the benchmarking framework, each test provides a bm_params dict and a bm_setup function, with the later taking a set of parameters (chosen based on N, M) and returning a pair of functions, one to run the test and one to get the results. When running the test the number of microseconds taken by the test are recorded. Then this is converted into a benchmark score by inverting it (so higher number is faster) and normalising it with an appropriate factor (based roughly on the amount of work done by the test, eg number of iterations). Test outputs are also compared against a "truth" value, computed by running the test with CPython. This provides a basic way of making sure the test actually ran correctly. Each test is run multiple times and the results averaged and standard deviation computed. This is output as a summary of the test. To make comparisons of performance across different runs the run-perfbench.py script also includes a diff mode that reads in the output of two previous runs and computes the difference in performance. Reports are given as a percentage change in performance with a combined standard deviation to give an indication if the noise in the benchmarking is less than the thing that is being measured. Example invocations for PC, pyboard and esp8266 targets respectively: $ ./run-perfbench.py 1000 1000 $ ./run-perfbench.py --pyboard 100 100 $ ./run-perfbench.py --pyboard --device /dev/ttyUSB0 50 25
2019-06-28tests: Rename "bench" tests to "internal_bench" and run-internalbench.pyDamien George
To emphasise these benchmark tests compare the internal performance of features amongst themselves, rather than absolute performance testing.
2019-06-28py/persistentcode: Fix compilation with load and save both enabled.Jun Wu
With both MICROPY_PERSISTENT_CODE_SAVE and MICROPY_PERSISTENT_CODE_LOAD enabled the code fails to compile, due to undeclared 'n_obj'. If MICROPY_EMIT_NATIVE is disabled there are more errors due to the use of undefined fields in mp_raw_code_t. This patch fixes such compilation by avoiding undefined fields. MICROPY_EMIT_NATIVE was changed to MICROPY_EMIT_MACHINE_CODE in this file to match the mp_raw_code_t definition.
2019-06-28py: Define EMIT_MACHINE_CODE as EMIT_NATIVE || EMIT_INLINE_ASM.Jun Wu
The combination MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM is used in many places, so define a new macro for it.
2019-06-26unix/unix_mphal: Use CLOCK_MONOTONIC for ticks_ms/us when available.Mikhail Zakharov
2019-06-25nrf/led: Adjust how board LEDs are defined.Glenn Ruben Bakke
Change static LED functions to lowercase names, and trim down source code lines for variants of MICROPY_HW_LED_COUNT. Also rename configuration for MICROPY_HW_LEDx_LEVEL to MICROPY_HW_LEDx_PULLUP to align with global PULLUP configuration.
2019-06-25stm32/usb: Fix regression with auto USB PID value giving PID=0xffff.Damien George
Commit 9e68eec8eac1188eab0bc059560b877928783978 introduced a regression where the PID of the USB device would be 0xffff if the default value was used. This commit fixes that by using a signed int type.
2019-06-25esp32/Makefile: Include all driver/*.c source files in the build.Josh Lloyd
Fixes #4869.
2019-06-25py/mkrules.mk: Use $(CPP) not $(CC) -E for preprocessor rule.Paul m. p. P
2019-06-25travis: Build esp32 firmware as part of Travis CI.Damien George
Toolchain installation and build takes about 3 minutes.
2019-06-25travis: Build esp8266 firmware as part of Travis CI.Damien George
Toolchain installation and build takes about 1 minute.
2019-06-25travis: Selectively fetch git submodules only when needed.Damien George
This saves time when building on Travis CI: unconditionally fetching all submodules takes about 40 seconds, but not all are needed for any given port, so only fetch as necessary.
2019-06-25stm32/boards: Rework all stm32??xx_hal_conf.h files to use common code.Damien George
This eliminates a lot of duplicated code in these header files.
2019-06-25stm32/boards: Add stm32??xx_hal_conf_base.h files with common settings.Damien George
These are intended to be used by all boards, to reduce the size of a board's configuration.
2019-06-25stm32/boards/pllvalues.py: Support HSx_VALUE defined without uint32_t.Damien George
2019-06-25stm32: Enter bootloader via a system reset.Damien George
Entering a bootloader (ST system bootloader, or custom mboot) from software by directly branching to it is not reliable, and the reliability of it working can depend on the peripherals that were enabled by the application code. It's also not possible to branch to a bootloader if the WDT is enabled (unless the bootloader has specific provisions to feed the WDT). This patch changes the way a bootloader is entered from software by first doing a complete system reset, then branching to the desired bootloader early on in the start-up process. The top two words of RAM (of the stack) are reserved to store flags indicating that the bootloader should be entered after a reset.
2019-06-24stm32/Makefile: Print info messages about use of mboot/QSPI flash.Damien George
2019-06-24stm32/boards: Enable ussl module via mbedtls for boards with network.Damien George
2019-06-22esp32/modnetwork: Still try to reconnect to WLAN even with AUTH_FAIL.Damien George
WIFI_REASON_AUTH_FAIL does not necessarily mean the password is wrong, and a wrong password may not lead to a WIFI_REASON_AUTH_FAIL error code. So to improve reliability connecting to a WLAN always reconnect regardless of the error.
2019-06-19py/nlrthumb: Save and restore VFP registers s16-s21 when CPU has them.Damien George
These s16-s21 registers are used by gcc so need to be saved. Future versions of gcc (beyond v9.1.0), or other compilers, may eventually need additional registers saved/restored. See issue #4844.
2019-06-19esp32: Update to use ESP IDF v3.3-beta3.Damien George
This updates ESP IDF to use v3.3-beta3. And also adjusts README.md to point to stable docs which provide a link to download the correct toolchain for this IDF version, namely 1.22.0-80-g6c4433a-5.2.0
2019-06-17esp32/machine_sdcard: Fix bug in SPI slot number selection.Nicko van Someren
And fix minor typo in docs when referring to SDCard class.
2019-06-17esp8266/uart: Fix invalid ringbuf name when event driven REPL enabled.Paul m. p. P
2019-06-14stm32: In link script, define start of stack separately from heap end.Chris Mason
Previously the end of the heap was the start (lowest address) of the stack. With the changes in this commit these addresses are now independent, allowing a board to place the heap and stack in separate locations.
2019-06-11stm32/usbd_msc: Allow to compile when USB enabled and SD card disabled.Damien George
2019-06-11stm32/usb: Add "msc" kw-arg to pyb.usb_mode to select MSC logical units.Damien George
With this the user can select multiple logical units to expose over USB MSC at once, eg: pyb.usb_mode('VCP+MSC', msc=(pyb.Flash(), pyb.SDCard())). The default behaviour is the original behaviour of just one unit at a time.
2019-06-11stm32/usb: Use ARG_xxx enums to access kw args in pyb_usb_mode.Damien George
2019-06-11stm32/usbd_msc: Provide Mode Sense response data in MSC interface.Damien George
Eventually these responses could be filled in by a function to make their contents dynamic, depending on the attached logical units. But for now they are fixed, and this patch fixes the MODE SENSE(6) responses so it is the correct length with the correct header.
2019-06-11stm32/usbd_msc: Provide custom irquiry processing by MSC interface.Damien George
So the MSC interface can customise the inquiry response based on the attached logical units.
2019-06-11stm32/usbd_msc: Rework USBD MSC code to support multiple logical units.Damien George
SCSI can support multiple logical units over the one interface (in this case over USBD MSC) and here the MSC code is reworked to support this feature. At this point only one LU is used and the behaviour is mostly unchanged from before, except the INQUIRY result is different (it will report "Flash" for both flash and SD card).
2019-06-11tools/mpy-tool.py: Fix linking of qstr objects in native ARM Thumb code.Damien George
Previously, when linking qstr objects in native code for ARM Thumb, the index into the machine code was being incremented by 4, not 8. It should be 8 to account for the size of the two machine instructions movw and movt. This patch makes sure the index into the machine code is incremented by the correct amount for all variations of qstr linking. See issue #4829.
2019-06-05stm32/lwip_inc: Update to enable mDNS, TCP listen backlog, faster DHCP.Damien George
2019-06-05stm32: Support optional lwIP mDNS responder.Damien George
2019-06-05extmod/extmod.mk: Include mdns app source in lwIP build.Damien George
2019-06-05stm32/boards/PYBD_SFx: Enable ussl module using mbedTLS.Damien George
2019-06-05stm32: Integrate optional mbedTLS component for ussl module.Damien George
To use it a board should define MICROPY_PY_USSL=1 and MICROPY_SSL_MBEDTLS=1 at the Makefile level. With the provided configuration it adds about 64k to the build.
2019-06-05extmod/modussl_mbedtls: Allow to build with object representation D.Damien George
2019-06-05unix/mpconfigport.mk: Update comment about TLS implementations.Damien George
As long as the submodule is checked out, mbedTLS is now fully integrated into the unix build if MICROPY_SSL_MBEDTLS=1.
2019-06-05extmod/extmod.mk: Integrate mbedTLS so it is built from source.Damien George
Setting MICROPY_PY_USSL and MICROPY_SSL_MBEDTLS at the Makefile-level will now build mbedTLS from source and include it in the build, with the ussl module using this TLS library. Extra settings like MBEDTLS_CONFIG_FILE may need to be provided by a given port. If a port wants to use its own mbedTLS library then it should not set MICROPY_SSL_MBEDTLS at the Makefile-level but rather set it at the C level, and provide the library as part of the build in its own way (see eg esp32 port).
2019-06-05lib: Add new submodule for mbedtls, currently at v2.17.0.Damien George
From upstream source: https://github.com/ARMmbed/mbedtls.git
2019-06-05extmod: Factor out makefile rules from py.mk to new extmod.mk file.Damien George
To logically separate extmod related rules out, and prevent py.mk from growing too large.
2019-06-05py/obj: Optimise small-int comparison to 0 in mp_obj_is_true.Yonatan Goldschmidt
Instead of converting to a small-int at runtime this can be done at compile time, then we only have a simple comparison during runtime. This reduces code size on some ports (e.g -4 on qemu-arm, -52 on unix nanbox), and for others at least doesn't increase code size.
2019-06-04tools/mpy-tool.py: Fix linking qstrs in native code, and multiple files.Damien George
Fixes errors in the tool when 1) linking qstrs in native ARM-M code; 2) freezing multiple files some of which use native code and some which don't. Fixes issue #4829.