Commit Graph

3103 Commits

Author SHA1 Message Date
Lephenixnoir fa6aa00dae
pe: basic GUI setup
Adds a file browser (selected files are not loaded yet) and a shell
widget with an input system that is still better than the previous
VT-100 emulation scheme (with locked modifiers mainly).

A lot of small things still need to be done to make the UI functional.
2022-11-05 18:25:54 +01:00
Lephenixnoir 4e529b5788
meta: add project headers
On all but a few files that are not going to stay there.
2022-10-30 18:52:54 +01:00
Lephenixnoir 2c238906e7
pe: enable the time module
Based on the UNIX port version, and extmod/utime_mphal.c.
2022-10-30 18:37:02 +01:00
Lephenixnoir 8809f3eee4
pe: cap shell refresh rate at 30 FPS 2022-10-30 17:53:13 +01:00
Lephenixnoir d6334be488
meta: cleanup 2022-10-29 21:48:01 +02:00
Lephenixnoir ce4fefebbe
pe: split fx-CG 50 and fx-9860G III versions
Both working although with terrible UI.
2022-10-29 20:42:43 +02:00
Lephenixnoir e1df7e5f0b
ports/sh: enable split GC 2022-10-29 11:32:43 +02:00
Lephenixnoir f930ff95db
modgint: basic gint module with some of <gint/keyboard.h> 2022-10-29 10:57:15 +02:00
Lephenixnoir 1992ec0a49
ports/sh: module loading and first attempt at open()
But I'm pretty sure there should be a ready-to-use POSIX version of
open() that I can enable instead of rewriting it.
2022-10-29 10:55:57 +02:00
Lephenixnoir c237e9874f
ports/sh: clean mpconfigport.h and enable modules 2022-10-27 19:07:22 +02:00
Lephenixnoir f9b4c1f844
pe: decent console with erasing, scrolling and more unused potential 2022-10-24 00:53:53 +02:00
Lephenixnoir e33d85b1de
ports/sh: first functional version, can compute in REPL 2022-10-24 00:48:14 +02:00
Damien George 8874a09119 extmod/mbedtls: Enable elliptic curve DH and DSA cryptography.
This is necessary to access sites that only support these protocols.

The rp2 port already has ECDH enabled, so this just adds ECDSA there.  The
other ports now gain both ECDH and ECDSA.  The code size increase is:

- rp2 (PICO_W): +2916 bytes flash, +24 bytes BSS
- stm32 (PYBD_SF6): +20480 bytes flash, +32 bytes data, +48 bytes BSS
- mimxrt (TEENSY41): +20708 bytes flash, +32 bytes data, +48 bytes BSS
- unix (standard x86-64): +39344 executable, +1744 bytes data, +96 BSS

This is obviously a large increase in code size.  But there doesn't seem to
be any other option because without elliptic curve cryptography devices are
partially cut off from the internet.  For use cases that require small
firmware size, they'll need to build custom firmware with a custom mbedtls
config.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-22 19:08:21 +11:00
Damien George 9347545f9e extmod/mbedtls: Enable MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE.
This was already enabled on all ports except mimxrt.  Now it's enabled on
all of them.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-22 19:06:21 +11:00
Damien George b337678964 extmod/mbedtls: Add common configuration file, and use it in all ports.
This is a no-op change.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-22 19:06:21 +11:00
Damien George 67f98ba10c extmod/btstack: Update BTstack bindings to work with latest BTstack.
The following multi-tests pass (eg with PYBD_SF6+LEGO_HUB_NO6):

    ble_gap_advertise.py
    ble_gap_connect.py
    ble_gap_device_name.py
    ble_gattc_discover_services.py
    ble_gatt_data_transfer.py
    perf_gatt_char_write.py
    perf_gatt_notify.py
    stress_log_filesystem.py

These are the same tests that passed prior to this BTstack update.

Also tested on the unix port using H4 transport.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-22 14:28:25 +11:00
iabdalkader 93f3910fe7 nrf: Rename machine I2C, PWM, SPI, UART types consistently across ports.
This renames:
- machine_hard_i2c_type -> machine_i2c_type
- machine_hard_pwm_type -> machine_pwm_type
- machine_hard_spi_type -> machine_spi_type
- machine_hard_uart_type -> machine_uart_type
2022-10-22 12:58:54 +11:00
iabdalkader 5e90ec2331 zephyr: Rename machine I2C and SPI types consistently across ports.
This renames:
- machine_hard_i2c_type -> machine_i2c_type
- machine_hard_spi_type -> machine_spi_type
2022-10-22 12:58:21 +11:00
iabdalkader bfa6f34404 renesas-ra: Rename machine SPI type consistently across ports.
This renames:
- machine_hard_spi_type -> machine_spi_type
2022-10-22 12:57:58 +11:00
iabdalkader e275a58ac1 samd: Rename machine I2C type consistently across ports.
This renames:
- machine_hw_i2c_type -> machine_i2c_type
2022-10-22 12:57:32 +11:00
iabdalkader 22ad45fda6 rp2: Rename machine I2C type consistently across ports.
This renames:
- machine_hw_i2c_type -> machine_i2c_type
2022-10-22 12:56:58 +11:00
iabdalkader 427670c210 esp32: Rename machine I2C and SPI types consistently across ports.
This renames:
- machine_hw_i2c_type -> machine_i2c_type
- machine_hw_spi_type -> machine_spi_type
2022-10-22 12:56:10 +11:00
iabdalkader af4ba6d1b4 stm32: Rename machine I2C and SPI types consistently across ports.
This renames:
- machine_hard_i2c_type -> machine_i2c_type
- machine_hard_spi_type -> machine_spi_type
2022-10-22 12:54:42 +11:00
Damien George 89b3207376 unix/modffi: Move header includes inside MICROPY_PY_FFI guard.
So ffi.h is not needed if this module is disabled.

Signed-off-by: Damien George <damien@micropython.org>
2022-10-14 14:36:17 +11:00
robert-hh 92d9118038 rp2/fatfs_port: Fix the modification date of files.
It was off by 2000 % 128 == 80 years.

Addresses issue #9535.
2022-10-12 00:31:38 +11:00
Jim Mussared b25087fc6f samd/Makefile: Split up SRC_C variables.
This improves clarity a bit, but also ensures that only the required files
are added to SRC_QSTR.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-12 00:10:18 +11:00
Jim Mussared a2aceb5007 nrf/Makefile: Split up SRC_C variables.
This improves clarity a bit, but also ensures that only the required files
are added to SRC_QSTR.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-12 00:09:55 +11:00
Jim Mussared 43bcfb148b mimxrt/Makefile: Split up SRC_C variables.
This improves clarity a bit, but also ensures that only the required files
are added to SRC_QSTR.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-12 00:08:49 +11:00
Jim Mussared d6d8722558 extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.

Make all extmod variables (src, flags, etc) private to extmod.mk.

Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.

Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:31:49 +11:00
Jim Mussared 87011f6353 extmod/extmod.mk: Make extmod.mk handle GIT_SUBMODULES.
This applies to nimble, btstack, axtls, mbedtls, lwip.

Rather than having the ports individually manage GIT_SUBMODULES for these
components, make extmod.mk append them when the relevant feature is
enabled.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:29:09 +11:00
Jim Mussared 065af04a4e unix/Makefile: Don't use _MOD variable names.
This conflicts with the triple-usage of these variables for user-C-modules
and extmod source.

For CFLAGS_MOD, just use CFLAGS directly. For SRC, use SRC_C directly as
the relevant files are all guarded by the preprocessor anyway.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:27:01 +11:00
Jim Mussared 3cc6decfc4 py/py.mk: Make user-C-module handling self-contained in py.mk.
Removes the need for the port to add anything to OBJS or SRC_QSTR.

Also makes it possible for user-C-modules to differentiate between code
that should be processed for QSTR vs other files (e.g. helpers and
libraries).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:23:18 +11:00
Jim Mussared 67d05ed02b ports: Make generated pin.c handling more consistent across ports.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:18:46 +11:00
Jim Mussared 17f2783e4a all: Use += rather than = everywhere for CFLAGS/LDFLAGS/LIBS.
This avoids a surprise where an = can cancel out an earlier +=.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11 23:17:41 +11:00
Jim Mussared 8e912a501a unix: Enable sys.executable.
Gives the absolute path to the unix micropython binary.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
2022-10-11 18:10:30 +11:00
robert-hh 366c801b35 samd/machine_pin: Change the printing of Pin and LED objects.
It now prints lines like:

    Pin("D9", mode=IN, pull=PULL_UP, GPIO=PA07)

or

    LED("LED")

showing for consistency the names as given in pins.csv.  For pins, the GPIO
numer is printed as well for a reference.
2022-10-06 23:14:21 +11:00
robert-hh 972212907d samd/mcu: Use lf2s for SAMD51 and lfs1 for SAMD21.
Using lfs1 gives a smaller code, but lfs2 has more features.
2022-10-06 23:14:21 +11:00
robert-hh 4cf527eb05 samd/main: Initialize readline on start up.
Somehow that was forgotten.
2022-10-06 23:14:21 +11:00
robert-hh 65f99e371d samd/boards: Use the same linker file for all SAMD51x19 variants. 2022-10-06 23:14:21 +11:00
robert-hh 9f4df86016 samd/boards: Move the flash filesystem definitions to the linker files.
They used to be in mpconfigmcu.h, but have to be different for different
chip variants, like the SAMD51x20.
2022-10-06 23:14:08 +11:00
robert-hh 387025f5d1 samd/mcu: Enable the math module on SAMD51. 2022-10-06 23:11:02 +11:00
robert-hh 00dcf04643 samd/mcu: Add floating point suport for SAMD21 devices.
For consistency it should be there.
2022-10-06 23:10:49 +11:00
robert-hh d9338aabc5 samd: Change the symbol names for the peripheral clocks.
From APB_FREQ to DFLL48M_FREQ, and from apb_freq to peripheral_freq.
2022-10-06 23:10:08 +11:00
robert-hh e9a76310ec samd/mphalport: Fix USB endpoint handling ignoring Ctrl-C.
Porting PR #8040 by @hoihu to SAMD, following the commit
5873390226.

One small addition: before executing keyboard interrupt, the input buffer
is cleared.
2022-10-06 23:08:22 +11:00
robert-hh b001730462 samd/Makefile: Fix a dependency problem with "make -j".
The build directory was not created before attempting to create the
generated files in it.
2022-10-06 23:08:00 +11:00
robert-hh 560170de02 samd/samd_flash: Remove obsolete printf's and return values instead.
Returning values is much more useful.
2022-10-06 23:06:43 +11:00
robert-hh 85fb8b8b02 samd/pin_af: Simplify the pin-af-table handling.
Changes are:
- The pin-af-table-SAMDxx.csv file are moved to the mcu directories with
  the name as pin-af-table.csv.
- The handling in Makefile and pin_af.c is simplified.
2022-10-06 23:05:46 +11:00
robert-hh 20e7313453 samd/clock_config: Add HW_DFLL_USB_SYNC and HW_MCU_OSC32KULP extensions.
Two new compile flags are:

MICROPY_HW_DFLL_USB_SYNC: Effective only if DFLL48 does not run from the
crystal.  It will synchronize the DFLL48M clock with the USB's SOF pulse.
If no USB is connected, it will fall back to open loop mode.  The DFLL48M
clock is then pretty precise, but with a higher clock jitter at SAMD51
devices.

MICROPY_HW_MCU_OSC32KULP: Effective only if the devics uses a crystal as
clock source.  Run the MCU clock from the ULP 32kHz oszillator instead of
the crystal.  This flag was added to cater for a interference problem of
the crystal and Neopixel/Debug pins at Adafruit FEATHER Mx boards, which
causes the board to crash.  Drawback: ticks_ms() and time.time() vs. than
ticks_us() and the peripherals like PWM run at not synchronous clocks.
2022-10-06 23:03:08 +11:00
robert-hh f00356a486 samd/clock_config: Split clock_config.c to separate SAMD21/SAMD51 files.
And put the file into the mcu directory.  The file got a little bit long
and hard to read.
2022-10-06 23:01:58 +11:00
robert-hh 929dfc66a3 samd/mpconfigport: Restructure to use ROM feature levels.
Changes are:
- Set the feature level for each MCU: CORE features for SAMD21, and EXTRA
  features for SAMD51.
- Remove all definitions that are included in the core feature level.
- Keep the default settings for feature level and float, to make the choice
  obvious.
2022-10-06 23:00:44 +11:00