summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-01-06zephyr: Upgrade to Zephyr v2.7.0.Maureen Helm
Updates the Zephyr port build instructions and CI to use the latest Zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-06tools/ci.sh: Upgrade Zephyr docker image to v0.21.0.Maureen Helm
As a prerequisite to upgrading to Zephyr v2.7.0, upgrade CI to use Zephyr docker image v0.21.0. In particular, this is needed to pick up a newer CMake version because Zephyr v2.7.0 increased the minimum CMake version required to 3.20.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-12-30tools/autobuild: Build esp8266 OTA image with GENERIC_1M board.Damien George
Because the GENERIC board won't fit in the flash defined by esp8266_ota.ld. Signed-off-by: Damien George <damien@micropython.org>
2021-12-30esp8266: Allow building a board to any dest directory.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29tools/upip.py: Skip '.frozen' entry in sys.path for install path.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29tools/mpremote: Add link to mpremote docs URL in help message.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-29tools/mpremote: Add help command.Sergei Silnov
Fixes issue #7480
2021-12-22tools/mpremote: Add mkdir and rmdir to RemoteFS.Michael Bentley
This allows the remote MicroPython instance to create and delete directories from the mounted host filesystem in addition to the already existing functionality of reading, creating, and modifying files. Signed-off-by: Michael Bentley <mikebentley15@gmail.com>
2021-12-18py: Only search frozen modules when '.frozen' is found in sys.path.Jim Mussared
This changes makemanifest.py & mpy-tool.py to merge string and mpy names into the same list (now mp_frozen_names). The various paths for loading a frozen module (mp_find_frozen_module) and checking existence of a frozen module (mp_frozen_stat) use a common function that searches this list. In addition, the frozen lookup will now only take place if the path starts with ".frozen", which needs to be added to sys.path. This fixes issues #1804, #2322, #3509, #6419. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-17tools/makemanifest.py: Merge make-frozen.py.Jim Mussared
Takes the functionality from tools/make-frozen.py, adds support for multiple frozen directories, and moves it to tools/makemanifest.py. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-15tools/makemanifest.py: Make str conversion compatible with Python 2.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-12-15tools/upip.py: Support == to specify exact package version.Christian Decker
2021-12-10tools/autobuild: Automatically build all esp32 boards.Damien George
Any board with a board.json file will be built. ESP32-based boards will be built using the IDF at $IDF_PATH_V42, all other MCU variants (S2, S3, C3) will be built using the IDF at $IDF_PATH_V44. Signed-off-by: Damien George <damien@micropython.org>
2021-12-09tools/mpremote: Implement seek and flush in ioctl method.Damien George
Fixes issue #8058. Signed-off-by: Damien George <damien@micropython.org>
2021-12-09all: Update Python formatting to latest Black version 21.12b0.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-22tools/autobuild: Automatically build all stm32 boards.Damien George
Any board with a board.json file will be built. Additional variants for certain pyboards will also be built by the explicit build-stm32-extra.sh script. Both .dfu and .hex files will be made available. Also build boards in a sorted order, and don't stop building if a single board fails. Signed-off-by: Damien George <damien@micropython.org>
2021-11-22stm32/boards: Build NUCLEO_WB55 and STM32F769DISC without mboot enabled.Damien George
This is to make the builds for all nucleo/discovery boards uniform, so they can be treated the same by the auto build scripts. The CI script is updated to explicitly enable mboot and packing, to test these features. Signed-off-by: Damien George <damien@micropython.org>
2021-11-13drivers/ninaw10: Add ublox Nina-W10 WiFi/BT module driver.iabdalkader
- Add WiFi/BT drivers for ublox Nina-W10 (esp32 based) module. - Add ublox Nina-W10 Python module in extmod.
2021-11-05tools/autobuild: Automatically build all mimxrt, rp2 and samd boards.Damien George
Any board with a board.json file will be automatically built. Signed-off-by: Damien George <damien@micropython.org>
2021-11-01tools/dfu.py: Make tool work with python3 when parsing DFU files.Dave Hylands
2021-10-27tools/autobuild: Add script to generate website board metadata.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-25tools/ci.sh: Use a specific ESP IDF v4.4 commit.Damien George
There is no release of IDF v4.4 yet but master is now on v5.0-dev so a specific commit must be chosen to stick to v4.4. Signed-off-by: Damien George <damien@micropython.org>
2021-10-25tools/autobuild: Add the MIMXRT1010_EVK board to autobuild.robert-hh
Having a board now available for testing, this binary can be provided with good confidence.
2021-09-16tools/ci.sh: Use IDF v4.4 as part of esp32 CI and build GENERIC_S3.Damien George
IDF v4.4 does not have an official release so for now use the latest master. Also remove building GENERIC with no options (all the other boards are no-option builds), to keep CI time reasonable. Signed-off-by: Damien George <damien@micropython.org>
2021-09-16all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.Jim Mussared
This commit removes all parts of code associated with the existing MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE optimisation option, including the -mcache-lookup-bc option to mpy-cross. This feature originally provided a significant performance boost for Unix, but wasn't able to be enabled for MCU targets (due to frozen bytecode), and added significant extra complexity to generating and distributing .mpy files. The equivalent performance gain is now provided by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE (which has been enabled on the unix port in the previous commit). It's hard to provide precise performance numbers, but tests have been run on a wide variety of architectures (x86-64, ARM Cortex, Aarch64, RISC-V, xtensa) and they all generally agree on the qualitative improvements seen by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE. For example, on a "quiet" Linux x64 environment (i3-5010U @ 2.10GHz) the change from CACHE_MAP_LOOKUP_IN_BYTECODE, to LOAD_ATTR_FAST_PATH combined with MAP_LOOKUP_CACHE is: diff of scores (higher is better) N=2000 M=2000 bccache -> attrmapcache diff diff% (error%) bm_chaos.py 13742.56 -> 13905.67 : +163.11 = +1.187% (+/-3.75%) bm_fannkuch.py 60.13 -> 61.34 : +1.21 = +2.012% (+/-2.11%) bm_fft.py 113083.20 -> 114793.68 : +1710.48 = +1.513% (+/-1.57%) bm_float.py 256552.80 -> 243908.29 : -12644.51 = -4.929% (+/-1.90%) bm_hexiom.py 521.93 -> 625.41 : +103.48 = +19.826% (+/-0.40%) bm_nqueens.py 197544.25 -> 217713.12 : +20168.87 = +10.210% (+/-3.01%) bm_pidigits.py 8072.98 -> 8198.75 : +125.77 = +1.558% (+/-3.22%) misc_aes.py 17283.45 -> 16480.52 : -802.93 = -4.646% (+/-0.82%) misc_mandel.py 99083.99 -> 128939.84 : +29855.85 = +30.132% (+/-5.88%) misc_pystone.py 83860.10 -> 82592.56 : -1267.54 = -1.511% (+/-2.27%) misc_raytrace.py 21490.40 -> 22227.23 : +736.83 = +3.429% (+/-1.88%) This shows that the new optimisations are at least as good as the existing inline-bytecode-caching, and are sometimes much better (because the new ones apply caching to a wider variety of map lookups). The new optimisations can also benefit code generated by the native emitter, because they apply to the runtime rather than the generated code. The improvement for the native emitter when LOAD_ATTR_FAST_PATH and MAP_LOOKUP_CACHE are enabled is (same Linux environment as above): diff of scores (higher is better) N=2000 M=2000 native -> nat-attrmapcache diff diff% (error%) bm_chaos.py 14130.62 -> 15464.68 : +1334.06 = +9.441% (+/-7.11%) bm_fannkuch.py 74.96 -> 76.16 : +1.20 = +1.601% (+/-1.80%) bm_fft.py 166682.99 -> 168221.86 : +1538.87 = +0.923% (+/-4.20%) bm_float.py 233415.23 -> 265524.90 : +32109.67 = +13.756% (+/-2.57%) bm_hexiom.py 628.59 -> 734.17 : +105.58 = +16.796% (+/-1.39%) bm_nqueens.py 225418.44 -> 232926.45 : +7508.01 = +3.331% (+/-3.10%) bm_pidigits.py 6322.00 -> 6379.52 : +57.52 = +0.910% (+/-5.62%) misc_aes.py 20670.10 -> 27223.18 : +6553.08 = +31.703% (+/-1.56%) misc_mandel.py 138221.11 -> 152014.01 : +13792.90 = +9.979% (+/-2.46%) misc_pystone.py 85032.14 -> 105681.44 : +20649.30 = +24.284% (+/-2.25%) misc_raytrace.py 19800.01 -> 23350.73 : +3550.72 = +17.933% (+/-2.79%) In summary, compared to MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE, the new MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE options: - are simpler; - take less code size; - are faster (generally); - work with code generated by the native emitter; - can be used on embedded targets with a small and constant RAM overhead; - allow the same .mpy bytecode to run on all targets. See #7680 for further discussion. And see also #7653 for a discussion about simplifying mpy-cross options. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-14mimxrt: Rework flash configuration.Philipp Ebensberger
- Moves definition of BOARD_FLASH_SIZE and other header files related to flash configuration into the Makefile. - Adds board specific clock_config.h. - Adds board.h, pin_mux.h, and peripherals.h as they are required by NXP MCU SDK in order to use our own clock_config.h. - Renames board specific FlexSPI configuration files. - Updates flash frequency of MIMXRT1020_EVK - Creates separated flash_config files for QSPI NOR and QSPI Hyper flash. - Unifies VFS start address to be @ 1M for 1010 and 1020 boards. - Unifies 1050EVK boards - Adds support to both NOR and HyperFlash on boards with both capabilities. - Adds automatic FlexRAM initialization to start-up code based on linker script and NXP HAL. - Applies code formatting to all files in mimxrt port. With this change the flash configuration is restructured and organized. This simplifies the configuration process and provides a better overview of each board's settings. With the integration of clock_config.h, board.h, pin_mux.h, and peripherals.h we gain better control of the settings and clock configurations. Furthermore the implementation of an explicit FlexRAM setup improves the system performance and allows for performance tuning. Signed-off-by: Philipp Ebensberger
2021-09-10tools/autobuild: Add auto build for GENERIC_C3_USB.Patrick Van Oosterwijck
2021-09-10esp32/boards: Add new FeatherS2-Neo board definition.Seon Rozenblum
2021-09-01tools/mpremote: Bump version to 0.0.6.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-08-31tools/uncrustify: Force 1 newline at end of file.David Lechner
To keep things neat and tidy, we ensure that each file has 1 and only 1 newline at the end of each file. Signed-off-by: David Lechner <david@pybricks.com>
2021-08-26tests/basics: Split f-string debug printing to separate file with .exp.Damien George
This feature {x=} was introduced in Python 3.8 so needs a separate .exp file to run on earlier Python versions. See https://bugs.python.org/issue36817 Signed-off-by: Damien George <damien@micropython.org>
2021-08-25tools/pyboard.py: Make --no-soft-reset consistent with other args.Jim Mussared
This makes it work like --no-follow and --no-exclusive using a mutex group and dest. Although the current implementation with BooleanOptionAction is neater it requires Python 3.9, so don't use this feature. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-25tools/pyboard.py: Add --exclusive to match --no-exclusive.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-25tools/pyboard.py: Make --no-follow use same variable as --follow.Jim Mussared
You can set one or the other (or neither) but not both. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-25tools/pyboard.py: Move --no-exclusive/--soft-reset out of mutex group.Jim Mussared
The --no-exclusive flag was accidentally added to the mutex group in 178198a01df51b5f4c5ef9f38ab2fb8f6269d5f4. The --soft-reset flag was accidentally added to the mutex group in 41adf178309759d5965c15972f04987a2635314c. These flags can be specified independently to --[no-]follow so should not be in that mutex group. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-19tools/autobuild: Don't use "-B" for make, it's already a fresh build.Damien George
And using "-B" means mpy-cross is forcefully rebuilt, sometimes with invalid CFLAGS_EXTRA options which makes the auto-build fail. Signed-off-by: Damien George <damien@micropython.org>
2021-08-19tools/mpremote: Remove support for pyb.USB_VCP in/out specialisation.Damien George
The sys.stdin.buffer and sys.stdout.buffer streams work just as well (and are just as fast) as pyb.USB_VCP on stm32 devices, so there's no need to have the USB_VCP specialisation code, which just adds complexity. Also, on stm32 devices with both USB and UART (or other serial interface), if something other than the USB_VCP port is used for the serial connection then mpremote mount will not work because it will default to reading and writing on USB_VCP instead of the other connected serial stream. As part of this simplification, support for a second port as input is removed (this feature was never exposed to the user). Signed-off-by: Damien George <damien@micropython.org>
2021-08-14py: Implement partial PEP-498 (f-string) support.Jim Mussared
This implements (most of) the PEP-498 spec for f-strings and is based on https://github.com/micropython/micropython/pull/4998 by @klardotsh. It is implemented in the lexer as a syntax translation to `str.format`: f"{a}" --> "{}".format(a) It also supports: f"{a=}" --> "a={}".format(a) This is done by extracting the arguments into a temporary vstr buffer, then after the string has been tokenized, the lexer input queue is saved and the contents of the temporary vstr buffer are injected into the lexer instead. There are four main limitations: - raw f-strings (`fr` or `rf` prefixes) are not supported and will raise `SyntaxError: raw f-strings are not supported`. - literal concatenation of f-strings with adjacent strings will fail "{}" f"{a}" --> "{}{}".format(a) (str.format will incorrectly use the braces from the non-f-string) f"{a}" f"{a}" --> "{}".format(a) "{}".format(a) (cannot concatenate) - PEP-498 requires the full parser to understand the interpolated argument, however because this entirely runs in the lexer it cannot resolve nested braces in expressions like f"{'}'}" - The !r, !s, and !a conversions are not supported. Includes tests and cpydiffs. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-14tools/mpremote: Add "devs" shortcut for "connect list".Damien George
See issue #7480. Signed-off-by: Damien George <damien@micropython.org>
2021-08-14tools/mpremote: Fix connect-list in case VID/PID are None.Damien George
Which can be the case on Windows and macOS for certain serial devices. Fixes issue #7636. Signed-off-by: Damien George <damien@micropython.org>
2021-08-13tools/autobuild: Add auto build for Silicognition wESP32.Patrick Van Oosterwijck
2021-08-13tools/gen-cpydiff.py: Don't rename foo to ufoo in diff output.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-08tools/codeformat.py: Include ports/nrf/modules/nrf in code formatting.Glenn Ruben Bakke
2021-08-08tools/ci.sh: Add mpy-cross build to nrf port.Glenn Ruben Bakke
2021-08-07ports: Rename USBD_VID/PID config macros to MICROPY_HW_USB_VID/PID.Damien George
For consistency with other board-level config macros that begin with MICROPY_HW_USB. Also allow boards in the mimxrt, nrf and samd ports to configure these values. Signed-off-by: Damien George <damien@micropython.org>
2021-07-31tools/autobuild: Add the MIMXRT1050_EVKB board to the daily builds.robert-hh
2021-07-31stm32/Makefile: Update to only pull in used Bluetooth library.Tobias Thyrrestrup
2021-07-23tools/mpremote: Raise OSError on unsupported RemoteFile.seek.Michel Bouwmans
Signed-off-by: Michel Bouwmans <m.bouwmans@ep-games.eu>
2021-07-23tools/mpremote: Add seek whence for mounted files.Michel Bouwmans
Fixes issue #7534. Signed-off-by: Michel Bouwmans <m.bouwmans@ep-games.eu>
2021-07-22tools/autobuild: Add FeatherS2 and TinyS2 to esp32 auto builds.Seon Rozenblum