summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-12mpy-cross,unix: Remove .gitignore file.Damien George
Now that all build artefacts are placed in a build/ directory the gitignore is no longer needed. Signed-off-by: Damien George <damien@micropython.org>
2022-08-12tests/extmod/ubinascii: Add tests for bytes.hex etc.Jim Mussared
Also make the sep test not micropython-specific. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-12py/objstr: Add hex/fromhex to bytes/memoryview/bytearray.Jim Mussared
These were added in Python 3.5. Enabled via MICROPY_PY_BUILTINS_BYTES_HEX, and enabled by default for all ports that currently have ubinascii. Rework ubinascii to use the implementation of these methods. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-11zephyr/machine_uart: Use mp_obj_str_get_str to get device name.Damien George
This checks that the argument is actually a string. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11nrf/modules/ubluepy: Use mp_obj_str_get_data to extract str data.Damien George
Instead of GET_STR_DATA_LEN, which is intended to be a private macro. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11py/objstr: Consolidate methods for str/bytes/bytearray/array.Andrew Leech
This commit adds the bytes methods to bytearray, matching CPython. The existing implementations of these methods for str/bytes are reused for bytearray with minor updates to match CPython return types. For details on the CPython behaviour see https://docs.python.org/3/library/stdtypes.html#bytes-and-bytearray-operations The work to merge locals tables for str/bytes/bytearray/array was done by @jimmo. Because of this merging of locals the change in code size for this commit is mostly negative: bare-arm: +0 +0.000% minimal x86: +29 +0.018% unix x64: -792 -0.128% standard[incl -448(data)] unix nanbox: -436 -0.078% nanbox[incl -448(data)] stm32: -40 -0.010% PYBV10 cc3200: -32 -0.017% esp8266: -28 -0.004% GENERIC esp32: -72 -0.005% GENERIC[incl -200(data)] mimxrt: -40 -0.011% TEENSY40 renesas-ra: -40 -0.006% RA6M2_EK nrf: -16 -0.009% pca10040 rp2: -64 -0.013% PICO samd: +148 +0.105% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2022-08-11py/qstr: Change qstr hash type from mp_uint_t to size_t.Damien George
The hash is either 8 or 16 bits (depending on MICROPY_QSTR_BYTES_IN_HASH) so will fit in a size_t. This saves 268 bytes on the unix nanbox build. Non-nanbox configurations are unchanged because mp_uint_t is the same size as size_t. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11windows/Makefile: Update test dependency on $(PROG).Jim Mussared
PR #9012 (b2e82402688b53829f37475583231b067b9faea7) changed the output to $(BUILD)/$(PROG) but the tests are still looking for $(PROG). Also remove the now-unnecessary override of $(PROG) in the standard variant. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-11drivers/sdcard: Add delay in init_card_v1 to make timeout work.Kyuchumimo
This now follows how init_card_v2 works.
2022-08-11docs/library/rp2: Fix pull_thresh docs to use pull instead of push.Nathan Hendler
2022-08-11docs: Update links for Arm GCC toolchain.David Lechner
The separate A and RM toolchains have been discontinued and replaced by a single toolchain. This updates the links to the RM toolchain to the new toolchain. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-11rp2: Correctly determine path to arm-none-eabi-size.Jacob Siverskog
Figure out path to arm-none-eabi-size the same way it's done for the other binaries, instead of assuming it to be in the user's $PATH. Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2022-08-11rp2: Mark gc_heap NOLOAD for faster boot.Phil Howard
Create a new linker section .unitialized_bss for bss that does not need zero-initialising. Move gc_heap to this section, which saves ~30ms from rising edge of RESET to setting a pin HIGH in MicroPython. Zero fill happens in Pico SDK crt0.S before ROSC is configured. It's very, very slow. Signed-off-by: Phil Howard <phil@gadgetoid.com>
2022-08-11rp2/boards/W5500_EVB_PICO: Add new board definition for W5500_EVB_PICO.omogenot
Signed-off-by: github@mymeterinfo.info
2022-08-11unix/modjni: Add missing const qualifier.David Yang
2022-08-11minimal/Makefile: Avoid terminal reset, use BUILD variable.Daniel Jour
stty can provide the current terminal settings, so that they can be stored in a shell variable and restored after running the firmware. This avoids the complete "blanking" of the terminal, and thus also removes the need for the sleep call. The run target now references the firmware file using the BUILD variable instead of using the hard coded "build/" path.
2022-08-11py/nlrpowerpc: Fix generation of ppc64 code on ppc32 build.Efi Weiss
Due to inline assembly, wrong instructions were generated. Use corresponding 32 bit instructions and fix the offsets used. Signed-off-by: Efi Weiss <efiwiss@gmail.com>
2022-08-11py/dynruntime.mk: Allow building assembly source in natmods.Mat Booth
Allow inclusion of assembly source files in dynamic native modules.
2022-08-11unix/variants: Remove variant suffix from executable filename.Damien George
The executable now lives in the build directory, and since the build directory already contains the variant name there is no need to also add it to the executable. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11tests/run-tests.py: Provide better default MPYCROSS value for Windows.Daniel Jour
2022-08-11tools/ci.sh: Force mpy-cross build for samd and teensy.Daniel Jour
2022-08-11all: Fix paths to mpy-cross and micropython binaries.Daniel Jour
Binaries built using the Make build system now no longer appear in the working directory of the build, but rather in the build directory. Thus some paths had to be adjusted.
2022-08-11py/mkrules.mk: Keep all build artefacts inside $(BUILD) directory.Daniel Jour
The rules for lib (static library with name $(LIBMICROPYTHON)) and the default rule to build a binary (name $(PROG)) produced outputs in the current working directory. Change this to build these files in the build directory. Note: An empty BUILD variable can cause issues (references to the root directory); this is not addressed by this commit due to multiple other places having the same issue.
2022-08-10javascript/Makefile: Remove obsolete disable of array-bounds warning.Damien George
This was fixed in bb70874111dbb246624a68c013e8f1c3245ca0d8 Signed-off-by: Damien George <damien@micropython.org>
2022-08-10py/objstr: Reformat str access macros to make them readable.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-08-10py/mpprint: Fix formatting typo with mp_print_ext_t struct name.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-08-10rp2/machine_spi: Add mp_hal_get_spi_obj helper function.Damien George
And remove the now-obsolete spi_from_mp_obj() function. Signed-off-by: Damien George <damien@micropython.org>
2022-08-10extmod/network_wiznet5k: Extract SPI transfer function dynamically.Damien George
Instead of using the fixed machine_spi_type entity to get the SPI transfer function, this transfer function is now extracted dynamically from the type of the SPI object. This allows the SPI object used to communicate with the WIZNET5K hardware to be SoftSPI or hardware SPI, or anything that has the SPI protocol (at the C level). Signed-off-by: Damien George <damien@micropython.org>
2022-08-09extmod/network_wiznet5k: Rearrange the function wiznet5k_poll().robert-hh
To have just one exit and a more compact flag test. This is just a style change without impact to the functionality.
2022-08-09extmod/network_wiznet5k: Schedule clearing of interrupt flags.robert-hh
Avoiding conflicts between the IRQ and an active transfers. Before this change the device could lock up in heavy traffic situations. Fix found and code supplied by @omogenot.
2022-08-09extmod/network_wiznet5k: Deinit the NIC before (re-)initialisation.robert-hh
If nic.active(True) is called several times in a row, the device may lock up. Even if that is bad coding practice, calling wiznet5k_deinit() in wiznet5k_init() prevents the lock.
2022-08-09extmod/network_wiznet5k: Drop obsolete argument count check.robert-hh
Drop an obsolete and wrong argument check, which prevented specifying a pin for the interrupt signal. The proper checks are now done further down in the code.
2022-08-09extmod/network_wiznet5k: Register NIC when the lwIP stack is used.robert-hh
That was missing, and network.route() returned an empty list.
2022-08-08mpy-cross/Makefile: Respect existing CFLAGS and LDFLAGS.David Yang
2022-08-08stm32/boards/NUCLEO_WB55: Add error handling to firmware update scripts.Andrew Leech
In-the-field use of these FUS/WS firmware update scripts has exposed some weak points, causing corrupted FUS/WS firmware to be flashed to the unit. The problems are mostly caused with the ST GUI application, but sometimes from un-recognised failures during bin file transfer to the WB55 prior to running the rfcore_firmware.py script. Other failures were caused by incorrect load addresses being used, again both from user error copying the address from the HTML release notes to the GUI tool, but also from similarly not updating the address correctly in rfcore_firmware.py To guard against these errors and make it easier to prepare different versions, this commit adds a few features to the rfcore firmware update tools: - When creating the bin file, automatically parse the release note in the folder to get the correct address. - Add a footer to the bin file containing the name, version, CRC, address etc. - Before flashing rfcore, check if the same version is already installed. - Verify the CRC and obfuscation key before flashing bin. - Log the name and version of file being flashed.
2022-08-06py/runtime: Fix crash in star arg unpacking.David Lechner
The reallocation trigger for unpacking star args with unknown length did not take into account the number of fixed args remaining. So it was possible that the unpacked iterators could take up exactly the memory allocated then nothing would be left for fixed args after the star args. This causes a segfault crash. This is fixed by taking into account the remaining number of fixed args in the check to decide whether to realloc yet or not. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-06extmod/network_cyw43: Add hostname config option.iabdalkader
2022-08-06drivers/cyw43: Allow configuring the netif/mDNS hostname.iabdalkader
Allow boards to configure/override the default hostname used for netif and mDNS.
2022-08-06extmod/modussl_mbedtls: Set a more sensible default debug log level.Ian Davies
2022-08-06extmod/ntptime: Factor out ntptime module from esp8266 port.Ian Davies
The ntptime module was previously only included in the ESP8266 port. This commit factors that module out into the extmod directory, makes it support different epochs, and includes it in the rp2 port.
2022-08-06rp2/mbedtls: Enable certificate validity time validation.Ian Davies
2022-08-06stm32/boards/LEGO_HUB_NO7: Add LEGO Hub No. 7 board definition.David Lechner
This adds support for the LEGO Hub No. 7, aka LEGO Technic Small hub, aka LEGO SPIKE Essential hub. This board is largely similar to Hub No. 6: - Same MCU (STM32F413 - different packaging with fewer pins). - Same Bluetooth chip (TI CC2564). - Same IMU chip. - Similar external flash chip - 4MiB instead of 32MiB. - 2 I/O ports instead of 6. - No display - only status and battery LEDs. - Different LED driver chip. - Only 1 button which is also the power button. - No speaker. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-06stm32/boards/LEGO_HUB_NO6/cc2564: Make timer configurable.David Lechner
This adds configurable macros to define the timer and channel used to provide the Bluetooth 32768 MHz clock. This will allow code to be shared with LEGO_HUB_NO7. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-06stm32/boards/LEGO_HUB_NO6/spiflash: Pick command type at runtime.David Lechner
This changes spiflash.py to read the flash chip ID at runtime to select the read/write/erase commands. This will allow the code to be shared with LEGO_HUB_NO7 which doesn't use the 32-bit commands. Also remove an unused constant while we are touching this. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-06stm32/boards/LEGO_HUB_NO6/appupdate: Detect filesystem size at runtime.David Lechner
This changes appupdate.py to get the filesystem size at runtime. This will allow the code to be shared with LEGO_HUB_NO7 which has a similar flash chip with a different size. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-05stm32/boards/LEGO_HUB_NO6: Use named pins.David Lechner
This changes all uses of pins to use the alias names of the pins. This makes the code easier to understand and will also allow sharing more code with LEGO_HUB_NO7. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-05stm32/boards/LEGO_HUB_NO6: Fix typo in README.David Lechner
This fixes a typo in the build directory path. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-03py/mkenv.mk: Use micropython-lib from submodule by default.Jim Mussared
Also adds micropython-lib to 'make submodules' when using a frozen manifest (for make and cmake). Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-03tools/ci.sh: Initialise submodules for more ports.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-03esp32/Makefile: Force micropython-lib as a required submodule.Jim Mussared
Also use mkrules.mk's submodule target rather than duplicating the call to `submodule sync`. Until we can find a way to use idf.py/cmake to discover submodules we have no way to discover optional or board-specific submodules so need to err on the side of including everything. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>