summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-06zephyr: Update to Zephyr v2.6.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@nxp.com>
2021-06-06zephyr: Disable CONFIG_NET_SOCKETS_POSIX_NAMES.Maureen Helm
Zephyr's default value for CONFIG_NET_SOCKETS_POSIX_NAMES was changed from false to true between Zephyr v2.5.0 and v2.6.0. This caused conflicts in MicroPython, which uses the zsock_ prefixed functions, so disable it. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06zephyr: Update disk access configuration for Zephyr v2.6.0.Maureen Helm
Zephyr's Kconfig symbols and defaults for SDHC/SDMMC disk drivers and the disk access subsystem were reworked between Zephyr v2.5.0 and v2.6.0. Update MicroPython accordingly. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-05github/workflows: Add workflow to build and run unix port on ARM.Damien George
Following on from ef16834887de02cbddf414b560e5a2af9cae4b16, this adds a coverage build and running of the test suite on an ARM 32-bit Linux-based architecture. Signed-off-by: Damien George <damien@micropython.org>
2021-06-05unix/main: Increase stack limit on ARM architectures.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-05py/stackctrl: Prevent unused-var warning when stack checking disabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-05py/emitglue: Always flush caches when assigning native ARM code.Damien George
Prior to this commit, cache flushing for ARM native code was done only in the assembler code asm_thumb_end_pass()/asm_arm_end_pass(), at the last pass of the assembler. But this misses flushing the cache when loading native code from an .mpy file, ie in persistentcode.c. The change here makes sure the cache is always flushed/cleaned/invalidated when assigning native code on ARM architectures. This problem was found running tests/micropython/import_mpy_native_gc.py on the mimxrt port. Signed-off-by: Damien George <damien@micropython.org>
2021-06-04esp32/Makefile: Fix wrong target for partition-table.bin.leo chung
"$(BUILD)/partition_table/partition -table.bin" is typing mistake. Signed-off-by: leo chung <gewalalb@gmail.com>
2021-06-04mimxrt/boards: Add board configuration files for Teensy 4.1.robert-hh
These are at the moment more or less identical to the Teensy 4.0 files, except for the pins.csv file and the flash size.
2021-06-04mimxrt/machine_adc: Add the ADC class to the machine module.Philipp Ebensberger
This adds the machine.ADC class with the read_u16() method. make-pins.py and supporting files are updated to generate ADC information.
2021-06-04mimxrt: Enable many Python and some extmod features.robert-hh
Besides Python features this includes the extmod modules which make use of the Pin module, especially machine.softSPI, machine.SoftI2C and onewire.
2021-06-04mimxrt: Add floating point support.robert-hh
Since not all boards support double fp, all board specific .mk files are affected too.
2021-06-03mimxrt/machine_rtc: Add the RTC class to the machine module.robert-hh
Initial version, using the LP RTC clock. It provides setting the date and time with rtc.init() or rtc.datetime(), and reading the date and time with rtc.datetime() or rtc.now(). The method weekday() reports the weekday of the current date. It starts with 0 for Monday. The tuple order for datetime() and now() matches the CPython sequence: (year, month, day, hour, minute, second, microsecond, TZ). TZ is ignored and reported as None. Microsecond is provided at a best effort. If a battery is not supplied, the default boot date/time is 1970/1/1 0:0:0. With a battery, the clock continues to run even when the board is not powered. The clock is quite precise. If not, using rtc.calibration() may help.
2021-06-03mimxrt/machine_timer: Leave the Timer clock source at IPG clock.robert-hh
Setting it to OSC_CLK interferes the utime module's functionality. This is still an area demanding an understanding.
2021-06-03mimxrt/machine_timer: Reuse any existing timer objects.robert-hh
So there is a 1-1 mapping of hardware timer to Python object.
2021-06-03mimxrt: Remove __WFE() from MICROPY_EVENT_POLL_HOOK.robert-hh
The device is unreliable with the WFE included. This needs further investigation.
2021-06-02mimxrt: Add the Timer class to the machine module.robert-hh
It supports three hardware timer channels based on the PIT timers of the MIMXRT MCU. The timer id's are 0, 1 and 2. On soft reboot all active timers will be stopped via finalisers.
2021-06-02tools/ci.sh: Build mpy-cross as part of ci_mimxrt_build.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-06-01mimxrt/boards/TEENSY40: Re-create the flash FS after deploy.robert-hh
This is required since the Teensy Halfkay loader attempts to erase all of the flash but fails to do so, at least in my tests. Formatting brings it back to a known state.
2021-06-01mimxrt: Add flash storage support with VFS and littlefs filesystem.robert-hh
This commit adds full support for a filesystem on all boards, with a block device object mimxrt.Flash() and uos.VfsLfs2 enabled. Main changes are: - Refactoring of linker scripts to accomodate reserved area for VFS. VFS will take up most of the available flash. 1M is reserved for code. 9K is reserved for flash configuration, interrupts, etc. - Addition of _boot.py with filesystem init code, called from main.c. - Definition of the mimxrt module with a Flash class in modmimxrt.[ch]. - Implementation of a flash driver class in mimxrt_flash.c. All flashing related functions are stored in ITCM RAM. - Addition of the uos module with filesystem functions. - Implementation of uos.urandom() for the sake of completeness of the uos module. It uses sample code from CircuitPython supplied under MIT license, which uses the NXP SDK example code. Done in collaboration with Philipp Ebensberger aka @alphaFred who contributed the essential part to enable writing to flash while code is executing, among other things.
2021-06-01mimxrt: Enable frozen modules.robert-hh
2021-06-01mimxrt: Add custom help text and enable help("modules").robert-hh
2021-05-30esp32/espneopixel: Add support for GPIO32 and GPIO33.Joseph Chiu
Adds support for NeoPixels on GPIO32 and GPIO33 on ESP32. Otherwise, NeoPixels wired to GPIO32/33 wll silently fail without any hints to the user. With thanks to @robert-hh. Fixes issue #7221.
2021-05-30esp32/boards: Add M5STACK_ATOM board definition.IAMLIUBO
ATOM is a very small ESP32 development board produced by M5Stack, with a size of 24mm * 24mm, with peripherals such as WS2812, IR, button, MPU6886 (Only Matrix), and 8 GPIO extensions. It also has a plastic shell.
2021-05-30docs/rp2: Add skeleton docs for the rp2 port.Matt Trentini
2021-05-30py/builtinimport: Change relative import's ValueError to ImportError.Damien George
Following CPython change, see https://bugs.python.org/issue37444. Signed-off-by: Damien George <damien@micropython.org>
2021-05-30extmod/modurandom: Support an argument of bits=0 to getrandbits.Damien George
This was changed in CPython 3.9; see https://bugs.python.org/issue40282. Signed-off-by: Damien George <damien@micropython.org>
2021-05-30extmod/modurandom: Add error message when getrandbits has bad value.Macarthur Inbody
The random module's getrandbits() method didn't give a proper error message when calling it with a value that was outside of the range of 1-32, which can lead to confusion using this function (which under CPython can accept numbers larger than 32). Now instead of simply giving a ValueError it gives an error message that states that the number of bits is constrained. Also, since the random module's functions getrandbits() and randint() differ from CPython, tests have been added to describe these differences. For getrandbits the relevant documentation is shown and added to the docs. The same is given for randint method so that the information is more easily found. Finally, since the int object lacks the bit_length() method there is a test for that method also to include within the docs, showing the difference to CPython.
2021-05-30tests/basics: Split out literal tests that raise SyntaxWarning on CPy.Damien George
Fixes issue #7330. Signed-off-by: Damien George <damien@micropython.org>
2021-05-30tests/extmod/btree_gc.py: Close the database to avoid a memory leak.Jeff Epler
Signed-off-by: Jeff Epler <jepler@gmail.com>
2021-05-30py/repl: Don't read past the end of import_str.Jeff Epler
asan considers that memcmp(p, q, N) is permitted to access N bytes at each of p and q, even for values of p and q that have a difference earlier. Accessing additional values is frequently done in practice, reading 4 or more bytes from each input at a time for efficiency, so when completing "non_exist<TAB>" in the repl, this causes a diagnostic: ==16938==ERROR: AddressSanitizer: global-buffer-overflow on address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff READ of size 9 at 0x555555cd8dc8 thread T0 #0 0x7ffff726457a (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a) #1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301 #2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re #3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513 #4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni #5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/ #6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m #7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308 #8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni 0x555555cd8dc8 is located 0 bytes to the right of global variable 'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of size 8 'import_str' is ascii string 'import ' Signed-off-by: Jeff Epler <jepler@gmail.com>
2021-05-30py/gc: Access the list of root pointers in an asan-compatible way.Jeff Epler
Signed-off-by: Jeff Epler <jepler@gmail.com>
2021-05-30py/compile: Raise an error on async with/for outside an async function.Jeff Epler
A simple reproducer is: async for x in (): x Before this change, it would cause an assertion error in mpy-cross and micropython-coverage.
2021-05-29tools/mpremote: Add new CLI utility to interact with remote device.Damien George
This has been under development since April 2017. See #3034 and #6375. Signed-off-by: Damien George <damien@micropython.org>
2021-05-29tools/pyboard.py: Add "soft_reset" option to Pyboard.enter_raw_repl().Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-29tools/pyboard.py: Track raw REPL state via in_raw_repl variable.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-28esp8266,esp32: Update manifest to point to new dirs in micropython-lib.Damien George
Following a refactoring of micropython-lib. Signed-off-by: Damien George <damien@micropython.org>
2021-05-27stm32/boards/PYBD_SF2: Disable GCC 11 warnings for array bounds.Damien George
With GCC 11 there is now a warning about array bounds of OTP-mac, due to the OTP being a literal address. Signed-off-by: Damien George <damien@micropython.org>
2021-05-27stm32/boards/NUCLEO_L432KC: Fix FS size and enable LFS1 filesystem.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26extmod/moduhashlib: Put hash obj in final state after digest is called.Damien George
If digest is called then the hash object is put in a "final" state and calling update() or digest() again will raise a ValueError (instead of silently producing the wrong result). See issue #4119. Signed-off-by: Damien George <damien@micropython.org>
2021-05-26esp8266/boards/GENERIC_512K: Add custom manifest without FS modules.Damien George
The 512k build does not have a filesystem so there is no reason to include the filesystem-related modules. This commit provides a custom manifest.py for this board which no longer includes: _boot.py, flashbdev.py, inisetup.py, upip.py, upip_utarfile.py. This cuts the build down by about 9k of flash. Signed-off-by: Damien George <damien@micropython.org>
2021-05-26github/workflows: Add workflow to build and run unix port on MIPS.Damien George
This adds a coverage build and running of the test suite on a MIPS 32-bit big endian architecture. It uses the feature of qemu to execute foreign code as though it were native to the system (using qemu user mode). The code compiled for MIPS will run under the qemu VM, but all syscalls made by this code go to the host (Linux) system. See related #7268 and #7273. Signed-off-by: Damien George <damien@micropython.org>
2021-05-26tests: Make float and framebuf tests skip or run on big-endian archs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26tools/ci.sh: Build Cortex-A9 sabrelite board as part of qemu-arm CI.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26qemu-arm: Add support for Cortex-A9 via sabrelite board.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26tools/tinytest-codegen.py: Add command-line option to exclude tests.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26tools/mpy-tool.py: Support relocating ARMv6 arch.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26py/asmarm: Use builtin func to flush I- and D-cache on ARM 7 archs.Damien George
The inline assembler code does not work for __ARM_ARCH == 7. Signed-off-by: Damien George <damien@micropython.org>
2021-05-25mimxrt: Extend the Pin module for SoftI2C, SoftSPI support.robert-hh
This change consists mostly of changing and extending the required definitions in mphalport.h.
2021-05-26github/workflows: Add CI workflow for mimxrt port.Philipp Ebensberger