summaryrefslogtreecommitdiffstatshomepage
path: root/tools
Commit message (Collapse)AuthorAge
* tools/ci.sh: Add a H5 board to stm32 CI build.Damien George2023-06-15
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tools/ci.sh: Build PICO_W board as part of rp2 CI.Damien George2023-06-14
| | | | Signed-off-by: Damien George <damien@micropython.org>
* esp32/esp32_ulp: Fix ULP (FSM) support for S2 and S3.Wilko Nienhaus2023-06-14
| | | | | | | | | | | | | This change enables the ULP (FSM) for all ESP32 variants rather than requiring it to be enabled for each board specifically. It also ensures the correct header file is included for each variant. Lastly, it updates the IDF version we're builing against to v4.4.2, as that version contains important fixes to make the ULP actually work on S2/S3 chips. See: https://github.com/espressif/esp-idf/commit/a0e3d48 Signed-off-by: Wilko Nienhaus <wilko.nienhaus@gmail.com>
* tools/mpremote: Fix exec_ -> exec in commands.py.Jim Mussared2023-06-09
| | | | | | | This was missed in the pyboard refactor and is preventing `cp -r` from working. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/ci.sh: Add mimxrt and samd ports to code size build.Damien George2023-06-08
| | | | | | | The automatic code size build and GitHub comment is a really useful feature. This commit adds a few more builds to it (mimxrt and samd). Signed-off-by: Damien George <damien@micropython.org>
* extmod/modtimeq: Remove timeq module.Jim Mussared2023-06-08
| | | | | | | | This is a MicroPython-specific module that existed to support the old version of uasyncio. It's undocumented and not enabled on all ports and takes up code size unnecessarily. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Replace all uses of umodule in Python code.Jim Mussared2023-06-08
| | | | | | | | Applies to drivers/examples/extmod/port-modules/tools. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tests: Replace umodule with module everywhere.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* examples/natmod: Rename umodule to module.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Rename *umodule*.c to remove the "u" prefix.Jim Mussared2023-06-08
| | | | | | | | | | | Updates any includes, and references from Makefiles/CMake. This essentially reverts what was done long ago in commit 136b5cbd7669e8318f8455fc2706da97a5b7994c This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Rename UMODULE to MODULE in preprocessor/Makefile vars.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Fix use of stdout_write_bytes function.Damien George2023-06-02
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tools/mpremote: Detach mpremote from pyboard.py.Jim Mussared2023-06-02
| | | | | | | | | | | | | | | | | This commit just takes the necessary parts of pyboard.py and merges them with pyboardextended.py to make a new transport_serial.py, and updates the rest of mpremote to use this instead. It is difficult to continue to add features to mpremote (which usually requires modification to pyboard.py) while also maintaining backwards compatibility for pyboard.py. The idea is that this provides a starting point for further refactoring of mpremote to allow different transports (webrepl, BLE, etc). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* docs/reference/mpremote.rst: Extend the mpremote guide.Jim Mussared2023-06-02
| | | | | | | | | | | | | | | | | | Changes in this commit: - Add a extra detail to each of the commands. - Add more about handling options and arguments. - Include shortcut commands that behave like real commands to the command list (e.g. bootloader, rtc). - Add extra information and reword to address common misconceptions, in particular how commands chain together. - Add additional examples showing some more interesting combinations. - Add descriptions to each of the examples. - Add pipx installation instructions. - Describe how user-configuration works. This work was sponsored by Google Season of Docs. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Handle `cp` without destination.Jim Mussared2023-06-02
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Add `rtc` commands to get and set the RTC.Jim Mussared2023-06-02
| | | | | | | | | | | Replaces the existing functionality provided by the `setrtc` alias to use the current time, rather than a hard-coded date/time. Use `rtc` to query the current time. Use `rtc --set` to set it. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Allow terminator for shortcut commands.Jim Mussared2023-06-02
| | | | | | | | | | | For example, the `reset` shortcut previously allowed an optional delay, but the argument handling cannot handle `reset next-command` as `next-command` will be interpreted as the delay argument. The fix in this commit allows `reset + next-command`. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Add `sleep` command.Jim Mussared2023-06-02
| | | | | | | | | | | | This allows the sequence to be paused (e.g. wait for device, etc). Also removes the t_ms arg in reset/bootloader, because these arguments don't really need to be changed, and keeping them would mean inconsistent units used for time delays. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/pydfu.py: Use getattr to retrieve getargspec function.Damien George2023-05-24
| | | | | | Since Python 3.11, inspect.getargspec() has been removed. Signed-off-by: Damien George <damien@micropython.org>
* tools/mpremote: Add repl option to escape non-printable characters.Damien George2023-05-22
| | | | | | | | | | | | | | This commit adds the "--escape-non-printable" option to the repl command. When specified the REPL console will escape non-printable characters, printing them as their hex value in square brackets. This escaping behaviour was previously the default and only behaviour, but it is now opt-in. As part of this change, the speed of echoing device data to the console is improved by by reading and writing in chunks. Signed-off-by: Damien George <damien@micropython.org>
* tools/manifestfile.py: Fix license capturing.Jim Mussared2023-05-19
| | | | | | The license field was incorrectly being set to the version. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/pyboard.py: Import errno to fix undefined name in PyboardError.Christian Clauss2023-05-09
| | | | | | This will keep line 96 from raising a NameError. Signed-off-by: Christian Clauss <cclauss@me.com>
* CODECONVENTIONS: Require that commits be signed-off by the author.Damien George2023-05-08
| | | | | | And use "must" instead of "should" where appropriate in related text. Signed-off-by: Damien George <damien@micropython.org>
* tools/pyboard.py: Import serial.tools.list_ports.Damien George2023-05-04
| | | | | | This import is needed by newer versions of pyserial. Signed-off-by: Damien George <damien@micropython.org>
* all: Fix cases of Python variable assigned but never used.Christian Clauss2023-05-02
| | | | This fixes ruff rule F841.
* all: Fix strings with backslash by using raw string literals.Christian Clauss2023-05-02
|
* tools/mpremote: Remove unused import of serial.Christian Clauss2023-05-02
|
* all: Fix spelling mistakes based on codespell check.Damien George2023-04-27
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tools/pyboard.py: Rename ProcessPtyToTerminal member "ser" to "serial".Damien George2023-04-27
| | | | | | So that this file doesn't need to be excluded from codespell. Signed-off-by: Damien George <damien@micropython.org>
* tools/ci.sh: Add functions to check code spelling using codespell.Damien George2023-04-27
| | | | | | | | | | | | Signed-off-by: Damien George <damien@micropython.org> tools/ci.sh: Explicitly specify pyproject.toml. Signed-off-by: Damien George <damien@micropython.org> tools/ci.sh: Import tomli. Signed-off-by: Damien George <damien@micropython.org>
* tools/ci.sh: Build both SAMD21 and SAMD51 boards as part of samd CI.Damien George2023-04-27
| | | | Signed-off-by: Damien George <damien@micropython.org>
* renesas-ra: Change MICROPY_HW_BOARD_NAME definition to product name.Takeo Takahashi2023-04-27
| | | | | | | | | | Changes in this commit: - Change MICROPY_HW_BOARD_NAME definition to match the product name. - Rename board folder's name to match the product name style. - Change related files like Makefile, document descriptions, test cases, CI and tools. Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
* extmod/modbluetooth: Make all HCI transports trace in the same format.Jim Mussared2023-04-26
| | | | | | | | - Use HCI_TRACE macro consistently. - Use the same colour formatting. - Add a tool to convert to .pcap for Wireshark. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/mpremote: Add ctrl-x as additonal mpremote disconnect shortcut.Jonas Scharpf2023-04-15
| | | | | | | | | The mpremote REPL can now be closed with either ctrl+] or ctrl+x, which gives users a choice, useful if the ']' key is difficult to access. Fixes issue #11197. Signed-off-by: Jonas Scharpf <jonas@brainelectronics.de>
* tools/manifestfile.py: Add support for publishing packages to PyPI.Jim Mussared2023-04-07
| | | | | | | | | | | | | | | | | | | | | | This adds a new MODE_PYPROJECT, which gives basic support to allow packaging a small subset of micropython-lib packages to PyPI. This change allows a package in micropython-lib to: - Add a "pypi" name to its metadata indicating that it's based on a PyPI package. - Add "stdlib" to its metadata indicating that it's a micropython version of a stdlib package. - Add a "pypi_publish" name to its metadata to indicate that it can be published to PyPI (this can be different to the package name, e.g. "foo" might want to be published as "micropython-foo"). When a package requires() another one, if it's in MODE_PYPROJECT then if the package is from pypi then it will record that as a pypi dependency instead (or no dependency at all if it's from stdlib). Also allows require() to explicitly specify the pypi name. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/pyboard.py: Fix ESPxx boards hanging in bootloader after reset.Jos Verlinde2023-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow up to d263438a6e365d3199494498a9b734cda29dde52, which solved one problem (reset on disconnect) but introduced a second one (hang in bootloader). To solve both probles, False/False is needed for DTR/RTS for ESPxx, but that would then block stm32 and others. Any unconditional combination of DTR/RTS ends up blocking normal operation on some type of board or another. A simple overview (for windows only): DTR CTS ESP8266/ESP32 STM32/SAMD51/RP2040 unspecified unspecified Reset on disconnect OK True False Hang in bootloader OK False False OK No Repl True True Reset on disconnect No Repl False True Reset on disconnect No Repl serial.manufacturer: wch.cn/Silicon Labs Microsoft serial.description: USB-SERIAL CH340 / USB Serial Device CP210x USB to UART Bridge The updated logic will only set the DTR/RTS signals for boards that do not use standard Microsoft drivers (based on the manufacturer). It would also be possible to check against a list of known driver manufactures (like wch.cn or Silicon Labs) but this would require a list of known drivers for all ports. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
* tools/pyboard.py: Fix joining of path in filesystem_command.Damien George2023-03-22
| | | | | | This was broken by 5327cd1021dc92cad428ff44cb114c4a94c0bc45 Signed-off-by: Damien George <damien@micropython.org>
* all: Fix Python comparison to None and True, and use "not in".Christian Clauss2023-03-10
| | | | These are basic PEP8 recommendations.
* tools/pyboard.py: Use '/' exclusively when dealing with paths.Damien George2023-02-24
| | | | | | | | | | | | | | | | | | | | | Currently, certain mpremote filesystem operations can fail on Windows due to a mixing of '/' and '\' for path separators. Eg if filesystem_command() is called with a destination that ends in / then dest.endswith(os.path.sep) will return False, which gives the wrong behaviour (it does end in a path separator). For similar reasons to 7e9a15966acf80ff50fdf5c52553dd56de164bb3, it's best to use '/' everywhere in pyboard.py and mpremote, because the target device understands only '/'. mpremote already does this, so the remaining place to fix it is in pyboard.y, to convert all incoming paths to use '/' instead of '\'. This effectively reverts 57fd66b80f8352e4859e6b71536b6083f9d7279c which tried to fix the problem in a different way. See also related 1f84440538a017e463aaad9686831ce9527122b5. Signed-off-by: Damien George <damien@micropython.org>
* tools/mpremote: Use hatch to build mpremote package.Jim Mussared2023-02-24
| | | | | | | | | | | | | | | | | | | | | | This allows the entire configuration to be defined in a single file, including the logic for including pyboard.py and automatically versioning based on the git tag. Building the package works both via `python -m build` as well as `hatch build`. `python -m build ` has the advantage of automatically fetching all dependencies, you don't need to manually install any hatch packages. In order to make the versioning work, and also keep things simpler for end users, mpremote releases will now be the same as MicroPython releases and use the same tag. The version strings for mpremote will look like: - X.Y.Z -- clean build at the tag - X.Y.Z.postN+gHASH -- clean build, N revisions from the most recent tag - X.Y.Z.postN+gHASH.dYYYYMMDD -- dirty build, N revisions from out This commit extends on the idea from #8404. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/ci.sh: Add unix, stm32 and rp2 ports to code size check.Damien George2023-02-20
| | | | | | | | | | Now that the code-size-check CI action gives a nice report (as a comment) on the code size difference, it's possible to have a few more ports reported there. In this commit, unix, stm32 and rp2 are added. Unix represents non-MCU builds, and stm32 and rp2 represent ARM-based builds, for ports that have lots of features enabled. Signed-off-by: Damien George <damien@micropython.org>
* tools/ci.sh: Install pkg-config for macos builds.Damien George2023-02-17
| | | | Signed-off-by: Damien George <damien@micropython.org>
* tools/mpy-tool.py: Initialize line_info_top.Martin Milata2023-02-01
| | | | | | Without it the line number mapping doesn't work. Signed-off-by: Martin Milata <martin@martinmilata.cz>
* tools/pyboard.py: Set DTR on Windows to avoid ESPxx hard reset.Jos Verlinde2023-01-13
| | | | | | Fixes issue #9659. Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
* tools/pyboard.py: Add fs_{listdir,readfile,writefile,stat}.Jim Mussared2023-01-13
| | | | | | | | | | | | | | | | | | | These are for working with the filesystem when using pyboard.py as a library, rather than at the command line. - fs_listdir returns a list of tuples, in the same format as os.ilistdir(). - fs_readfile returns the contents of a file as a bytes object. - fs_writefile allows writing a bytes object to a file. - fs_stat returns an os.statresult. All raise FileNotFoundError (or OSError(ENOENT) on Python 2) if the file is not found (or PyboardError on other errors). Updated fs_cp and fs_get to use fs_stat to compute file size. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/pyboard.py: Add parse kwarg to eval.Jim Mussared2023-01-13
| | | | | | | | | | | | | | | | | This is useful when using pyboard.py as a library rather than at the command line. pyb.eval("1+1") --> b"2" pyb.eval("{'a': '\x00'}") --> b"{'a': '\\x00'}" Now you can also do pyb.eval("1+1", parse=True) --> 2 pyb.eval("{'a': '\x00'}", parse=True) --> {'a': '\x00'} This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/pyboard.py: Fix Python 2 compatibility.Jim Mussared2023-01-13
| | | | | | | In Python 2, serial.read()[0] a string, not int. Use struct.unpack to do this instead. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* tools/autobuild: Create .uf2 file for seeed_xiao_nrf52.robert-hh2022-12-19
| | | | And for all other nrf boards that have or get a uf2 build tag.
* all: Keep msvc build output in build/ directories.stijn2022-12-13
| | | | This follow the change made for Makefile-based projects in b2e82402.
* tools/mpremote: Only auto connect to serial device with USB VID/PID.Michael Mogenson2022-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On MacOS and Windows there are a few default serial devices that are returned by `serial.tools.list_ports.comports()`. For example on MacOS: ``` {'description': 'n/a', 'device': '/dev/cu.Bluetooth-Incoming-Port', 'hwid': 'n/a', 'interface': None, 'location': None, 'manufacturer': None, 'name': 'cu.Bluetooth-Incoming-Port', 'pid': None, 'product': None, 'serial_number': None, 'vid': None} {'description': 'n/a', 'device': '/dev/cu.wlan-debug', 'hwid': 'n/a', 'interface': None, 'location': None, 'manufacturer': None, 'name': 'cu.wlan-debug', 'pid': None, 'product': None, 'serial_number': None, 'vid': None} ``` Users of mpremote most likely do not want to connect to these ports. It would be desirable if mpremote did not select this ports when using the auto connect behavior. These serial ports do not have USB VID or PID values and serial ports for Micropython boards with FTDI/serial-to-USB adapter or native USB CDC/ACM support do. Check for the presence of a USB VID / PID int value when selecting a serial port to auto connect to. All serial ports will still be listed by the `list` command and can still be selected by name when connecting. Signed-off-by: Michael Mogenson <michael.mogenson@gmail.com>