Commit Graph

8235 Commits

Author SHA1 Message Date
Frédéric Pierson c422ca3da1 rp2/boards: Add PYBSTICK26 RP2040 board definition. 2021-11-25 21:05:21 +11:00
Dan Halbert 95c09ac66f
Merge pull request #5610 from tannewt/rpi
Initial broadcom port for Raspberry Pi
2021-11-24 19:02:23 -05:00
Scott Shawcroft e6a68cc4a7
Shrink 3 SAMD builds by disabling onewireio 2021-11-24 14:27:49 -08:00
Scott Shawcroft ee5536386d
Merge remote-tracking branch 'adafruit/main' into rpi 2021-11-24 14:23:23 -08:00
Dan Halbert 2afe599811
Add missing include for zero2w pins.c 2021-11-24 09:43:06 -05:00
microDev e5c125d153
update espressif makefile formatting 2021-11-24 18:14:54 +05:30
microDev 7ba5513f9a
update espressif port
- update esp-idf to v4.4
- add esp32s3 support
- add analogio on esp32c3
- disable rgbmatrix on all espressif soc

Co-authored-by: Scott Shawcroft <scott@adafruit.com>
Co-authored-by: Seon Rozenblum <seon@unexpectedmaker.com>
2021-11-24 18:01:34 +05:30
robert-hh 81f706aee4 mimxrt: Support PWM using the FLEXPWM and QTMR modules.
Frequency range 15Hz/18Hz to > 1 MHz, with decreasing resolution of the
duty cycle.  The basic API is supported as documentated, except that
keyword parameters are accepted for both the instatiaton and the
PWM.init() call.

Extensions: support PWM for channel pairs.  Channel pairs are declared by
supplying 2-element tuples for the pins.  The two channels of a pair must
be the A/B channel of a FLEXPWM module.  These form than a complementary
pair.

Additional supported keyword arguments:

- center=value Defines the center position of a pulse within the pulse
  cycle.  The align keyword is actually shortcut for center.

- sync=True|False: If set to True, the channels will be synchronized to a
  submodule 0 channel, which has already to be enabled.

- align=PWM.MIDDLE | PMW.BEGIN | PWM.END. It defines, whether synchronized
  channels are Center-Aligned or Edge-aligned.  The channels must be either
  complementary a channel pair or a group of synchronized channels.  It may
  as well be applied to a single channel, but withiout any benefit.

- invert= 0..3. Controls ouput inversion of the pins.  Bit 0 controls the
  first pin, bit 1 the second.

- deadtime=time_ns time of complementary channels for delaying the rising
  slope.

- xor=0|1|2 xor causes the output of channel A and B to be xored.  If
  applied to a X channel, it shows the value oif A ^ B.  If applied to an A
  or B channel, both channel show the xored signal for xor=1.  For xor=2,
  the xored signal is split between channels A and B.  See also the
  Reference Manual, chapter about double pulses.  The behavior of xor=2 can
  also be achieved using the center method for locating a pulse within a
  clock period.

The output is enabled for board pins only.

CPU pins may still be used for FLEXPWM, e.g. as sync source, but the signal
will not be routed to the output.  That applies only to FLEXPWM pins.  The
use of QTMR pins which are not board pins will be rejected.

As part of this commit, the _WFE() statement is removed from
ticks_delay_us64() to prevent PWM glitching during calls to sleep().
2021-11-24 13:48:27 +11:00
Scott Shawcroft 927a720de9
Fix I2C and feedback from Dan 2021-11-23 17:23:13 -08:00
gamblor21 f7df39ef88 Re-enable on microbit v2 2021-11-23 13:20:00 -06:00
Jeff Epler b1a3ccb36c
clear out interrupt when freeing the timer
Closes #5418
2021-11-23 13:03:01 -06:00
Pierre Constantineau 81eed3ff4e
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-22 17:12:35 -06:00
Pierre Constantineau 401f1fadaf
Merge branch 'adafruit:main' into board-pykey87 2021-11-22 17:11:36 -06:00
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Damien George 90554d03c0 stm32/boards: Build NUCLEO_WB55 and STM32F769DISC without mboot enabled.
This is to make the builds for all nucleo/discovery boards uniform, so they
can be treated the same by the auto build scripts.

The CI script is updated to explicitly enable mboot and packing, to test
these features.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 17:12:16 +11:00
Damien George 01ceb9aca3 stm32/dma: Make DMA2_Stream3 exclusive to SDIO when CYW43 enabled.
This prevents SPI4/5 from being used if SDIO and CYW43 are enabled, because
the DMA for the SDIO is used on an IRQ and must be exclusivly available for
use by the SDIO peripheral.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 11:57:37 +11:00
Damien George dfa75f33a5 stm32/sdio: Don't explicitly disable DMA2 on deinit of SDIO.
Because DMA2 may be in use by other peripherals, eg SPI1.

On PYBD-SF6 it's possible to trigger a bug in the existing code by turning
on WLAN and connecting to an AP, pinging the IP address from a PC and
running the following code on the PYBD:

    def spi_test(s):
        while 1:
            s.write('test')
            s.read(4)

    spi_test(machine.SPI(1,100000000))

This will eventually fail with `OSError: [Errno 110] ETIMEDOUT` because
DMA2 was turned off by the CYW43 driver during the SPI1 transfer.

This commit fixes the bug by removing the code that explicitly disables
DMA2.  Instead DMA2 will be automatically disabled after an inactivity
timeout, see commit a96afae90f

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 11:57:37 +11:00
Peter Boin e83aa252f7 stm32/main: Run optional frozen module at boot.
If a board specifies a filename via MICROPY_BOARD_FROZEN_BOOT_FILE then
that will be run on start up, before the usual boot.py.
2021-11-22 11:56:24 +11:00
gamblor21 5337e45411 Only enable if not disabled 2021-11-21 11:39:42 -06:00
gamblor21 6d412e20c4 Disabling from some boards 2021-11-20 14:04:49 -06:00
gamblor21 d063bf2675 Initial commit for IS31 2021-11-20 13:46:11 -06:00
Nathan Young 7afb4f1129 Temporary: Use same USB PID as the MicroMod STM32 2021-11-20 13:10:41 +01:00
Lorenzo Cappelletti 8f0e304e65 stm32/boards: Add new board MikroElektronika Quail, and F427 support.
Quail (https://www.mikroe.com/quail, PID: MIKROE-1793) is based on an
STM32F427VI CPU, featuring 2048 kB of Flash memory and 192 kB of RAM.  An
on-board Cypress S25FL164K adds 8 MB of SPI Flash.

Quail has 4 mikroBUS(TM) sockets for Mikroe click(TM) board connectivity,
along with 24 screw terminals for connecting additional electronics and two
USB ports (one for programming, the other for external mass storage).

4 UARTs, 2 SPIs and 1 I2C bus are available for communication.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2021-11-19 16:33:13 +11:00
Lorenzo Cappelletti 16c7a80874 stm32/boards/MIKROE_CLICKER2_STM32: Add more detail to board.json.
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2021-11-19 16:32:53 +11:00
iabdalkader 78425208ba nrf/main: Use VFS helper function to mount fs and chdir. 2021-11-19 15:43:04 +11:00
Mike Causer 172a031dff rp2/boards/PIMORONI_PICOLIPO_16MB: Fix 16MB flash size.
Was incorrectly added as 7MB for an 8MB SPI flash, but this board has a
16MB chip, not 8MB, so it should be 15MB leaving 1MB for MicroPython.

Thanks to @robert-hh
2021-11-19 15:34:07 +11:00
Seon Rozenblum 1904833e0c esp32: Add SDCard support for S3, and a GENERIC_S3_SPIRAM board.
Also add support for GPIO 47 and 48 on S3 boards.
2021-11-19 14:05:55 +11:00
oli 0a9335ecaa rp2/rp2_pio: Support exec with sideset.
The rp2.StateMachine.exec errors when supplying a sideset action.  This
commit passes the sideset_opt from the StateMachine though to the parser.
It also adds some value validation to the sideset operator.

Additionally, the "word" method is added to the exec to allow any other
unsupported opcodes.

Fixes issue #7924.
2021-11-19 13:35:28 +11:00
Peter van der Burg 3dc9a42bc2 samd/README.md: Update README to reflect new features and boards. 2021-11-19 11:49:10 +11:00
Peter van der Burg b991902983 samd/boards/SEEED_XIAO: Add new board definition. 2021-11-19 11:48:25 +11:00
Peter van der Burg ef4e63aabc samd/boards/SEEED_WIO_TERMINAL: Add new board definition. 2021-11-19 11:48:12 +11:00
Peter van der Burg 771d673e5c samd/boards/SAMD21_XPLAINED_PRO: Update for flash and pins.
- mpconfigboard.h: flash and USART config
- mpconfigboard.mk: enable LFS1
- pins.c: define pins and LEDs
- pins.h: define structs and consts
2021-11-19 11:47:43 +11:00
Peter van der Burg fb79e58636 samd/boards/ADAFRUIT_TRINKET_M0: Update for flash and pins.
- mpconfigboard.h: flash and USART config
- mpconfigboard.mk: enable LFS1
- pins.c: define pins and LEDs
- pins.h: define structs and consts
2021-11-19 11:47:19 +11:00
Peter van der Burg 3d33dbedc9 samd/boards/MINISAM_M4: Update for flash and pins.
- mpconfigboard.h: flash and USART config
- mpconfigboard.mk: enable LFS1
- pins.c: define pins and LEDs
- pins.h: define structs and consts
2021-11-19 11:46:53 +11:00
Peter van der Burg 199b6a8a8b samd/boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS: Update for flash and pins.
- mpconfigboard.h: flash and USART config
- mpconfigboard.mk: enable LFS1
- pins.c: define pins and LEDs
- pins.h: define structs and consts
2021-11-19 11:46:30 +11:00
Peter van der Burg 72cb4ff596 samd/boards/ADAFRUIT_FEATHER_M0_EXPRESS: Update for flash and pins.
- mpconfigboard.h: flash and USART config
- mpconfigboard.mk: enable LFS1
- pins.c: define pins and LEDs
- pins.h: define structs and consts
2021-11-19 11:44:07 +11:00
Peter van der Burg 2f65ded1a2 samd: Add Pin and LED classes, and machine.unique_id. 2021-11-19 11:43:06 +11:00
Peter van der Burg 2121353602 samd: Add internal flash block device, filesystem and uos support. 2021-11-19 11:42:58 +11:00
Peter van der Burg 4c132614e1 samd/samd_soc: Allow a board to configure the low-level MCU config.
The board specific #defines will be moved to individual boards.
2021-11-19 11:42:47 +11:00
Peter van der Burg cd2223b8fe samd: Integrate latest asf4, add help, more time funcs and uPy features.
- Makefile: update to use new ASF4 files, support frozen manifest, and
  include source files in upcoming commits
- boards/manifest.py: add files to freeze
- boards/samd51p19a.ld: add linker script for this MCU
- help.c: add custom help text
- main.c: execute _boot.py, boot.py and main.py on start-up
- modules/_boot.py: startup file to freeze
- modutime.c: add gmtime, localtime, mktime, time functions
- mpconfigport.h: enabled more features for sys and io and modules
- mphalport.h: add mp_hal_pin_xxx macros
- mphalport.c: add mp_hal_stdio_poll
2021-11-19 11:05:05 +11:00
stijn 5900257dd6 extmod/uplatform: Use generic custom platform string.
Don't force the 'HAL' string to be part of the platform string because
it doesn't have a sensible meaning for all possible platforms, and
swap it with the PLATFORM_ARCH string so the strings which most platforms
have come first.
2021-11-18 10:46:14 +11:00
Scott Shawcroft 3b7d2f1dc3
Merge pull request #5593 from anecdata/ap_extras
Set AP MAC address
2021-11-17 10:26:36 -08:00
Nathan Young 0ff3c0dac0 Board definition for SparkFun Thing Plus - STM32 2021-11-17 19:18:28 +01:00
retsyo e5f9e2febc windows/mpconfigport.h: Enable help and help("modules").
Following a similar change to the unix port in
6430cd3e02
2021-11-17 14:52:39 +11:00
Matt van de Werken a4c0f52714 stm32/led: Support an extra 2 LEDs in board configuration.
Although the pyboard has only 4 LEDs, there are some boards that (may) have
more.  This commit adds 2 more LEDs to the led.c file that if defined in
the board-specific config file will be compiled in.
2021-11-17 14:46:58 +11:00
Pooya Moradi 95ccd9a005 nrf/Makefile: Improve Black Magic Probe commands.
Used batch mode to get rid of the confirmation prompt on flashing.
Used 'compare-sections' to verify flash.
Removed the unnecessary `quit` at the end.
2021-11-17 14:32:02 +11:00
Henk Vergonet d11ff0499f unix/modos: Add support for uos.urandom(n).
Use getrandom function if available, otherwise read from /dev/urandom.

Signed-off-by: Henk.Vergonet@gmail.com
2021-11-17 12:59:38 +11:00
robert-hh 5ed7a748f0 rp2/boards: Add neopixel.py to manifest.py.
Because machine.bitstream is now implemented on the rp2 port.
2021-11-17 10:02:32 +11:00
robert-hh b73d8b045a rp2/machine_bitstream: Implement the machine.bitstream driver.
Timing error is ~20ns at 125MHz, and ~10ns at 250MHz.
2021-11-17 10:01:15 +11:00
Pierre Constantineau da1ce6e80b
Merge branch 'adafruit:main' into board-pykey87 2021-11-16 15:53:42 -06:00
anecdata c2a5ca2fa2
INVERT the sense of the I2C_POWER pin (active low)
I don't have the board to test, but this was reported and discussed on Discord.
2021-11-16 14:47:53 -06:00
anecdata 193e936807 like #5571, but for AP 2021-11-16 12:21:50 -06:00
Dan Halbert 582a923ec9
Merge pull request #5579 from jepler/fix-optimization-same54
same54: Use the same optimization as other sam d5x/e5x
2021-11-16 08:32:08 -05:00
robert-hh 7d7d29dbe2 mimxrt: Fix mp_hal_quiet_timing_enter()/exit() so timer still runs.
The initial code disabled IRQs, which caused the us-ticks timer to stop.
The change here changes the priotity level, such that the timer still runs.
2021-11-16 23:20:06 +11:00
robert-hh 7cc9b257a9 mimxrt/boards: Update the board.json files and add deploy_xx.md files.
- Add board.md files for MIMXRT1060_EVK and MIMXRT1064_EVK warning about
  their experimental state.
- Add separate deploy_teensy.md and deploy_mimxrt.md files.
2021-11-16 23:17:42 +11:00
robert-hh d72d699dad mimxrt/boards: Add the Seeed ARCH MIX board.
The ARCH MIX board exposes the Ethernet Pins at it's connectors.  Therefore
the software is configured for using a LAN8720 PHY device.  Breakout boards
with the LAN8720 are easily available.
2021-11-16 23:11:21 +11:00
iabdalkader c3dceb1c32 rp2/boards: Add support for Arduino Nano RP2040. 2021-11-16 15:05:10 +11:00
Dan Halbert 73430af78b
-O2 without -fno-inline-functions 2021-11-15 22:36:23 -05:00
Dan Halbert bd22667eb5
Merge pull request #5571 from anecdata/set_mac
Set Station MAC address & validate connect SSID len
2021-11-15 20:33:54 -05:00
Pierre Constantineau 4f0fc1eb17
Merge branch 'adafruit:main' into board-pykey87 2021-11-15 16:45:15 -06:00
Scott Shawcroft ba2f32e374
Merge pull request #5578 from jepler/disable-mkfs-fat32
oofatfs: Allow fat32 mkfs to be compiled out.  optimize rainbowio & enable everywhere
2021-11-15 10:57:25 -08:00
Scott Shawcroft 894adc78e9
Merge pull request #5580 from jepler/litex-prototypes
litex: Enable -Werror=missing-prototypes
2021-11-15 10:22:59 -08:00
microDev 733bfbc10a
Merge branch 'main' into set_mac 2021-11-15 20:44:30 +05:30
Pierre Constantineau ce7cd22116 updated pins.c to enable support for PyKey87 2021-11-14 21:56:18 -06:00
Pierre Constantineau 2c3557d4af
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-14 21:44:10 -06:00
Jeff Epler edeb31f789
Fix remaining builds 2021-11-13 07:44:17 -06:00
iabdalkader 3745c393c8 rp2: Add support for Nina-W10 WiFi/BT module.
This commit integrates the Nina-W10 driver as an optional component in the
rp2 port.
2021-11-13 23:01:37 +11:00
Jeff Epler 59cb8e91b2
mimxrt1011: enable -Werror=missing-prototypes 2021-11-12 19:30:47 -06:00
Jeff Epler 535f4b3c54
mimxrt10xx: enable Werror 2021-11-12 19:30:43 -06:00
Mike Teachman b6dbbbe82f rp2/machine_i2s: Add I2S protocol support.
This commit adds I2S protocol support for the rp2 port:
- I2S API is consistent with STM32 and ESP32 ports
- I2S configurations supported:
  - master transmit and master receive
  - 16-bit and 32-bit sample sizes
  - mono and stereo formats
  - sampling frequency
  - 3 modes of operation:
    - blocking
    - non-blocking with callback
    - uasyncio
  - internal ring buffer size can be tuned
- DMA IRQs are managed on an I2S object basis, allowing other
  RP2 entities to use DMA IRQs when I2S is not being used
- MicroPython documentation
- tested on Raspberry Pi Pico development board
- build metric changes for this commit: text(+4552), data(0), bss(+8)

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-11-13 12:27:42 +11:00
MikeTeachman 6d5296e65e stm32,esp32: In machine_i2s, make object reference arrays root pointers.
This change eliminates the risk of the IRQ callback accessing invalid data.
Discussed here:
https://github.com/micropython/micropython/pull/7183#discussion_r660209875

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-11-13 12:22:42 +11:00
Jeff Epler ac978969f7
litex: Enable -Werror=missing-prototypes 2021-11-12 19:13:51 -06:00
Jeff Epler 1039e1116b
same54: Use the same optimization as other sam d5x/e5x
It's likely that this is a relic of my early testing.
2021-11-12 18:54:56 -06:00
Jeff Epler 1cea871c70
enable rainbowio on unix coverage port 2021-11-12 17:31:14 -06:00
Jeff Epler dfef5014ed
enable rainbowio with newly free space 2021-11-12 17:31:12 -06:00
Jeff Epler 12c95ee9e9
oofatfs: Allow fat32 mkfs to be compiled out
Saves 508 bytes
2021-11-12 17:31:12 -06:00
anecdata 31d45a3f32 fix old bug that was masking new bug 2021-11-12 16:27:13 -06:00
Dan Halbert b9ecb0fdb4
Merge pull request #5575 from jepler/bitmaptools-on-host
Enable bitmaptools on the 'unix' build, 'coverage' variant
2021-11-12 16:16:53 -05:00
Scott Shawcroft 1d76be2dbd
Merge pull request #5574 from microDev1/traceback
Fix traceback object init
2021-11-12 09:30:57 -08:00
Scott Shawcroft 6a8c82d542
Merge pull request #5573 from ladyada/main
fix speed by not rotating
2021-11-12 09:27:46 -08:00
Jeff Epler d55388a17d
Add bitmaptools to unix build 2021-11-12 10:47:18 -06:00
Jeff Epler c6dbc7df3a
Add displayio bitmaps to unix build 2021-11-12 10:47:17 -06:00
microDev b5dd8891e2
turn off `onewireio` on `feather_m0_adalogger` 2021-11-12 20:02:22 +05:30
MikeTeachman 0be3b91f11 stm32,esp32: In machine_i2s, send null samples in underflow situations.
Eliminate noise data from being sent to the I2S peripheral when the
transmitted sample stream is stopped.

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-11-12 16:50:15 +11:00
Magnus von Wachenfeldt 6d9da27c21 esp32: Support building with latest IDF v5.
The latest ESP-IDF v5.0-dev declares MAJOR_VERSION 5 and MINOR_VERSION 0.
timer_ll_set_alarm_enable() is also changed to timer_ll_set_alarm_value().
2021-11-12 16:40:46 +11:00
anecdata e4f06f69cd maybe fewer bytes 2021-11-11 23:23:52 -06:00
anecdata bb8e9ef483 tweak exception messages (re-tested) 2021-11-11 21:54:41 -06:00
lady ada 104af801b7 fix speed by not rotating 2021-11-11 21:39:23 -05:00
anecdata 18f2019300 Set Station MAC address & validate connect SSID len 2021-11-11 17:04:35 -06:00
Limor "Ladyada" Fried accadf9c25
Merge pull request #5570 from ladyada/main
add esp32s2 tft feather rev A
2021-11-11 17:06:34 -05:00
Scott Shawcroft c1177662cd
Merge pull request #5537 from microDev1/monitor-mode
Add Monitor Mode
2021-11-11 10:10:39 -08:00
Dan Halbert adac5ee596
Merge pull request #5563 from jepler/enable-error-missing-prototypes
Additional missing-prototypes fixes
2021-11-11 11:57:43 -05:00
lady ada 0ba47ed115 comma on 2021-11-11 11:43:44 -05:00
Jeff Epler cd6599ce65
A few more missing-prototypes fixes 2021-11-11 08:42:30 -06:00
lady ada bcec249091 displaaaaaaaaay 2021-11-10 23:13:22 -05:00
Dan Halbert f058c5ec8c fix kicksat-sprite 2021-11-10 23:05:06 -05:00
Jeff Epler 340d6b9213
more missing-prototypes fixes 2021-11-10 21:00:17 -06:00
Dan Halbert e7d9dc323b shrink kicksat-sprite, simmel, pyb_nano_v2 2021-11-10 21:12:41 -05:00
ladyada d30c3ba4c6 nu board w tft 2021-11-10 17:23:29 -05:00
Dan Halbert 58485bc0b1 Switch SAMD51 and SAME51 back to -Os from -O2
The SAMx51 builds were getting very close to full on larger translations. This PR
adds 1400 bytes of enabled features, and pushed some over the edge.
2021-11-10 16:00:38 -05:00
Jeff Epler ebc8359c67
disable missing-prototypes diagnostics in yet another tinyusb file 2021-11-10 12:47:55 -06:00
Jeff Epler 5cba23e04d
More missing-prototypes fixes 2021-11-10 12:22:07 -06:00
Jeff Epler 017b52c455
further raspberrypi fixes 2021-11-10 12:11:06 -06:00
microDev a62675a81a
fix wifi reset and monitor deinit routine 2021-11-10 23:38:44 +05:30
Jeff Epler 9e799a7c74
-Werror=missing-prototypes for nRF 2021-11-10 11:26:54 -06:00
Jeff Epler c9475adb00
Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
lady ada afd035eb56 remove old nopsram version 2021-11-10 12:05:16 -05:00
Jeff Epler 621953c960
Additional missing-prototypes fixes
I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
2021-11-10 10:55:53 -06:00
Dan Halbert a69496b0e7
Merge pull request #5562 from microDev1/traceback
Refactor traceback handling
2021-11-10 11:53:35 -05:00
microDev 53a68f7ce6
turn off `onewireio` on `arduino_nano_33_iot` 2021-11-10 20:25:46 +05:30
Jeff Epler 63fbf98186
Enable -Wmissing-prototypes for atmel-samd 2021-11-09 20:05:00 -06:00
Jeff Epler 20cbd5e635 Disable bitmapio on some boards where it no longer fits 2021-11-08 18:58:33 -06:00
Jeff Epler cbfa41f238 Merge remote-tracking branch 'origin/main' into dither3 2021-11-08 16:46:36 -06:00
Scott Shawcroft bb71f8c9b3
Merge pull request #5544 from jepler/alphablend
bitmaptools: add alphablend
2021-11-08 10:50:03 -08:00
Jeff Epler 6351de6ad1 espressif: Allow -DENABLE_JTAG=0 to force JTAG off
With the Kaluga devkit, the camera interferes with the JTAG function.
However, having DEBUG turned on e.g., to get extended debug information
on the UART debug connection remains useful.

Now, by arranging to add to CFLAGS += -DDEBUG -DENABLE_JTAG=0, this
configuration is easy to achieve.
2021-11-08 10:38:05 -06:00
EmergReanimator 94866fc1e3
Merge branch 'adafruit:main' into stm 2021-11-07 14:19:54 +01:00
EmergReanimator a0074c36d8 Improved accuracy of common_hal_mcu_delay_us of STM port.
SysTick Current Value Register must be cleared before enabling.
2021-11-07 14:19:01 +01:00
Jeff Epler 6790f95953 Fix disabling of FRAMEBUFFERIO on atmel-samd
.. this needs to imply the disabling of RGBMATRIX too
2021-11-05 15:19:01 -05:00
Jeff Epler 4f62b540a2 Disable bitmaptools on thunderpack_v11 2021-11-05 15:18:41 -05:00
Dan Halbert 49207fba2c
Merge pull request #5549 from jepler/samd-watchdog-rounding
atmel-samd: Fix converting watchdog seconds to cycles
2021-11-05 14:39:59 -04:00
lady ada 02573676e7 add KB2040 and fix Trinkey QT2040 pid 2021-11-05 12:43:44 -04:00
Jeff Epler 43b593725b atmel-samd: Fix converting watchdog seconds to cycles
It's intended that the actual timeout always be at least the requested
timeout.  However, due to multiplying by the wrong factor to get from
seconds to cycles, a timeout request of e.g., 8.1s (which is less than
8.192s) would give an actual timeout of 8, not 16 as it should.
2021-11-05 11:40:08 -05:00
Jeff Epler 8e8c44afea Merge remote-tracking branch 'origin/main' into alphablend 2021-11-05 11:24:51 -05:00
Jeff Epler d532ad388b disable framebufferio so bitmaptools can fit 2021-11-05 11:24:03 -05:00
Damien George ff4f1f3ab3 esp8266/boards/GENERIC: Enable f-strings.
Costs 612 bytes of code space.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-05 14:05:54 +11:00
Damien George fa873ce67c minimal/mpconfigport.h: Disable features that are not needed.
Now that there are feature levels, and that this port uses
MICROPY_CONFIG_ROM_LEVEL_MINIMUM, it's easy to see what optional features
can be disabled.  And this commit disables them.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-05 13:12:18 +11:00
Jeff Epler 334a9c85ce Merge remote-tracking branch 'origin/main' into gifio 2021-11-04 20:22:00 -05:00
Scott Shawcroft a08412420e
Merge pull request #5540 from jepler/continuous-capture
ParallelImageCapture: Add continuous capture on espressif
2021-11-04 13:33:32 -07:00
microDev b435e7b56a
update wifi monitor
- rename loss method to lost
- add method to get queued packet count

Co-authored-by: anecdata <16617689+anecdata@users.noreply.github.com>
2021-11-04 16:21:18 +05:30
Jim Mussared c9c55032dc minimal/Makefile: Don't force a 32-bit build.
Word-size specific configuration is now done automatically, so it no longer
requires this to match the ARM configuration.

Also it's less common to have 32-bit compilation support installed, so this
will make it work "out of the box" for more people.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-04 15:59:20 +11:00
Scott Shawcroft 0dfb7a9a2d
Merge pull request #5541 from DavePutz/issue_5477
Corrected number of serial bytes returned
2021-11-03 16:53:15 -07:00
root 1e3215f4ee Corrected number of serial bytes returned 2021-11-03 16:29:05 -05:00
Pierre Constantineau f3eb9ea5e1
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-03 14:07:45 -06:00
Jeff Epler a8614a61dc ParallelImageCapture: Add continuous capture on espressif
By having a pair of buffers, the capture hardware can fill one buffer while
Python code (including displayio, etc) operates on the other buffer.  This
increases the responsiveness of camera-using code.

On the Kaluga it makes the following improvements:
 * 320x240 viewfinder at 30fps instead of 15fps using directio
 * 240x240 animated gif capture at 10fps instead of 7.5fps

As discussed at length on Discord, the "usual end user" code will look like
this:

    camera = ...

    with camera.continuous_capture(buffer1, buffer2) as capture:
        for frame in capture:
            # Do something with frame

However, rather than presenting a context manager, the core code consists of
three new functions to start & stop continuous capture, and to get the next
frame.  The reason is twofold.  First, it's simply easier to implement the
context manager object in pure Python.  Second, for more advanced usage, the
context manager may be too limiting, and it's easier to iterate on the right
design in Python code.  In particular, I noticed that adapting the
JPEG-capturing programs to use continuous capture mode needed a change in
program structure.

The camera app was structured as
```python
while True:
    if shutter button was just pressed:
        capture a jpeg frame
    else:
        update the viewfinder
```

However, "capture a jpeg frame" needs to (A) switch the camera settings and (B)
capture into a different, larger buffer then (C) return to the earlier
settings. This can't be done during continuous capture mode. So just
restructuring it as follows isn't going to work:

```python
with camera.continuous_capture(buffer1, buffer2) as capture:
    for frame in capture:
        if shutter button was just pressed:
            capture a jpeg frame, without disturbing continuous capture mode
        else:
            update the viewfinder
```

The continuous mode is only implemented in the espressif port; others
will throw an exception if the associated methods are invoked.  It's not
impossible to implement there, just not a priority, since these micros don't
have enough RAM for two framebuffer copies at any resonable sizes.

The capture code, including single-shot capture, now take mp_obj_t in the
common-hal layer, instead of a buffer & length.  This was done for the
continuous capture mode because it has to identify & return to the user the
proper Python object representing the original buffer.  In the Espressif port,
it was convenient to implement single capture in terms of a multi-capture,
which is why I changed the singleshot routine's signature too.
2021-11-03 11:02:46 -05:00
Pierre Constantineau a75473af96 update to EXTERNAL_FLASH_DEVICES to Puya P25Q16H 2021-11-02 20:52:58 -06:00
Dan Halbert 38c381633b
Merge pull request #5534 from jepler/add-rainbowio
Add rainbowio
2021-11-02 21:57:08 -04:00
Jeff Epler 63e01cde77 we decided not to add rainbowio on simmel 2021-11-02 19:01:05 -05:00
microDev 27b137f931
Merge branch 'main' into monitor-mode 2021-11-02 13:56:56 +05:30
microDev 4e207853f0
rearrange hostname 2021-11-02 12:33:11 +05:30
microDev 95172cf3ce
add monitor class
Co-authored-by: anecdata <16617689+anecdata@users.noreply.github.com>
2021-11-02 12:32:09 +05:30
Jeff Epler 18eaee9beb reenable RAINBOWIO on these boards 2021-11-01 12:52:13 -05:00
Kong Wai Weng 36459c8a5a Fixed whitespace issues. 2021-11-01 16:50:46 +08:00
Kong Wai Weng e0332c1e49 Using 4x spaces instead of a tab. 2021-11-01 16:47:02 +08:00
Kong Wai Weng b64ec36418 Using GP0 as default LED pin. 2021-11-01 16:43:13 +08:00
Kong Wai Weng 0034472778 Reversal of PR #4981. GPIO25 on Maker Pi RP2040 is not connected to anything. 2021-11-01 16:26:40 +08:00
Jim Mussared 693b927687 rp2: Enable optimisations (comp goto, map cache, fast attr).
Computed goto costs 1800 bytes for 5-10% performance.

Map caching and attr fast path costs 130 bytes for up to 30%.

Net effect of those three optimisations:
bm_chaos.py         +16.059% (+/-0.09%)
bm_fannkuch.py      +11.145% (+/-0.01%)
bm_fft.py           +14.604% (+/-0.01%)
bm_float.py         +26.849% (+/-0.08%)
bm_hexiom.py        +34.039% (+/-0.03%)
bm_nqueens.py       +18.333% (+/-0.06%)
bm_pidigits.py       +4.472% (+/-0.03%)
misc_aes.py         +28.765% (+/-0.09%)
misc_mandel.py      +27.116% (+/-0.05%)
misc_pystone.py     +40.299% (+/-0.20%)
misc_raytrace.py    +22.812% (+/-0.07%)

Also enable other EXTRA-level optimisations (module const, return_if_expr,
triple_tuple_assign, factorial, mpz bitwise).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-01 15:25:45 +11:00
Damien George c62351fbd6 py/mpconfig.h: Revert MICROPY_REPL_INFO to disabled at all levels.
This is an stm32-specific feature that's accessed via the pyb module, so
not something that will be widely enabled.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-01 15:18:22 +11:00
Jim Mussared b1a0ce46d1 rp2/mpconfigport.h: Use the "extra" feature level.
This commit is a no-op change to simplify existing config.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-01 15:02:58 +11:00
Jim Mussared 3041881353 stm32/mpconfigport.h: Use the "extra" feature level.
This commit is a no-op change.  Future improvements can come from making
individual boards use CORE or BASIC.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-01 15:02:22 +11:00
Damien George ad17d9f001 bare-arm/mpconfigport.h: Disable remaining optional features.
Signed-off-by: Damien George <damien@micropython.org>
2021-11-01 14:23:06 +11:00
Damien George b4de39c43c bare-arm/mpconfigport.h: Use MICROPY_CONFIG_ROM_LEVEL_MINIMUM.
To simplify the config.  This commit does not change the build.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-01 14:17:22 +11:00
Scott Shawcroft bf0bef9684
Split listdir entries across two packets
when the MTU of the BLE connection is smaller than the 28 bytes of
the header. (The smallest possible MTU is 20.)

Fixes #5511
2021-10-28 10:57:16 -07:00
Mike Causer 7f14344428 ports: Add images, features and urls to board.json. 2021-10-28 15:25:38 +11:00
Damien George 83827e8e63 stm32/uart: Fix race conditions and clearing status in IRQ handler.
Prior to this commit IRQs on STM32F4 could be lost because SR is cleared by
reading SR then reading DR.  For example, if both RXNE and IDLE IRQs were
active upon entry to the IRQ handler, then IDLE is lost because the code
that handles RXNE comes first and accidentally clears SR (by reading SR
then DR to get the incoming character).

This commit fixes this problem by making the IRQ handler more atomic in the
following operations:
- get current IRQ status flags
- deal with RX character
- clear remaining status flags
- call user handler

On the STM32F4 it's very hard to get this right because the only way to
clear IRQ status flags is to read SR then DR, but the read of DR may read
some data which should remain in the register until the user wants to read
it.  And it won't work to cache the read because RTS/CTS flow control will
then not work.  So instead the new code disables interrupts if the DR is
full and waits for the user to read it before reenabling the interrupts.

Fixes issue mentioned in #4599 and #6082.

Signed-off-by: Damien George <damien@micropython.org>
2021-10-28 13:14:21 +11:00
Mike Causer 07ea1afe74 esp32/boards/ESP32_S2_WROVER: Link to specific deploy_s2 instructions. 2021-10-28 12:58:58 +11:00
Mike Causer 3ace779e8e esp32/boards/LOLIN_S2_PICO: Add LOLIN_S2_PICO board definition files. 2021-10-28 12:58:50 +11:00
Damien George 1e4849557d esp32/usb: Further improve speed of USB CDC output.
Following on from ba940250a5, the change here
makes output about 15 times faster (now up to about 550 kbytes/sec).

tinyusb_cdcacm_write_queue will return the number of bytes written, so
there's no need to use tud_cdc_n_write_available.

Signed-off-by: Damien George <damien@micropython.org>
2021-10-28 11:37:35 +11:00
Seon Rozenblum 5b9c9cd097 esp32/boards: Update board and deploy metadata for UM_xxx boards. 2021-10-28 11:32:13 +11:00
Mike Causer 590ec2ca6e stm32/boards: Add images to board.json for Adafruit and VCC_GND boards. 2021-10-28 09:52:59 +11:00
Mike Causer 5bb14c4e46 esp32/boards/LOLIN_S2_MINI: Add image to board.json. 2021-10-28 09:51:04 +11:00
Jim Mussared 910e9f9111 esp32: Add specific deploy_s2.md instructions for esp32-s2.
In particular the UM S2 boards (and update the features list).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-28 09:47:47 +11:00
Pierre Constantineau ceeec6f1a0 updated USB PID to match one received from MengDu from Seeed 2021-10-27 08:10:47 -06:00
Pierre Constantineau c9f834f3a1 added LEDs 2021-10-26 21:55:38 -06:00
Pierre Constantineau 0f9e3eed01 initial commit for Seeed Review 2021-10-26 21:48:11 -06:00
Jim Mussared e359b077dd ports: Add board.json for all boards.
This will be used by https://micropython.org/download/ to generate the
full listing of boards and firmware files.

Optionally supports a board.md for additional customisation of the
download page, as well as deploy.md for flashing instructions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-27 14:04:53 +11:00
Dan Halbert c61ab864da
Update ports/espressif/boards/adafruit_feather_esp32s2/board.c 2021-10-26 17:14:23 -04:00
Limor "Ladyada" Fried 037d893923
Update ports/espressif/boards/adafruit_feather_esp32s2/pins.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-10-26 15:55:18 -04:00
Limor "Ladyada" Fried ccb6c5e5a9
Update ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-10-26 15:55:11 -04:00
Limor "Ladyada" Fried 5e59fa65ec
Update ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-10-26 15:54:49 -04:00
Jeff Epler b881aec4c5 disable gifio on meowbit 2021-10-26 14:24:11 -05:00
lady ada 613f314857 will delete later 2021-10-26 15:09:05 -04:00
lady ada ba4e9797c7 add a nuuuuuboard 2021-10-26 15:05:10 -04:00
Jeff Epler 3e020a73a8 Disable gifio if no displayio & for small boards
Technically all gifio needs from displayio is the definition of
colorspaces, but let's just disable it for now.
2021-10-26 08:54:18 -05:00
Jeff Epler 8c7760b1a6 don't include gifio on samd21 boards 2021-10-26 08:54:18 -05:00
Jeff Epler c34b6f757f Implement gifio.GifWriter
This involves:
 * Adding a new "L8" colorspace for colorconverters
 * factoring out displayio_colorconverter_convert_pixel
 * Making a minimal "colorspace only" version of displayio for the
   unix port (testing purposes)
 * fixing an error message

I only tested writing B&W animated images, with the following script:
```python
import displayio
import gifio

with gifio.GifWriter("foo.gif", 64, 64, displayio.Colorspace.L8) as g:
    for i in range(0, 256, 14):
        data = bytes([i, 255-i] * 32 + [255-i, i] * 32) * 32
        print("add_frame")
        g.add_frame(data)

# expected to raise an error, buffer is not big enough
with gifio.GifWriter("/dev/null", 64, 64, displayio.Colorspace.L8) as g:
    g.add_frame(bytes([3,3,3]))
```
2021-10-26 08:54:18 -05:00
Dan Halbert e868f1b1fe
Merge pull request #5510 from jepler/cmd25-v2
sdcardio: Use CMD25 across multiple writeblocks() calls
2021-10-26 08:46:28 -04:00
Scott Shawcroft 5315348b11
Merge pull request #5425 from maholli/samd-sleep
functioning samd deep sleep ('alarm.time' & 'alarm.pin')
2021-10-25 14:42:12 -07:00
Scott Shawcroft de45382599
Merge pull request #5504 from solderparty/rp2040_stamp
Add the Solder Party RP2040 Stamp board
2021-10-25 14:08:04 -07:00
Jeff Epler d999a88e57 Drop Adafruit_CircuitPython_SD where sdcardio is enabled 2021-10-25 16:07:27 -05:00
Dan Halbert 7377375e8d
Merge pull request #5506 from maholli/nvm-toml-fix
NVM toml fix (MRAM)
2021-10-25 16:50:43 -04:00
Dan Halbert 644272ee8b
Merge pull request #5509 from DavePutz/issue_5469
Added reset of pulsein buffer pointer
2021-10-25 16:35:24 -04:00
Jim Mussared 43467b9c71 extmod/modbluetooth: Add connection interval to gap_connect.
This forwards through directly to the NimBLE and BTStack connect functions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-26 00:16:53 +11:00
robert-hh 9f6604eb27 mimxrt: Enable the platform module. 2021-10-25 23:54:52 +11:00
robert-hh 4f89c38a6a mimxrt: Optimize the runtime speed.
By moving code to ITCM, like vm, gc, parse, runtime.  The change affects
mostly the execution speed of MicroPython code.  The speed is increased by
up to a factor of 6, especially for MCU with small cache.
2021-10-25 23:54:47 +11:00
robert-hh 90b45efa6a mimxrt/boards/make-pins.py: Allow empty lines and comments in pins.csv. 2021-10-25 23:53:51 +11:00
robert-hh 6754213a9d mimxrt/modmachine: Implement soft_reset() and unique_id() functions. 2021-10-25 23:53:48 +11:00
robert-hh a12e318948 mimxrt/mpconfigport.h: Enable f-strings. 2021-10-25 23:52:35 +11:00
robert-hh c827d4b7ab mimxrt: Extend the help() message and README.md. 2021-10-25 23:52:08 +11:00
robert-hh e7572776c3 mimxrt: Add dht_readinto() to the mimxrt module, and freeze dht.py.
The change affects dht.py from the drivers directory as well to include the
logic for the mimxrt port.
2021-10-25 23:49:28 +11:00
robert-hh 99221cd118 mimxrt: Fix cycle counter for time.ticks_cpu() and machine.bitstream().
Prior to this commit mp_hal_ticks_cpu() was not started properly.  It only
started when the code was executed with a debugger attached, except for the
Teensy (i.MXRT1062) boards.  As an additional fix, the CYYCNT timer is now
started at boot time.

Also rename mp_hal_ticks_cpu_init() to mp_hal_ticks_cpu_enable().
2021-10-25 15:50:44 +11:00
robert-hh 06d1b02014 mimxrt/dma_channel: Fix the DMA channel management.
The MIMXRT1011 has only 16 channels, so size the channel list accordingly.
2021-10-25 15:50:44 +11:00
robert-hh 101d2ddea3 mimxrt/hal: Remove duplicate definitions from flexspi_hyper_flash.h. 2021-10-25 15:50:44 +11:00
robert-hh 68146aa197 mimxrt/boards: Fix the D14/D15 pin assignment of MIMXRT1050/60/64_EVK.
There are several PCB layouts in the market under the same name.
2021-10-25 15:50:38 +11:00
robert-hh c2e4759cfa mimxrt/modmachine: Implement machine.WDT() and machine.reset_cause().
The API follows that of rp2, stm32, esp32, and the docs.

    wdt=machine.WDT(0, timeout)

        Timeout is given in ms. The valid range is 500 to 128000 (128
        seconds) with 500 ms granularity. Values outside of that range will
        be silently aligned.

    wdt.feed()

        Resets the watchdog timer (feeding).

    wdt.timeout_ms(value)

        Sets a new timeout and feeds the watchdog.

        This is a new, preliminary method which is not yet documented.

    reset_cause = machine.reset_cause()

        Values returned:

        1  Power On reset
        3  Watchdog reset
        5  Software reset: state after calling machine.reset()

More elaborate API functions are supported by the MCU, like an interrupt
called a certain time after feeding.  But for port cosistency that is not
implemented.
2021-10-25 15:43:56 +11:00
robert-hh 1866ed7e2e mimxrt/eth: Add LAN support and integrate the network module.
This commit implements 10/100 Mbit Ethernet support in the mimxrt port.

The following boards are configured without ETH network:
- MIMXRT1010_EVK
- Teensy 4.0

The following boards are configured with ETH network:
- MIMXRT1020_EVK
- MIMXRT1050_EVK
- MIMXRT1060_EVK
- MIMXRT1064_EVK
- Teensy 4.1

Ethernet support tested with TEENSY 4.1, MIMRTX1020_EVK and MIMXRT1050_EVK.
Build tested with Teensy 4.0 and MIMXRT1010_EVK to be still working.
Compiles and builds properly for MIMXRT1060_EVK and MIMXRT1064_EVK, but not
tested lacking suitable boards.

Tested functions are:
- ping works bothway
- simple UDP transfer works bothway
- ntptime works
- the ftp server works
- secure socker works
- telnet and webrepl works

The MAC address is 0x02 plus 5 bytes from the manifacturing info field,
which can be considered as unique per device.

Some boards do not wire the RESET and INT pin of the PHY transceiver.  For
operation, these are not required.  If they are defined, they will be used.
2021-10-25 15:14:26 +11:00
root d2febfaf20 Added reset of pulsein buffer pointer 2021-10-24 20:46:18 -05:00
Max Holliday 339cf5ecf9 staying caught up with runtime changes 2021-10-24 15:49:14 -07:00
Max Holliday e45fe3d778
Merge branch 'adafruit:main' into samd-sleep 2021-10-24 15:46:07 -07:00
Pierre Constantineau 3425bcc910 added startup delay multiplier 2021-10-24 14:20:07 -06:00
Max Holliday adbff053ce fix QSPI_SINGLE pin definitions 2021-10-24 12:37:30 -07:00
arturo182 915275e5fd Add the Solder Party RP2040 Stamp board 2021-10-24 17:13:41 +02:00
Max Holliday 943f2b2085 remove interrupt_char.h 2021-10-23 09:01:40 -07:00
Pierre Constantineau 40326ab3f9 fix pre-commit 2021-10-22 18:35:38 -06:00
Pierre Constantineau d6e9e9c3c9 added neopixel to mpconfigboard.h 2021-10-22 18:32:21 -06:00
Philipp Ebensberger 7e62c9707a mimxrt/sdram: Add SDRAM support.
Adds support for SDRAM via `SEMC` peripheral. SDRAM support can be
enabled in the mpconfigboard.mk file by setting `MICROPY_HW_SDRAM_AVAIL`
to `1` and poviding the size of the RAM via `MICROPY_HW_FLASH_SIZE`.

When SDRAM support is enabled the whole SDRAM is currently used used
for MicroPython heap.

Signed-off-by: Philipp Ebensberger
2021-10-22 08:23:24 +02:00
Max Holliday 397b2f6bb5 pin alarm configures pins again before deep sleep 2021-10-21 10:03:46 -07:00
Max Holliday e74a8e38fe
Merge branch 'adafruit:main' into samd-sleep 2021-10-21 09:52:55 -07:00
Scott Shawcroft cf4597c6db
Merge pull request #5484 from dhalbert/samd21-pdmin-fix
fix SAMD21 PDMIn DMA event use
2021-10-20 09:47:13 -07:00
Damien George 30268c93dc stm32/pendsv: Allow a board to add entries for pendsv_schedule_dispatch.
Signed-off-by: Damien George <damien@micropython.org>
2021-10-20 21:20:18 +11:00
Damien George 69522822de stm32/mpbthciport: Allow a board to hook BT HCI poll functions.
Signed-off-by: Damien George <damien@micropython.org>
2021-10-20 21:20:18 +11:00
Damien George 5f2f9044ff stm32/usbd_cdc_interface: Allow a board to hook into USBD CDC RX events.
Signed-off-by: Damien George <damien@micropython.org>
2021-10-20 21:20:18 +11:00
Dan Halbert fc440e7609 move sercom_reset() etc. out of busio/SPI.c to busio/__init__.c 2021-10-19 15:18:32 -04:00
Jeff Epler 39795430a4
Apply suggestions from code review
Eliminates the "pet" function

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-10-19 13:25:28 -05:00
Dan Halbert 79ee78e690 fix SAMD21 PDMIn DMA event use 2021-10-19 13:18:14 -04:00
Jeff Epler d38cf05e59 samd51: Add watchdog timer 2021-10-19 10:52:14 -05:00
Andrew Leech cc42b7c88b unix/modusocket: Support MP_STREAM_POLL in unix socket_ioctl.
Allows asyncio reading of network sockets when MICROPY_PY_USELECT is used
in the build configuration.
2021-10-19 22:48:10 +11:00
Jeff Epler 9eebb3dbab rotaryio: Add the ability to set the divisor
At present, Adafruit's rotary encoders all move 1 quadrature cycle per
detent, so we originally hard-coded division-by-4.  However, other
encoders exist, including ones without detents, ones with 2 detents per
cycle, and others with 4 detents per cycle.

The new `divisor` property and constructor argument allows selecting
a divisor of 1, 2, or 4; with the default of 4 giving backward
compatibility.

The property is not supported (yet?) on espressif MCUs; it throws an
error if a value other than 4 is set.
2021-10-16 09:43:45 -05:00
Dan Halbert 23d2c96476
Merge pull request #5466 from jepler/merge-1.17
Merge 1.17
2021-10-15 23:34:31 -04:00
Jeff Epler 414c2f9da6 Always use python3
.. similar to https://github.com/micropython/micropython/pull/4448
2021-10-15 15:11:21 -05:00
Jeff Epler 4e7c1a4bd4 Rename make_new's parameter to `all_args`
.. and fix two straggling modules that weren't updated at all.
Maybe they're not included in any builds?
2021-10-15 13:49:33 -05:00
microDev 23b24278a7
Merge pull request #5465 from melopero/main
Added D17/Battery Pin definition to melopero shake rp2040
2021-10-15 21:47:47 +05:30
Leonardo La Rocca 45600b1b99
Update ports/raspberrypi/boards/melopero_shake_rp2040/pins.c
Co-authored-by: microDev <70126934+microDev1@users.noreply.github.com>
2021-10-15 16:52:25 +02:00
Damien George ba940250a5 esp32/usb: Improve speed of USB CDC output.
Signed-off-by: Damien George <damien@micropython.org>
2021-10-16 00:23:59 +11:00
Jeff Epler 8d8f83bc05 Merge tag 'v1.17' into merge-1.17
F-strings, new machine.I2S class, ESP32-C3 support and LEGO_HUB_NO6 board

This release of MicroPython adds support for f-strings (PEP-498), with a
few limitations compared to normal Python.  F-strings are essentially
syntactic sugar for "".format() and make formatting strings a lot more
convenient.  Other improvements to the core runtime include pretty printing
OSError when it has two arguments (an errno code and a string), scheduling
of KeyboardInterrupt on the main thread, and support for a single argument
to the optimised form of StopIteration.

In the machine module a new I2S class has been added, with support for
esp32 and stm32 ports.  This provides a consistent API for transmit and
receive of audio data in blocking, non-blocking and asyncio-based
operation.  Also, the json module has support for the "separators" argument
in the dump and dumps functions, and framebuf now includes a way to blit
between frame buffers of different formats using a palette.  A new,
portable machine.bitstream function is also added which can output a stream
of bits with configurable timing, and is used as the basis for driving
WS2812 LEDs in a common way across ports.

There has been some restructuring of the repository directory layout, with
all third-party code now in the lib/ directory.  And a new top-level
directory shared/ has been added with first-party code that was previously
in lib/ moved there.

The docs have seen further improvement with enhancements and additions to
the rp2 parts, as well as a new quick reference for the zephyr port.
The terms master/slave have been replaced with controller/peripheral,
mainly relating to I2C and SPI usage.  And u-module references have been
replaced with just the module name without the u-prefix to help clear up
the intended usage of modules in MicroPython.

For the esp8266 and esp32 ports, hidden networks are now included in WLAN
scan results.  On the esp32 the RMT class is enhanced with idle_level and
write_pulses modes.  There is initial support for ESP32-C3 chips with
GENERIC_C3 and GENERIC_C3_USB boards.

The javascript port has had its Makefile and garbage collector
implementation reworked so it compiles and runs with latest the Emscripten
using asyncify.

The mimxrt port sees the addition of hardware I2C and SPI support, as well
as some additional methods to the machine module.  There is also support
for Hyperflash chips.

The nrf port now has full VFS storage support, enables source-line on
traceback, and has .mpy features consistent with other ports.

For the rp2 port there is now more configurability for boards, and more
boards added.

The stm32 port has a new LEGO_HUB_NO6 board definition with detailed
information how to get this LEGO Hub running stock MicroPython.  There is
also now support to change the CPU frequency on STM32WB MCUs.  And USBD_xxx
descriptor options have been renamed to MICROPY_HW_USB_xxx.

Thanks to everyone who contributed to this release: Amir Gonnen, Andrew
Scheller, Bryan Tong Minh, Chris Wilson, Damien George, Daniel Mizyrycki,
David Lechner, David P, Fernando, finefoot, Frank Pilhofer, Glenn Ruben
Bakke, iabdalkader, Jeff Epler, Jim Mussared, Jonathan Hogg, Josh Klar,
Josh Lloyd, Julia Hathaway, Krzysztof Adamski, Matúš Olekšák, Michael
Weiss, Michel Bouwmans, Mike Causer, Mike Teachman, Ned Konz, NitiKaur,
oclyke, Patrick Van Oosterwijck, Peter Hinch, Peter Züger, Philipp
Ebensberger, robert-hh, Roberto Colistete Jr, Sashkoiv, Seon Rozenblum,
Tobias Thyrrestrup, Tom McDermott, Will Sowerbutts, Yonatan Goldschmidt.

What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.

Main components
===============

all:
- fix signed shifts and NULL access errors from -fsanitize=undefined
- update to point to files in new shared/ directory

py core:
- mpstate: make exceptions thread-local
- mpstate: schedule KeyboardInterrupt on main thread
- mperrno: add MP_ECANCELED error code
- makeqstrdefs.py: don't include .h files explicitly in preprocessing
- mark unused arguments from bytecode decoding macros
- objexcept: pretty print OSError also when it has 2 arguments
- makeversionhdr: add --tags arg to git describe
- vm: simplify handling of MP_OBJ_STOP_ITERATION in yield-from opcode
- objexcept: make mp_obj_exception_get_value support subclassed excs
- support single argument to optimised MP_OBJ_STOP_ITERATION
- introduce and use mp_raise_type_arg helper
- modsys: optimise sys.exit for code size by using exception helpers
- objexcept: make mp_obj_new_exception_arg1 inline
- obj: fix formatting of comment for mp_obj_is_integer
- emitnative: reuse need_reg_all func in need_stack_settled
- emitnative: ensure stack settling is safe mid-branch
- runtime: fix bool unary op for subclasses of native types
- builtinimport: fix condition for including do_execute_raw_code()
- mkrules: automatically build mpy-cross if it doesn't exist
- implement partial PEP-498 (f-string) support
- lexer: clear fstring_args vstr on lexer free
- mkrules.mk: do submodule sync in "make submodules"

extmod:
- btstack: add missing call to mp_bluetooth_hci_uart_deinit
- btstack: check that BLE is active before performing operations
- uasyncio: get addr and bind server socket before creating task
- axtls-include: add axtls_os_port.h to customise axTLS
- update for move of crypto-algorithms, re1.5, uzlib to lib
- moduselect: conditionally compile select()
- nimble: fix leak in l2cap_send if send-while-stalled
- btstack/btstack.mk: use -Wno-implicit-fallthrough, not =0
- utime: always invoke mp_hal_delay_ms when >= to 0ms
- modbluetooth: clamp MTU values to 32->UINT16_MAX
- nimble: allow modbluetooth binding to hook "sent HCI packet"
- nimble: add "memory stalling" mechanism for l2cap_send
- uasyncio: in open_connection use address info in socket creation
- modujson: add support for dump/dumps separators keyword-argument
- modlwip: fix close and clean up of UDP and raw sockets
- modbluetooth: add send_update arg to gatts_write
- add machine.bitstream
- modframebuf: enable blit between different formats via a palette

lib:
- tinyusb: update to version 0.10.1
- pico-sdk: update to version 1.2.0
- utils/stdout_helpers: make mp_hal_stdout_tx_strn_cooked efficient
- axtls: switch to repo at micropython/axtls
- axtls: update to latest axtls 2.1.5 wih additional commits
- re1.5: move re1.5 code from extmod to lib
- uzlib: move uzlib code from extmod to lib
- crypto-algorithms: move crypto-algorithms code from extmod to lib
- update README's based on contents of these dirs

drivers:
- neopixel: add common machine.bitstream-based neopixel module
- neopixel: optimize fill() for speed
- neopixel: reduce code size of driver
- cyw43: fix cyw43_deinit so it can be called many times in a row
- cyw43: make wifi join fail if interface is not active

mpy-cross:
- disable stack check when building with Emscripten

Support components
==================

docs:
- library: document new esp32.RMT features and fix wait_done
- library: warn that ustruct doesn't handle spaces in format strings
- esp8266/tutorial: change flash mode from dio to dout
- replace master/slave with controller/peripheral in I2C and SPI
- rp2: enhance quickref and change image to Pico pinout
- rp2: update general section to give a brief technical overview
- library/utime.rst: clarify behaviour and precision of sleep ms/us
- library/uasyncio.rst: document stream readexactly() method
- library/machine.I2S.rst: fix use of sd pin in examples
- zephyr: add quick reference for the Zephyr port
- library/zephyr: add libraries specific to the Zephyr port
- templates: add unix and zephyr quickref links to top-index
- rename ufoo.rst to foo.rst
- replace ufoo with foo in all docs
- library/index.rst: clarify module naming and purpose
- library/builtins.rst: add module title
- library/network.rst: simplify socket import
- add docs for machine.bitstream and neopixel module
- library: fix usage of :term: for frozen module reference
- esp8266: use monospace for software tools
- reference: mention that slicing a memoryview causes allocation

examples: no changes specific to this component/port

tests:
- extmod: make uasyncio_heaplock test more deterministic
- cpydiff/modules_struct_whitespace_in_format: run black
- extmod/ujson: add tests for dump/dumps separators argument
- run-multitests.py: add broadcast and wait facility
- multi_bluetooth/ble_subscribe.py: add test for subscription
- extmod/vfs_fat_finaliser.py: ensure alloc at never-used GC blocks
- basics: split f-string debug printing to separate file with .exp
- pybnative: make while.py test run on boards without pyb.delay

tools:
- autobuild: add scripts to build release firmware
- remove obsolete build-stm-latest.sh script
- ci.sh: run apt-get update in ci_powerpc_setup
- makemanifest.py: allow passing flags to mpy-tool.py
- autobuild: add mimxrt port to build scripts for nightly builds
- pyboard.py: add cmd-line option to make soft reset configurable
- mpremote: swap order of PID and VID in connect-list output
- ci.sh: build unix dev variant as part of macOS CI
- ci.sh: build GENERIC_C3 board as part of esp32 CI
- autobuild: use separate IDF version to build newer esp32 SoCs
- autobuild: add FeatherS2 and TinyS2 to esp32 auto builds
- mpremote: add seek whence for mounted files
- mpremote: raise OSError on unsupported RemoteFile.seek
- autobuild: add the MIMXRT1050_EVKB board to the daily builds
- ci.sh: add mpy-cross build to nrf port
- codeformat.py: include ports/nrf/modules/nrf in code formatting
- gen-cpydiff.py: don't rename foo to ufoo in diff output
- autobuild: add auto build for Silicognition wESP32
- mpremote: fix connect-list in case VID/PID are None
- mpremote: add "devs" shortcut for "connect list"
- mpremote: remove support for pyb.USB_VCP in/out specialisation
- autobuild: don't use "-B" for make, it's already a fresh build
- pyboard.py: move --no-exclusive/--soft-reset out of mutex group
- pyboard.py: make --no-follow use same variable as --follow
- pyboard.py: add --exclusive to match --no-exclusive
- pyboard.py: make --no-soft-reset consistent with other args
- uncrustify: force 1 newline at end of file
- mpremote: bump version to 0.0.6

CI:
- workflows: add workflow to build and test javascript port
- workflows: switch from Coveralls to Codecov
- workflows: switch from lcov to gcov
- workflows: add workflow to build and test unix dev variant

The ports
=========

all ports:
- use common mp_hal_stdout_tx_strn_cooked instead of custom one
- update for move of crypto-algorithms, uzlib to lib
- rename USBD_VID/PID config macros to MICROPY_HW_USB_VID/PID

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

cc3200 port: no changes specific to this component/port

esp8266 port:
- add __len__ to NeoPixel driver to support iterating
- Makefile: add more libm files to build
- include hidden networks in WLAN.scan results
- replace esp.neopixel with machine.bitstream
- remove dead code for end_ticks in machine_bitstream

esp32 port:
- boards/sdkconfig.base: disable MEMPROT_FEATURE to alloc from IRAM
- add __len__ to NeoPixel driver to support iterating
- main: allow MICROPY_DIR to be overridden
- esp32_rmt: fix RMT looping in newer IDF versions
- esp32_rmt: enhance RMT with idle_level and write_pulses modes
- add new machine.I2S class for I2S protocol support
- machine_spi: calculate actual attained baudrate
- machine_hw_spi: use a 2 item SPI queue for long transfers
- machine_dac: add MICROPY_PY_MACHINE_DAC option, enable by default
- machine_i2s: add MICROPY_PY_MACHINE_I2S option, enable by default
- fix use of mp_int_t, size_t and uintptr_t
- add initial support for ESP32C3 SoCs
- boards/GENERIC_C3: add generic C3-based board
- modmachine: release the GIL in machine.idle()
- mphalport: always yield at least once in delay_ms
- machine_uart: add flow kw-arg to enable hardware flow control
- boards: add Silicognition wESP32 board configuration
- mpconfigport.h: enable reverse and inplace special methods
- include hidden networks in WLAN.scan results
- makeimg.py: get bootloader and partition offset from sdkconfig
- enable MICROPY_PY_FSTRINGS by default
- machine_hw_spi: release GIL during transfers
- machine_pin: make check for non-output pins respect chip variant
- replace esp.neopixel with machine.bitstream
- remove dead code for end_ticks in machine_bitstream
- boards: add GENERIC_C3_USB board with USB serial/JTAG support

javascript port:
- rework Makefile and GC so it works with latest Emscripten
- Makefile: suppress compiler errors from array bounds
- Makefile: change variable to EXPORTED_RUNTIME_METHODS

mimxrt port:
- move calc_weekday helper function to timeutils
- machine_spi: add the SPI class to the machine module
- moduos: seed the PRNG on boot using the TRNG
- boards: set vfs partition start to 1 MBbyte
- main: skip running main.py if boot.py failed
- main: extend the information returned by help()
- mimxrt_flash: remove commented-out code
- modmachine: add a few minor methods to the machine module
- machine_led: use mp_raise_msg_varg helper
- machine_i2c: add hardware-based machine.I2C to machine module
- add support for Hyperflash chips
- boards: add support for the MIMXRT1050_EVKB board
- machine_pin: implement ioctl for Pin

minimal port:
- Makefile: add support for building with user C modules

nrf port:
- modules: replace master/slave with controller/peripheral in SPI
- boards/common.ld: calculate unused flash region
- modules/nrf: add new nrf module with flash block device
- drivers: add support for using flash block device with SoftDevice
- mpconfigport.h: expose nrf module when MICROPY_PY_NRF is set
- README: update README.md to reflect internal file systems
- mpconfigport.h: tune FAT FS configuration
- Makefile: add _fs_size linker script override from make
- modules/uos: allow a board to configure MICROPY_VFS_FAT/LFS1/LFS2
- mpconfigport.h: enable MICROPY_PY_IO_FILEIO when an FS is enabled
- qstrdefsport.h: add entries for in-built FS mount points
- main: add auto mount and auto format hook for internal flash FS
- boards: enable needed features for FAT/LFS1/LFS2
- facilitate use of freeze manifest
- boards: set FROZEN_MANIFEST blank when SD present on nrf51 targets
- modules/scripts: add file system formatting script
- Makefile: set default manifest file for all targets
- mphalport: add dummy function for mp_hal_time_ns()
- boards: enable MICROPY_VFS_LFS2 for all target boards
- modules/uos: add ilistdir to uos module
- modules/nrf: add function to enable/disable DCDC
- enable source line on tracebacks
- set .mpy features consistent with documentation and other ports

pic16bit port: no changes specific to this component/port

powerpc port: no changes specific to this component/port

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

rp2 port:
- use 0=Monday datetime convention in RTC
- machine_rtc: in RTC.datetime, compute weekday automatically
- CMakeLists.txt: suppress compiler errors for pico-sdk and tinyusb
- tusb_config.h: set CFG_TUD_CDC_EP_BUFSIZE to 256
- machine_uart: add hardware flow control support
- machine_uart: allow overriding default machine UART pins
- machine_i2c: allow boards to configure I2C pins using new macros
- machine_spi: allow boards to configure SPI pins using new macros
- machine_uart: fix poll ioctl to also check hardware FIFO
- machine_uart: fix read when FIFO has chars but ringbuf doesn't
- tusb_port: allow boards to configure USB VID and PID
- boards/ADAFRUIT_FEATHER_RP2040: configure custom VID/PID
- boards/ADAFRUIT_FEATHER_RP2040: configure I2C/SPI default pins
- boards/SPARKFUN_PROMICRO: configure UART/I2C/SPI default pins
- boards/SPARKFUN_THINGPLUS: configure I2C/SPI default pins
- boards: add Adafruit ItsyBitsy RP2040
- boards: add Adafruit QT Py RP2040
- boards: add Pimoroni Pico LiPo 4MB
- boards: add Pimoroni Pico LiPo 16MB
- boards: add Pimoroni Tiny 2040
- CMakeLists.txt: allow a board's cmake to set the manifest path
- enable MICROPY_PY_FSTRINGS by default
- Makefile: add "submodules" target, to match other ports
- rp2_flash: disable IRQs while calling flash_erase/program
- CMakeLists.txt: add option to enable double tap reset to bootrom
- mpconfigport.h: allow boards to add root pointers

samd port:
- add support for building with user C modules

stm32 port:
- softtimer: add soft_timer_reinsert() helper function
- mpbthciport: change from systick to soft-timer for BT scheduling
- provide a custom BTstack runloop that integrates with soft timer
- usb: make irq's default trigger enable all events
- boardctrl: skip running main.py if boot.py had an error
- sdio: fix undefined reference to DMA stream on H7
- dma: add DMAMUX configuration for H7 to fix dma_nohal_init
- main: call mp_deinit() at end of main
- adc: allow using ADC12 and ADC3 for H7
- adc: define the ADC instance used for internal channels
- adc: simplify and generalise how pin_adcX table is defined
- add new machine.I2S class for I2S protocol support
- boards/NUCLEO_F446RE: fix I2C1 pin assignment to match datasheet
- replace master/slave with controller/peripheral in I2C and SPI
- systick: always POLL_HOOK when delaying for milliseconds
- sdram: make SDRAM test cache aware, and optional failure with msg
- boards/NUCLEO_F446RE: enable CAN bus support
- boards: add support for SparkFun STM32 MicroMod Processor board
- uart: fix LPUART1 baudrate set/get
- uart: support low baudrates on LPUART1
- boards/STM32F429DISC: set correct UART2 pins and add UART3/6
- boards/NUCLEO_F439ZI: add board definition for NUCLEO_F439ZI
- boards/LEGO_HUB_NO6: add board definition for LEGO_HUB_NO6
- Makefile: update to only pull in used Bluetooth library
- README.md: update supported MCUs, and submodule and mboot use
- usbd_desc: rename USBD_xxx descriptor opts to MICROPY_HW_USB_xxx
- usbd_cdc_interface: rename USBD_CDC_xx opts to MICROPY_HW_USB_xx
- powerctrl: support changing frequency on WB MCUs
- boards/NUCLEO_H743ZI2: add modified version of NUCLEO_H743ZI
- mbedtls: fix compile warning about uninitialized val
- enable MICROPY_PY_FSTRINGS by default
- add implementation of machine.bitstream
- Makefile: allow GIT_SUBMODULES and LIBS to be extended
- stm32_it: support TIM17 IRQs on WB MCUs
- disable computed goto on constrained boards
- storage: make extended-block-device more configurable
- boards/LEGO_HUB_NO6: change SPI flash storage to use hardware SPI
- boards/LEGO_HUB_NO6: skip first 1MiB of SPI flash for storage
- boards/LEGO_HUB_NO6: add make commands to backup/restore firmware

teensy port: no changes specific to this component/port

unix port:
- modffi: add option to lock GC in callback, and cfun access
- Makefile: add back LIB_SRC_C to list of object files
- variants: enable help and help("modules") on standard and dev
- Makefile: disable error compression on arm-linux-gnueabi-gcc

windows port:
- Makefile: add .exe extension to executables name
- appveyor: update to VS 2017 and use Python 3.8 for build/test

zephyr port:
- machine_spi: add support for hardware SPI
2021-10-15 08:20:54 -05:00
Damien George 549448e8bb esp32: Enable optimisations and move code to iRAM to boost performance.
This commit enables some significant optimisations for esp32:
- move the VM to iRAM
- move hot parts of the runtime to iRAM (map lookup, load global/name,
  mp_obj_get_type)
- enable MICROPY_OPT_LOAD_ATTR_FAST_PATH
- enable MICROPY_OPT_MAP_LOOKUP_CACHE
- disable assertions
- change from -Os to -O2 for compilation

It's hard to measure performance on esp32 due to external flash and
hardware caching.  But this set of changes improves performance compared to
master by (on a TinyPICO with the GENERIC build, using IDF 4.2.2, running
at 160MHz):

diff of scores (higher is better)
N=100 M=100    esp32-master -> esp32-perf       diff      diff% (error%)
bm_chaos.py           71.28 ->     268.08 :  +196.80 = +276.094% (+/-0.04%)
bm_fannkuch.py        44.10 ->      69.31 :   +25.21 = +57.166% (+/-0.01%)
bm_fft.py           1385.27 ->    2538.23 : +1152.96 = +83.230% (+/-0.01%)
bm_float.py         1060.94 ->    3900.62 : +2839.68 = +267.657% (+/-0.03%)
bm_hexiom.py          10.90 ->      32.79 :   +21.89 = +200.826% (+/-0.02%)
bm_nqueens.py       1000.83 ->    2372.87 : +1372.04 = +137.090% (+/-0.01%)
bm_pidigits.py       288.13 ->     664.40 :  +376.27 = +130.590% (+/-0.46%)
misc_aes.py          102.45 ->     345.69 :  +243.24 = +237.423% (+/-0.01%)
misc_mandel.py      1016.58 ->    2121.92 : +1105.34 = +108.731% (+/-0.01%)
misc_pystone.py      632.91 ->    1801.87 : +1168.96 = +184.696% (+/-0.08%)
misc_raytrace.py      76.66 ->     281.78 :  +205.12 = +267.571% (+/-0.05%)
viper_call0.py       210.63 ->     273.17 :   +62.54 = +29.692% (+/-0.01%)
viper_call1a.py      208.45 ->     269.51 :   +61.06 = +29.292% (+/-0.00%)
viper_call1b.py      185.44 ->     228.25 :   +42.81 = +23.086% (+/-0.01%)
viper_call1c.py      185.86 ->     228.90 :   +43.04 = +23.157% (+/-0.01%)
viper_call2a.py      207.10 ->     267.25 :   +60.15 = +29.044% (+/-0.00%)
viper_call2b.py      173.76 ->     209.42 :   +35.66 = +20.523% (+/-0.00%)

Five tests have more than 3x speed up (200%+).

The performance of the tests bm_fft, bm_pidigits and misc_aes now scale
with CPU frequency (eg changing frequency to 240MHz boosts the performance
of these by 50%), which means they are no longer influenced by timing of
external flash access.  (The viper_call* tests did previously scale with
CPU frequency, and they still do.)

Turning off assertions reduces code size by about 80k, and going from -Os
to -O2 costs about 100k, so the net change in code size (for the GENERIC
board) is about +20k.

If a board wants to enable assertions, or use -Os instead of -O2, that's
still possible by overriding the sdkconfig parameters.

Signed-off-by: Damien George <damien@micropython.org>
2021-10-16 00:07:11 +11:00
iabdalkader eea6cd85b3 stm32/sdram: Enforce gcc opt, and use volatile and DSB in sdram_test.
Ensures consistent behaviour and resolves the D-Cache bug (the "exhaustive"
argument being lost due to cache being turned off) when O0 is used.

The changes in this commit are:

- Change -O0 to -Os because "gcc is considered broken at -O0" according to
  https://github.com/ARM-software/CMSIS_5/issues/620#issuecomment-550235656

- Use volatile for mem_base so the compiler doesn't optimise away reads or
  writes to the SDRAM, which is being tested.

- Use DSB to prevent any other compiler optimisations that would change the
  testing logic.

- Use alternating pattern/antipattern in exhaustive test to catch more
  hardware/configuration errors.

Implementation adapted by @andrewleech, taken directly from investigation
by @iabdalkader and @dpgeorge.

See #7841 and #7869 for further discussion.
2021-10-15 17:59:31 +11:00
evildave666 97e64ebd8c add i2c singleton for s2 mini 2021-10-15 13:22:35 +09:00
Leonardo La Rocca 376c3a1bab
Merge branch 'adafruit:main' into main 2021-10-14 19:33:55 +02:00
root 9a8ebb0ef0 added battery pin definition 2021-10-14 18:41:09 +02:00
Bruce Segal 5310f304a0 Add board definitio for Lolin/Wemos S2-Pico 2021-10-13 13:27:56 -07:00
Limor "Ladyada" Fried 1099716986
Merge pull request #5457 from jepler/espressif-cam-missed-frame
eespressif: ParallelImageCapture: keep peripheral running
2021-10-11 20:25:18 -04:00
Max Holliday 7cbcc2f9ec updating pycubed board defs & including 2021-10-11 15:34:58 -07:00
Max Holliday 37bddecf54 adding CIRCUITPY_ALARM checks to port.c 2021-10-11 15:03:57 -06:00
Jeff Epler 6abb7dd461 eespressif: ParallelImageCapture: keep peripheral running
Otherwise, a lot of frames were being dropped, leading to a low framerate
in the "directio" demo for OV5640 cameras
2021-10-11 15:37:57 -05:00
Max Holliday 5c4f903328 rearranging port.c include order for common-hal/alarm 2021-10-11 13:31:29 -07:00
Max Holliday e7324fa7c3 fixing pre-commit stuff 2021-10-10 16:40:00 -07:00
Max Holliday e136cbd007 forgot to commit port.c 2021-10-10 12:16:15 -07:00
Max Holliday dcb5fd280a alarm.wake_alarm works for pin and time. Pin & time can both be set at once 2021-10-10 12:01:04 -07:00
Max Holliday 752bf6e4e0 correcting which nina-fw commit to use 2021-10-09 15:14:03 -07:00
Max Holliday 4f631f2bb3 fixing nina-fw certs maybe? 2021-10-09 15:09:55 -07:00
Max Holliday 238b07c3af Fixed merge conflict for circuitpython.pot 2021-10-09 14:28:20 -07:00
Max Holliday 112739e247 minor tweaks 2021-10-09 14:50:55 -06:00
Max Holliday d66d7d476c
Update ports/atmel-samd/mpconfigport.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-10-09 12:33:05 -06:00
Max Holliday 8486502e65 reworked fake sleep. functional for pin and time 2021-10-09 11:44:10 -06:00
Dan Halbert 4c45364dca
Merge pull request #5442 from jpconstantineau/board-xiao-kb
Add new board variant: Seeed XIAO targeted for Keyboards/HID Devices
2021-10-08 18:19:58 -04:00
Dan Halbert f0e2945747 clarify RP2040 IncrementalEncoder sequential pin message 2021-10-08 10:40:58 -04:00
Pierre Constantineau 37d3adfe4f updated PID from Seeed provided VID/PID 2021-10-08 07:15:18 -06:00
Pierre Constantineau 002383691c changing MICROPY_HW_BOARD_NAME from Dongle to DK 2021-10-07 21:57:04 -06:00
Scott Shawcroft df10543bee
Merge pull request #3768 from microDev1/i2c-S2
ESP32S2: Support for i2cperipheral
2021-10-07 10:07:47 -07:00
microDev 620ef26385
Merge pull request #5437 from pewpew-game/stage-picosystem
PicoSystem: freeze the Stage library
2021-10-07 21:38:14 +05:30
Jeff Epler 14ec6b70cf
Merge pull request #5403 from blues/add-strm32l4t5-swan-support
stm32l4r5 Swan support
2021-10-07 11:00:59 -05:00
Radomir Dopieralski d76eda153b PicoSystem: freeze the Stage library 2021-10-07 15:01:18 +02:00
microDev 647e589a6a
rename `i2c_num_status` to `peripherals_i2c_get_free_num` 2021-10-07 14:12:14 +05:30
microDev a3aeefd92c
Merge pull request #5430 from microDev1/patch
Convert all modules to use `MP_REGISTER_MODULE`
2021-10-07 09:44:11 +05:30
Scott Shawcroft 98ee9ee019
Merge pull request #5435 from jpconstantineau/m60-updates
adding battery monitoring pins to M60
2021-10-06 17:58:28 -07:00
Scott Shawcroft d2add4b4fd
Merge pull request #5409 from skieast/ai_thinker_esp32-c3s
Add AIThinker ESP32-C3S_Kit board
2021-10-06 17:25:26 -07:00
Pierre Constantineau ed68e1f047 fix pre-commit trailing whitespace 2021-10-06 17:46:30 -06:00
Pierre Constantineau 79e68a7404 adding battery monitoring pins to M60 2021-10-06 17:41:49 -06:00
Limor "Ladyada" Fried 218667377c
Merge pull request #5398 from Gadgetoid/patch-picosystem-displayio
PicoSystem: Add DisplayIO to board config
2021-10-06 10:12:29 -04:00
Scott Shawcroft 04459f5e2a
Merge branch 'main' into ai_thinker_esp32-c3s 2021-10-05 14:28:17 -07:00
Scott Shawcroft 39886701d6
Merge pull request #5404 from microDev1/microdev-micro-c3
Add board MicroDev microC3
2021-10-05 13:31:24 -07:00
microDev a46aa48e23
Convert more modules to use MP_REGISTER_MODULE
Convert espidf, os, rp2pio, samd and time to use MP_REGISTER_MODULE.

Related to #5183.
2021-10-05 16:58:24 +05:30
Josh Gadeken 881724b529
[#4701] Correct DAC clock speed comments for SAMD21 and SAMD51 2021-10-04 22:18:26 -06:00
Max Holliday 6811c5e881 c formatting... 2021-10-04 15:44:46 -06:00
Max Holliday 0dd276ba79 c formatting 2021-10-04 15:04:55 -06:00
Max Holliday 2ff038f08b fixing c formatting 2021-10-04 14:55:44 -06:00
microDev d9eafffa6a
i2cperipheral implementation for esp32s2 2021-10-05 01:02:55 +05:30
EmergReanimator e636db713f Lose dependency to USB via CIRCUITPY_USB define for atmel port. 2021-10-04 10:57:39 +02:00
Max Holliday 6a8b4f5f07 fixed c formating 2021-10-03 23:13:58 -06:00
Max Holliday 5ceb72009e fixed c formating for pre-commit check 2021-10-03 22:42:04 -06:00
Max Holliday b95325e3c7
Merge branch 'samd-sleep' into samd-sleep-v1 2021-10-03 17:16:27 -06:00
Lucian Copeland f748d66128 Setup outline for SAMD alarm module 2021-10-03 14:57:44 -07:00
Max Holliday 7a703aaa64 adding comments 2021-10-02 15:00:18 -06:00
Max Holliday 433a901ffb
Merge branch 'adafruit:main' into samd-sleep-v1 2021-10-02 14:56:15 -06:00
microDev 8b5ea98271
minor updates for board microdev_micro_s2 2021-10-02 17:10:46 +05:30
Max Holliday 79cd10ac85 cleaning up TimeAlarm and PinAlarm 2021-10-01 17:36:04 -06:00
Max Holliday cd28d50e7a
Merge branch 'adafruit:main' into samd-sleep-v1 2021-10-01 16:13:06 -06:00
microDev 26fbb4eb85
add esp32c3 documentation in readme 2021-10-01 01:26:05 +05:30
Phil Howard 2fc6a72cc7 PicoSystem: Add DisplayIO & Stage to board config
* Bring up PicoSystem's display with DisplayIO
* Add stage game library
* Add supporting modules - AUDIOIO and KEYPAD
2021-09-30 13:57:03 +01:00
Matthew McGowan e54073b95b feat(swan_r5):bootloader build (UF2_BOOTLOADER=2) does not set the ISR vector table. 2021-09-29 20:40:37 -07:00
Bruce Segal b3a46955ea Add AIThinker ESP32-C3S_Kit board 2021-09-29 18:52:16 -07:00
Max Holliday d536be7228 working samd deep sleep timealarm and pinalarm (sketchy) 2021-09-29 11:44:15 -06:00
Matthew McGowan 1c1eb49b36 fix(swan_r5):revert changes to GPIO ports. While these ports are available on the L4R5, they aren't used. This fixes a build error on the stm32f412zg_discovery. 2021-09-28 18:52:03 -07:00
Matthew McGowan 9b179ffbe4 style(swan_r5): pre-commit whitespace style changes 2021-09-28 18:52:03 -07:00
Matthew McGowan 295cc18190 style(swan_r5): pre-commit whitespace style changes 2021-09-28 18:52:03 -07:00
Matthew McGowan 8a3fb7bd13 fix(swan_r5):fixes timer definitions in the array. Requires padding to match peripheral with interrupt handler index. 2021-09-28 18:52:02 -07:00
Matthew McGowan 7b7b4997a4 docs(swan_r5): misc comments/formatting 2021-09-28 18:52:02 -07:00
Matthew McGowan 599368373e feat(swan_r5): user button tested 2021-09-28 18:52:02 -07:00
Matthew McGowan 40c3b5c7e6 docs(swan_r5):todo cleanup 2021-09-28 18:52:02 -07:00
Matthew McGowan 88f6bb2cf2 chore(swan_r5):pwmio test 2021-09-28 18:52:02 -07:00
Matthew McGowan 9d27d249cf chore(swan_r5):tests used to smoke test the board functionality 2021-09-28 18:52:02 -07:00
Matthew McGowan 2a05b22f42 reworks memory map for flash 2021-09-28 18:52:02 -07:00
Brandon Satrom 48f67d007e feat: add Blues Swan R5 support
complete pin mapping for Feather pins

stubbed out files needed for complilation. still to be modified

0 out all CPY modules in mpconfigboard.mk until we get the build running

add csv for pin generation for STM32L4R5

add F4R5 references in peripherals files

refactored out board files BECAUSE I AM AN IDIOT; add L4 series system clocks file from CubeMX

took a guess at the number of USB endpoint pairs to get the build done

guess was close, but wrong. It is 8

clean up peripheral DEFs

Fixes build error:
```
In file included from ../../py/mpstate.h:33,
                 from ../../py/mpstate.c:27:
../../py/misc.h: In function 'vstr_str':
../../py/misc.h:196:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
 static inline char *vstr_str(vstr_t *vstr) {
 ^~~~~~
```
Sleuthing steps:
* verify that the feather_stm32f4_express board builds correctly
* put a `#error` at the bottom of the `mpstate.c` file.
* build for the feather and swan boards, with V=2 to capture the build command for that file.
* use a differencing tool to inspect the differences between the two invocations
* inspecting the differences, I saw a missing `-mcpu=cortex-m4` I tested by adding that to the Swan build command. The file built fine (stopping at the hard error, but no other warnings.)

A grep through the sources revealed where this flag was being set for the stm ports.

With this commit, the build gets further, but does not complete. The next exciting episode in this unfolding coding saga is just a commit away!

working build with minimal set of modules for the Blues Swan r5

chore:change header copyright name to Blues Wireless Contributors

USB operational.  Fixed up clocks to be hardwired for LSE no HSE case. (Trying to combine HSE in there made the code much more complex, and I don't have a board to test it out on.)

USART working

adds support for `ENABLE_3V3` and `DISCHARGE_3V3` pins.  I am surprised that pin definitions are quite low-level and don't include default direction and state, so the code currently has to initialize `ENABLE_3V3` pin as output.  The LED takes over a second to discharge, so I wonder if the board startup code is not having the desired affect.

short circuit implementation of backup memory for the STM32L4

all the ports

remove company name from board name to be consistent with the Arduino board definition.

add default pins for I2C, SPI and UART, so that `board.I2C` et al. works as expected.  Confirmed I2C timing.

fix board name

fix incorrect pin definition. add test to allow manual check of each output pin

analog IO

code changes for WebUSB. Doesn't appear to work, will revisit later.

ensure that `sys.platform` is available

checkin missing file

feat: make room for a larger filesystem so the sensor tutorial will fit on the device.

fix:(stm32l4r5zi.csv): merged AF0-7 and AF8-15 into single lines and removed extraneous headers mixed in with the data.

fix(parse_af_csv.py): pin index in the csv is 0 not 1, and AF index made 1 larger

chore(Swan R5): update peripherals pins from `parse_af_csv.py` output

optimize flash sector access
2021-09-28 18:52:02 -07:00
microDev 317751bd79
add board microdev_micro_c3 2021-09-29 00:14:00 +05:30
Scott Shawcroft fab27f6be6
Merge pull request #5394 from microDev1/c3-port
Add initial esp32c3 support
2021-09-28 10:31:11 -07:00
Scott Shawcroft aa52d726de
Merge pull request #5395 from PontusO/main
Added Challenger RP2040 LTE board.
2021-09-27 11:19:28 -07:00
Feyn ed18c1f2b8
Fix a critical "typo"
Current compiled downloads are unusable because MICROPY_QSPI_CS is defined as the wrong pin
2021-09-26 13:47:05 +02:00
Pontus Oldberg 5649887d34 Added support for the Challenger NB RP2040 WiFi board. 2021-09-26 07:54:07 +02:00
Pontus Oldberg 7d002478ef Added Challenger RP2040 LTE board. 2021-09-26 07:15:30 +02:00
microDev 3da86b0ac2
add initial esp32c3 support 2021-09-26 09:39:40 +05:30
microDev bd997dd67e
Merge pull request #5388 from microDev1/serial-over-uart
Fix espressif serial over uart
2021-09-26 09:30:08 +05:30
Pontus Oldberg 6e296999d6 Fixed incorrect pin definitions. 2021-09-25 16:19:48 +02:00
microDev 1be6c41da4
fix espressif serial over uart 2021-09-25 09:03:24 +05:30
Damien George ea186de4c5 esp32: Split out WLAN code from modnetwork.c to network_wlan.c.
To match network_lan.c and network_ppp.c, and make it clear what code is
specifically for WLAN support.

Also provide a configuration option MICROPY_PY_NETWORK_WLAN which can be
used to fully disable network.WLAN (it's enabled by default).

Signed-off-by: Damien George <damien@micropython.org>
2021-09-24 12:41:35 +10:00
Damien George f046b50ca5 esp32/main: Add option for a board to hook code into startup sequence.
To do this the board must define MICROPY_BOARD_STARTUP, set
MICROPY_SOURCE_BOARD then define the new start-up code.

For example, in mpconfigboard.h:

    #define MICROPY_BOARD_STARTUP board_startup
    void board_startup(void);

in mpconfigboard.cmake:

    set(MICROPY_SOURCE_BOARD
        ${MICROPY_BOARD_DIR}/board.c
    )

and in a new board.c file in the board directory:

    #include "py/mpconfig.h"

    void board_startup(void) {
        boardctrl_startup();
        // extra custom startup
    }

This follows stm32's boardctrl facilities.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-24 12:23:14 +10:00
leo chung 4fdf795efa esp32/mpthreadport: Fix TCB cleanup function so thread_mutex is ready.
Because vPortCleanUpTCB is called by the FreeRTOS idle task, and it checks
thread, but didn't check the thread_mutex.

And if thread is not NULL, but thread_mutex not ready then it will crash
with an error when calling mp_thread_mutex_lock(&thread_mutex, 1).

As suggested by @dpgeorge, move the thread = &thread_entry0 line to the end
of mp_thread_init().

Signed-off-by: leo chung <gewalalb@gmail.com>
2021-09-24 12:12:03 +10:00
Jeff Epler 10fdc80b9c
Merge pull request #5378 from jepler/esp32s2-paralleldisplay-i2s
Espressif: Use i2s peripheral for parallel LCD displays
2021-09-23 20:25:43 -05:00
Seon Rozenblum a39a596b79 esp32/machine_pin: Block out IO16 and IO17 when using SPIRAM on ESP32.
Fixes issue #7819.
2021-09-24 10:56:09 +10:00
Jeff Epler a97e46be66 espressif: Fix ParallelBus clock speed
The observed does not match the datasheet, so go with what was
observed.
2021-09-23 14:12:59 -05:00
Jeff Epler 3f4bbc5aff Fix number of LCD data pins 2021-09-23 13:37:30 -05:00
Michael Thomson 94ca3f594e Enable CS "active-high" device support
Reference https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/issues/71

Add a new parameter cs_active_value for devices that require CS to use "active high" logic.

Update mpconfigboard.mk to disable pyb_nano_v2 from core build as its flash is too small now.
2021-09-23 09:14:39 +01:00
Jeff Epler 4714861f38 espressif: Implement parallel display using i2s 2021-09-21 14:38:12 -05:00
Jeff Epler 2f1ac44d78 add files from espressif/esp-dev-kits@ec03a13333 2021-09-21 14:38:05 -05:00
Seon Rozenblum 35fb90bd57 esp32/usb: Add USB host connection detection for CDC serial output.
This callback allows detecting if there is a USB host connected to the CDC
or not, in which case the stdout_tx should skip CDC TX writing and
flushing or the system will block.

Fixes issue #7820.
2021-09-22 00:42:20 +10:00
Seon Rozenblum 7bf466a281 esp32/README: Updated readme with req IDF vers for ESP32-S2, C3 and S3. 2021-09-22 00:41:02 +10:00
IhorNehrutsa 52636fa692 esp32/machine_pwm: Add support for all PWM timers and channels.
This commit allows using all the available PWM timers (up to 8) and
channels (up to 16), without affecting the PWM API.

If a new frequency is set, first it checks if another timer is using the
same frequency.  If yes, then it uses this timer, otherwise, it creates a
new one.  If all timers are used, the user should set an already used
frequency, or de-init a channel.

This work is based on #6276 and #3608.
2021-09-21 23:18:09 +10:00
Stewart Bonnick 0d9429f44c esp32/boards: Add LOLIN_S2_MINI ESP32-S2 board.
To support Lolin S2 Mini ESP32-S2 Variant board.  More information about
this board can be found at https://www.wemos.cc/en/latest/s2/s2_mini.html
2021-09-21 22:49:51 +10:00
iabdalkader 67d1dca9c2 stm32/machine_i2c: Use hardware I2C for STM32H7. 2021-09-21 18:13:28 +10:00
roland van straten 9eff4029ab stm32/boards: Add PF11-BOOT0 to stm32f091_af.csv.
PF11 is added so it can be used as GPIO.
2021-09-21 18:11:42 +10:00
Ned Konz 99bb52047c stm32/boards/NUCLEO_H743ZI: Enable VfsLfs2 on NUCLEO_H743ZI(2) boards. 2021-09-21 18:02:19 +10:00
Ned Konz 8c214ed200 stm32: Extended flash filesystem space to 512K on H743 boards.
The H743 has equal sized pages of 128k, which means the filesystem doesn't
need to be near the beginning.  This commit moves the filesystem to the
very end of flash, and extends it to 512k (4 pages).

Signed-off-by: Damien George <damien@micropython.org>
2021-09-21 18:02:14 +10:00
Scott Shawcroft 276d425899
Merge pull request #5302 from maholli/pycubed_v05c
updating pycubed firmware for mainboardv05
2021-09-20 15:00:25 -07:00
Scott Shawcroft 48866dd3e7
Merge pull request #5367 from microDev1/refactor-esp-port
Update espressif port
2021-09-20 14:59:27 -07:00
Scott Shawcroft 58eda2e0e8
Merge pull request #5350 from microDev1/ci-docs-split
CI: Build docs dynamically
2021-09-20 14:53:40 -07:00
Pierre Constantineau c5672066d0 initial xiao kb config 2021-09-20 15:52:28 -06:00
Dan Halbert 8e63a2e6c0
Merge pull request #5368 from skerr92/add-ODT-bread-2040
Add ODT Bread 2040
2021-09-20 17:13:23 -04:00
Dan Halbert 951ea46de1
Added CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
This is a recent addition to add `board.board_id` and `board.__name__`.
2021-09-20 16:52:16 -04:00
leoli51 a980f8f743 added missing board config file 2021-09-19 16:09:17 +02:00
leoli51 761b1dbf12 merged commits from main 2021-09-19 15:51:43 +02:00
iabdalkader 782d5b2e53 stm32: Enable platform module.
The HAL version is based on the stm32lib version.
2021-09-19 23:35:44 +10:00
iabdalkader 38f8e852e0 rp2: Add framework for networking.
MICROPY_PY_NETWORK and MICROPY_PY_USOCKET need to be enabled by a board to
get networking.  No NICs have yet been defined.
2021-09-19 23:20:13 +10:00
iabdalkader c973cfd2f3 rp2: Add support for bluetooth module using NimBLE. 2021-09-19 23:09:59 +10:00
Chris Fiege 6e39f2cc1e stm32/boards: Add OLIMEX H407 board definition.
This change adds the OLIMEX H407 support to the STM32 port.  The H407
(https://www.olimex.com/Products/ARM/ST/STM32-H407/) is simliar to the
already existing E407
(https://www.olimex.com/Products/ARM/ST/STM32-E407) but does not support
Ethernet and has a full-size USB-A port instead of a Mini-USB socket.

Both boards use the STM32F407ZGT6 CPU.

This port is basically a copy of the E407 but with changed pinmux:
* Removed Ethernet pin definition
* Removed UART1 (pins are used for other functions)
* Removed UART3 flow control pins (pins are used for other functions)
* Removed SD-Card detect pin (since it is not connected on the H407)

A REPL on UART3 is connected to the U3BOOT-header, a 3-pin header with RX,
TX and GND that is intended for the serial terminal.

Tested:
* Micro-SD Card is detected when inserted on RESET
* REPL on UART3 works
* Serial port on the mini USB socket

Signed-off-by: Chris Fiege <cfi@pengutronix.de>
2021-09-19 16:58:58 +10:00
patrick 4cfd85eb4a esp32/boards: Add board definition for ESP32-S2-WROVER module. 2021-09-19 16:49:35 +10:00
Seon Rozenblum 13e6e0d7f5 esp32/machine_hw_spi: Fix hardware SPI DMA channels for S2/S3. 2021-09-19 10:23:12 +10:00
Seth Kerr de55073eea Add ODT Bread 2040 2021-09-18 10:45:02 -06:00
microDev 7dda3ec91c
switch to `IDF_TARGET` for soc dependent stuff
Co-authored-by: Seon Rozenblum <seon@unexpectedmaker.com>
2021-09-18 19:49:32 +05:30
microDev dcfde14bf9
move pins and sdkconfig into soc specific directories 2021-09-18 19:47:18 +05:30
microDev eb0738fb33
update esp-idf to v4.3.1 2021-09-18 19:44:14 +05:30
microDev 1536ec0123
rename left over esp32s2 to espressif 2021-09-18 19:42:18 +05:30
leoli51 bb424c7510 renamed folder and added neopixel gpio 2021-09-18 16:05:13 +02:00
microDev be3fca81e7
fix espidf docs 2021-09-17 21:27:18 +05:30
Max Holliday 0f8cb5618f
Merge branch 'adafruit:main' into pycubed_v05c 2021-09-16 12:12:36 -06:00
Max Holliday 4eda8b04c4 removing redudant pycubed v04 board defs 2021-09-16 12:12:15 -06:00
Dan Halbert a5dc0fef5f Revert #5341. Does not work on power-cycle. 2021-09-16 11:59:43 -04:00
Damien George 80fe25689f esp32/boards: Add new GENERIC_S3 board definition.
Thanks to Seon Rozenblum aka @UnexpectedMaker for the work.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 22:58:47 +10:00
Damien George 54d33b266c esp32: Add support for ESP32-S3 SoCs.
Thanks to Seon Rozenblum aka @UnexpectedMaker for the work.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 22:58:47 +10:00
Jim Mussared b326edf68c all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.
This commit removes all parts of code associated with the existing
MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE optimisation option, including the
-mcache-lookup-bc option to mpy-cross.

This feature originally provided a significant performance boost for Unix,
but wasn't able to be enabled for MCU targets (due to frozen bytecode), and
added significant extra complexity to generating and distributing .mpy
files.

The equivalent performance gain is now provided by the combination of
MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE (which has
been enabled on the unix port in the previous commit).

It's hard to provide precise performance numbers, but tests have been run
on a wide variety of architectures (x86-64, ARM Cortex, Aarch64, RISC-V,
xtensa) and they all generally agree on the qualitative improvements seen
by the combination of MICROPY_OPT_LOAD_ATTR_FAST_PATH and
MICROPY_OPT_MAP_LOOKUP_CACHE.

For example, on a "quiet" Linux x64 environment (i3-5010U @ 2.10GHz) the
change from CACHE_MAP_LOOKUP_IN_BYTECODE, to LOAD_ATTR_FAST_PATH combined
with MAP_LOOKUP_CACHE is:

diff of scores (higher is better)
N=2000 M=2000       bccache -> attrmapcache      diff      diff% (error%)
bm_chaos.py        13742.56 ->   13905.67 :   +163.11 =  +1.187% (+/-3.75%)
bm_fannkuch.py        60.13 ->      61.34 :     +1.21 =  +2.012% (+/-2.11%)
bm_fft.py         113083.20 ->  114793.68 :  +1710.48 =  +1.513% (+/-1.57%)
bm_float.py       256552.80 ->  243908.29 : -12644.51 =  -4.929% (+/-1.90%)
bm_hexiom.py         521.93 ->     625.41 :   +103.48 = +19.826% (+/-0.40%)
bm_nqueens.py     197544.25 ->  217713.12 : +20168.87 = +10.210% (+/-3.01%)
bm_pidigits.py      8072.98 ->    8198.75 :   +125.77 =  +1.558% (+/-3.22%)
misc_aes.py        17283.45 ->   16480.52 :   -802.93 =  -4.646% (+/-0.82%)
misc_mandel.py     99083.99 ->  128939.84 : +29855.85 = +30.132% (+/-5.88%)
misc_pystone.py    83860.10 ->   82592.56 :  -1267.54 =  -1.511% (+/-2.27%)
misc_raytrace.py   21490.40 ->   22227.23 :   +736.83 =  +3.429% (+/-1.88%)

This shows that the new optimisations are at least as good as the existing
inline-bytecode-caching, and are sometimes much better (because the new
ones apply caching to a wider variety of map lookups).

The new optimisations can also benefit code generated by the native
emitter, because they apply to the runtime rather than the generated code.
The improvement for the native emitter when LOAD_ATTR_FAST_PATH and
MAP_LOOKUP_CACHE are enabled is (same Linux environment as above):

diff of scores (higher is better)
N=2000 M=2000        native -> nat-attrmapcache  diff      diff% (error%)
bm_chaos.py        14130.62 ->   15464.68 :  +1334.06 =  +9.441% (+/-7.11%)
bm_fannkuch.py        74.96 ->      76.16 :     +1.20 =  +1.601% (+/-1.80%)
bm_fft.py         166682.99 ->  168221.86 :  +1538.87 =  +0.923% (+/-4.20%)
bm_float.py       233415.23 ->  265524.90 : +32109.67 = +13.756% (+/-2.57%)
bm_hexiom.py         628.59 ->     734.17 :   +105.58 = +16.796% (+/-1.39%)
bm_nqueens.py     225418.44 ->  232926.45 :  +7508.01 =  +3.331% (+/-3.10%)
bm_pidigits.py      6322.00 ->    6379.52 :    +57.52 =  +0.910% (+/-5.62%)
misc_aes.py        20670.10 ->   27223.18 :  +6553.08 = +31.703% (+/-1.56%)
misc_mandel.py    138221.11 ->  152014.01 : +13792.90 =  +9.979% (+/-2.46%)
misc_pystone.py    85032.14 ->  105681.44 : +20649.30 = +24.284% (+/-2.25%)
misc_raytrace.py   19800.01 ->   23350.73 :  +3550.72 = +17.933% (+/-2.79%)

In summary, compared to MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE, the new
MICROPY_OPT_LOAD_ATTR_FAST_PATH and MICROPY_OPT_MAP_LOOKUP_CACHE options:
- are simpler;
- take less code size;
- are faster (generally);
- work with code generated by the native emitter;
- can be used on embedded targets with a small and constant RAM overhead;
- allow the same .mpy bytecode to run on all targets.

See #7680 for further discussion.  And see also #7653 for a discussion
about simplifying mpy-cross options.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 16:04:03 +10:00
Jim Mussared 60c6d5594f unix: Enable LOAD_ATTR fast path, and map lookup caching.
Enabled for all variants except minimal.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 16:02:19 +10:00
Jim Mussared 68219a295c stm32: Enable LOAD_ATTR fast path, and map lookup caching on >M0.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 16:02:19 +10:00
Jim Mussared 910e060f93 minimal/mpconfigport.h: Use MICROPY_CONFIG_ROM_LEVEL_MINIMUM.
Update minimal port to use the new "minimal" rom level config (this is a
no-op change, the binary is the same size and contains the exact same
symbols).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 13:24:33 +10:00
Damien George 0c0807e084 stm32/dma: Add functions for external users of DMA to enable clock.
Any external user of DMA (eg a board with a custom DMA driver) must call
dma_external_acquire() for their DMA controller/stream to ensure that the
DMA clock is not automatically turned off while it's still being used
externally.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 13:01:43 +10:00
Damien George c51cc46bf8 stm32/boards/make-pins.py: Allow empty lines and comments in pins.csv.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 12:53:16 +10:00
Damien George a6907c779a stm32/boards/make-pins.py: Allow a CPU pin to be hidden.
This change allows a CPU pin to be hidden from the user by prefixing it
with a "-" in the pins.csv file for a board.  It will still be available in
C code, just not exposed to Python.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 12:53:16 +10:00
Jim Mussared e3eebc329f stm32: Suggest putting code in main.py not boot.py.
Don't want users to accidentally use boot.py (because recovering requires
knowing how to activate safe mode).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-09-16 12:40:05 +10:00
Jan Staal 9e2423e730 stm32: Add support for H7A3(Q)/H7B3(Q), and STM32H73B3I_DK board defn.
This commit is based upon prior work of @dpgeorge and @koendv.

MCU support for the STM32H7A3 and B3 families MCUs:
- STM32H7A3xx
- STM32H7A3xxQ (SMPS)
- STM32H7B3xx
- STM32H7B3xxQ (SMPS)

Support has been added for the STM32H7B3I_DK board.

Signed-off-by: Jan Staal <info@janstaal.com>
2021-09-16 12:29:28 +10:00
Max Holliday 1ccaeeb619
adding back heritage pycubed board defs 2021-09-15 14:36:27 -06:00
Max Holliday 4f10a91f85 moving boot counter to main() and re-adding old pin names for SD_CS 2021-09-15 14:33:54 -06:00
Max Holliday 5b69aa0a58
Merge branch 'adafruit:main' into pycubed_v05c 2021-09-15 14:23:56 -06:00
microDev e91fb247a3
build docs dynamically 2021-09-16 00:05:42 +05:30
Scott Shawcroft 3cc4f25a1c
Merge pull request #5337 from hathach/tinyusb-compliance-stm-imxrt-esp32
update tinyusb to have esp32sx, stm32 and imxrt passed compliance test suite
2021-09-14 22:40:13 -07:00
Dan Halbert 9e8c6b2bab Shrink pca10100 some more 2021-09-14 21:37:30 -04:00
iabdalkader d9749f90ad extmod/modnetwork: Remove modnetwork socket u_state member.
To simplify the socket state.

The CC3K driver (see drivers/cc3000/inc/socket.h and src/socket.c) has
socket() returning an INT16 so there is now enough room to store it
directly in the fileno member.
2021-09-15 11:29:02 +10:00
Jan Hrudka d451dc0086 stm32: Add basic support for STM32H750. 2021-09-15 10:42:20 +10:00
Dan Halbert 02dc0481c5 shrink stm32f411ve_discovery 2021-09-14 19:50:46 -04:00
Dan Halbert 59b1bedcda
Merge pull request #5333 from microDev1/patch
Make `next_code_allocation` and `prev_traceback_allocation` movable
2021-09-14 19:27:40 -04:00
Scott Shawcroft dfba2ee26e
Merge pull request #5342 from tannewt/rename_esp32s2_to_espressif
Rename esp32s2 port to espressif
2021-09-14 16:23:14 -07:00
Dan Halbert 0ab4df6f2f shrink some SAMD21 builds, and nrf simmel 2021-09-14 17:10:49 -04:00
Dan Halbert 81e28308c2 Revert "turn off inline-unit-growth and max-inline-insns-auto uses"
This reverts commit 94d76e0f48.
2021-09-14 16:56:04 -04:00
microDev 8520c430a7
Merge pull request #5341 from urish/patch-1
Enable WFI for raspberrypi port
2021-09-14 22:10:02 +05:30
Dan Halbert 94d76e0f48 turn off inline-unit-growth and max-inline-insns-auto uses 2021-09-14 12:15:21 -04:00
iabdalkader 4dba04a50f extmod/modnetwork: Define network interfaces in port config files.
So this network implementation becomes more generic.
2021-09-15 01:29:26 +10:00
iabdalkader 7aab0dc5d8 extmod: Move modnetwork and modusocket from stm32 to extmod.
So they can be used by other ports.
2021-09-15 01:25:12 +10:00
Philipp Ebensberger 0d7366c912 mimxrt: Rework flash configuration.
- Moves definition of BOARD_FLASH_SIZE and other header files related to
	flash configuration into the Makefile.
- Adds board specific clock_config.h.
- Adds board.h, pin_mux.h, and peripherals.h as they are
	required by NXP MCU SDK in order to use our own clock_config.h.
- Renames board specific FlexSPI configuration files.
- Updates flash frequency of MIMXRT1020_EVK
- Creates separated flash_config files for QSPI NOR and
	QSPI Hyper flash.
- Unifies VFS start address to be @ 1M for 1010 and 1020 boards.
- Unifies 1050EVK boards
- Adds support to both NOR and HyperFlash on boards with
	both capabilities.
- Adds automatic FlexRAM initialization to start-up code based on
	linker script and NXP HAL.
- Applies code formatting to all files in mimxrt port.

With this change the flash configuration is restructured and
organized. This simplifies the configuration process and
provides a better overview of each board's settings. With the integration
of clock_config.h, board.h, pin_mux.h, and peripherals.h we gain better
control of the settings and clock configurations. Furthermore the
implementation of an explicit FlexRAM setup improves the system
performance and allows for performance tuning.

Signed-off-by: Philipp Ebensberger
2021-09-14 13:52:52 +02:00
Scott Shawcroft 973a90f2aa
Rename esp32s2 port to espressif
This is in preparation for ESP32-S3 support and potentially others.

Related to #4363
2021-09-13 16:44:55 -07:00
Dan Halbert 650ce17c0d
Fix formatting 2021-09-13 19:12:21 -04:00
Uri Shaked e5290a2886
Enable WFI for raspberrypi port
See #5331 for details
2021-09-14 01:09:15 +03:00
Scott Shawcroft 64ff8d9e19
v3 BLE file service: Add file modification times 2021-09-13 14:46:14 -07:00
Scott Shawcroft 5d90991745
Trade RAM for flash on pca10100 2021-09-13 12:04:27 -07:00
microDev cddbfffb38
Merge pull request #5335 from skieast/espressif_hmi_v1.1_pins_update
Update pins.c to match hmi devkit board
2021-09-13 16:23:02 +05:30
Kamil Tomaszewski a0d960f2a1 spresense: update SDK to 2.3.0 2021-09-13 11:04:15 +02:00
Seon Rozenblum f690fd3a47 esp32/machine_timer: Use tx_update member for IDF 4.4 and above. 2021-09-13 18:25:16 +10:00
Bruce Segal c4bea28446 Update pins.c to match hmi devkit board 2021-09-12 17:54:44 -07:00
Max Holliday dbd557dc89 splitting pycubed board def into pycubed_v04 and pycubed_v05 2021-09-11 20:29:40 -06:00
Max Holliday d9ae2c00b4
Merge branch 'adafruit:main' into pycubed_v05c 2021-09-11 20:09:59 -06:00
Dan Halbert f5bb53e112
Merge pull request #5329 from dhalbert/prox-trinkey-squeeze
proxlight: Freeze adafruit_apds9960 instead of adafruit_hid; enable usb_midi
2021-09-10 18:17:42 -04:00
Max Holliday bc26194bd0
Merge branch 'adafruit:main' into pycubed_v05c 2021-09-10 13:33:11 -06:00
Dan Halbert aa1d089cdb proxlight: Freeze adafruit_adps9960 instead of adafruit_hid; enable usb_midi 2021-09-10 14:50:09 -04:00
Dan Halbert 189efdf074 Use NO_PIN, not 0, for PDMIn unset pins.
Also:
- Use NO_PIN, not 0xff for I2SOut (cosmetic fix only; no actual functional change)
- Add VOLTAGE_MONITOR/BATTERY, ACCELEROMETER_INTERRUPT pins for LED Glasses Driver
2021-09-10 13:18:29 -04:00
Damien George 0a51073724 stm32/boards: Remove trailing spaces, and add newline at end of file.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-10 16:09:03 +10:00
Tobias Thyrrestrup 4c31d0ab60 stm32/boards/LEGO_HUB_NO6: Remove user paths from cc2564 init file.
Signed-off-by: Tobias Thyrrestrup <tt@LEGO.com>
2021-09-10 16:00:21 +10:00
Daniel Gorny b71c621f46 stm32/boards/OLIMEX_E407: Add Ethernet RMII support. 2021-09-10 15:52:03 +10:00
Boris Vinogradov 97bbc0bb91 stm32/boards/VCC_GND_H743VI: Add board definition for VCC_GND_H743VI. 2021-09-10 15:49:26 +10:00
Seon Rozenblum 9a7f77bfbc esp32/boards: Add new FeatherS2-Neo board definition. 2021-09-10 15:40:32 +10:00
stijn 318c029d45 windows/README: Remove unsupported Python instructions for Cygwin.
It's not possible anymore to build MicroPython on Cygwin using a
standard Windows installation of Python so don't advertise that.
Specifically: preprocessing in makeqstrdefs.py fails on the subprocess
call with 'gcc: fatal error: no input files' because one of the flags
contains double quotes and that somehow messes up the commandline.
2021-09-10 15:19:25 +10:00
robert-hh 61b7c098b9 mimxrt/machine_bitstream: Add bitstream function to machine module.
Following the code example for ESP32 of Jim Mussard.

As a side effect:
- mp_hal_ticks_cpu() was implemented,
- mp_hal_get_cpu_freq() and mp_hal_ticks_cpu_init() were added and used.
- mp_hal_pin_high() and mp_hal_pin_low() were changed for symmetry
2021-09-10 13:32:53 +10:00
Scott Shawcroft 0ee0ed7035
Merge pull request #5320 from rjp5th/main
Implement reset_reason for raspberrypi port
2021-09-09 10:54:14 -07:00
Pontus Oldberg 647eca6a81 Added support for Challenger RP2040 WiFi 2021-09-09 17:36:56 +02:00
microDev 09859a60e7
Merge pull request #5319 from tannewt/fix_nrf_gcc11
Fix the nRF builds with GCC 11.2
2021-09-09 09:09:34 +05:30
Max Holliday fa83c1c2f9
adding boot counter to main.c
The boot counter is a uint8_t single-byte counter stored in the first NVM byte position (`micrcontroller.nvm[0]`). The counter increments by 1 each time the board boots, regardless if it's a hard or soft reset. 

Enable the boot counter by adding `#define CIRCUITPY_BOOT_COUNTER 1` to your board's mpconfigboard.h file. Note that an error will be thrown during the build if `CIRCUITPY_INTERNAL_NVM_SIZE` is not also set within mpconfigboard.h.
2021-09-08 19:56:23 -06:00
Max Holliday 5d29caf499
Merge branch 'adafruit:main' into pycubed_v05c 2021-09-08 19:37:06 -06:00
Scott Shawcroft 2b4fdcdfa2
Fix scanning after a peripheral bond has been made
The BLE workflow will be advertising and the scan's load of
identities conflicts with it. This change ensures scanning and
advertising happens exclusively.

This showed as an unknown error 3204.

Fixes https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/134
2021-09-08 16:58:53 -07:00
Robert Pafford 65f8804816
Implement reset_reason for raspberrypi port 2021-09-08 18:34:34 -04:00
Scott Shawcroft f2de010059
Fix the nRF builds with GCC 11.2
See adafruit/Adafruit_nRF52_Bootloader#221
for background on the flag.
2021-09-08 12:53:39 -07:00
Kattni 2ea330581d
Merge pull request #5310 from dhalbert/rsp2040-i2s-fix
Fix RP2040 I2S: always copy to output buffer
2021-09-07 18:18:30 -04:00
Scott Shawcroft a5ac5e1efb
Merge pull request #5297 from durapensa/s2mini
Lolin S2 Mini - remove NeoPixel, pin assignments to match Wemos
2021-09-07 14:11:21 -07:00
Dan Halbert d2d0bd289f Fix RP2040 I2S: always copy to output buffer 2021-09-07 16:35:42 -04:00
Philipp Ebensberger 87f97e490c mimxrt/sdcard: Implement SDCard driver.
- Configures `PLL2->PFD0` with **198MHz** as base clock of
	`USDHCx` peripheral.
- Adds guards for SDCard related files via `MICROPY_PY_MACHINE_SDCARD`
- Adds creation of pin defines for SDCard to make-pins.py
- Adds new configuration option for SDCard peripheral pinout
        to mpconfigport.h
- Adds interrupt handling support instead of polling
- Adds support for `ADMA2` powered data transfer
- Configures SDCard to run in HS (high-speed mode) with **50MHz** only!

SDCard support is optional and requires `USDHC` peripheral.
Thus this driver is not available on `MIMXRT1010_EVK`.
SDCard support is enabled by setting `MICROPY_PY_MACHINE_SDCARD = 1`
in mpconfigboard.mk.

Signed-off-by: Philipp Ebensberger
2021-09-07 20:45:33 +02:00
Max Holliday 674a3027fc
updating pycubed firmware for mainboardv05 :) 2021-09-04 18:39:24 -06:00
YoungJoon Chun bbbdef4cc1 rp2/mpconfigport.h: Enable heapq module.
Fixes issue #7746.
2021-09-04 23:51:14 +10:00
Damien George af64c2ddbd extmod/machine_pwm: Factor out machine.PWM bindings to common code.
This commit refactors machine.PWM and creates extmod/machine_pwm.c.  The
esp8266, esp32 and rp2 ports all use this and provide implementations of
the required PWM functionality.  This helps to reduce code duplication and
keep the same Python API across ports.

This commit does not make any functional changes.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-04 16:31:17 +10:00
Durapensa 7e10785ec7 Lolin S2 Mini - fix EOF issue caught by pre-commit 2021-09-03 16:46:50 -04:00
durapensa 2fc372b9e1
Lolin S2 Mini - Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-09-03 15:10:22 -04:00
Neradoc 8625e53817 change board dicts to include a common macro with __name__ 2021-09-03 21:03:55 +02:00
Durapensa 15fc44cab7 Lolin S2 Mini fix typo in pin assignment 2021-09-03 12:20:07 -04:00
Durapensa 32b9450e7f Lolin S2 Mini removed some redundant comments 2021-09-03 12:14:59 -04:00
Durapensa c0f039da29 Lolin S2 Mini added pin definitions from Wemos/Lolin D1 Mini 2021-09-03 12:08:38 -04:00
Durapensa ef6d7fe731 Lolin S2 Mini change 'Espressif' references to 'Wemos' 2021-09-03 10:17:44 -04:00
Durapensa 765eee424e Lolin S2 Mini added I2C & SPI defs from Espressif MicroPython 2021-09-03 10:08:38 -04:00
Durapensa ec20b2a02e Merge branch 'main' of github.com:adafruit/circuitpython into s2mini 2021-09-03 09:26:47 -04:00
Durapensa 762c15535f Lolin S2 Mini pin assignment changes 2021-09-03 09:12:14 -04:00
Scott Shawcroft 3508b01ed9
Merge pull request #5294 from tannewt/patch-1
Add FeatherS2 Neo from Unexpected Maker
2021-09-02 12:44:27 -07:00
Scott Shawcroft bf5e8bf20b
Use Espressif PID 2021-09-02 10:17:38 -07:00
Scott Shawcroft a78cc7a22c
Merge pull request #5293 from microDev1/patch
Make `aesio` module full build dependent
2021-09-02 09:34:53 -07:00
microDev d526925d49
make aesio module full build dependent 2021-09-02 19:02:01 +05:30
Damien George 9792c9105f stm32/main: Don't unconditionally enable GPIO A,B,C,D clocks.
Rely on them being enabled only when needed.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 20:28:53 +10:00
Damien George 05cd17e36f stm32/pin: Enable GPIO clock of pin if it's constructed without init.
Fixes issue #7363.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 20:28:53 +10:00
Seon Rozenblum 9bfa2a416d Added STAGE support for my TinyS2 board 2021-09-02 18:09:08 +10:00
Seon Rozenblum 24859ed596 Added support for my new FeatherS2 Neo esp32s2 board 2021-09-02 15:01:52 +10:00
Damien George 1083cb2f33 zephyr/mphalport.h: Remove unused and unimplemented C-level pin API.
It gives compile warnings.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 13:11:23 +10:00
Damien George d41f6dde56 extmod/modonewire: Make _onewire module configurable via macro option.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 13:11:23 +10:00
Damien George afe0634c98 extmod/machine_spi: Make SoftSPI configurable via macro option.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 13:11:23 +10:00
Damien George 122d901ef1 extmod/machine_i2c: Make SoftI2C configurable via macro option.
The zephyr port doesn't support SoftI2C so it's not enabled, and the legacy
I2C constructor check can be removed.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 13:11:23 +10:00
Scott Shawcroft 57e4b78340
Merge pull request #5284 from tannewt/linking_fixes
Two fixes, one for ble workflow, one for linking
2021-09-01 15:21:33 -07:00
Scott Shawcroft cf0899487f
Merge pull request #5237 from jepler/hmi
Add Espressif's HMI DevKit
2021-09-01 13:49:58 -07:00
Scott Shawcroft 0d280fa83c
Two fixes, one for ble workflow, one for linking
BLE workflow had an incorrect list size for characteristics

Linking didn't advance . link it should have without extra ().
2021-09-01 12:43:43 -07:00
Scott Shawcroft 9557ca89f2
Update USB PID 2021-09-01 10:50:48 -07:00
Scott Shawcroft b80ffee105
Merge pull request #5268 from hathach/nrf-usb-compliance-test
Update tinyusb for USB Compliance Verification test
2021-09-01 10:48:35 -07:00
Scott Shawcroft 9c4c3e1780
Only sort .text for nrf 2021-09-01 08:57:18 -07:00
Damien George 25f30eb8a6 stm32/boards/LEGO_HUB_NO6: Add comment re constraints on SPI flash cfg.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 00:03:41 +10:00
Bruce Segal bec7a6265a Change name VBAT_SENSE -> BATTERY 2021-08-31 19:52:40 -07:00
Scott Shawcroft 0cffa6be81
Sort .text section to reduce fill on nRF 2021-08-31 19:33:44 -07:00
Scott Shawcroft cd5acae4f4
Sort .text section to reduce fill 2021-08-31 18:04:01 -07:00
Bruce Segal 736b592d2d Add IO9 / VBAT_SENSE to lilygo-t8-s2-st7789 2021-08-31 16:50:50 -07:00
Scott Shawcroft 771b4c7464
Add two space saving knobs
* Reduce the number of supported HID reports of IDs per descriptor.
  This saves ~200 bytes in the default HID objects.
* (Not enabled) Compute QSTR attrs on init. This trades 1k RAM for
  flash. Flash is the default (1).
2021-08-31 13:02:34 -07:00
Scott Shawcroft cc0a6c8a5f
Merge remote-tracking branch 'adafruit/main' into fix_nrf_wdt_crashes 2021-08-31 11:03:44 -07:00
Damien George 35ead0ff0f javascript/Makefile: Change variable to EXPORTED_RUNTIME_METHODS.
EXTRA_EXPORTED_RUNTIME_METHODS is deprecated.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-01 00:42:40 +10:00
microDev 513ca098f9
Merge pull request #5273 from tannewt/fix_nrf_light_sleep_cdc
Fix nrf light_sleep when on usb
2021-08-31 13:29:04 +05:30
microDev 1dbeed87af
Merge pull request #5253 from tannewt/fix_nrf_gpiote_crash
Fix GPIOTE crashes by checking everything is ok
2021-08-31 09:11:36 +05:30
David Lechner 86371781e9 tools/uncrustify: Force 1 newline at end of file.
To keep things neat and tidy, we ensure that each file has 1 and only 1
newline at the end of each file.

Signed-off-by: David Lechner <david@pybricks.com>
2021-08-31 13:14:45 +10:00
Scott Shawcroft 6ef5241f59
Merge pull request #5267 from pewpew-game/meowbit-stage
stm32: Add support for Stage games to Meowbit
2021-08-30 18:35:41 -07:00
Scott Shawcroft 5fb4fa6f12
Merge pull request #5260 from jepler/paralleldisplay
Split out paralleldisplay to its own module
2021-08-30 18:35:15 -07:00
Scott Shawcroft fa9c2189d4
Fix nrf light_sleep when on usb
Don't let pending serial input wake us up

Fixes #5257
2021-08-30 18:26:12 -07:00
Scott Shawcroft a4246bcfa3
Fix two watchdog crashes
Fixes a crash from trying to raise an exception when trying to
deinit a RESET wdt by not raising an exception.

Fixes a crash when raise a wdt exception in the REPL when waiting
for input. We now catch and print any exceptions raised.

Fixes #5261
2021-08-30 18:10:43 -07:00
Scott Shawcroft 3ea90dbc1e
Merge pull request #5263 from jepler/printf-0xp
Include leading 0x on addresses printed with %p
2021-08-30 18:00:43 -07:00
Scott Shawcroft 838d30b3a4
Fix incorrect macros 2021-08-30 14:40:14 -07:00
Scott Shawcroft 8fbb3e6d25
Merge pull request #5239 from durapensa/s2mini
Add board Lolin S2 Mini
2021-08-30 14:12:56 -07:00
Scott Shawcroft eabceb9fce
Fix builds without alarm 2021-08-30 14:09:36 -07:00
Radomir Dopieralski 89fc1890af stm32: Add support for Stage games to Meowbit
This enables the _stage library and adds stage and ugame modules to the
frozen modules, so that all Stage games should work.

I had to do several hacks:

* Since displayio.release_displays doesn't release the pins, I couldn't
  re-initialize the display inside the ugame module. Instead I changed
  the default display initialization for the board to match what Stage
  expects.

* I wanted to make the MENU key works as K_Z, but when I try to use it
  with the keypad module, I get "pin in use" error. So for now only the
  A and B buttons are used.
2021-08-30 20:27:50 +02:00
Damien George 6f19b9c08d stm32/boards/LEGO_HUB_NO6: Add make commands to backup/restore firmware.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Damien George bac791c5fd stm32/boards/LEGO_HUB_NO6: Skip first 1MiB of SPI flash for storage.
The first 1MiB is used by the built-in bootloader and is best left as-is.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Damien George e3eed26d0b stm32/boards/LEGO_HUB_NO6: Change SPI flash storage to use hardware SPI.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Damien George 6936f410ab stm32/storage: Make extended-block-device more configurable.
A board can now define the following to fully customise the extended block
device interface provided by the storage sub-system:
- MICROPY_HW_BDEV_BLOCKSIZE_EXT
- MICROPY_HW_BDEV_READBLOCKS_EXT
- MICROPY_HW_BDEV_WRITEBLOCKS_EXT
- MICROPY_HW_BDEV_ERASEBLOCKS_EXT

Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Patrick Van Oosterwijck a66bd7a489 esp32/boards: Add GENERIC_C3_USB board with USB serial/JTAG support.
Add a new board type for ESP32-C3 revision 3 and up that implement the USB
serial/JTAG port on pin 18 and 19.  This variant uses the USB serial for
programming and console, leaving the UART free.

- Pins 18 and 19 are correctly reserved for this variant.  Also pins 14-17
  are reserved for flash for any ESP32-C3 so they can't be reconfigured
  anymore to crash the system.
- Added usb_serial_jtag.c and .h to implement this interface.
- Interface was tested to work correctly together with webrepl.
- Interface was tested to work correctly when sending and receiving
  large files with ampy.
- Disconnecting terminal or USB will not hang the system when it's
  trying to print.
2021-08-31 00:12:41 +10:00
Durapensa 80cadc6ec1 Added Espressif-assigned PID for "Lolin S2 Mini - CircuitPython" 2021-08-30 06:31:20 -04:00
lady ada d50dc064ee fix i2c 2021-08-29 17:53:57 -04:00
Jeff Epler 68af5fd040 unix: Filter out -std=gnu11
On Debian Bullseye, it is an error to include this flag when building
a C++ file, which caused the unix coverage build to fail.
2021-08-29 11:36:17 -05:00
Jeff Epler d7193dcf7c remove debug print 2021-08-29 11:36:17 -05:00
Jeff Epler 8f024316ad explicitly disable paralleldisplay on a few boards 2021-08-29 07:33:54 -05:00
Jeff Epler 468558896c remove paralleldisplay from ports where it was unimplemented 2021-08-29 07:33:54 -05:00
Jeff Epler 7520feed1c Move ParallelBus to its own module 2021-08-29 07:33:54 -05:00
iabdalkader a3ce8f08ec rp2/mpconfigport.h: Allow boards to add root pointers. 2021-08-29 12:22:50 +10:00
iabdalkader 79baef843b rp2/CMakeLists.txt: Add option to enable double tap reset to bootrom.
* For boards a with reset switch, pressing twice resets into bootloader.
* Enabled by linking with the pico_bootsel_via_double_reset library.
2021-08-29 12:20:01 +10:00
iabdalkader c82244a7c0 rp2/rp2_flash: Disable IRQs while calling flash_erase/program.
Flash erase/program functions disable the XIP bit.  If any code runs from
flash at the same time (eg an IRQ or code it calls) it will fail and cause
a lockup.
2021-08-29 12:15:01 +10:00
Dan Halbert 5a4029059e
Merge pull request #5246 from jpconstantineau/board-CNCEncoderPad-RP2040
Add New Board: EncoderPad RP2040
2021-08-28 10:44:10 -04:00
leoli51 68a4b6448e ready for pull request 2021-08-28 16:34:38 +02:00
microDev b90a16b67c
Merge pull request #5255 from tannewt/fix_rp_countio
Fix RP2 countio reset
2021-08-28 08:45:00 +05:30
Scott Shawcroft 6e7e703f89
Fix RP2 countio reset
Fixes #5251
2021-08-27 17:39:19 -07:00
Scott Shawcroft a8dd881ee5
Fix GPIOTE crashes by checking everything is ok
Fixes #5240 and fixes #5211
2021-08-27 16:07:29 -07:00
Scott Shawcroft ca989c4357
Update the idf to a newer 4.3 commit
Also, make all port-level CIRCUITPY_ settings overridable.
2021-08-27 10:49:57 -07:00
Scott Shawcroft 3e9daeca8f
Merge pull request #5244 from dhalbert/stop-pio-on-deinit
Stop StateMachine explicitly on deinit
2021-08-27 08:59:04 -07:00
Scott Shawcroft 8edf0c5d3c
Merge pull request #5243 from dhalbert/user-interruptible-pio
Allow PIO to be user-interruptible
2021-08-27 08:57:08 -07:00
Pierre Constantineau ada178893d updated PID as per OpenMoko PR 2021-08-27 09:02:49 -06:00
Dan Halbert 09897dbc82
Merge pull request #5238 from tannewt/fix_rp2_usb
Fix usb irq race
2021-08-27 10:40:06 -04:00
Dan Halbert 0261cacb06 Stop StateMachine explicitly on deinit 2021-08-27 10:07:14 -04:00
Dan Halbert f1d25af7ba Allow PIO to be user-interruptible 2021-08-27 08:38:51 -04:00
Jeff Epler c174b7c7e7
Merge pull request #5229 from warmbit/warmbit_bluepixel
add warmbit_bluepixel
2021-08-27 06:48:34 -05:00
Pierre Constantineau e07bce2bf1 fixing trailing space 2021-08-27 00:25:22 -06:00
Pierre Constantineau 873729149d adding EncodderPad RP2040 2021-08-26 23:08:10 -06:00
Neradoc 1302ef62f7 rebase, add adafruit_led_glasses_nrf52840 2021-08-26 23:18:44 +02:00
Jeff Epler 318ea7c8cb Add Espressif's HMI DevKit
this is only tested to come up to the REPL & mount CIRCUITPY. Pin
assignments should be right but were not double-checked.  The screen
is unsupported so far.

This board depends on the I/O pull ups for the I2C bus (verified by
schematic) so this adds a compile time option that enables pull ups
for ANY i2c bus on a board.
2021-08-26 16:14:19 -05:00
Neradoc 4d05bb26bf change board.ID to board.board_id 2021-08-26 23:11:55 +02:00
Neradoc fed6e8ea99 Spresense: add CIRCUITPY_BOARD_ID because it doesn't use BASE_CFLAGS 2021-08-26 23:11:55 +02:00
Neradoc b14b294516 add board.ID 2021-08-26 23:11:55 +02:00
Durapensa 05874f3fab pre-commit fixes 2021-08-26 14:29:04 -04:00
Durapensa b0d0880f80 Add some more pin definitions, for NEOPIXEL_POWER, I2C, SPI 2021-08-26 13:53:04 -04:00
Scott Shawcroft 9663a227a3
Fix usb irq race
Run the USB background once after we hook our IRQ up in case we
missed one.

Related to #5212
2021-08-26 10:20:26 -07:00
Durapensa b9c7badb56 fix for default names for BUTTON, NEOPIXEL, SDA/SCL, LED, SPI MOSI/MISO/SCK 2021-08-26 10:31:35 -04:00
Durapensa ffaad96310 fix for GPIO0 / CIRCUITPY_BOOT_BUTTON 2021-08-26 10:15:15 -04:00
Durapensa da1e29d9e4 fix in pins.c for build 2021-08-26 08:59:02 -04:00