aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-06-26travis: Build mboot for PYBV10 with LFS2 enabled in stm32 job.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-26stm32/mboot: Update README to describe WB and littlefs support.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-26stm32/mboot: Add support for littlefs.Damien George
Mboot now supports FAT, LFS1 and LFS2 filesystems, to load firmware from. The filesystem needed by the board must be explicitly enabled by the configuration variables MBOOT_VFS_FAT, MBOOT_VFS_LFS1 and MBOOT_VFS_LFS2. Boards that previously used FAT implicitly (with MBOOT_FSLOAD enabled) must now add the following config to mpconfigboard.h: #define MBOOT_VFS_FAT (1) Signed-off-by: Damien George <damien@micropython.org>
2020-06-26stm32/mboot: Decouple stream, filesystem and top-level loading code.Damien George
This commit factors the code for files and streaming to separate source files (vfs_fat.c and gzstream.c respectively) and introduces an abstract gzstream interface to make it easier to plug in different filesystems. Signed-off-by: Damien George <damien@micropython.org>
2020-06-26stm32/mboot: Don't search for firmware on FS, just attempt to open it.Damien George
There's no need to do a directory listing to search for the given firmware filename, it just takes extra time and code size. Instead this commit changes it so that the requested firmware file is opened immediately and will abort if the file couldn't be opened. This also allows to specify files in a directory. Signed-off-by: Damien George <damien@micropython.org>
2020-06-25stm32/boards: Enable LFS2 on PYBD_SF3 and PYBD_SF6.Damien George
This was missed in commit 120368ba1ab444b2f1c17d1eb69bc6f09072ec5d Signed-off-by: Damien George <damien@micropython.org>
2020-06-25stm32/timer: Support TIM1 on WB MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-25stm32/mpconfigport.h: Enable PY_IO_FILEIO when any VFS is enabled.Damien George
Previously, if FAT was not enabled but LFS1/2 was then MICROPY_PY_IO_FILEIO would be disabled and file binary-mode was not supported. Signed-off-by: Damien George <damien@micropython.org>
2020-06-25extmod/vfs_lfs: Fix littlefs bindings to build in nan-box mode.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-24tools/makemanifest.py: Support freezing a subdirectory recursively.Damien George
This adds support for freezing an entire directory while keeping the directory as part of the import path. For example freeze("path/to/library", "module") will recursively freeze all scripts in "path/to/library/module" and have them importable as "from module import ...". Signed-off-by: Damien George <damien@micropython.org>
2020-06-24py/objtype: Support passing in an OrderedDict to type() as the locals.Damien George
An OrderedDict can now be used for the locals when creating a type explicitly via type(name, bases, locals). Signed-off-by: Damien George <damien@micropython.org>
2020-06-24extmod/moductypes: Use mp_obj_is_dict_or_ordereddict to simplify code.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-24py/obj.h: Add public mp_obj_is_dict_or_ordereddict() helper macro.Damien George
And use it in py/objdict.c instead of mp_obj_is_dict_type. Signed-off-by: Damien George <damien@micropython.org>
2020-06-23stm32/mboot: Use additional CFLAGS to compile string0.c.Damien George
This is the same as a902b69dd51de0e3fe3bb6955296591d6a93abab but applied to mboot's Makefile. Signed-off-by: Damien George <damien@micropython.org>
2020-06-23stm32/mboot: Set VTOR on start up to ensure it has the correct value.Damien George
Commit 8675858465f3d83aab709170eab6dc141570acf4 switched to using the CMSIS provided SystemInit function which sets VTOR to 0x00000000 (previously it was 0x08000000). A VTOR of 0x00000000 will be correct on some MCUs but not on others where the built-in bootloader is remapped to this address, via __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH(). To make sure mboot has the correct vector table, this commit explicitly sets VTOR to the correct value of 0x08000000. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22travis: In stm32 job, build mboot for NUCLEO_WB55.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/boards: Add build-time option for NUCLEO_WB55 to use mboot.Damien George
As an example of how to use mboot on a WB series MCU. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/mboot: Add support for using mboot with WB MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/mboot: Use CMSIS system source code for SystemInit function.Damien George
There's no need to duplicate this functionality in mboot, the code provided in stm32lib/CMSIS does the same thing and makes it easier to support other MCU series. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/mboot: Use flash routines from main stm32 code rather than custom.Damien George
The flash functions in ports/stm32/flash.c are almost identical to those in ports/stm32/mboot/main.c, so remove the duplicated code in mboot and use instead the main stm32 code. This also allows supporting other MCU series. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/flash: Add flash_is_valid_addr, and extend sectors for 2MB F7.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/i2cslave: Add support for WB MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/flash: Make flash C-API reusable, and funcs return an error code.Damien George
This commit makes the low-level flash C functions usable by code other than flashbdev.c (eg by mboot). Changes in this commit are: - flash_erase() and flash_write() now return an errno error code, a negative value on error. - flash_erase() now automatically locks the flash, as well as unlocking it. - flash_write() now automatically unlocks the flash, as well as locking it. - flashbdev.c is modified for the above changes. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/powerctrlboot: Include irq.h to get definitions of IRQ priorities.Damien George
irq.h is included by py/mphal.h but it's better to be explicit, eg if mboot uses powerctrlboot.c. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22stm32/irq: Clean up irq.h so it does not depend on core uPy defines.Damien George
The irq.h file now just provides low-level IRQ definitions and priorities. All Python binding definitions are moved to modmachine.h, with some renaming of pyb -> machine, and also the machine_idle definition (was pyb_wfi) is moved to modmachine.c. The cc3200 and teensy ports are updated to build with these changes. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22travis: Build qemu-arm with MP_ENDIANNESS_BIG=1 to test bigendian build.Damien George
Eventually it would be good to run the full test suite on a big-endian system, but for now this will help to catch build errors with the big-endian configuration. Signed-off-by: Damien George <damien@micropython.org>
2020-06-22qemu-arm/Makefile: Add CFLAGS_EXTRA to CFLAGS.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-22py/misc.h: Add missing semi-colon in mp_float_union_t for big-endian.Damien George
Fixes issue #6161. Signed-off-by: Damien George <damien@micropython.org>
2020-06-19esp32/esp32_rmt: Call rmt_driver_install before rmt_config.Jonathan Hogg
Otherwise the RMT will repeat pulses when using loop(True). This repeating is due to a bug in the IDF which will be fixed in an upcoming release, but for now the accepted workaround is to swap these calls, which should still work in the fixed version of the IDF. Fixes issue #6167.
2020-06-19tools/uncrustify: Enable more opts to remove space between func and '('.David Lechner
With only `sp_func_proto_paren = remove` set there are some cases where uncrustify misses removing a space between the function name and the opening '('. This sets all of the related options to `force` as well.
2020-06-18tools/codeformat.py: Include extmod/{btstack,nimble} in code formatting.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-18stm32/boards/NUCLEO_WB55: Add more CPU pins and aliases to SW1/2/3.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-18github: Add FUNDING.yml file pointing to micropython GitHub sponsorship.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-17travis: Change nrf pca10056 board to build with soft-device enabled.Damien George
To test building with SD which enables a lot of additional code. Signed-off-by: Damien George <damien@micropython.org>
2020-06-17nrf/bluetooth: Use MP_ERROR_TEXT for all error messages.Glenn Ruben Bakke
This follows up on commit def76fe4d9bbc2c342594dc05861b24d7165d274. Fixes issue #6152.
2020-06-17stm32/rfcore: Leave txpower level as default when initialising rfcore.Damien George
And provide a convenient API function to change it (currently unused). Fixes issue #5985. Signed-off-by: Damien George <damien@micropython.org>
2020-06-17stm32/usb: Add support for 2xVCP on L0, L432 and WB MCUs.Damien George
There are a maximum of 8 USB endpoints and each has 2 buffer slots (in/out). This commit add support for up to 8 endpoints and adds FIFO configuration for USB profiles with 2xVCP on MCUs that have device-only USB peripherals. Tested on NUCLEO_WB55 in 2xVCP, 2xVCP+MSC and 2xVCP+MSC+HID mode. Signed-off-by: Damien George <damien@micropython.org>
2020-06-17stm32/factoryreset: Provide empty create-FS function when FAT disabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-06-17esp32/esp32_rmt: Extend RMT to support carrier feature.Jon Rob
The ESP32 RMT peripheral has hardware support for a carrier frequency, and this commit exposes it to Python with the keyword arguments carrier_freq and carrier_duty_percent in the constructor. Example usage: r = esp32.RMT(0, pin=Pin(2), clock_div=80, carrier_freq=38000, carrier_duty_percent=50)
2020-06-16tests/basics: Add tests for variable annotations.Damien George
2020-06-16py/compile: Implement PEP 526, syntax for variable annotations.Damien George
This addition to the grammar was introduced in Python 3.6. It allows annotating the type of a varilable, like: x: int = 123 s: str The implementation in this commit is quite simple and just ignores the annotation (the int and str bits above). The reason to implement this is to allow Python 3.6+ code that uses this feature to compile under MicroPython without change, and for users to use type checkers. In the future viper could use this syntax as a way to give types to variables, which is currently done in a bit of an ad-hoc way, eg x = int(123). And this syntax could potentially be used in the inline assembler to define labels in an way that's easier to read.
2020-06-16py/grammar.h: Consolidate duplicate sub-rules for :test and =test.Damien George
2020-06-16tests/cpydiff: Add CPy diff test for assignment expression behaviour.Damien George
2020-06-16tests/basics: Add tests for assignment operator :=.Damien George
2020-06-16ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports.Damien George
To keep these ports as minimal as possible.
2020-06-16py/compile: Implement PEP 572, assignment expressions with := operator.Damien George
The syntax matches CPython and the semantics are equivalent except that, unlike CPython, MicroPython allows using := to assign to comprehension iteration variables, because disallowing this would take a lot of code to check for it. The new compile-time option MICROPY_PY_ASSIGN_EXPR selects this feature and is enabled by default, following MICROPY_PY_ASYNC_AWAIT.
2020-06-16py/compile: Convert scope test to SCOPE_IS_COMP_LIKE macro.Damien George
This macro can be used elsewhere.
2020-06-14tools/uncrustify: Update config for v0.71.0.David Lechner
This is the result of running... uncrustify -c tools/uncrustify.cfg --update-config-with-doc -o tools/uncrustify.cfg ...with some manual fixups to correct places where it changed things it should not have. Essentially it just adds new config parameters introduced in v0.71.0 with their default values. Signed-off-by: David Lechner <david@pybricks.com>
2020-06-14tools/codeformat.py: Remove sizeof fixup.David Lechner
Formatting for `* sizeof` was fixed in uncrustify v0.71, so we no longer need the fixups for it. Also, there was one file where the updated uncrustify caught a problem that the regex didn't pick up, which is updated in this commit. Signed-off-by: David Lechner <david@pybricks.com>
2020-06-14tools/uncrustify.cfg: Remove deprecated sp_word_brace option.David Lechner
This option was removed in uncrustify v0.71. Signed-off-by: David Lechner <david@pybricks.com>