-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge MicroPython V1.14 #4280
Merge MicroPython V1.14 #4280
Conversation
Signed-off-by: Damien George <damien@micropython.org>
This provides microsecond accuracy. Signed-off-by: Damien George <damien@micropython.org>
It requires mp_hal_time_ns() to be provided by a port. This function allows very accurate absolute timestamps. Enabled on unix, windows, stm32, esp8266 and esp32. Signed-off-by: Damien George <damien@micropython.org>
So it can be enabled without modifying the source. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
DMA2 clock and registers should be left in their current state in the H7 build.
Changes are: - Fix missing IRQ handler when SDMMC2 is used instead of SDMMC1 with H7 MCUs. - Removed outdated H7 series compatibility macros. - Defined common IRQ handler macro for F4 series.
The new functions provide FUS/WS status, version and SYS HCI commands: - stm.rfcore_status() - stm.rfcore_fw_version(fw_id) - stm.rfcore_sys_hci(ogf, ocf, cmd)
This commit adds a script that can be run on-device to install FUS and WS binaries from the filesystem. Instructions for use are provided in the rfcore_firmware.py file. The commit also removes unneeded functionality from the existing rfcore.py debug script (and renames it rfcore_debug.py).
This WS update to 1.9.0.0.4 broke the workaround used in rfcore for OCF_CB_SET_EVENT_MASK2, so fix it to support WS 1.8 and 1.9.
The flash can sometimes be in an already-unlocked state, and attempting to unlock it again will cause an immediate reset. So make _Flash.unlock() check FLASH_CR_LOCK to get the current state. Also fix some magic numbers for FLASH_CR_LOCK AND FLASH_CR_STRT. The machine.reset() could be removed because it no longer crashes now that the flash unlock is fixed. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
When installing WS firmware, the very first GET_STATE can take several seconds to respond (especially with the larger binaries like BLE_stack_full). Allows stm.rfcore_sys_hci to take an optional timeout, defaulting to SYS_ACK_TIMEOUT_MS (which is 250ms). Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
The last argument of TUD_CDC_DESCRIPTOR() is the endpoint size (or wMaxPacketSize), not the CDC RX buffer size (which can be larger than the endpoint size). Signed-off-by: Damien George <damien@micropython.org>
Adding a port number other then 443 to a PyPI URL may be needed if a local server like devpi is used.
This is a generally useful feature and because it's part of the object model it cannot be added at runtime by some loadable Python code, so enable it on the standard unix build.
To align with unix and stm32 ports.
If the device is not connected over USB CDC to a host then all output to the CDC (eg initial boot messages) is written to the CDC TX buffer with wrapping, so that the most recent data is retained when the USB CDC is eventually connected (eg so the REPL banner is displayed upon connection). This commit fixes a bug in this behaviour, which was likely introduced in e4fcd21, where the initial data in the CDC TX buffer is repeated multiple times on first connection of the device to the host. Signed-off-by: Damien George <damien@micropython.org>
The function scope_find_or_add_id used to take a scope_kind_t enum and save it in an uint8_t. Saving an enum in a uint8_t is fine, but everywhere this function is called it is not actually given a scope_kind_t but an anonymous enum instead. Let's give this enum a name and use that as the argument type. This doesn't change the generated code, but is a C type mismatch that unfortunately doesn't show up unless you enable -Wenum-conversion.
mp_emergency_exception_buf_size is signed, so let's make sure we compare it as such.
With a check for reproducible build date. Invocation of the test suite is not needed because it's already run in another job. Signed-off-by: iTitou <moiandme@gmail.com>
Some devices have lower precision than 1ms for time_ns() (eg PYBv1.x has 3.9ms resolution of the RTC) so make the test more lenient for them. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
This fixes machine_pin.c to build against the new pico-sdk coming down the pipeline, whilst still working with the existing version.
In particular it fixes GPIO19 so that it can be used as an output. Signed-off-by: Damien George <damien@micropython.org>
PIO state machines can make a conditional jump on the state of a pin: the `JMP PIN` command. This requires the pin to be configured with `sm_config_set_jmp_pin`, but until now we didn't have a way of doing that in MicroPython. This commit adds a new `jmp_pin=None` argument to `StateMachine`. If it is not `None` then we try to interpret it as a Pin, and pass its value to `sm_config_set_jmp_pin`. Signed-off-by: Tim Radvan <tim@tjvr.org>
This was adapted from the `pio/uart_rx` example from the `pico-examples` repository: https://github.com/raspberrypi/pico-examples/blob/master/pio/uart_rx/uart_rx.pio It demonstrates the `jmp_pin` feature in action. Signed-off-by: Tim Radvan <tim@tjvr.org>
MCUs with device-only USB peripherals (eg L0, WB) do not implement (at least not in the ST HAL) the HAL_PCD_DisconnectCallback event. So if a USB cable is disconnected the USB driver does not deinitialise itself (usbd_cdc_deinit is not called) and the CDC driver can stay in the USBD_CDC_CONNECT_STATE_CONNECTED state. Then if the USB was attached to the REPL, output can become very slow waiting in usbd_cdc_tx_always for 500ms for each character. The disconnect event is not implemented on these MCUs but the suspend event is. And in the situation where the USB cable is disconnected the suspend event is raised because SOF packets are no longer received. The issue of very slow output on these MCUs is fixed in this commit (really worked around) by adding a check in usbd_cdc_tx_always to see if the USB device state is suspended, and, if so, breaking out of the 500ms wait loop. This should also help all MCUs for a real USB suspend. A proper fix for MCUs with device-only USB would be to implement or somehow synthesise the HAL_PCD_DisconnectCallback event. See issue #6672. Signed-off-by: Damien George <damien@micropython.org>
With mboot encrpytion and fsload enabled, the DEBUG build -O0 compiler settings result in mboot no longer fitting in the 32k sector. This commit changes this to -Og which also brings it into line with the regular stm32 build.
Default to just calling python since that is most commonly available: the official installer or zipfiles from python.org, anaconda, nupkg all result in python being available but not python3. In other words: the default used so far is wrong. Note that os.name is 'posix' when running the python version which comes with Cygwin or MSys2 so they are not affected by this. However of all possible ways to get Python on Windows, only Cygwin provides no python command so update the default way for running tests in the README.
Added functions in the machine module are: - unique_id (returns 8 bytes) - soft_reset - idle - lightsleep, deepsleep (not power saving at the moment) - disable_irq, enable_irq - time_pulse_us Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Thank you for starting to work on this! The last time I did it was #1068, in 2018. I would really like to understand the changes rather than just depend on automatic merging. To that end, I think it would be good to make some of the changes that MicroPython has made, by hand, first, so as to minimize the diffs. For instance:
The worst merge issues I had were in We changed the signatures for Python API routines in [note that I've edited the above several times] |
@dhalbert Thanks! for the suggestions.
I ran the same script (i.e. tools/codeformat.py) on the whole
These can have another PR too...
Sure, I plan to rebase this a few times. These can be handled based on the reviews.
Ya... I have only kept changes in |
|
I don't think so. I'd expect merging 1.15 in to be easier after 1.14 has already been. I suspect 1.14 merge will be much more difficult. We shouldn't merge 1.14 until we branch off for 6.2.0 though because it may lead to instability. |
Though if 1.15 comes out before 6.2.0 is branched, I'm not sure it makes much difference if we start with 1.15. |
We've marked the |
I've started this merge work but am taking a different approach. I'm merging each MP release from 1.10 up to 1.15. This will make the merges a bit more tractable and easier to hunt errors/bugs as we find them. (Started in #4646 ) |
I agree, merging all of it at once is kinda overwhelming. |
This PR merges in upstream MicroPython changes till release V1.14.
Notes :-
mpy-cross
builds successfully.CI
currently fails atbuid unix port
.Changes :-
We can run the formatting script later in another PR after this is merged for consistency.
I'll update this section once there is more info for future reference.