温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何将micropython升级到v1.15

发布时间:2021-10-09 16:08:08 来源:亿速云 阅读:227 作者:柒染 栏目:互联网科技

这篇文章将为大家详细讲解有关如何将micropython升级到v1.15,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

MicroPython在这个版本中增加了对使用CMake作为构建系统的通用支持。RP2移植被合并以使用新的CMake文件,esp32和zephyr移植已切换为纯CMake项目。这三个移植都有围绕CMake构建的SDK,这一更改使它们更易于维护和使用。

作为这项工作的一部分,基于CMake的移植现在支持用户C模块。用户C模块的作者应该同时提供.mk和.cmake配置文件(遵循文档和示例)。

修复了多精度整数库中的一个错误,即长除法例程中的算术溢出。在此修复之前,某些整数除法将花费大量时间并产生不正确的结果。有关详细信息,请参见提交0a59938。此外,还修复了正则表达式,在编译表达式时检查和报告字节溢出错误。参见172fb52。

在uasyncio库中,添加了一个新的MicroPython扩展ThreadSafeFlag,它可以从asyncio事件循环外部进行设置,例如从其他线程、irq或调度程序上下文。它允许像irq这样的抢占式代码中向asyncio任务发送信号,这些任务本质上是协作的(非抢占式的)。asyncio.current_task() 也已添加,语义与CPython相同。

如上所述,esp32移植已切换到基于CMake的完整项目,传统的make功能已被删除(尽管仍保留一个简单的helper Makefile,以使顶级构建/部署命令与其他移植保持一致)。因为切换到 CMake,network.LAN 支持已被删除,并将在以后重新添加(如果需要LAN,请使用以前的版本)。esp32模块增加了对非易失性存储的基本支持。此外,还初步支持 ESP32-S2 和 USB,并定义了一个通用的 S2板。

在mimxrt和samd移植上,USB-CDC-TX处理已修复,因此现在可以可靠地工作。

RP2移植启用了更多的Python核心特性,同时还启用了ubinascii.crc32()、uos.VfsFat和machine.Signal类,以及uerrno模块。uos.urandom() 已添加,并且machine.freq() 现在可以更改CPU时钟频率。machine.UART 类现在支持timeout/timeout_char、反转的TX/RX信号和可配置缓冲区大小的TX/RX。对于PIO,StateMachine添加了restart(), rx_fifo() 和 tx_fifo()助手函数,并支持fifo连接。现在支持用户C模块(通过CMake)和构建不同的板配置(默认仍然是PICO板)。提高了USB的可靠性。

对于stm32移植,现在有更多的板配置选项,例如USBD VID/PID和模块的fine-grained选择。UART类现在支持L0、L4、H7和WB MCU上的LPUART。WB MCU对访问BLE ACL 自由缓冲区列表的竞争条件有一个修复,解决低级BLE bug。

zephyr移植已经更新为使用 Zephyr v2.5.0,并使用 CMake 构建MicroPython。

下面是从git提交历史生成的更改的详细列表,并将其组织为多个部分。

主要组件

all:

  • rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD

  • add .git-blame-ignore-revs for fixing up git blame output

py core:

  • gc: don't include mpconfig.h and misc.h in gc.h

  • remove BITS_PER_WORD definition

  • rename BITS_PER_BYTE to MP_BITS_PER_BYTE

  • rename WORD_MSBIT_HIGH to MP_OBJ_WORD_MSBIT_HIGH

  • gc: change include of stdint.h to stddef.h

  • mpz: fix overflow of borrow in mpn_div

  • add core cmake rule files

  • expand lists in core cmake custom commands

  • mkrules.cmake: rename QSTR_DEFS variables to QSTRDEFS

  • mkrules.cmake: add MICROPY_QSTRDEFS_PORT to qstr build process

  • nlr: implement NLR for AArch74

  • nlrx64: fix typo in comment

  • vm: for tracing use mp_printf, and print state when thread enabled

  • rename remaining object types to be of the form mp_type_xxx

  • py.cmake: move qstr helper code to micropy_gather_target_properties

  • py.cmake: introduce MICROPY_INC_CORE as a list with core includes

  • profile: resolve name collision with STATIC unset

  • runtime: make sys.modules preallocate to a configurable size

extmod:

  • vfs_posix_file: allow closing an already closed file

  • btstack: add HCI trace debugging option in btstack_hci_uart

  • btstack: add stub functions for passkey, l2cap bindings

  • btstack: enable SYNC_EVENTS, PAIRING_BONDING by default

  • uasyncio: add asyncio.current_task()

  • add core cmake rule files

  • nimble: ensure handle is set on read error

  • moduselect: fix unsigned/signed comparison for timeout!=-1

  • uasyncio: add ThreadSafeFlag

  • nimble/hal/hal_uart: fix HCI_TRACE format specifiers

  • modbluetooth: allow NimBLE to use Zephyr static address

  • modussl: fix ussl read/recv/send/write errors when non-blocking

  • btstack: use MICROPY_HW_BLE_UART_BAUDRATE for first UART init

  • modbluetooth: separate enabling of "client" from "central"

  • extmod.cmake: add modonewire.c to MICROPY_SOURCE_EXTMOD list

  • modbluetooth: free temp arrays in gatts register services

  • re1.5: check and report byte overflow errors in _compilecode

  • extmod.cmake: add support to build btree module with CMake

lib:

  • tinyusb: update to version 0.8.0

  • mbedtls: switch to currently latest commit of LTS branch v2.16

  • utils/gchelper_generic: implement AArch74 support

  • pico-sdk: update to latest version 1.1.0

drivers: no changes specific to this component/port

mpy-cross: no changes specific to this component/port

支撑组件

docs:

  • library/uasyncio.rst: add docs for ThreadSafeFlag

  • develop/cmodules.rst: document C-modules and micropython.cmake

  • develop: improve user C modules to properly describe how to build

examples:

  • usercmodule: add micropython.cmake to the C and CPP examples

  • usercmodules: simplify user C module enabling

  • embedding: fix example so it compiles again

tests:

  • extmod/vfs_posix.py: add more tests for VfsPosix class

  • extmod: add test for ThreadSafeFlag

  • multi_bluetooth: add basic performance tests

  • rename run-tests to run-tests.py for consistency

  • run-tests.py: reformat with Black

  • multi_bluetooth: skip tests when BLE features are unsupported

  • extmod/vfs_fat_fileio2.py: close test file at end of test

  • run-tests.py: provide more info if script run via pyboard crashes

  • feature_check: check for lack of pass result rather than failure

  • net_inet: add 'Strict-Transport-Security' to exp file

tools:

  • add filesystem action examples to pyboard.py help

  • ci.sh: change esp32 CI to work with idf.py and IDF v4.0.2

  • makemanifest.py: allow passing option args to include()

  • ci.sh: update zephyr docker image to v0.11.13

  • verifygitlog.py: show required format regexp in error message

  • pydfu.py: support DFU files with elements of zero size

  • ci.sh: add CI for CMake USER_C_MODULE support

  • ci.sh: build user C modules for esp32

  • metrics.py: fix esp32 output filename due to move to CMake

  • ci.sh: build esp32 using IDF v4.0.2 and v4.3

移植

all ports:

  • remove def of MP_PLAT_PRINT_STRN if it's the same as the default

  • update to build with new tinyusb

bare-arm port:

  • clean up the code, make it run on an F405, and add a README

cc3200 port: no changes specific to this component/port

esp8266 port:

  • modules: fix fs_corrupted() to use start_sec not START_SEC

esp32 port:

  • add support to build using IDF with cmake

  • esp32_rmt: don't do unnecessary check for unsigned less than zero

  • add explicit initialisers to silence compiler warnings

  • remove traditional "make" capability

  • boards: remove old IDF v3 sdkconfig values

  • boards: enable BLE on all boards

  • README: update based on new IDF v4 cmake build process

  • add support to build with ESP-IDF v4.1.1

  • add support to build with ESP-IDF v4.2

  • remove obsolete IDF v3 code wrapped in MICROPY_ESP_IDF_4

  • modsocket: remove unix socket error code translation

  • set MICROPY_USE_INTERNAL_ERRNO=0 to use toolchain's errno.h

  • boards: enable size optimisation for builds

  • add support to build with ESP-IDF v4.3 pre-release

  • add basic support for Non-Volatile-Storage in esp32 module

  • make machine.soft_reset() work in main.py and reset_cause()

  • define MICROPY_QSTRDEFS_PORT to include special qstrs

  • Makefile: specify port and baud on erase_flash command

  • machine_hw_spi: use default pins when making SPI if none given

  • restore USER_C_MODULE support with new CMake build system

  • fix multiple definition errors with mp_hal_stdout_tx functions

  • enable btree module

  • modsocket: correctly handle poll/read of unconnected TCP socket

  • add initial support for ESP32S2 SoCs

  • add support for USB with CDC ACM

  • boards: add GENERIC_S2 board definition

  • machine_pin: use rtc_gpio_deinit instead of gpio_reset_pin

javascript port: no changes specific to this component/port

mimxrt port:

  • fix USB CDC handling so it works reliably

  • boards: add MIMXRT1050_EVK board, based on MIMXRT1060_EVK

  • enable CPYTHON_COMPAT, PY_ASYNC_AWAIT, PY_ATTRTUPLE options

minimal port: no changes specific to this component/port

nrf port:

  • drivers/usb: add USBD_IRQHandler which calls tud_int_handler

pic16bit port: no changes specific to this component/port

powerpc port: no changes specific to this component/port

qemu-arm port: no changes specific to this component/port

rp2 port:

  • machine_adc: only initialise the ADC periph if not already enabled

  • micropy_rules.cmake: fix makemoduledefs vpath to work with abs path

  • use local tinyusb instead of the one in pico-sdk

  • enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32()

  • enable VfsFat class for FAT filesystem support

  • machine_uart: add timeout/timeout_char to read and write

  • machine_uart: add support for inverted TX and RX lines

  • rp2_pio: allow more than 8 consecutive pins for PIO out/set/sideset

  • rp2_pio: fix sm.get(buf) to not wait after getting last item

  • modmachine: allow changing CPU clock frequency

  • modmachine: re-init UART for REPL on frequency change

  • rp2_flash: prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative

  • enable uerrno module

  • enabled more core Python features

  • modmachine: enable machine.Signal class

  • use core-provided cmake fragments instead of custom ones

  • mpthreadport.h: cast core_state to _mp_state_thread_t

  • add support for USER_C_MODULES to CMake build system

  • don't advertise remote wakeup for USB serial

  • CMakeLists.txt: enable USB enumeration fix

  • import uarray instead of array in rp2 module

  • rp2_pio: validate state machine frequency in constructor

  • moduos: implement uos.urandom()

  • rp2_pio: add StateMachine restart,rx_fifo,tx_fifo helper functions

  • machine_uart: add buffered transfer of data with rxbuf/txbuf kwargs

  • add support for building different board configurations

  • rp2_pio: add fifo_join support for PIO

samd port:

  • mphalport: fix USB CDC tx handling to work reliably

stm32 port:

  • uart: add uart_set_baudrate function

  • mpbthciport: only init the uart once, then use uart_set_baudrate

  • mboot: add unpack-dfu command to mboot_pack_dfu.py tool

  • usb: allow a board to configure USBD_VID and all PIDs

  • make pyb, uos, utime, machine and onewire modules configurable

  • boards: disable onewire module on boards with small flash

  • mpbthciport: fix initial baudrate to use provided value

  • mpbthciport: use mp_printf instead of printf for error message

  • mpbtstackport: allow chipset and secondary baudrate to be set

  • mboot: after sig verify, only write firmware-head if latter valid

  • uart: add support for LPUART1 on L0, L4, H7 and WB MCUs

  • boards/NUCLEO_WB55: enable LPUART1 on PA2/PA3

  • enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32()

  • rfcore: allow BLE settings to be changed by a board

  • storage: prevent attempts to read/write invalid block addresses

  • make-stmconst.py: allow "" chars when parsing source comments

  • main: fix passing state.reset_mode to init_flash_fs

  • powerctrl: save and restore EWUP state when configuring standby

  • spi: fix baudrate calculation for H7 series

  • boardctrl: add MICROPY_BOARD_STARTUP hook

  • Makefile: fix C++ linker flags when toolchain has spaces in path

  • Makefile: allow QSTR_DEFS,QSTR_GLOBAL_DEPENDENCIES to be extended

  • include .ARM section in firmware for C++ exception handling

  • powerctrl: allow a board to configure AHB and APB clock dividers

  • powerctrl: support using PLLI2C on STM32F413 as USB clock source

  • boards/pllvalues.py: relax PLLQ constraints on STM32F413 MCUs

  • mpconfigport.h: add support for a board to specify root pointers

  • boardctrl: give boards control over execution of boot.py,main.py

  • boards/NUCLEO_L476RG: add 5 remaining UARTs

  • rfcore: fix race condition with C2 accessing free buffer list

  • rfcore: intercept addr-resolution HCI cmd to work around BLE bug

  • boards: split UARTx_RTS_DE into UARTx_RTS/UARTx_DE in pin defs

  • uart: use LL_USART_GetBaudRate to compute baudrate

  • sdram: make MICROPY_HW_FMC_BA1,MICROPY_HW_FMC_A11 optional pins

teensy port: no changes specific to this component/port

unix port:

  • mpbtstackport_common: implement mp_bluetooth_hci_active

  • moduselect: don't allow both posix and non-posix configurations

  • improve command line argument processing

  • main: make static variable that's potentially clobbered by longjmp

windows port: no changes specific to this component/port

zephyr port:

  • update to zephyr v2.5.0

  • disable frozen source modules

  • remove unused build files

  • build MicroPython as a cmake target

  • boards: add support for the nucleo_h743zi board

  • modusocket: fix parameter in calls to net_context_get_XXX()


关于如何将micropython升级到v1.15就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI