summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-20extmod/btstack: Fix descriptor discovery handle range and events.Damien George
This fixes two problems with the BTstack implementation of descriptor discovery: - The call to gatt_client_discover_characteristic_descriptors needs to have value_handle set to the starting handle (actually characteristic handle) to start the search from. - The BTstack event for a descriptor query result is GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT. With this change the test tests/multi_bluetooth/ble_subscribe.py now passes when BTstack is instance1 (for BTstack to pass as instance0 requires gatts_write to support sending an update on BTstack). Signed-off-by: Damien George <damien@micropython.org>
2022-07-20extmod/modussl_mbedtls: Implement cert_reqs and cadata arguments.Carlosgg
Add cert_reqs and cadata keyword-args to ssl.wrap_socket() and ssl.CERT_NONE, ssl.CERT_OPTIONAL, ssl.CERT_REQUIRED constants to allow certificate validation. CPython doesn't accept cadata in ssl.wrap_socket(), but it does in SSLContext.load_verify_locations(), so we use this name to at least match the same name in load_verify_locations(). Add docs for these new arguments, as well as docs for the existing server_hostname argument which is important for certificate validation. Tests are added as well. Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
2022-07-19shared/runtime/softtimer: Remove obsolete #include statement.robert-hh
2022-07-19renesas-ra/softtimer: Switch to use softtimer code from shared/runtime.robert-hh
2022-07-19stm32/softtimer: Switch to use softtimer code from shared/runtime.robert-hh
2022-07-19shared/runtime/softtimer: Move softtimer.[ch] to shared/runtime.robert-hh
And change the include lock to the naming scheme of that place. This comes from ports/stm32/softtimer.[ch].
2022-07-19ports: Adapt mimxrt, nrf and rp2 ports to work with latest TinyUSB.robert-hh
rp2: change tud_task() to tud_task_ext(). mimxrt: use lib/tinyusb/src/portable/chipidea/ci_hs/dcd_ci_hs.c instead of lib/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c. nrf: add a definition for the changed tud_task(). tud_task() is changed to tud_task_ext(), and the #define for backward compatibility is in src/device/usbd.h. The items I know which are fixed with this version: - Fix for the SAMD USB lock-up. - Support the MIMXRT11XX series of MCUs. - Fix a wrong pin definition for MIMXRT1050_EVKB. Tested with the MIMXRT boards, rp2 Pico, SAMD boards, nrf board.
2022-07-19lib/tinyusb: Update to the most recent master.robert-hh
2022-07-19unix/mpconfigport: Allow overriding MICROPY_EVENT_POLL_HOOK.David Lechner
This allows variants to supply their own `MICROPY_EVENT_POLL_HOOK`. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-19unix/Makefile: Only checkout libffi submodule when used.David Lechner
This moves the libffi submodule variable modifier inside of the if statement where it is actually used so that the submodule will only be checked out if it is actually being used. A new DEPLIBS variable is also introduced to prevent building the libffi submodule when not needed. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18py/qstr: Make mp_decompress_rom_string decl and def the same.stijn
Fixes MSVC warning about mismatching argument types.
2022-07-18windows/msvc: Support compressed ROM text for error messages.stijn
Enable it in the dev variant as well for consistency with the makefile-based dev variant.
2022-07-18py/misc: Fix msvc compilation with compressed error messages.stijn
2022-07-18windows: Provide a definition for MP_ALWAYSINLINE.stijn
2022-07-18examples/embedding: Remove obsolete axtls build target.Damien George
axtls is now built as part of the standard make process, using rules in extmod/extmod.mk. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18extmod: Always use custom mbedtls error message code.Damien George
All ports that use mbedtls use the custom error messages in mp_mbedtls_errors.c. This commit simplifies the build so that ports don't need to explicitly add this file, it's now used by default when mbedtls is enabled. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18unix/Makefile: Only include axtls in GIT_SUBMODULES list when enabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-18unix/mpconfigport: Switch ussl from axtls to mbedtls.Damien George
The reasons to make this switch are: - The axtls library is not being maintained/updated, mbedtls is. - So CI and tests can run against mbedtls, which is now the main TLS library used by the ports (eg stm32, rp2, mimxrt, esp32). Only esp8266 uses axtls. Increases unix standard build on x86-64 by about 89000 bytes. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18unix/mbedtls: Add custom config for mbedtls.Damien George
Based on existing bare-metal config from stm32. Also uses shorter error messages from lib/mbedtls_errors. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18unix/mpconfigport: Make MICROPY_EVENT_POLL_HOOK call usleep directly.Damien George
So that MICROPY_EVENT_POLL_HOOK can be used without including py/mphal.h. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18tests/extmod/ussl_basic: Make test run on axtls and mbedtls.Damien George
Fixes issue #4364. Signed-off-by: Damien George <damien@micropython.org>
2022-07-18stm32/Makefile: Workaround LTO linker order bug in binutils <2.35.Angus Gratton
Assembly files with weak symbols need to be linked first to avoid issues with the weak symbols being incorrectly linked instead of strong ones. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83967 and https://bugs.launchpad.net/gcc-arm-embedded/+bug/1747966 This is the workaround suggested in comment 10 of the gcc-arm-embedded bug. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2022-07-18py/scheduler: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register sched_queue instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18py/modsys: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register cur_exception, sys_exitfunc, mp_sys_path_obj, mp_sys_argv_obj and sys_mutable instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18py/persistentcode: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register track_reloc_code_list instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/modbluetooth: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register `bluetooth` instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/vfs: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register vfs_cur and vfs_mount_table instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/modlwip: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register lwip_slip_stream instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/uos_dupterm: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register dupterm_objs instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18shared/runtime/pyexec: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register repl_line instead of using a conditional inside of mp_state_vm_t. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18py/mpstate: Drop MICROPY_PORT_ROOT_POINTERS from mp_state_vm_t.David Lechner
All in-tree uses of MICROPY_PORT_ROOT_POINTERS have been replaced with MP_REGISTER_ROOT_POINTER(), so now we can remove both MICROPY_PORT_ROOT_POINTERS and MICROPY_BOARD_ROOT_POINTERS from the code and remaining config files. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18zephyr: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register port-specific root pointers for the zephyr port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18teensy/teensy_hal: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register pyb_stdio_uart and removes the same from mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18teensy/mpconfigport: Drop unused root pointers.David Lechner
pin_class_mapper and pin_class_map_dict are not used in the teensy port and can be removed. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18stm32: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the stm32 port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18rp2: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the rp2 port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18renesas-ra: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the renesas-ra port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18renesas-ra/mpconfigport: Drop pyb_hid_report_desc root pointer.David Lechner
pyb_hid_report_desc is not used anywhere in the renesas-ra port (probably was copied from stm32 port). Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18pic16bit/pic16bit_mphal: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register keyboard_interrupt_obj and removes the same from mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18nrf: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers for the nrf port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18mimxrt: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the mimxrt port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18esp8266: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the esp2866 port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18esp32: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all root pointers in the esp32 port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18cc3200: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers for the cc3200 port. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18cc3200/mpconfigport: Remove mp_const_user_interrupt.David Lechner
mp_const_user_interrupt was listed as a root pointer but not used anywhere in the code base, so it can be removed. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/modnetwork: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register mod_network_nic_list and removes the same from all mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/nimble: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register bluetooth_nimble_memory and bluetooth_nimble_root_pointers and removes the same from all mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18extmod/btstack: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register bluetooth_btstack_root_pointers and removes the same from all mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18drivers/ninaw10/nina_wifi_bsp: Use MP_REGISTER_ROOT_POINTER().David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register mp_wifi_spi, mp_wifi_timer and mp_wifi_sockpoll_list and removes the same from all mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18unix/alloc: Use MP_REGISTER_ROOT_POINTER() for mmap_region_head.David Lechner
This uses MP_REGISTER_ROOT_POINTER() to register mmap_region_head and removes the same from mpconfigport.h. Signed-off-by: David Lechner <david@pybricks.com>