Commit Graph

7153 Commits

Author SHA1 Message Date
Pavol Rusnak 95048129b1 unix: Fix build on arm64-darwin due to integer cast.
This fixes error: cast to smaller integer type 'int' from 'pthread_t'.
pthread_t is defined as long, not as int.

Signed-off-by: Pavol Rusnak <pavol@rusnak.io>
2021-06-15 00:08:24 +10:00
Krzysztof Adamski e7f7094ef6 rp2/machine_rtc: Check return value from rtc_set_datetime.
The rtc_set_datetime() from pico-sdk will validate the values in the
datetime_t structure and refuse to set the time if they aren't valid. It
makes sense to raise an exception if this happens instead of failing
silently which might be confusing (as an example, see:
https://github.com/micropython/micropython/pull/6928#issuecomment-860166044
).
2021-06-15 00:06:26 +10:00
iabdalkader 66115a3744 stm32/eth: Fix eth_link_status function to use correct BSR bit.
Fixes #7346.
2021-06-13 12:29:11 +10:00
iabdalkader 51614ce365 stm32/eth: Add low-power mode configuration option.
Add low power functionality configurable with:

    lan.config(low_power=True/False)
2021-06-13 12:27:33 +10:00
robert-hh 3ab8806c0d mimxrt/machine_rtc: Maintain microsecond offset.
The supplied value for microseconds in datetime() will be treated as a
starting value for the reported microseconds.  Due to internal processing
in setting the time, there is an offset about 1 ms.
2021-06-12 23:20:12 +10:00
robert-hh fd4eec5555 mimxrt/machine_rtc: Change RTC.datetime() tuple to match other ports.
This change moves the datetime tuple format back to the one used by all the
other ports:

    (year, month, day, weekday, hour, minute, second, microsecond)

Weekday is a number between 0 and 6, with 0 assigned to Monday.  It has to
be provided when setting the RTC with datetime(), but will be ignored on
entry and calculated when needed.

The weekday() method was removed, since that is now again a part of the
datetime tuple.

The now() method was updated so it continues to return a tuple that matches
CPython's datetime module.
2021-06-12 23:15:05 +10:00
Krzysztof Adamski 37d01d4be3 rp2/machine_rtc: Add initial support for RTC.
Initial support for machine.RTC on rp2 port. It only supports datetime()
method and nothing else. The method gets/returns a tuple of 8 items, just
like esp32 port, for example, but the usec parameter is ignored as the RP2
RTC only works up to seconds precision.

The Pico RTC isn't very useful as the time is lost during reset and there
seems to be no way to easily power up just the RTC clock with a low current
voltage, but still there seems to be use-cases for that, see issues #6831,
and a Thonny issue #1592. It was also requested for inclusion on v1.15
roadmap on #6832.

Signed-off-by: Krzysztof Adamski <k@japko.eu>
2021-06-12 23:02:54 +10:00
Jeff Epler 1a06d06468 ulab: disable on several stm boards with constrained flash storage 2021-06-11 07:46:21 -05:00
IhorNehrutsa da8aad18a4 esp32/README: Describe how to select compatible version of existing IDF. 2021-06-11 19:52:10 +10:00
noslaver f314cac604 esp32/partitions-2MiB.csv: Update table so firmware fits.
The current MicroPython app size is larger than the size allocated in the
partitions table.
2021-06-11 17:57:40 +10:00
Damien George 865abba197 esp32/makeimg.py: Load sizes from partition table and verify data fits.
Changes introduced are:
- the application offset is now loaded from the partition table instead of
  being hard-coded to 0x10000
- maximum size of all sections is computed using the partition table
- an error is generated if any section overflows its allocated space
- remaining bytes are printed for each section

Signed-off-by: Damien George <damien@micropython.org>
2021-06-11 15:43:49 +10:00
Jeff Epler 2cbdd18a20 esp32s2: Implement parallel image capture 2021-06-10 11:27:49 -05:00
Jeff Epler 268717e427 ParallelImageCapture: Switch to taking a list of pins
.. adopting validate_pins from RGBMatrix into shared-bindings

.. updating other platforms for API change
2021-06-10 11:15:18 -05:00
Jeff Epler 7782bc2e2e Skeleton implementation, does nothing 2021-06-10 11:15:18 -05:00
Jeff Epler 98f812e0c2 esp32s2: cam.c: Remove GPIO interrupt at deinit 2021-06-10 11:15:18 -05:00
Jeff Epler 929d6dab73 esp32s2: cam.c: work around possible compiler bug 2021-06-10 11:15:18 -05:00
Jeff Epler 8c88ab8142 cam: Use a named constant instead of a number 2021-06-10 11:15:18 -05:00
Jeff Epler 400d1d90c9 cam: Add a way to check if a frame is ready without blocking 2021-06-10 11:15:18 -05:00
Jeff Epler 5d5098152a cam: Remove support for xclk
we do this our own way in CP
2021-06-10 11:15:18 -05:00
Jeff Epler 20098dfdd8 cam: Improve memory allocation
* realloc the dma descriptors and buffers, so we can change the image size
 * NULL out the camera pointer after deinit, so deinit is idempotent
2021-06-10 11:15:18 -05:00
Jeff Epler 43509495ea cam: Always work in total pixels, not width x height 2021-06-10 11:15:18 -05:00
Jeff Epler eaf2def340 esp32s2: fix build errors in cam.c 2021-06-10 11:15:18 -05:00
Jeff Epler dc6472bb5b esp32s2: Add "cam" files from esp-dev-kits@282a356
.. these files have been re-formatted by our code-formatting
scripts, so their content does NOT match upstream.
2021-06-10 11:15:18 -05:00
Jeff Epler a0ec95f092 kaluga 1.2: add camera_data_tuple 2021-06-10 11:15:18 -05:00
Jeff Epler 80f909001d esp32s2: Add support for `make monitor`
`idf.py monitor` connects to the debug UART and shows the messages.  In
contrast to a traditional terminal program, it also has the limited
ability to transform hex addresses into file & line number information,
especially for debug builds.

This requires the elf file be copied to a specific place.
2021-06-10 11:15:18 -05:00
Jeff Epler 3e83834621 esp32s2: Add claim_pin_number
In ParallelImageCapture we need to grab a group of pins by number
2021-06-10 11:15:10 -05:00
Dan Halbert b815164bdf Turn off keypad on a few small builds 2021-06-10 10:09:55 -04:00
Damien George 61f91de361 stm32/sdram: Prevent array-bounds warnings with GCC 11.
Signed-off-by: Damien George <damien@micropython.org>
2021-06-10 22:48:54 +10:00
Damien George cf849d84b9 stm32/boards: Enable MICROPY_HW_SPIFLASH_ENABLE_CACHE on VCC_GND boards.
Because these boards use the SPI flash cache in their bdev.c configuration.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-10 22:48:17 +10:00
Damien George 71e3538a32 stm32/usb: Add USB_VCP.irq method, to set a callback on USB data RX.
Usage:

    usb = pyb.USB_VCP()
    usb.irq(lambda u:print(u, u.read()), usb.IRQ_RX)

Signed-off-by: Damien George <damien@micropython.org>
2021-06-10 15:26:21 +10:00
Dan Halbert bdb70669a1 fix bad merge 2021-06-09 23:47:49 -04:00
Ben Clifford 5c835adb10 Correct pull-down direction in parameter documentation for rp2pio 2021-06-09 20:39:56 +00:00
Jeff Epler 576003e989
Merge pull request #4873 from netroy/fix-4810
Update the sdkconfig for LILYGO TTGO T8 ESP32-S2
2021-06-09 14:44:42 -05:00
Jeff Epler 26a75f74ec
Merge pull request #4862 from DavePutz/issue_3383
Fix for issue #3383 - SAMD5x microcontroller.cpu.voltage
2021-06-09 14:42:27 -05:00
root bc34403d71 Removed all references to MICROCONTROLLER_VOLTAGE_DISABLE 2021-06-09 10:46:14 -05:00
Aditya 3e463ed89e fix #4810 2021-06-09 17:37:22 +02:00
Dan Halbert abe29fc6d9 merge from upstream 2021-06-08 18:03:43 -04:00
Jeff Epler 124c7b785a Add kaluga version 1.3
.. this board is nearly the same as the "1.2" version originally
released, but makes a few changes to reduce pin conflicts between the 13-pin
camera header and the bootstrapping pins.  "1.3" was introduced in summer
2020-- check the bottom of your board silk to find out whether you have a 1.2
or a 1.3, because it's not clear whether there is remaining 1.2 stock.

Another vexing fact about the 1.3 is that its LCD can have one of two
chipets, and the chipset used is not marked anywhere!
2021-06-08 13:28:48 -05:00
root 72db13fc2d enable microcontroller.cpu.voltage on SAME54 2021-06-08 10:04:40 -05:00
Zoltán Vörös 8c02b94946 nrf: Add more math sources to Makefile, and enable log2 implementation.
This commit adds a few math functions to the source list in the Makefile,
and implements the log2f function, so that ulab can be compiled on the nrf
boards.  It also addresses part of #5162.
2021-06-08 16:39:47 +10:00
Abilio Marques 525a920ca5 unix/modffi: Fix conversion between Python integers and ffi types.
This commit fixes the following problems converting to/from Python integers
and ffi types:
- integers of 8 and 16 bits not working on big endian
- integers of 64 bits not working on 32 bits architectures
- unsigned returns were converted to signed Python integers

Fixes issue #7269.
2021-06-08 13:06:17 +10:00
Limor "Ladyada" Fried c1c101ca2d
Merge pull request #4864 from ladyada/main
macropad rev B definion and fix for SH110x addressing
2021-06-07 21:59:56 -04:00
Lucian Copeland b6a268fca4 Further deinit additions 2021-06-07 14:13:59 -04:00
Lucian Copeland 63c1791d87 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-06-07 14:11:41 -04:00
Lucian Copeland f2149edbd2 Add deinit to new boards 2021-06-07 12:48:12 -04:00
lady ada 2ff9e9766f handclang 2021-06-07 12:39:59 -04:00
Limor "Ladyada" Fried c4f685aab1
Merge pull request #4865 from ZodiusInfuser/pimoroni_boards
Added definition for upcoming Pimoroni RP2040 board
2021-06-07 11:13:01 -04:00
lady ada 3890271f19 turn off all neopix when booting 2021-06-06 18:30:17 -04:00
lady ada 01195c2089 update to rev B 2021-06-06 15:57:41 -04:00
Damien George d00523ba0c zephyr/boards: Enable ubluetooth on nucleo_wb55rg board.
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06 21:57:44 +10:00
Damien George 80e79a777d zephyr: Add initial ubluetooth module integration.
Currently only advertising and scanning are supported, using the ring
buffer for events (ie not synchronous events at this stage).

The ble_gap_advertise.py multi-test passes (tested on a nucleo_wb55rg
board).

Signed-off-by: Damien George <damien@micropython.org>
2021-06-06 21:57:06 +10:00
Maureen Helm 5cb2ade65b zephyr: Update to Zephyr v2.6.0.
Updates the zephyr port build instructions and CI to use the latest
zephyr release tag.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06 20:17:42 +10:00
Maureen Helm 3331b1811d zephyr: Disable CONFIG_NET_SOCKETS_POSIX_NAMES.
Zephyr's default value for CONFIG_NET_SOCKETS_POSIX_NAMES was changed
from false to true between Zephyr v2.5.0 and v2.6.0. This caused
conflicts in MicroPython, which uses the zsock_ prefixed functions, so
disable it.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06 20:17:42 +10:00
Maureen Helm f17c0db5f7 zephyr: Update disk access configuration for Zephyr v2.6.0.
Zephyr's Kconfig symbols and defaults for SDHC/SDMMC disk drivers and
the disk access subsystem were reworked between Zephyr v2.5.0 and
v2.6.0. Update MicroPython accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-06 20:17:42 +10:00
root b2dea8ae0d Fix for issue #3383 - SAMD51 microcontroller.cpu.voltage 2021-06-05 16:17:14 -05:00
Damien George 36cb365cad unix/main: Increase stack limit on ARM architectures.
Signed-off-by: Damien George <damien@micropython.org>
2021-06-05 11:03:09 +10:00
Scott Shawcroft bc014cecb5
Merge pull request #4859 from DavePutz/hcsr04_fix
Fix pulsein pause and resume functions to handle HCSR04
2021-06-04 13:26:05 -07:00
Scott Shawcroft 121ea4283f
Merge pull request #4855 from jepler/update-run-tests
run_tests: Parallelism improvements, partial sync with micropython
2021-06-04 10:36:50 -07:00
root 57334c812e Fix pulsein pause and resume functions to handle HCSR04 2021-06-04 12:10:41 -05:00
ZodiusInfuser af7557b53b
Updated with final USB PID 2021-06-04 16:02:32 +01:00
Jeff Epler a99eba35b8
Merge pull request #4809 from DavePutz/issue_4266
Fix for Issue #4266 - second PWMAudioOut interferes with the first one
2021-06-03 19:08:28 -05:00
Jeff Epler e6fe55349d run_tests: Parallelism improvements, partial sync with micropython
Take changes from https://github.com/micropython/micropython/pull/3694
(expected to be merged soon) as well as other accumulated stuff from
upstream that we want.

Leave our desired differences, including:
 * silencing warnings in python3
 * renaming the file descriptors returned by openpty()
 * adding ulab tests
 * Adding "." to the import path for skip_if

This speeds up `make test_full` and should also reduce the time in CI
a little bit.
2021-06-03 16:17:47 -05:00
leo chung fad0efdcf2 esp32/Makefile: Fix wrong target for partition-table.bin.
"$(BUILD)/partition_table/partition  -table.bin" is typing mistake.

Signed-off-by: leo chung <gewalalb@gmail.com>
2021-06-04 01:04:35 +10:00
robert-hh 53fea8598e mimxrt/boards: Add board configuration files for Teensy 4.1.
These are at the moment more or less identical to the Teensy 4.0 files,
except for the pins.csv file and the flash size.
2021-06-04 01:00:39 +10:00
Philipp Ebensberger b8c65b174f mimxrt/machine_adc: Add the ADC class to the machine module.
This adds the machine.ADC class with the read_u16() method.  make-pins.py
and supporting files are updated to generate ADC information.
2021-06-04 00:51:58 +10:00
ZodiusInfuser 6011db3aec Added board definition 2021-06-03 15:49:23 +01:00
robert-hh bbdc98f72e mimxrt: Enable many Python and some extmod features.
Besides Python features this includes the extmod modules which make use of
the Pin module, especially machine.softSPI, machine.SoftI2C and onewire.
2021-06-04 00:38:18 +10:00
robert-hh a40e1473dc mimxrt: Add floating point support.
Since not all boards support double fp, all board specific .mk files are
affected too.
2021-06-04 00:37:22 +10:00
George White 9cde8a2265
MicroMod SAMD51 - correct I2C_INT pin 2021-06-03 06:05:13 -04:00
George White 26c6bd2346
MicroMod SAMD51 - correct SCL2 2021-06-03 05:39:09 -04:00
George White 6e36f30d9f
MicroMod SAMDt1 - correct board nane 2021-06-03 05:36:05 -04:00
robert-hh 2f365d234e mimxrt/machine_rtc: Add the RTC class to the machine module.
Initial version, using the LP RTC clock.  It provides setting the date and
time with rtc.init() or rtc.datetime(), and reading the date and time with
rtc.datetime() or rtc.now().  The method weekday() reports the weekday of
the current date.  It starts with 0 for Monday.

The tuple order for datetime() and now() matches the CPython sequence:
(year, month, day, hour, minute, second, microsecond, TZ).  TZ is ignored
and reported as None.  Microsecond is provided at a best effort.

If a battery is not supplied, the default boot date/time is 1970/1/1 0:0:0.
With a battery, the clock continues to run even when the board is not
powered.  The clock is quite precise.  If not, using rtc.calibration() may
help.
2021-06-03 15:24:04 +10:00
George White 2b068414e1
Fix missing comma
Doh
2021-06-02 23:13:08 -04:00
robert-hh d79105d7c0 mimxrt/machine_timer: Leave the Timer clock source at IPG clock.
Setting it to OSC_CLK interferes the utime module's functionality.  This is
still an area demanding an understanding.
2021-06-03 13:03:02 +10:00
robert-hh cdd95ce737 mimxrt/machine_timer: Reuse any existing timer objects.
So there is a 1-1 mapping of hardware timer to Python object.
2021-06-03 13:02:51 +10:00
George White 0437199706
Fix some pin mappings
Conflicts:
	ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c
2021-06-02 22:22:04 -04:00
robert-hh 5226d6e1ee mimxrt: Remove __WFE() from MICROPY_EVENT_POLL_HOOK.
The device is unreliable with the WFE included.  This needs further
investigation.
2021-06-03 12:21:36 +10:00
George White 4c493c86c8 Add Sparkfun MicroMod SAMD51 2021-06-02 22:05:58 -04:00
George White db1830d62b Add Sparkfun MicroMod SAMD51 2021-06-02 21:53:23 -04:00
Dan Halbert 51fc9027eb Remove non-product Adafruit boards 2021-06-02 12:41:07 -04:00
Dan Halbert 3930440bc5 Fix usb_cdc.enable(console=False, data=True) 2021-06-02 11:29:56 -04:00
Dan Halbert 6af36757a7 lengthen RP2040 xosc startup time 2021-06-02 08:50:20 -04:00
Scott Shawcroft 6ee9acc900
Merge pull request #4755 from jepler/esp32s2-protomatter
Esp32s2 protomatter
2021-06-01 13:32:34 -07:00
Scott Shawcroft 892dfa84ed
Merge pull request #4826 from jepler/actions-windows-build
Check that select firmwares build on Windows with MSYS2
2021-06-01 13:04:06 -07:00
robert-hh 4c407c790f mimxrt: Add the Timer class to the machine module.
It supports three hardware timer channels based on the PIT timers of the
MIMXRT MCU.  The timer id's are 0, 1 and 2.  On soft reboot all active
timers will be stopped via finalisers.
2021-06-02 00:33:13 +10:00
robert-hh 745b4319a2 mimxrt/boards/TEENSY40: Re-create the flash FS after deploy.
This is required since the Teensy Halfkay loader attempts to erase all of
the flash but fails to do so, at least in my tests.  Formatting brings it
back to a known state.
2021-06-01 23:52:45 +10:00
robert-hh dfd4324eb1 mimxrt: Add flash storage support with VFS and littlefs filesystem.
This commit adds full support for a filesystem on all boards, with a block
device object mimxrt.Flash() and uos.VfsLfs2 enabled.

Main changes are:
- Refactoring of linker scripts to accomodate reserved area for VFS.  VFS
  will take up most of the available flash. 1M is reserved for code.  9K is
  reserved for flash configuration, interrupts, etc.
- Addition of _boot.py with filesystem init code, called from main.c.
- Definition of the mimxrt module with a Flash class in modmimxrt.[ch].
- Implementation of a flash driver class in mimxrt_flash.c.  All flashing
  related functions are stored in ITCM RAM.
- Addition of the uos module with filesystem functions.
- Implementation of uos.urandom() for the sake of completeness of the uos
  module.

It uses sample code from CircuitPython supplied under MIT license, which
uses the NXP SDK example code.

Done in collaboration with Philipp Ebensberger aka @alphaFred who
contributed the essential part to enable writing to flash while code is
executing, among other things.
2021-06-01 23:42:57 +10:00
robert-hh c303b15f10 mimxrt: Enable frozen modules. 2021-06-01 22:57:09 +10:00
robert-hh fdaf2b80d9 mimxrt: Add custom help text and enable help("modules"). 2021-06-01 22:52:44 +10:00
reppad 61d25f197a Add requested Espressif PID 2021-05-30 20:18:49 +02:00
root 8761e4bfd7 Initialize pacing timer 2021-05-30 12:12:38 -05:00
reppad 625fa881c6 Add Muselab Nanoesp32_s2 w/Wrover 2021-05-30 16:14:21 +02:00
Joseph Chiu c5d2095e59 esp32/espneopixel: Add support for GPIO32 and GPIO33.
Adds support for NeoPixels on GPIO32 and GPIO33 on ESP32.  Otherwise,
NeoPixels wired to GPIO32/33 wll silently fail without any hints to the
user.

With thanks to @robert-hh.

Fixes issue #7221.
2021-05-30 23:36:50 +10:00
IAMLIUBO a18f695e29 esp32/boards: Add M5STACK_ATOM board definition.
ATOM is a very small ESP32 development board produced by M5Stack, with a
size of 24mm * 24mm, with peripherals such as WS2812, IR, button, MPU6886
(Only Matrix), and 8 GPIO extensions.  It also has a plastic shell.
2021-05-30 23:15:13 +10:00
Limor "Ladyada" Fried c80e253072
Merge pull request #4824 from CytronTechnologies/add-maker-pi-rp2040
Added New Board - Cytron Maker Pi RP2040
2021-05-30 00:24:20 -04:00
Kong Wai Weng b06ec0a776 Added libraries dependency. 2021-05-30 09:57:00 +08:00
root a2b220370e Fix formatting issue 2021-05-29 12:26:41 -05:00
root 760e8c77bd Changes to correct repeat playing on a channel 2021-05-29 11:55:10 -05:00
Jeff Epler 6b476c19ba fix formatting 2021-05-29 08:10:10 -05:00
Kong Wai Weng ebe4d90ac3 Updated the copyright information. 2021-05-29 10:12:22 +08:00
Jeff Epler b0dd0e344c
Merge pull request #4772 from EmergReanimator/atmel-samd
[resolves #4771] DEBUG UART supported on ATMSAME5x
2021-05-28 20:05:06 -06:00
Jeff Epler 49db85cb3d Check that select firmwares build on Windows with MSYS2
This configuration is used by @ladyada and more often than it should
we've discovered late that a change introduced problems building
there.

By adding this to regular CI, hopefully we learn about and fix these
issues sooner rather than later.
2021-05-28 16:47:29 -05:00
Lucian Copeland feff243e8f Add RTC deep sleep alarm support 2021-05-28 13:52:05 -04:00
Kong Wai Weng ebda9e07f4 Use 4 spaces instead of tab. 2021-05-29 01:04:13 +08:00
Kong Wai Weng bfcb8c5896 Do not use neopixel as status LED. Also removed the unused definition. 2021-05-29 00:47:14 +08:00
Kong Wai Weng 5920ac647a Modified the essential files for Maker Pi RP2040. 2021-05-28 22:42:54 +08:00
Kong Wai Weng 321e5dd16f Use underscore instead of dash for board name. 2021-05-28 18:01:02 +08:00
Damien George db8704ecbd esp8266,esp32: Update manifest to point to new dirs in micropython-lib.
Following a refactoring of micropython-lib.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-28 18:32:56 +10:00
Lucian Copeland 24041f34b0 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-05-27 18:40:40 -04:00
Lucian Copeland 8e1892ac6f Implement RP2040 Alarm module
Adds light and deep sleep functionality for the TimeAlarm and PinAlarm
alarm categories. Adds board deinit for all platforms.
2021-05-27 18:33:29 -04:00
Damien George 211c3e41f1 stm32/boards/PYBD_SF2: Disable GCC 11 warnings for array bounds.
With GCC 11 there is now a warning about array bounds of OTP-mac, due to
the OTP being a literal address.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 23:57:51 +10:00
Kong Wai Weng da7c74f614 Initial commit. 2021-05-27 18:02:52 +08:00
Damien George 62f75376dd stm32/boards/NUCLEO_L432KC: Fix FS size and enable LFS1 filesystem.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 12:18:41 +10:00
Dan Halbert 6e71f6099f
Merge pull request #4812 from dhalbert/remove-a-few-boards
Remove non-product Adafruit boards
2021-05-26 18:22:26 -04:00
Dan Halbert 5eb4cc6489 Remove non-product Adafruit boards 2021-05-26 16:01:17 -04:00
Jeff Epler 11288c1c28 esp32s2: Add rgbmatrix support 2021-05-26 11:21:59 -05:00
Jeff Epler 4de8fa09ab esp32s2: peripherals: store address of timer peripheral in its struct
.. this is helpful if we need to go down to the esp-idf low level
I/O routines
2021-05-26 11:18:02 -05:00
Jeff Epler 60c9a57815 esp32s2: Add pin_number, reset_pin_number needed by rgbmatrix 2021-05-26 11:18:02 -05:00
Jeff Epler 6750d3feab esp32s2: Introduce, use NO_PIN
GPIO_NUM_NC is -1 so it's equivalent to the existing code.
2021-05-26 11:18:02 -05:00
Damien George 0abf6f830c esp8266/boards/GENERIC_512K: Add custom manifest without FS modules.
The 512k build does not have a filesystem so there is no reason to include
the filesystem-related modules.  This commit provides a custom manifest.py
for this board which no longer includes: _boot.py, flashbdev.py,
inisetup.py, upip.py, upip_utarfile.py.  This cuts the build down by about
9k of flash.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-26 21:41:40 +10:00
Damien George b84406f313 qemu-arm: Add support for Cortex-A9 via sabrelite board.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-26 16:24:00 +10:00
root 24e641a834 Fix for Issue #4266 2021-05-25 16:06:00 -05:00
robert-hh c732b80f05 mimxrt: Extend the Pin module for SoftI2C, SoftSPI support.
This change consists mostly of changing and extending the required
definitions in mphalport.h.
2021-05-25 20:43:52 +02:00
Dan Halbert d79d68705b
Merge pull request #4763 from jepler/esp32s2-build-memory-info
Add build_memory_info for esp32s2
2021-05-25 13:41:35 -04:00
Jeff Epler f21eec5fe1 Work for non-psram builds
This is more or less a complete re-organization of the code.

 * Use the actual byte size of the .bin file as the flash size,
   as the algorithm for packing sections into the flash is complicated
 * Match each section to a data region & find the high water mark in the
   region
 * Report on all the RAM regions, separately

Note that elftools is a requirement of esp-idf and so does not need to
be listed in our requirements.txt.
2021-05-25 10:06:31 -05:00
Philipp Ebensberger c326d9a67b mimxrt: Enable built-in help. 2021-05-26 00:12:45 +10:00
Philipp Ebensberger ff5d39529c mimxrt: Implement machine.Pin class.
- modified pin type from pin_obj_t to machine_pin_obj_t
- created machine_pin.c
- implemented basic version of make-pins.py to genertate pins.c/.h files
  automatically; the only alternate function currently supported is GPIO
- added af.csv files for all supported MCUs
- replaced pins.c/pins.h files with pin.csv for all boards
- implemented on/off/high/low/value/init methods
- Implemented IN/OUT/OPEN_DRAIN modes
- modified LDFLAGS for DEBUG build to get usefull .elf file for debugging

Signed-off-by: Philipp Ebensberger
2021-05-26 00:12:42 +10:00
Scott Shawcroft 038c9d6194
Merge pull request #4796 from Neradoc/nera-pwmrgb-status-pimoroni
Enable the PWM status LED on Pimoroni Tiny 2040 and PicoSystem
2021-05-24 13:30:55 -07:00
lady ada 2e90d5ed07 clang a bit 2021-05-22 12:39:42 -04:00
lady ada d52f149e84 add ESP CS pin to make wifi demos easier 2021-05-22 12:22:28 -04:00
lady ada ac855afb48 Some pin neatening and updated PID to unused Adafruit one! 2021-05-22 11:57:46 -04:00
BlitzCityDIY 14dbec7c04 Merge branch 'main' of https://github.com/blitzcitydiy/circuitpython into main 2021-05-22 01:02:21 -04:00
BlitzCityDIY 9f4eb48e70 Updating MISO
While testing WIFI realized MISO was defined incorrectly
2021-05-22 01:02:06 -04:00
BlitzCityDIY 352281e23e Adding Arduino Nano RP2040 Connect
Re-commiting to fix local GitHub config issues. Adding CircuitPython support for the Arduino Nano RP2040 Connect. Have tested all digital and analog I/O, I2C, onboard LSM6DSOX. Uses the AT25SF128A external flash.
2021-05-21 20:44:11 -04:00
Neradoc 6808d04d53 enable the PWM status LED on Pimonoroni Tiny 2040 and PicoSystem 2021-05-21 20:13:30 +02:00
Kevin Matocha b14d573655 reduce SPI display baudrate from 60 MHz to 5 MHz to reduce display glitch 2021-05-20 21:23:59 -05:00
Scott Shawcroft 561ffec693
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 13:46:42 -07:00
Dan Halbert f5aa55c247
Merge pull request #4606 from hierophect/sleep-revamp
Internal API revisions to sleep
2021-05-20 16:00:52 -04:00
Lucian Copeland af43f956d3 Merge remote-tracking branch 'upstream/main' into sleep-revamp 2021-05-20 15:56:34 -04:00
Scott Shawcroft 5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
Damien George ea81bcf1c0 stm32/mboot: Leave bootloader from thread mode, not from IRQ.
Leaving the bootloader from an IRQ (eg USB or I2C IRQ) will not work if
MBOOT_LEAVE_BOOTLOADER_VIA_RESET is disabled, ie if mboot jumps directly to
the application.  This is because the CPU will still be in IRQ state when
the application starts and IRQs of lower priority will be blocked.

Fix this by setting a flag when the bootloader should finish, and exit the
bootloader always from the main (top level) thread.

This also improves the USB behaviour of mboot: it no longer abruptly
disconnects when the manifest command is sent.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-21 00:46:01 +10:00
Damien George 748339b281 stm32/uart: Configure pull-up only on RX and CTS, not TX and RTS.
RX and CTS are the input pins and pull-ups are enabled so they don't cause
a problem if left unconnected.  But the output pins don't need a pull up
(they were originally all configured with pull up in commit
8f7491a109).

If needed, the pull-ups can be disabled in Python using machine.Pin after
the UART is constructed.

See issue #4369.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-21 00:38:04 +10:00
Damien George a96afae90f stm32/sdio: Fix case of SDIO DMA turning off mid transfer.
The DMA driver will turn off DMA if it hasn't been used for an amount of
time (to save power).  The SDIO driver for cyw43 WLAN was not informing the
DMA driver that it was using DMA and there was a chance that the DMA would
turn off in the middle of an SDIO DMA transfer.  The symptoms of this would
be printing of SDIO error messages and a failure to communicate with the
cyw43 WLAN module.

This commit fixes this issue by changing the SDIO driver to use the
dma_nohal_XXX API to initialise and start the DMA.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-21 00:08:13 +10:00
Mike Causer 47b778332a all: Replace busses with buses.
"buses" is the widely accepted plural form of "bus".
2021-05-20 23:22:03 +10:00
Mike Causer 1ca66efbf7 stm32/boards: Add VCC_GND_F407ZG board. 2021-05-20 23:17:51 +10:00
Mike Causer c24003abec stm32/boards: Add VCC_GND_F407VE board. 2021-05-20 23:15:56 +10:00
Dan Halbert 74355e8281
Merge pull request #4783 from tannewt/fix_sm_rp2040_7
Fix safe mode on rp2040 (in 7.x)
2021-05-20 09:02:35 -04:00
Scott Shawcroft 499a4388cf
Handle inverted neopixel power 2021-05-19 17:29:02 -07:00
Scott Shawcroft 42ee48ccb5
Improve error for invalid parameters 2021-05-19 14:09:11 -07:00
Scott Shawcroft ee7a701487
Switch to start_advertising arg 2021-05-19 12:21:48 -07:00
gabewillen e29158483e
Update Adapter.h
Added the tx_power to the adapter object
2021-05-19 11:56:49 -07:00
gabewillen 6b39df406a
Update Adapter.c
Added support for setting transmitter power currently done during every time advertising starts as implemented in the Arduino library
2021-05-19 11:55:47 -07:00
Scott Shawcroft b78e9fcd19
Improve STM reset reason
This causes safe mode to skip the wait for reset when waking up
from an alarm. (It also means we don't flash the LED for it.)
2021-05-19 11:48:02 -07:00
EmergReanimator 7805392b9e
Update UART.c
Incorporating feedback: https://github.com/adafruit/circuitpython/pull/4772#discussion_r634112839
2021-05-19 20:19:16 +02:00
Scott Shawcroft 642fbcf87a
Handle status led power
This no longer turns on status LED power before running user code.
Therefore, use of the status LED on some boards will also have to
enable the power.
2021-05-19 10:57:14 -07:00
Scott Shawcroft 9dabe882f1
Fix safe mode on rp2040 2021-05-19 10:18:43 -07:00
Scott Shawcroft 14a550c395
Merge pull request #4770 from ladyada/main
Add rev A of macropad definition
2021-05-19 10:09:19 -07:00
Dan Halbert 4c928acbd4
Merge pull request #4774 from kamtom480/spresense_usb_fix
spresense: Fix USB CDC and MSC
2021-05-19 12:42:08 -04:00
lady ada 9a70aa1e8d figure out the AREF thing later 2021-05-18 22:20:38 -04:00
Limor "Ladyada" Fried b667736110 Merge branch 'adafruit:main' into main 2021-05-18 20:55:55 -04:00
lady ada d8b895f1d7 add LED and speaker - natch! 2021-05-18 20:53:13 -04:00
Lucian Copeland bce541dcc5 Minor text fixes 2021-05-18 15:16:25 -04:00
lady ada fdbd3bc8c2 add missing AREF pin 2021-05-18 11:09:31 -04:00
ladyada cec9015e19 iz makropad with oled 2021-05-18 11:09:03 -04:00
Kamil Tomaszewski da248d1594 spresense: Fix USB CDC and MSC 2021-05-18 17:02:16 +02:00
Damien George 7408ca1d78 mimxrt: Improve ticks and sleep functions using GPT.
SysTick cannot wake the CPU from WFI/WFE so a hardware timer is needed to
keep track of ticks/delay (similar to the nrf port).

Fixes issue #7234.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-18 22:36:32 +10:00
root 9393467819 Update comment for spelling 2021-05-17 22:13:00 -05:00
Bruno Martins ea2d83e961 nrf/boards: Add support for evk_nina_b3 board. 2021-05-18 12:14:57 +10:00
Bruno Martins 94fb5e7f5a nrf: Add machine.memXX, and allow boards to customise some features. 2021-05-18 12:01:51 +10:00
Lucian Copeland 633d83cc3e Merge remote-tracking branch 'upstream/main' into sleep-revamp 2021-05-17 18:57:10 -04:00
root ff4b1b28d2 iFormatting fixes 2021-05-17 16:43:55 -05:00
root 11ef36d09d Implement pulseout for RP2040 2021-05-17 16:24:45 -05:00
EmergReanimator 2b64b1d335 [resolves #4771] DEBUG UART supported on ATMSAME5x 2021-05-17 21:22:24 +02:00
Limor "Ladyada" Fried 9752162508
Merge pull request #4765 from dhalbert/rotary-trinkey-rev-c-pins
Update various Trinkey pins and add _pixelbuf
2021-05-15 11:52:33 -04:00
Dan Halbert ea0e18d2e0 fix logic for suppressing ja and ko clean builds when not necessary 2021-05-14 23:41:44 -04:00
Dan Halbert 1e2a945782 Make busio.SPI be NotImplementedError on proxlight to save space 2021-05-14 21:52:54 -04:00
Scott Shawcroft 5c33c9d597
Fix SAMD
RTC needed to wait for sync. NeoPixel on SAMD doesn't need disabled
caches. It just needed timing adjustment for 120mhz clock speed.
2021-05-14 16:14:24 -07:00
Dan Halbert 990e58902d add CIRCUITPY_PIXELBUF to all trinkeys; add NeoPixel to prox 2021-05-14 17:09:15 -04:00
Dan Halbert 6a2ba83e30 Update Rotary Trinkey and Slide Trinkey pins 2021-05-14 15:40:29 -04:00
Lucian Copeland 715f7ee490 Add STM32 and NRF52 compatibility 2021-05-14 14:34:35 -04:00
Scott Shawcroft 689ec86225
Merge pull request #4754 from dhalbert/fix-endpoint-checking
Fix endpoint checking; Clean up safe mode printing
2021-05-14 11:25:01 -07:00
Jeff Epler c931e5deb7 Add build_memory_info for esp32s2
This detects an overflowed flash partition, such as
```
1452105 bytes used, -10313 bytes free in flash firmware space out of 1441792 bytes (1408.0kB).
444428 bytes used, 1652724 bytes free in ram for stack and heap out of 2097152 bytes (2048.0kB).
```
on a metro esp32-s2 built with debugging.
2021-05-14 10:39:07 -05:00
Dan Halbert c65986f526 shrink a bit more 2021-05-14 09:18:14 -04:00
Mike Causer 605b74f390 esp32/boards: Fix spelling mistakes in comments for UM_xxx boards. 2021-05-14 22:26:29 +10:00
Mike Causer 9e65662a11 esp32/boards: Set default I2C and SPI pins on UM_xxx boards.
And fix incorrect I2C and SPI pins in the feathers2 module.
2021-05-14 22:26:05 +10:00
Mike Causer 538b9a9be5 esp32/machine_i2c: Allow boards to configure I2C pins using new macros.
Following how SPI is configured (and how stm32 does it).
2021-05-14 22:22:13 +10:00
Dan Halbert 0fcb11b7b2 shrink some STM32F4 builds: turn MIDI back off 2021-05-13 23:14:12 -04:00
Dan Halbert fa6c06fb38 count in/out endpoints; allow more usb modules on low-endpoint boards 2021-05-13 21:59:02 -04:00
Scott Shawcroft 1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Lucian Copeland 295103bb31 Merge remote-tracking branch 'upstream/main' into sleep-revamp 2021-05-13 16:22:12 -04:00
Scott Shawcroft 35ee4add63
Merge pull request #4388 from hierophect/stm-alarm
STM32: Alarms and sleep
2021-05-13 10:27:51 -07:00
Lucian Copeland 849e3a7319 Style fixes, submodules 2021-05-13 11:24:27 -04:00
Jeff Epler 47947dc23c
Merge pull request #4749 from tannewt/merge_1.15
Merge in MicroPython 1.15
2021-05-12 20:52:11 -05:00
Scott Shawcroft 966d25c6a5
Merge MicroPython v1.15 into CircuitPython 2021-05-12 17:51:42 -07:00
Damien George 9a0bca2c2a stm32/mboot: Make LEDs and reset-mode selection more configurable.
A board can now customise mboot with:
- MBOOT_LED1, MBOOT_LED2, MBOOT_LED3, MBOOT_LED4: if it needs to have
  different LEDs for mboot compared to the application
- MBOOT_BOARD_LED_INIT: if it needs a fully customised LED init function
- MBOOT_BOARD_LED_STATE: if it needs a fully customised LED state-setting
  function
- MBOOT_BOARD_GET_RESET_MODE: if it needs a fully customised function to
  get the reset mode

With full customisation, the only requirement is a single LED to show the
status of the bootloader (idle, erasing, flashing, etc), which can be
configured to do nothing if needed.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-12 13:44:57 +10:00
Damien George 6639e282c7 stm32/mboot: Add MBOOT_LEAVE_BOOTLOADER_VIA_RESET option.
It is enabled by default to get the standard behaviour of doing a reset
after it is finished, but can be disabled by a board to jump straight to
the application (likely the board needs to use MBOOT_BOARD_CLEANUP to make
this work).

The application is passed a reset mode of BOARDCTRL_RESET_MODE_BOOTLOADER
if the bootloader was active and entered via a jump.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-12 13:44:52 +10:00
Damien George 9ee116c452 stm32/boardctrl: Adjust logic for running boot.py, main.py.
This new logic is equivalent to the old logic when the only possibilities
for reset_mode are NORMAL, SAFE_MODE and FILESYSTEM, which is the standard
case.  But the new logic also allows other reset_mode values (eg
BOOTLOADER) to run boot.py and main.py.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-12 13:44:47 +10:00
Damien George ee4ffc1804 stm32/powerctrl: Add MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET option.
When disabled the bootloader is entered via a direct jump.  When enabled
the bootloader is entered via a system reset then a jump.  It's enabled by
default to retain the existing behaviour, which is the recommended way.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-12 13:44:41 +10:00
lady ada 502b66eac0 moar trinkz 2021-05-11 22:03:05 -04:00
Scott Shawcroft a70fc0caee
Merge pull request #4744 from tannewt/merge_1.14
Merge MicroPython 1.14
2021-05-11 16:11:58 -07:00
Scott Shawcroft e02a26453c
Merge MicroPython 1.14 into CircuitPython 2021-05-11 15:07:40 -07:00
Damien George 4404dababb rp2/CMakeLists.txt: Include tinyusb_common in PICO_SDK_COMPONENTS.
So the TinyUSB headers can be found during qstr processing.

Fixes issue #7236.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-11 12:46:18 +10:00
Dan Halbert 0eb4b9b982
Merge pull request #4742 from kattni/led
Add LED pin to Adafruit boards.
2021-05-10 21:12:02 -04:00
Chris Greening cce7096d1a esp32/boards/UM_TINYPICO: Fix include of sdkconfig fragment.
This was broken by 32ec07a350
2021-05-11 09:36:41 +10:00
Lucian Copeland 525b34b042 Fix formatting and broken links
Implmements missed pre-commit changes for all files, and fixes links broken by
cleanup in #4698
2021-05-10 18:04:43 -04:00
Lucian Copeland 0d3c5222d8 Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-05-10 17:30:33 -04:00
Kattni Rembor 294ef59f27 Add LED pin to Adafruit boards. 2021-05-10 16:39:01 -04:00
Scott Shawcroft 4eb4f14840
Merge pull request #4734 from dhalbert/dynamic-usb-fixes
fix HID; fix interface name table creation
2021-05-10 12:55:29 -07:00
Kattni 054317d47d
Merge pull request #4735 from bleything/bhb-unreserve-pa00-pa01
free up PA00 and PA01 on BHB
2021-05-10 12:38:02 -04:00
Damien George 0e87459e2b esp32/boards: Add UM_FEATHERS2 and UM_TINYS2 board definitions.
Based on original commit made by Seon Rozenblum aka @UnexpectedMaker.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-10 16:56:53 +10:00
Seon Rozenblum 32ec07a350 esp32/boards: Rename TINYPICO board to UM_TINYPICO.
And add default hardware SPI 0 pins in mpconfigboard.h, and
CONFIG_LWIP_LOCAL_HOSTNAME in sdkconfig.board.
2021-05-10 16:56:53 +10:00
Damien George 5093d49fae esp32: Extend support for S2 series, and S3 where applicable.
Improvements made:
- PSRAM support for S2
- partition definition for 16MiB flash
- correct ADC and DAC pins
- correct GPIO and IRQ pins
- S3 components in CMakeLists

Based on original commit made by Seon Rozenblum aka @UnexpectedMaker.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-10 16:56:53 +10:00
Neradoc dcfb7949d7
fix FunHome to FunHouse
FunHouse, sweet FunHouse.
2021-05-10 05:34:03 +02:00
Ben Bleything 44f162bb64
free up PA00 and PA01 on BHB 2021-05-09 10:19:48 -07:00
Dan Halbert becff6f93d restore pulseio to pirkey 2021-05-09 11:33:35 -04:00
nm3210 a3de9bda5f Swap mis-labelled D0/D1 pins on SparkFun Pro Micro RP2040 2021-05-08 21:35:37 -04:00
Damien George d0de16266f rp2/mpthreadport: Add mp_thread_deinit to reset core1 on soft reset.
Any code running on core1 should be stopped on soft-reset (the GC heap is
reset so if code continues to run on core1 it will see corrupt memory).

Signed-off-by: Damien George <damien@micropython.org>
2021-05-09 00:08:30 +10:00
Jeff Epler 5e06c91244
Merge pull request #4716 from tyomitch/main
s/Circuit Python/CircuitPython/g
2021-05-08 08:47:29 -05:00
Jeff Epler 446169e078
Merge pull request #4720 from tannewt/merge_1.13
Merge in MicroPython 1.13
2021-05-08 08:46:03 -05:00
Damien George 864e4ecc47 esp32/mpthreadport: Use binary semaphore instead of mutex.
So a lock can be acquired on one Python thread and then released on
another.  A test for this is added.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-08 22:47:03 +10:00
Damien George 31e0b8c71c esp32/mpthreadport: Don't explicitly free thread struct in TCB cleanup.
Because vPortCleanUpTCB runs on the FreeRTOS idle task and cannot execute
any VM or runtime related code like freeing memory.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-08 22:47:03 +10:00
Lucian Copeland 9920741c2f Merge remote-tracking branch 'upstream/main' into stm-espr-pico-fix 2021-05-06 17:43:38 -04:00
Scott Shawcroft 42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Lucian Copeland 80a459d1f8 Remove settings for DNP oscillator 2021-05-06 13:52:07 -04:00
Dan Halbert ebf9dcb47a
Merge pull request #4689 from dhalbert/dynamic-usb-descriptors
Dynamic USB descriptors
2021-05-06 13:51:38 -04:00
Artyom Skrobov 908d83d1f2 s/Circuit Python/CircuitPython/g
Some comments and messages used the non-standard spelling
2021-05-06 16:22:35 +03:00
mishafarms 8ff3520f67 esp32/esp32_rmt: Clear config struct before filling it out.
Or unset entries will have garbage in them.

Signed-off-by: mishafarms <github@mishafarms.us>
2021-05-06 15:53:56 +10:00
Damien George 9e29217c73 unix/modffi: Use a union for passing/returning FFI values.
This fixes a bug where double arguments on a 32-bit architecture would not
be passed correctly because they only had 4 bytes of storage (not 8).  It
also fixes a compiler warning/error in return_ffi_value on certian
architectures: array subscript 'double[0]' is partly outside array bounds
of 'ffi_arg[1]' {aka 'long unsigned int[1]'}.

Fixes issue #7064.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-06 12:17:10 +10:00
Scott Shawcroft 59c2787702
Fix esp32s2 build 2021-05-05 18:27:21 -07:00
Scott Shawcroft 3fda0c0a1b
Fix board builds and use MP_ERROR_TEXT in py and extmod 2021-05-05 17:51:52 -07:00
Dan Halbert 843598ec3a fix more board builds 2021-05-05 18:44:27 -04:00
Dan Halbert 579cdf30f1 fix more build errors 2021-05-05 16:49:29 -04:00
Dan Halbert c37f021791 regularize and shrink many builds 2021-05-05 12:35:41 -04:00
Dan Halbert fc8e1c4c2e address review comments 2021-05-05 12:35:12 -04:00
Jeff Epler 4054860ff3 Name the variant like micropython does 2021-05-05 11:00:39 -05:00
Jeff Epler 607148bb85 Add frzqstr to coverage build
This fixes a fail in extra_coverage.py.
2021-05-05 11:00:39 -05:00
Scott Shawcroft 30c7aa8fc9
Merge pull request #4650 from anecdata/ap
wifi.radio Access Point modes
2021-05-05 08:47:55 -07:00
Scott Shawcroft f0bb26d70f
Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
Damien George 8172c2e9c5 rp2: Move manifest.py to boards directory.
To match other ports.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-04 23:39:24 +10:00
David Lechner ca0c75f504 stm32/boards: Change default LSI_VALUE to 32000 for F4 MCUs.
In the STM32 HAL libraries, the default value for LSI_VALUE for F4 MCUs is
32 kHz.

Signed-off-by: David Lechner <david@pybricks.com>
2021-05-04 16:53:40 +10:00
Dan Halbert adc3d7d55e update Python API according to review comments 2021-05-03 22:29:02 -04:00
Dan Halbert d2b558993e merge from main, including MicroPython 1.12 merge 2021-05-03 20:56:04 -04:00
Scott Shawcroft b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
Scott Shawcroft 25ccd5d8f1
Merge pull request #4679 from t-ikegami/wio_add_pin_assign
Add DAC* and RTL_* pin assignments to Wio Terminal board.
2021-05-03 11:08:28 -07:00
Scott Shawcroft 678279720f
Merge pull request #4702 from rsbohn/patch-1
esp32-s2: Don't set PWMOut frequency to 0
2021-05-03 11:01:59 -07:00
Randall Bohn d1db782760
Move validation code to the right spot.
As MicroDev1 pointed out the problem is a divide by zero when calculating the duty cycle.
Maybe need to check again in `common_hal_pwmio_pwmout_set_frequency()`.
2021-05-03 09:16:46 -06:00
Randall Bohn 8613b9a9fe
Trim Trailing Whitespace
was causing pre-commit checks to fail
2021-05-03 07:41:52 -06:00
Dan Halbert 94ed5e0048
Merge pull request #4696 from dhalbert/no-pulseio-on-small-boards
Include pulseio only on CIRCUITPY_FULL_BUILD
2021-05-03 09:35:29 -04:00
Dan Halbert 9ca0e689a5
Merge branch 'main' into wio_add_pin_assign 2021-05-03 09:33:18 -04:00
Dan Halbert 8b8968101d
Merge pull request #4691 from nm3210/sparkfunthingplusrp2040_boardupdate
Update Sparkfun Thing Plus RP2040 pins to match board breakouts
2021-05-03 09:27:19 -04:00
Randall Bohn 2db113f191
esp32-s2: Don't set PWMOut frequency to 0
FeatherS2 crashes if you set the PWMOut frequency to 0.
This change will raise `ValueError: Invalid PWM frequency` if the requested frequency is 0.
(Lifted from the atmel-samd port)
2021-05-03 07:15:39 -06:00
Dan Halbert e475dc8899 Fix broken builds 2021-05-03 00:09:15 -04:00
robert-hh 1e2f0d2809 rp2/tusb_port: Add the device unique-id to the USB id.
The number shown in the USB id is now the same as that returned by
machine.unique_id().  All 8 bytes are inserted as hex into the USB id.  A
usb id at /dev/serial/by-id then looks like:

    usb-MicroPython_Board_in_FS_mode_e469b03567342f37-if00
2021-05-02 23:38:01 +10:00
Jan Jurgen Griesfeller d80a037e6b rp2/boards: Add board definition for SparkFun Pro Micro board. 2021-05-02 23:23:27 +10:00
Jan Jurgen Griesfeller 3c918d0f58 rp2/boards: Add board definition for SparkFun Thing Plus RP2040. 2021-05-02 23:22:46 +10:00
Artyom Skrobov ca35c0059c py/repl: Autocomplete builtin modules.
Doing "import <tab>" will now complete/list built-in modules.

Originally at adafruit#4548 and adafruit#4608

Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02 23:11:14 +10:00
Dan Halbert 749a3ac978 remove pwmio from litex port 2021-05-01 23:22:52 -04:00
Dan Halbert ebedeeb51d
Merge pull request #4695 from dhalbert/magtag-spi-naming
MagTag: Remove board.SPI(); rename display-only pins
2021-05-01 09:44:42 -04:00
Dan Halbert 07dab34294 re-enable for pirkey 2021-05-01 09:32:13 -04:00
Dan Halbert 670c49ed94 MagTag: Remove board.SPI(); rename display-only pins 2021-04-30 22:58:51 -04:00
Jeff Epler 1a52cbcf5d Format a straggler file 2021-04-30 16:42:25 -05:00
Jeff Epler da19e8e2d7 Merge remote-tracking branch 'origin/main' into fix-codeformat-subdirs 2021-04-30 15:31:08 -05:00
Jeff Epler dfa7c3d32d codeformat: Fix handling of `**`
After discussing with danh, I noticed that `a/**/b` would not match `a/b`.

After correcting this and re-running "pre-commit run --all", additional
files were reindented, including the codeformat script itself.
2021-04-30 15:30:13 -05:00
nm3210 929ee8d3b4 Fix pre-commit whitespace error 2021-04-30 14:16:13 -04:00
Scott Shawcroft d93a9a1dbc
Merge pull request #4683 from DavePutz/issue_4661
Issue #4661 - Wrap pulsein values when maxlen is exceeded.
2021-04-30 11:07:54 -07:00
microDev eebcd2eeaf
remove unsupported authmodes 2021-04-30 22:11:32 +05:30
microDev 6640db9555
make authmode settable 2021-04-30 21:35:02 +05:30
Jeff Epler e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
Dan Halbert 353e55d710
Merge pull request #4688 from jepler/fix-pixelbuf-subscr
objtype: Restore our customized behavior of instance_subscr
2021-04-30 10:45:44 -04:00
Dan Halbert be7b2b00a8 uncrustify with newer version of uncrustify 2021-04-30 10:40:12 -04:00
nm3210 9c1466a330 Update Sparkfun Thing Plus RP2040 pins to match board
This fixes some missing and incorrectly-assigned pins for the SparkFun Thing Plus RP2040 protoboard so that they actually match what the board says. This also changes the default SPI pins from the SD card pins to the breakout pins on the side of the board.
2021-04-30 09:37:37 -04:00
microDev 7c845818b3
Merge branch 'main' into ap 2021-04-30 17:11:22 +05:30
Damien George 888664130c zephyr/boards: Add config for nucleo_wb55rg board.
This board does not work with CONFIG_NETWORKING enabled.  And
CONFIG_CONSOLE_SUBSYS is enabled so that ctrl-C works.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:32:16 +10:00
Damien George b46a033e25 zephyr/modmachine: Add machine.idle().
Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:32:16 +10:00
Damien George d120859857 zephyr: Run scheduled callbacks at REPL and during mp_hal_delay_ms.
And ctrl-C can now interrupt a time.sleep call.  This uses Zephyr's k_poll
API to wait efficiently for an event signal, and an optional semaphore.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:32:16 +10:00
Damien George e9e9c76ddf all: Rename mp_keyboard_interrupt to mp_sched_keyboard_interrupt.
To match mp_sched_exception() and mp_sched_schedule().

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:13:43 +10:00
Damien George bd54eb566f nrf/boards/microbit: Use mp_sched_exception() where appropriate.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:13:43 +10:00
Damien George 7cbf826a95 py/scheduler: Add mp_sched_exception() to schedule a pending exception.
This helper is added to properly set a pending exception, to mirror
mp_sched_schedule(), which schedules a function.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:13:43 +10:00
Damien George a41cd150be esp8266/modnetwork: Use mp_handle_pending() to raise pending exception.
If MICROPY_ENABLE_SCHEDULER is enabled then MP_STATE_VM(sched_state) must
be updated after handling the pending exception, which is done by the
mp_handle_pending() function.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 15:13:43 +10:00
Tsutomu IKEGAMI 11a9372da3 Set Xtal, Aref, and NC pins to be IGNORE_ed in microcontroller.pin for Wio Terminal. 2021-04-30 13:06:09 +09:00
Tsutomu IKEGAMI d79d6ba688 Add I2S_* pin assignments to Wio Terminal board. 2021-04-30 13:03:29 +09:00
Mark 5ef9b10669
Merge pull request #4685 from microDev1/authmode
Add AuthMode class
2021-04-29 22:12:58 -05:00
Dan Halbert b5efce12cd delete hid .py; undo some debugging changes 2021-04-29 23:05:31 -04:00
iabdalkader a1111b83ed stm32/sdio: Allow configuring the SDMMC periph used for SDIO.
This can now be selected by setting MICROPY_HW_SDIO_SDMMC, which defaults
to 1, ie SDMMC1.  The pins can also be selected and default to the standard
C8/C9/C10/C11/C12/D2.
2021-04-30 11:26:04 +10:00
Mark 5679eb4fd7
Merge pull request #4677 from skerr92/add-cp-sapling-rev-b
Add cp sapling rev b
2021-04-29 19:22:49 -05:00
iabdalkader baa712b7f0 stm32/boards/PYBD_SF2: Enable RF switch compile option. 2021-04-30 10:16:15 +10:00
Seth Kerr 8b611d4b6b changing mpconfigboard makefile 2021-04-29 16:45:08 -06:00
Lucian Copeland 07b86fcb76 fix sleepmemory object redefine error 2021-04-29 17:28:06 -04:00
Jeff Epler 90bdb25219 ignore some pins to reclaim flash space 2021-04-29 14:36:29 -05:00
Jeff Epler 6498684f5e ignore some pins to reclaim flash space 2021-04-29 14:30:31 -05:00
Lucian Copeland bab5a22f0c Fix build issues
H7 compatibility problems in port.c and peripherals/exti
NRF build failures due to new use of const for PinAlarm pin objects
Isolated board flash overage on blackpill_with_flash, remove audio modules
2021-04-29 14:48:16 -04:00
Kattni Rembor 4d97680cae Fix board definition. 2021-04-29 13:45:39 -04:00
DavePutz 1ec59cd534
Fix up indentation 2021-04-29 12:38:13 -05:00
Kattni Rembor 0bf747870a Fixing board definition. 2021-04-29 12:41:23 -04:00
iabdalkader 80788154b3 stm32/sdio: Add functions to re/enable SDIO/SDIOIT. 2021-04-30 01:12:08 +10:00
iabdalkader 4d96786823 stm32/uart: Enable HW flow control for UART 1/5/7/8. 2021-04-30 01:10:02 +10:00
Damien George cf7e71fa43 stm32/sdcard: Allow configuring the SDMMC periph used for SD/MMC card.
This can now be selected by setting MICROPY_HW_SDCARD_SDMMC, which defaults
to 1, ie SDMMC1.  This commit also renames the SD pin configuration macros
from MICROPY_HW_SDMMC2_xxx to MICROPY_HW_SDCARD_xxx, as well as renaming
MICROPY_HW_SDMMC_BUS_WIDTH to MICROPY_HW_SDCARD_BUS_WIDTH.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:58:17 +10:00
Damien George 37494b8c8a stm32/mboot: Allow mboot to be placed at any location in flash.
A board can now define MBOOT_TEXT0_ADDR to place mboot at a location other
than 0x08000000.  This can be useful if, for example, there is already a
different bootloader on the device.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:42:59 +10:00
Damien George 58be5a5aa3 stm32/mboot: Allow a board to customise the linker scripts.
A board can now define MBOOT_LD_FILES (at the Makefile-level) to specify
custom linker scripts.  And stm32_generic.ld has been split into 2 pieces
so one or the other can be reused (usually stm32_sections.ld wolud be
reused by a board, and stm32_memory.ld redefined).

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:42:59 +10:00
Damien George 97f09fda3e stm32/mboot: Fix mp_hal_delay_us() and add mp_hal_ticks_ms().
Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:42:59 +10:00
Damien George fd01b6c779 stm32/adc: Allow mboot to use basic ADC functions.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:42:59 +10:00
Damien George ef2896bdea stm32/mboot: Allow a board to add source files to the build.
A board can now use BUILDING_MBOOT at the Makefile-level to do things
conditional on building mboot, for example add source files to SRC_C.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:42:59 +10:00
Damien George 885b246ca9 stm32/boardctrl: Show first reset-mode state on LEDs when selecting.
Commit 1e297c8898 introduced a bug where the
very first reset-mode state on the LEDs was not shown, because prior to
that commit the first reset-mode state was the same as the initial LED
state (green on, others off) and update_reset_mode() was called after
setting this initial LED state.

This is fixed in this commit by changing the update_reset_mode() loop so
that it displays the current reset mode before doing the delay.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:32:12 +10:00
Damien George a72b8443ca stm32/boardctrl: Add constants for reset mode values.
And use the same boardctrl.h header for both the application and mboot so
these constants are consistent.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:31:35 +10:00
microDev 1b972c51c3
add authmode class 2021-04-29 18:42:36 +05:30
Damien George 647fa63f9c stm32/softtimer: Support static soft timer instances.
This adds support for making static (ie not on the Python GC heap) soft
timers.  This can be useful for a board to define a custom background
handler, or eventually for BLE/network processing to use instead of systick
slots; it will be more efficient using soft timer for this.

The main issue with using the existing code for static soft timers is that
it would combine heap allocated and statically allocated soft_timer_entry_t
instances in the same pairing-heap data structure.  This would prevent the
GC from tracing some of the heap allocated entries (because the GC won't
follow pointers outside the heap).

This commit makes it so that soft timer entries are explicitly marked,
instead of relying on implicit marking by having the root of the pairing
heap in the root pointer section.  Also, on soft reset only the heap-
allocated soft timers are deleted from the pairing heap, leaving the
statically allocated ones.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-29 16:54:35 +10:00
Damien George 89b64478c7 stm32/softtimer: Add support for having a C-based callback.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-29 16:54:35 +10:00
Dan Halbert f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
Seth Kerr 555ade7ff3 final change to ja flags i think 2021-04-28 20:42:13 -06:00
Steve App 21fee92be6 esp32: Restore FROZEN_MANIFEST support with new CMake build system.
This commit re-enables the command-line make option "FROZEN_MANIFEST".  The
boards/*/mpconfigboard.cmake will now use the command-line FROZEN_MANIFEST
value if supplied.

Usage: make FROZEN_MANIFEST=~/foo/my-manifest.py
2021-04-29 12:34:00 +10:00
Seth Kerr 8090af07dd fix ja build issue 2021-04-28 19:14:45 -06:00
Lucian Copeland 9fe8d61656 Fix broken MP macros from 1.11 merge 2021-04-28 18:26:52 -04:00
Lucian Copeland 5c4500dbfa Fix MP type macros 2021-04-28 15:35:15 -04:00
Lucian Copeland 9feef41c82 Merge remote-tracking branch 'upstream/main' into stm-alarm 2021-04-28 15:10:55 -04:00
Tsutomu IKEGAMI 0d25b95f0d Add definitions of PB2[4-9] pins to microcontroller.pin for atmel-samd. 2021-04-29 02:19:34 +09:00
root cfac07c1cc Wrap pulsein when maxlen is exceeded 2021-04-28 11:20:13 -05:00
Dan Halbert d4d96bb25f
Merge pull request #4236 from jun2sak/nrf52-sleep
sleep and wakeup for nrf52
2021-04-28 12:11:31 -04:00
Tsutomu IKEGAMI 22c4abd28f Add DAC* and RTL_* pin assignments to Wio Terminal board. 2021-04-28 18:57:21 +09:00
Dan Halbert 8500e846c6 partially working 2021-04-27 23:53:23 -04:00
Seth Kerr e85091193b adding CP Sapling Rev B 2021-04-27 16:30:44 -06:00
Dan Halbert f98a54628b wip: compiles 2021-04-27 14:37:36 -04:00
Scott Shawcroft 17fcd499b2
Merge pull request #4649 from tannewt/merge_1.11_2
Merge MicroPython v1.11 into CircuitPython
2021-04-27 11:02:02 -07:00
Scott Shawcroft f99deeda68
Merge pull request #4668 from DavePutz/issue_4659
Increased possible pulsein length to ~65 ms.
2021-04-27 11:01:51 -07:00
Scott Shawcroft 9e183bbbba
Merge pull request #4674 from kattni/dotstar-pins
Adding clearer on-board DotStar pin names.
2021-04-27 10:56:47 -07:00
Kattni Rembor 4e1d2fa056 Adding clearer on-board DotStar pin names. 2021-04-27 12:52:24 -04:00
Melissa LeBlanc-Williams d7faac11b8 Release display on FunHouse for DeepSleep 2021-04-27 09:09:23 -07:00
iabdalkader a708848b0c stm32/uart: Fix H7 UART clock source configuration.
Previously to this commit, Usart16ClockSelection was overwritten and
Usart234578ClockSelection was not set.
2021-04-28 00:46:48 +10:00
plan-do-break-fix 4dc802400f stm32,teensy: Correct typos in project README files. 2021-04-28 00:29:18 +10:00
Daniel Maslowski f452b9c265 pic16bit/Makefile: Make the XC compiler version user-configurable. 2021-04-28 00:18:04 +10:00
Damien George 43a8c8178e bare-arm: Switch to use MICROPY_ERROR_REPORTING_NONE to reduce size.
Reduces size of this port by about 3300 bytes, and demonstrates how to use
this feature.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-27 23:52:40 +10:00
Damien George 65b90cd0f9 teensy: Provide own implementation of gc_collect, to not use stm32.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-27 12:08:00 +10:00
root 91739de71a Increased max pulse to 65535 us 2021-04-26 18:52:15 -05:00
Scott Shawcroft 76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Lucian Copeland 43840363c2 Fix submodule 2021-04-26 17:59:21 -04:00
Kattni 65c1ddb570
Merge pull request #4667 from ajs256/trinkey_pixel_fixes
Trinkey pixel fixes
2021-04-26 17:19:14 -04:00
anecdata a1e2afadce AP ip_info, gateway, & subnet 2021-04-26 00:22:51 -05:00
Dan Halbert c26e49c2e6 wip: starting to try to compile 2021-04-25 23:17:41 -04:00
root 5bd1da21a2 Increased possible pulsein length to 32 ms. 2021-04-25 21:38:57 -05:00
Jeff Epler 92919c25c2
Merge pull request #4666 from DavePutz/issue_4660
Reset buffer index in PulseIn clear
2021-04-25 20:33:58 -05:00
ajs256 de3c5ff976
oh crud, i forgot a semicolon 2021-04-25 16:42:58 -07:00
anecdata f20a53177b add authmode to start_ap() 2021-04-25 18:20:18 -05:00
anecdata 747d72f5a5 redundant with system log 2021-04-25 18:18:45 -05:00
ajs256 4bafbca0c3 Trinkeys: Clear neopixels on board reset 2021-04-25 12:58:52 -07:00
root d1861a6b9c Reset buffer index in PulseIn clear 2021-04-25 14:24:21 -05:00
Limor "Ladyada" Fried f7f6a42f3d
Merge pull request #4663 from zapwizard/patch-1
Update pins.c
2021-04-25 15:09:13 -04:00
zapwizard 889da596ff
Update pins.c
Both D0 and D1 were assigned to pin_GPIO7, fixed D0 to pin_GPIO6, which also matches the comment.
2021-04-25 13:10:52 -05:00
gamblor21 30f31639d3 Added statemachine deinit 2021-04-25 11:58:22 -05:00
jun2sak 872fff7fbb simplify system_on_idle_until_alarm() 2021-04-25 23:59:21 +09:00
anecdata c510c4d501 allow start/stop sta/ap (changing modes) when `wifi.radio.enabled = False` 2021-04-25 09:29:15 -05:00
Dan Halbert 9d1fcc3b14 merge from main 2021-04-25 10:27:52 -04:00