| Age | Commit message (Collapse) | Author |
|
The current code evaluates `pyb.RTC().datetime()` resulting in a remote
side exception, as `pyb` is not defined on most ports (only stm32).
The code should evaluate `machine.RTC().datetime()` and hence return the
current time.
Signed-off-by: rufusclark <50201718+rufusclark@users.noreply.github.com>
Signed-off-by: Damien George <damien@micropython.org>
|
|
It's not necessary to support this, which allows an arbitrary memory
address to be specified and potentially allows invalid memory accesses.
Requiring an object with the buffer protocol is safer, and also means that
the length of the region is always specified.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
This commit implements a small subset of the CPython `marshal` module. It
implements `marshal.dumps()` and `marshal.loads()`, but only supports
(un)marshalling code objects at this stage. The semantics match CPython,
except that the actual marshalled bytes is not compatible with CPython's
marshalled bytes.
The module is enabled at the everything level (only on the unix coverage
build at this stage).
Signed-off-by: Damien George <damien@micropython.org>
|
|
Serialises a bytecode function/generator to a valid .mpy as bytes.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This allows retrieving the code object of a function using
`function.__code__`, and then reconstructing a function from a code object
using `FunctionType(code_object)`.
This feature is controlled by `MICROPY_PY_FUNCTION_ATTRS_CODE` and is
enabled at the full-features level.
Signed-off-by: Damien George <damien@micropython.org>
|
|
The `mp_obj_code_t` and `mp_type_code` code object was defined internally
in both `py/builtinevex.c` and `py/profile.c`, with completely different
implementations (the former very minimal, the latter quite complete).
This commit factors these implementations into a new, separate source file,
and allows the code object to have four different modes, selected at
compile-time:
- MICROPY_PY_BUILTINS_CODE_NONE: code object not included in the build.
- MICROPY_PY_BUILTINS_CODE_MINIMUM: very simple code object that just holds
a reference to the function that it represents. This level is used when
MICROPY_PY_BUILTINS_COMPILE is enabled.
- MICROPY_PY_BUILTINS_CODE_BASIC: simple code object that holds a reference
to the proto-function and its constants.
- MICROPY_PY_BUILTINS_CODE_FULL: almost complete implementation of the code
object. This level is used when MICROPY_PY_SYS_SETTRACE is enabled.
Signed-off-by: Damien George <damien@micropython.org>
|
|
To make it easier to diagnose why CPython crashed.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This commit adds a clarification for the ESPNow module's documentation
regarding its "config" method.
The original documentation for that method could be interpreted as having
all its configuration keys being able to be queried, but the "rate"
configuration key is actually write-only due to ESP-IDF's lack of a way to
retrieve that bit of information from the radio's configuration. The
documentation changes highlight the fact that said configuration key is
actually write-only.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
Also add some additional context links, suggestions for alternative
classes, etc.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Also add the default values of these macros to the respective
`mpconfigport.h` files, to improve discoverability.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Also cross-link with the other WIZNET5K driver, to avoid confusion.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
The `rp2` package use a global dict `_pio_funcs` to populate a namespace
for `@asm_pio` functions to be executed in. That dict is not cleaned up
after use, keeping references to bound methods of a `PIOASMEmit`. By not
setting/clearing all the functions, `asm_pio_encode` unintentionally allows
the use of the old directives (harmless) as well as `jmp` (in general,
produces the wrong output).
Fix that by making sure `_pio_funcs` is returned to its original state
after using it:
- For `@asm_pio` update the target dict from `_pio_funcs` and then set
additional functions as needed, leaving `_pio_funcs` unchanged.
- For `asm_pio_encode`, borrow `_pio_funcs` to use as globals (avoiding a
bunch of memory alloc/free) but delete the instruction entries after use.
Signed-off-by: Neil Ludban <neil.ludban@gmail.com>
|
|
Add support for `mpremote mip install package.json` where `package.json` is
a json file on the local filesystem.
Without this, package json files can only be loaded from http, https,
github or gitlab URLs.
This is useful for testing `package.json` files for pacages in development
and for constructing one's own `package.json` files for Python packages
which are not yet available for installation using mip.
Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
|
|
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
Reduced to 16KBs to allow enabling MSC.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
Add MSC support using internal flash storage or SD card.
Note this is disabled by default, and can be enabled by boards if needed.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
The flash clock frequency may have been set to a different value by a
bootloader. Set the frequency according to the configured value. Use a
table of pre-calculated dividers to get the closest value for the flash
frequency, achieving for MIMXRT10xx:
30 -> 30.85 MHz
50 -> 49.65 MHz
60 -> 60 MHz
75 -> 75.13 MHz
80 -> 80 MHz
100 -> 99.31 Mhz
133 -> 132.92 MHz
166 -> 166.15 MHz
for MIMXRT1176:
30 -> 31 MHz
50 -> 52.8 MJz
60 -> 58.7 MHz
75 -> 75.4 MHz
80 -> 75.4 MHz
100 -> 105.6 MHz
133 -> 132 MHz
166 -> 176 MHz
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
And use these to initialize the LUT table properly for the various flash
types. The different flash types differ by 3 parameters. Thus it is
easier to just keep one copy of the qspiflash_config structure with the LUT
table and update it during flash initialisation as needed.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
This change stopped problems with USB IRQ happening during flash writes.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Changes:
- Change the LUT table ordering to be similar to the order of the
UF2-Bootloader and fsl_romapi.h.
- Rewrite the LUT entry for PAGEPROGRAM_QUAD and update the LUT. That
enabled QUAD program again.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Allowing to use e.g. the Adafruit bootloaders with MicroPython. The .uf2
file is created in addition to the .bin and .hex files allowing to use the
latter ones without the bootloader for debugging and testing.
Changes:
- Set the location of the ISR Vector and .text segment to 0x6000C000 and
0x6000C400.
- Reserve an area at the start of ITCM for a copy of the interrupt vector
table and copy the table on reset to this place.
- Extend `machine.bootloader()` by setting the magic number to enable the
bootloader on reset.
- Create a .uf2 file which skips the segments below 0x6000C000.
The bootloader has to be installed as a preparation step using the board
specific methods, but then the firmware's .uf2 file version can be
installed using the bootloader. The bootloader can be invoked with:
- double reset
- calling machine.bootloader()
- Using the touch1200 method
Double reset is hard to achieve on MIMXRT boards, since there is no clean
reset pin. Some MIMXRT boards provide it by switching the power.
Some boards are excluded from the .uf2 build:
- MIMXRT1050_EVK: The uf2 bootloader is built for the QSPI version of the
board. MicroPython supports the Hyperflash version.
- MIMXRT1176_EVK: No support for this board yet, but it should be possible.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
|
|
Side-setting can also be used to change pin directions instead of pin
values. This adds a parameter `side_pindir` to decorator `asm_pio()` to
configure it.
Also replaces a few close-by 0s with corresponding PIO.* constants.
Addresses issue #10027.
Signed-off-by: Markus Gyger <markus@gyger.org>
|
|
Signed-off-by: StrayCat <marcin.eu@gmail.com>
|
|
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
In more recent SDKs, this feature is actually disabled for the MIMXRT1062.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
|
|
The table shows the devices available at the pin and the respective package
letter.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Only pins accessible at the board are shown.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Tested with that board.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Supporting a variant with an optional SPIFLASH device as well. Tested both
variants with a QT Py board.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
Tested with a Adafruit SAMD QT board, which may optionally be equipped with
SPIFLASH memory.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD51J20 device as well, only that fewer pins are accessible.
Tested with a SAMD51J20 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD51G19 and SAMD51J19 devices as well, only that fewer pins
are accessible.
Tested with a SAMD51G19 and SAMD51J9 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD21G18 and SAMD21E18 devices as well, only that fewer pins
are accessible.
Tested with a SAMD21E18, SAM21G18 and SAMD21J18 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
|
|
This commit fixes two Xtensa sequences in order to terminate early when
loading and storing word values via an immediate index.
This was meant to be part of 55ca3fd67512555707304c6b68b836eb89f09d1c
but whilst it was part of the code being tested, it didn't end up in the
commit.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit marks as const the condition code tables used when figuring
out which opcode sequence must be emitted depending on the requested
comparison type.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit adds the natmod tests for the MPS2_AN385 board running
inside QEMU to the CI pipeline. Now natmod tests capabilities are equal
between the Arm and RV32 platforms for the QEMU port.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit fixes the command used to run natmod tests, as it relied on
a string interpolation feature of the POSIX shell that was not working
as expected inside a makefile.
The interpolation was not performed from inside the makefile and the raw
command string was sent to the operating system for execution. Now the
command is run by using a different type of string substitution, which
explicitly performs the interpolation using a POSIX shell for-loop.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
This commit lets the natmod tests runner to automatically detect the
architecture of the test target. This allows to avoid to explicitly
pass the architecture name to the runner in test scripts.
However, the ability to manually specify a target was not removed but it
was made optional. This way the user is able to override the
architecture name if needed (like if one wants to test an armv6 MPY on
an armv7 board).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
When a port automatically compiles `mpy-cross`, if `USER_C_MODULES` is
provided by the user on the command line then it is also applied to the
`mpy-cross` build. That can lead to build errors if the path is relative
and not found when building `mpy-cross`.
Fix that by explicitly resetting `USER_C_MODULES` when invoking the
`mpy-cross` build.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
|
|
Signed-off-by: eggfly <lihaohua90@gmail.com>
|
|
Not needed due to parent commit.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
Also permits channel option to be used for STA_IF interface. This
provides compatibility with esp32 code, especially for espnow users.
Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
|
|
Prior to this fix, `WLAN.config('channel')` would return an incorrect
channel for AP_IF if STA has connected to an external AP running on a
different channel.
The esp8266 now has the same behaviour as for esp32 per commit
98d1c50159fe9427d72ec358ba0219eaebb1d991.
Fixes issue #11463.
Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
|
|
With regression test.
See upstream bug https://github.com/raspberrypi/pico-sdk/issues/2201
Tested-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Mike Bell <mdb036@gmail.com>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
The problem was introduced in d1423ef7a23793de3777e84d985f9902241e788e,
calling `machine.lightsleep()` overwrites RP2xxx registers `SLEEP_EN0` and
`SLEEP_EN1` with their power on default values.
Prior to that commit the register values were saved on entry to lightsleep
and restored before returning.
These changes restores the earlier behavior.
Fixes issue #16502.
Signed-off-by: Carl Pottle <cpottle9@outlook.com>
|