Wykres commitów

2889 Commity (4cf9928902a1e4bca4edc433eeab6b8fdb1a5245)

Autor SHA1 Wiadomość Data
Jim Mussared 4cf9928902 cc3200: Fix various array-based compiler warnings.
1. Add -Wno-array-bounds to avoid false positive on gcc 12.1; see related
   issue #8685.
2. Remove always-true not-NULL-check (Msg.Rsp.Args.Common.Bssid is an array
   not a pointer).
3. Fix pointer-to-freed-stack in wlan_set_security.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-21 16:26:04 +10:00
Jim Mussared a053827084 extmod/network_ninaw10: Move ninaw10 root pointer registrations here.
Originally in drivers/ninaw10/nina_wifi_bsp.c but that isn't a QSTR source.

Also remove outdated commment about root pointers in mpconfigport.h.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-21 16:21:50 +10:00
Jim Mussared 8b4298a4bf rp2/mpbthciport: Remove mp_bthci_uart from set of root pointers.
This is a statically-allocated UART (see machine_uart.c), and doesn't
contain any heap pointers other than the ringbufs (which are already root
pointers), so no need to track it additionally.

Saves needing to add mpbthciport.c to the QSTR sources.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-21 16:19:42 +10:00
robert-hh 2e2fc8f60f nrf/main: Call usb_cdc_init() before executing boot.py and main.py.
Otherwise, there is no USB available when running main.py, and main.py
cannot be interrupted with Ctrl-C.
2022-07-20 17:17:17 +10:00
iabdalkader 768cbea507 nrf/boards/arduino_nano_33_ble_sense: Update deploy instructions. 2022-07-20 17:16:15 +10:00
robert-hh 678cb5a585 renesas-ra/softtimer: Switch to use softtimer code from shared/runtime. 2022-07-19 13:46:28 +10:00
robert-hh c781899438 stm32/softtimer: Switch to use softtimer code from shared/runtime. 2022-07-19 12:33:19 +10:00
robert-hh 80339f1a33 ports: Adapt mimxrt, nrf and rp2 ports to work with latest TinyUSB.
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-19 11:27:21 +10:00
David Lechner 03fb671833 unix/mpconfigport: Allow overriding MICROPY_EVENT_POLL_HOOK.
This allows variants to supply their own `MICROPY_EVENT_POLL_HOOK`.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-19 11:24:42 +10:00
David Lechner c947c25294 unix/Makefile: Only checkout libffi submodule when used.
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-19 11:17:16 +10:00
stijn d05377c060 windows/msvc: Support compressed ROM text for error messages.
Enable it in the dev variant as well for consistency with the
makefile-based dev variant.
2022-07-18 23:25:38 +10:00
stijn c4adeb2e08 windows: Provide a definition for MP_ALWAYSINLINE. 2022-07-18 23:24:46 +10:00
Damien George b89422ceaa extmod: Always use custom mbedtls error message code.
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-18 22:55:22 +10:00
Damien George b87f796ef5 unix/Makefile: Only include axtls in GIT_SUBMODULES list when enabled.
Signed-off-by: Damien George <damien@micropython.org>
2022-07-18 22:45:38 +10:00
Damien George 13c78ab6fe unix/mpconfigport: Switch ussl from axtls to mbedtls.
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-18 22:43:01 +10:00
Damien George 26dec1fafb unix/mbedtls: Add custom config for mbedtls.
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-18 22:42:51 +10:00
Damien George e30e7ced6f unix/mpconfigport: Make MICROPY_EVENT_POLL_HOOK call usleep directly.
So that MICROPY_EVENT_POLL_HOOK can be used without including py/mphal.h.

Signed-off-by: Damien George <damien@micropython.org>
2022-07-18 18:12:39 +10:00
Angus Gratton 1d23c01dd6 stm32/Makefile: Workaround LTO linker order bug in binutils <2.35.
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-18 16:12:08 +10:00
David Lechner 68f46342aa shared/runtime/pyexec: Use MP_REGISTER_ROOT_POINTER().
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-18 13:52:01 +10:00
David Lechner 7e4b205cb0 py/mpstate: Drop MICROPY_PORT_ROOT_POINTERS from mp_state_vm_t.
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-18 13:51:16 +10:00
David Lechner ccda7686a4 zephyr: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:35 +10:00
David Lechner 186be074a7 teensy/teensy_hal: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:35 +10:00
David Lechner 2d8589f1a5 teensy/mpconfigport: Drop unused root pointers.
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-18 13:50:34 +10:00
David Lechner 816e4537f2 stm32: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner ffa22b8f97 rp2: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner 575fa61c6d renesas-ra: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner f8805e2416 renesas-ra/mpconfigport: Drop pyb_hid_report_desc root pointer.
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-18 13:50:34 +10:00
David Lechner c09e31dabb pic16bit/pic16bit_mphal: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner 8a69c54211 nrf: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner a316a8fdb3 mimxrt: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner e2d4db96da esp8266: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner b63282c361 esp32: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner 226e969ad3 cc3200: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:34 +10:00
David Lechner 095ad87adf cc3200/mpconfigport: Remove mp_const_user_interrupt.
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-18 13:50:34 +10:00
David Lechner a3703584fe extmod/modnetwork: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:25 +10:00
David Lechner e531b72b56 extmod/nimble: Use MP_REGISTER_ROOT_POINTER().
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-18 13:50:14 +10:00
David Lechner 8fa6191f95 extmod/btstack: Use MP_REGISTER_ROOT_POINTER().
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-18 13:49:51 +10:00
David Lechner ac86e8449a drivers/ninaw10/nina_wifi_bsp: Use MP_REGISTER_ROOT_POINTER().
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-18 13:49:28 +10:00
David Lechner e5631d9595 unix/alloc: Use MP_REGISTER_ROOT_POINTER() for mmap_region_head.
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>
2022-07-18 13:49:09 +10:00
David Lechner 81dbea1ce3 shared/readline: Use MP_REGISTER_ROOT_POINTER().
This uses MP_REGISTER_ROOT_POINTER() to register the readline_history root
pointer array used by shared/readline.c and removes the registration from
all mpconfigport.h files.

This also required adding a new MICROPY_READLINE_HISTORY_SIZE config option
since not all ports used the same sized array.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:48:49 +10:00
David Lechner fc3d7ae11b py/make_root_pointers: Add MP_REGISTER_ROOT_POINTER parser/generator.
This adds new compile-time infrastructure to parse source code files for
`MP_REGISTER_ROOT_POINTER()` and generates a new `root_pointers.h` header
file containing the collected declarations.  This works the same as the
existing `MP_REGISTER_MODULE()` feature.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-18 13:48:23 +10:00
robert-hh cca2305211 nrf/drivers/usb: Fix reading of a single USB CDC character. 2022-07-17 00:13:15 +10:00
robert-hh be6f0f3b3b nrf/mpconfigport: Call tud_task() in MICROPY_EVENT_POLL_HOOK.
So that the interrupt character can interrupt a long-running loop, like a
sleep.
2022-07-17 00:12:34 +10:00
robert-hh c985a0b514 nrf/drivers/usb: Add a tud_cdc_rx_cb() callback to check interrupt char. 2022-07-17 00:12:03 +10:00
robert-hh 60539ea162 nrf/drivers/usb: Probe for interrupt char in USB CDC task.
And ensure that the input queue is empty when scheduling the interrupt.
2022-07-17 00:11:14 +10:00
Stuart Langridge 30c7f1790b nrf/drivers/bluetooth: Handle PHY_UPDATE messages, used in Bluetooth 5.
Some devices, such as the LightBlue BTLE app on iOS, try to use Bluetooth 5
when connecting to a device.  This means that they will send a
BLE_GAP_EVT_PHY_UPDATE_REQUEST message to shift to a new physical layer.
If this event isn't handled, LightBlue (and likely other Bluetooth 5.0
central devices) will try to connect and then fail, staying in
"Connecting..." state forever.  This message should be replied to with
sd_ble_gap_phy_update, as documented in
drivers/bluetooth/s140_nrf52_6.1.1/s140_nrf52_6.1.1_API/include/ble_gap.h.

This commit handles the event.  LightBlue can now successfully connect to a
BTLE device on a P10059 nRF52840 dongle running MicroPython.  Two other
related events have logging added in case they are needed in the future.
2022-07-16 23:46:30 +10:00
iabdalkader 262f4a4855 nrf/mpconfigport: Remove obsolete module declarations.
External module declarations are no longer used/needed after the
introduction of MP_REGISTER_MODULE.
2022-07-15 22:54:25 +10:00
Jim Mussared 74794d42b8 rp2/CMakeLists: Use armv6m mpy-cross arch for rp2.
Commit 0e28a1f0e5 made it possible to set
-march=armv6m.  It needs to be used when freezing for rp2.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-12 23:50:19 +10:00
David Lechner 093c4b6b26 unix/main: Restore tty settings on nlr_jump_fail().
Since nlr_jump_fail() exits the process, it can leave the terminal in raw
mode which means characters are not echoed.  Fix this by restoring the
original terminal mode.

Signed-off-by: David Lechner <david@pybricks.com>
2022-07-12 17:20:37 +10:00
Peter Harper 9f0f7e34c7 rp2/mphalport: Fix missing storage_read_blocks symbol in debug build.
When building `make BOARD=PICO_W DEBUG=1` the cyw43-driver requires
storage_read_blocks().

Signed-off-by: Peter Harper <peter.harper@raspberrypi.com>
2022-07-12 16:56:38 +10:00