Commit Graph

7291 Commits

Author SHA1 Message Date
Damien George f31c6b4840 mimxrt: Fix USB CDC handling so it works reliably.
On i.MX the SysTick IRQ cannot wake the CPU from a WFI so the CPU was
blocked on WFI waiting for USB data in mp_hal_stdin_rx_chr() even though it
had already arrived (because it may arrive just after calling the check
tud_cdc_available()).  This commit fixes this problem by using SEV/WFE to
indicate that there has been a USB event.

The mp_hal_stdout_tx_strn() function is also fixed so that it doesn't
overflow the USB buffers.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-12 13:48:51 +11:00
Damien George c9260dda23 rp2: Use local tinyusb instead of the one in pico-sdk.
So that all MicroPython ports that use tinyusb use the same version.  Also
requires fewer submodule checkouts when building rp2 along with other ports
that use tinyusb.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-12 12:56:28 +11:00
Damien George 035d16126a ports: Update to build with new tinyusb.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-12 12:50:36 +11:00
Damien George 7815dd2cc5 unix/mpbtstackport_common: Implement mp_bluetooth_hci_active.
So that BTSTACK can be enabled with SYNC_EVENTS.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-12 12:07:05 +11:00
lady ada 6c914b8722 QT Py with RP2040 2021-02-11 19:21:42 -05:00
Dan Halbert f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Lucian Copeland edb7f2d807 Free up space for JA build 2021-02-11 16:30:27 -05:00
Lucian Copeland a061768ceb Merge remote-tracking branch 'upstream/main' into stm32-i2cstart 2021-02-11 16:19:12 -05:00
Scott Shawcroft aae10fb37f
Merge pull request #4167 from tannewt/rp2040_audiopwmio
Add PWM based audio playback
2021-02-11 12:19:57 -08:00
microDev 205837c47b
nvm implementation for rp2040 2021-02-11 12:48:36 +05:30
Lucian Copeland d00bee2149 Fix I2C Repeated start error by converting to IT mode 2021-02-10 14:59:19 -05:00
Scott Shawcroft f6603aa566
Merge pull request #4168 from BHDynamics/main
Add DynaLoRa-USB Dongle
2021-02-10 11:03:16 -08:00
Enrique Casado 983c75fb24 Add more pin names 2021-02-10 12:19:50 +01:00
Scott Shawcroft 191b143e7b
Add PWM based audio playback
See
https://learn.adafruit.com/circuitpython-essentials/circuitpython-audio-out
to get started.

Fixes #4037
2021-02-09 15:38:33 -08:00
Scott Shawcroft b19c700d4a
Merge pull request #4165 from DavePutz/issue_4143
Issue 4143 - Fixed marking a PWM slice incorrectly as variable frequency
2021-02-09 14:30:39 -08:00
root 9a28f0bf45 Fix check for variable PWM frequency 2021-02-09 15:22:59 -06:00
Dan Halbert 5ba28e9861
Merge pull request #4159 from dhalbert/disable-brownout-before-deep-sleep-4025
turn off brownout before deep sleep
2021-02-09 09:03:33 -05:00
Scott Shawcroft 6efd87b3c6
Merge pull request #4124 from m4tk/main
Add display init code for Lilygo TTGO T8 ESP32-S2
2021-02-08 16:35:27 -08:00
Scott Shawcroft 0ceac79dfb
Merge pull request #4048 from janderit/fix_3763_mimxrt10xx_spi
fixes: busio, SPI OS error 5 for mimxrt10xx
2021-02-08 16:29:48 -08:00
Damien George c7aaee2b2b esp8266/modules: Fix fs_corrupted() to use start_sec not START_SEC.
START_SEC was changed in e0905e85a7.

Also, update the error message to mention how to format the partition at
the REPL, and make the total message shorter to save a bit of flash.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-09 10:46:07 +11:00
Dan Halbert 3c99b09993
Merge pull request #4160 from gamblor21/rp2040_neopixel_pin_fix
RP2040 Set the neopixel pin as output after PIO use
2021-02-08 17:57:30 -05:00
Dan Halbert 3a68ac8abb
Merge pull request #3536 from pewpew-game/pew-get-ticks
Fix #3504: Don't use time module in pew.tick()
2021-02-08 17:50:44 -05:00
Dan Halbert b0ed258302
Merge pull request #4155 from jepler/rpi-pio-background
rp2pio: Transfer up to 32 bytes before checking background tasks
2021-02-08 16:34:16 -05:00
Dan Halbert f171660870
Merge pull request #4139 from hierophect/socket-accept-conn
Socket: Connect accepted sockets
2021-02-08 16:25:31 -05:00
Dan Halbert be500fd15c
Merge pull request #4136 from hierophect/socket-portmax
Socket: fix inconsistencies in argument types
2021-02-08 16:23:20 -05:00
Dan Halbert c8cf1258ac
Merge pull request #4154 from LuminousOwl/fix-max-pio-instructions
Fix maximum PIO instructions
2021-02-08 16:21:49 -05:00
gamblor21 386b49c3e1 Set the pin as output after PIO use 2021-02-08 15:13:37 -06:00
Dan Halbert c3a1bd8f13 turn off brownout before deep sleep 2021-02-08 12:40:20 -05:00
Lucian Copeland 1043d619fd
Merge pull request #4148 from Neradoc/fix-recv_into
Fix socket.recv_into receiving one less byte than expected
2021-02-08 11:29:41 -05:00
Dan Halbert 1b7f3d11e7 wip 2021-02-08 10:57:41 -05:00
Jeff Epler 5423e4966c rp2pio: Transfer up to 32 bytes before checking background tasks
@Jerryneedell noticed that this problem affected strips short enough
to not use the DMA peripheral, thanks for the hot tip!

Instead of checking for background tasks after every byte transfer,
try up to 32 transfers before attending to background tasks.

This fixes the problem I was seeing on my 5-pixel circuit.

Closes #4135.
2021-02-08 08:35:07 -06:00
Philip Jander 5bf08c503b adds: maximum retries on SPI busy 2021-02-07 17:06:46 +01:00
Philip Jander ae91b12aea chore: whitespace fixed 2021-02-07 16:59:11 +01:00
Philip Jander 127cc6204a adds: idle loop to wait for SPI not busy (mimxrt10xx) 2021-02-07 16:59:11 +01:00
Neradoc 6be2466d6f ESP32S2: Socket.recv_into only took len-1 bytes 2021-02-07 08:57:19 +01:00
Jason Nichols ae262cde55 Fix maximum PIO instructions 2021-02-06 10:54:25 -05:00
Scott Shawcroft 22dc7d5359
Update to the very latest SDK w/GP15 restore
Also adds unique id support

Fixes #4039 and hopefully #4107
2021-02-05 18:44:06 -08:00
Lucian Copeland 582bc59d39 Connect accepted sockets 2021-02-05 17:32:15 -05:00
Scott Shawcroft c6a7b00030
Merge pull request #4137 from ferret-guy/smps-mode-pin-rpi-pico
Add SMPS mode pin to Raspi Pico pins.c
2021-02-05 12:12:55 -08:00
Scott Shawcroft e7438c481e
Merge pull request #4125 from xorbit/main
Add A3 pin to Raspberry Pi Pico
2021-02-05 12:08:35 -08:00
Scott Shawcroft a310d4336b
Merge pull request #4128 from hierophect/esp32s2-i2s-claimpin
ESP32S2: Add I2S pin claiming
2021-02-05 11:47:49 -08:00
Lucian Copeland 8214d67e5f Fix LWIP connect error report 2021-02-05 13:14:49 -05:00
Mark Omo 1292c35d59
Add SMPS mode pin to Raspi Pico pins.c
Add SMPS mode pin to Raspi Pico pins.c; see section "4.3. Using the ADC" of the Pico datasheet for discussion. 

Driving this pin high forces the onboard regulator into a lower noise PWM mode.
2021-02-05 11:09:40 -07:00
Patrick Van Oosterwijck a158dde628 Add alternate name `VOLTAGE_MONITOR` for `A3` 2021-02-05 10:55:03 -07:00
Lucian Copeland 4d26ffb447 Make timeout core types consistent 2021-02-05 12:32:41 -05:00
Dan Halbert 5bb722b927
Merge pull request #4122 from hathach/fix-3986
Fix 3986 background reset remove existing usb callback
2021-02-05 09:13:28 -05:00
Dan Halbert 0a55cfbde8
Merge pull request #4126 from FiriaCTO/webusb
WebUSB serial support (compile-time option, currently defaulted to OFF)
2021-02-05 09:11:43 -05:00
Enrique Casado 70e15d61b2 ports/atmel-samd/boards/dynalora_usb/board.c 2021-02-05 13:24:59 +01:00
m4tk 54bd79a51a LCD_MISO is not connected on board 2021-02-05 07:52:01 +01:00
Damien George 9dedcf122d py/gc: Change include of stdint.h to stddef.h.
No std-int types are used in gc.h, but size_t is which needs stddef.h.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-05 15:46:56 +11:00
Dan Halbert 25d456a5b8 shrink a couple of builds 2021-02-04 22:15:32 -05:00
Dan Halbert 0802b22ed6 usb descriptors all set; rework of enabling for USB devices 2021-02-04 19:23:40 -05:00
Lucian Copeland 210d0f8798 Add I2S pin claiming 2021-02-04 16:30:05 -05:00
Jeff Epler 6e153d9948 raspberrypi: implement reset, reset_to_bootloader
This makes all the following work:
 * normal microcontroller.reset()
 * reset into safe mode or UF2 bootloader via microcontroller.on_next_reset()
 * reset into UF2 bootloader via the "1200 baud trick"

The implementation of reset_cpu is from micropython.
2021-02-04 12:07:50 -06:00
Patrick Van Oosterwijck d357a05870 Add A3 pin to Raspberry Pi Pico
We want to be able to use this to measure VSYS.
2021-02-04 10:44:37 -07:00
m4tk ff7b296b04 Add display init code for Lilygo TTGO T8 ESP32-S2 2021-02-04 16:46:15 +01:00
Damien George 1f800cac3c rp2/micropy_rules.cmake: Fix makemoduledefs vpath to work with abs path.
In particular the firmware can now be built in a build directory that lives
outside the source tree, and the py/modarray.c file will still be found.

See issue #6837.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-05 01:10:30 +11:00
Damien George ad4656b861 all: Rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD.
The "word" referred to by BYTES_PER_WORD is actually the size of mp_obj_t
which is not always the same as the size of a pointer on the target
architecture.  So rename this config value to better reflect what it
measures, and also prefix it with MP_.

For uses of BYTES_PER_WORD in setting the stack limit this has been
changed to sizeof(void *), because the stack usually grows with
machine-word sized values (eg an nlr_buf_t has many machine words in it).

Signed-off-by: Damien George <damien@micropython.org>
2021-02-04 22:46:42 +11:00
Damien George 7c44354592 ports: Remove def of MP_PLAT_PRINT_STRN if it's the same as the default.
To simplify config, there's no need to specify MP_PLAT_PRINT_STRN if it's
the same as the default definition in py/mpconfig.h.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-04 22:39:17 +11:00
Xiang Xiao 5fdf351178 py/gc: Don't include mpconfig.h and misc.h in gc.h.
Because gc.h doesn't reference any symbol from these header files.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-02-04 22:37:26 +11:00
Damien George 7f7b4f2bc6 rp2/machine_adc: Only initialise the ADC periph if not already enabled.
Otherwise it resets the ADC peripheral each time a new ADC object is
constructed, which can reset other state that has already been set up.

See issue #6833.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-04 10:55:43 +11:00
Kevin Banks 215a56c920 Merge branch 'main' into webusb (trying to get CI back online) 2021-02-03 16:48:28 -06:00
BiffoBear 4eb396806c Updated trinket_m0 make file to squeeze all translations as per Dan Halbert. 2021-02-03 11:47:56 +07:00
BiffoBear 2656c84b01 Initial commit. Edited error messages in .c files 2021-02-03 05:49:40 +07:00
Scott Shawcroft 9140bfb5b2
Merge pull request #4049 from hierophect/sslsocket
Separate SSLSocket from Socket
2021-02-02 10:35:07 -08:00
Damien George 195e7dfa06 rp2/modmachine: Implement additional functions incl unique_id and idle.
Added functions in the machine module are:
- unique_id (returns 8 bytes)
- soft_reset
- idle
- lightsleep, deepsleep (not power saving at the moment)
- disable_irq, enable_irq
- time_pulse_us

Signed-off-by: Damien George <damien@micropython.org>
2021-02-02 22:14:22 +11:00
stijn 81a4d96aed windows/msvc: Use same default python command as core. 2021-02-02 21:33:18 +11:00
stijn 0397448501 tests/run-tests: Change default Python command used on Windows.
Default to just calling python since that is most commonly available: the
official installer or zipfiles from python.org, anaconda, nupkg all result
in python being available but not python3.  In other words: the default
used so far is wrong.  Note that os.name is 'posix' when running the python
version which comes with Cygwin or MSys2 so they are not affected by this.
However of all possible ways to get Python on Windows, only Cygwin provides
no python command so update the default way for running tests in the
README.
2021-02-02 21:32:20 +11:00
Andrew Leech 5ef71cd167 stm32/mboot: Change debug compiler optimisation from -O0 to -Og.
With mboot encrpytion and fsload enabled, the DEBUG build -O0 compiler
settings result in mboot no longer fitting in the 32k sector.  This commit
changes this to -Og which also brings it into line with the regular stm32
build.
2021-02-02 21:25:13 +11:00
Scott Shawcroft 8789a2c8a9
Merge pull request #4110 from microDev1/rtc-rp
RP2040: Support for RTC
2021-02-01 19:47:44 -08:00
Scott Shawcroft ced3dc70ff
Merge pull request #4018 from iot49/cp-flow
add uart hardware flow control to nrf port
2021-02-01 19:38:16 -08:00
Damien George 7be1f77902 stm32/usbd_cdc_interface: Don't wait in usbd_cdc_tx_always if suspended.
MCUs with device-only USB peripherals (eg L0, WB) do not implement (at
least not in the ST HAL) the HAL_PCD_DisconnectCallback event.  So if a USB
cable is disconnected the USB driver does not deinitialise itself
(usbd_cdc_deinit is not called) and the CDC driver can stay in the
USBD_CDC_CONNECT_STATE_CONNECTED state.  Then if the USB was attached to
the REPL, output can become very slow waiting in usbd_cdc_tx_always for
500ms for each character.

The disconnect event is not implemented on these MCUs but the suspend event
is.  And in the situation where the USB cable is disconnected the suspend
event is raised because SOF packets are no longer received.

The issue of very slow output on these MCUs is fixed in this commit (really
worked around) by adding a check in usbd_cdc_tx_always to see if the USB
device state is suspended, and, if so, breaking out of the 500ms wait loop.
This should also help all MCUs for a real USB suspend.

A proper fix for MCUs with device-only USB would be to implement or somehow
synthesise the HAL_PCD_DisconnectCallback event.

See issue #6672.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-02 12:09:33 +11:00
Kevin Banks e79283932d Moving control of USB compile-time options down to the BOARD level 2021-02-01 19:08:56 -06:00
Tim Radvan 7a9027fd5d rp2/rp2_pio: Add JMP PIN support for PIO.
PIO state machines can make a conditional jump on the state of a pin: the
`JMP PIN` command.  This requires the pin to be configured with
`sm_config_set_jmp_pin`, but until now we didn't have a way of doing that
in MicroPython.

This commit adds a new `jmp_pin=None` argument to `StateMachine`.  If it is
not `None` then we try to interpret it as a Pin, and pass its value to
`sm_config_set_jmp_pin`.

Signed-off-by: Tim Radvan <tim@tjvr.org>
2021-02-02 11:32:48 +11:00
graham sanderson 52d3ae707d rp2/memmap_mp.ld: Update for latest SDK. 2021-02-02 10:59:10 +11:00
Kevin Banks e1618c21b2 Default WebUSB to OFF because other ports are not ready for it yet 2021-02-01 17:56:38 -06:00
Andrew Scheller c9210a65df rp2/machine_pin: Change N_GPIOS to NUM_BANK0_GPIOS for pico-sdk compat.
This fixes machine_pin.c to build against the new pico-sdk coming down the
pipeline, whilst still working with the existing version.
2021-02-02 09:50:55 +11:00
microDev ec03267035
rtc implementation for rp2040 2021-02-02 00:00:00 +05:30
Dan Halbert 459f323247
Merge pull request #4087 from DavePutz/cpu_temp_doc
Fixing microcontroller.cpu on multi-core cpus and adding microcontroller.cpus
2021-02-01 12:50:37 -05:00
Dan Halbert 745ba01768 shrink simmel 2021-02-01 12:22:35 -05:00
Lucian Copeland 66639b237f Merge remote-tracking branch 'upstream/main' into sslsocket 2021-02-01 11:43:01 -05:00
Lucian Copeland 8277ffca86 Fix hash, close, error bugs 2021-02-01 11:04:12 -05:00
Damien George ffded48810 zephyr/machine_uart: Fix arg of machine_uart_ioctl to make it uintptr_t.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-01 22:30:50 +11:00
Scott Shawcroft 0c0b517112
Merge pull request #4105 from xorbit/main
Add board Silicognition LLC M4-Shim
2021-01-31 20:02:36 -08:00
Scott Shawcroft 529114c162
Merge pull request #4077 from netroy/lilygo-ttgo-t8-esp32-s2
Add support for Lilygo TTGO T8 ESP32-S2
2021-01-31 19:50:36 -08:00
Scott Shawcroft 17cf03c8e4
Merge pull request #4083 from microDev1/watchdog-rp
RP2040: Support for WatchDog
2021-01-31 19:45:38 -08:00
Scott Shawcroft a52395a4bb
Merge pull request #4095 from hierophect/socket-timeout
Fix default socket timeout
2021-01-31 19:17:12 -08:00
Aditya 6dba7a146d Add support for Lilygo TTGO T8 ESP32-S2 2021-01-31 14:30:31 +01:00
Patrick Van Oosterwijck 0dbd3293a9 Add board Silicognition LLC M4-Shim 2021-01-30 18:35:35 -07:00
Lucian Copeland ddd516a683 Fix default timeout 2021-01-30 15:44:44 -05:00
microDev 34fe152fcf
extend include path 2021-01-30 14:00:14 +05:30
Christopher Tse 5c37e76e4f esp8266/modules/neopixel.py: Add timing param to NeoPixel constructor.
This matches the esp32 port.
2021-01-30 14:35:54 +11:00
Chris Hemingway 993ab6aa2c nrf/README: Add use of "make submodules" in alternative build paragraph.
Add "make submodules" to commands when building for the first time.
Otherwise, on a first time build, the submodules have not been checked out
and a lot of `fatal error: nrfx.h: No such file or directory` errors are
printed.
2021-01-30 14:32:55 +11:00
Andrew Scheller 499e199add docs,stm32: Fix minor typos in RTC docs, and->an. 2021-01-30 14:13:30 +11:00
stijn b9a35bebf7 py/qstr.h: Remove QSTR_FROM_STR_STATIC macro.
It practically does the same as qstr_from_str and was only used in one
place, which should actually use the compile-time MP_QSTR_XXX form for
consistency; qstr_from_str is for runtime strings only.
2021-01-30 13:40:48 +11:00
Jim Mussared 0f9a9129da stm32/rfcore: Fix flow control for IPCC RX IRQ.
Don't clear the IPCC channel flag until we've actually handled the incoming
data, or else the wireless firmware may clobber the IPCC buffer if more
data arrives.  This requires masking the IRQ until the data is handled.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-01-30 13:21:04 +11:00
James Bowman acbf66dacc Make sys.platform "RP2040" on raspberrypi
[#4091]
2021-01-29 12:33:37 -08:00
James Bowman 067f42b4f8 Add Gameduino 3X Dazzler support on raspberry_pi_pico
Tested with hardware. Looks good.

Follow on from #4054
2021-01-29 12:25:59 -08:00
Lucian Copeland a724f6f954 Fix documentation builds 2021-01-29 11:58:02 -05:00
Damien George 469345e728 rp2: Add new port to Raspberry Pi RP2 microcontroller.
This commit adds a new port "rp2" which targets the new Raspberry Pi RP2040
microcontroller.

The build system uses pure cmake (with a small Makefile wrapper for
convenience).  The USB driver is TinyUSB, and there is a machine module
with most of the standard classes implemented.  Some examples are provided
in the examples/rp2/ directory.

Work done in collaboration with Graham Sanderson.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-30 00:42:29 +11:00
Damien George d1f120b142 stm32/main: Introduce MICROPY_HW_FLASH_MOUNT_AT_BOOT config option.
It's enabled by default to retain the existing behaviour.  A board can
disable this option if it manages mounting the filesystem itself, for
example in frozen code.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Damien George 8f211df360 stm32/mboot/fwupdate.py: Refactor update_mpy with support for STATUS.
Changes are:
- refactor to use new _create_element function
- support extended version of MOUNT element with block size
- support STATUS element

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Damien George bd7110a3d5 stm32/mboot: Introduce MBOOT_ERRNO_xxx constants and use them.
So that a failed update via fsload can be more easily diagnosed.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Damien George 0efa0b5437 stm32/mboot: Add ELEM_TYPE_STATUS element so application can get status.
This new element takes the form: (ELEM_TYPE_STATUS, 4, <address>).  If this
element is present in the mboot command then mboot will store to the given
address the result of the filesystem firmware update process.  The address
can for example be an RTC backup register.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Damien George c1eb292927 stm32/mboot: Don't auto-detect littlefs block size.
Instead it is now passed in as an optional parameter to the ELEM_MOUNT
element, with a compile-time configurable default.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Damien George d1945cc2b5 stm32/main: Check block 0 and 1 when auto-detecting littlefs.
The superblock for littlefs is in block 0 and 1, but block 0 may be erased
or partially written, so block 1 must be checked if block 0 does not have a
valid littlefs superblock in it.

Prior to this commit, if block 0 did not contain a valid littlefs
superblock (but block 1 did) then the auto-detection would fail, mounting a
FAT filesystem would also fail, and the system would reformat the flash,
even though it may have contained a valid littlefs filesystem.  This is now
fixed.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-29 15:02:55 +11:00
Kevin Banks 63f9b12fe6 Partially hard-coded VENDOR descriptor has been added. First build to be accessed via WebUSB. NOTE - had to disable HID (EndPoint shortage?) 2021-01-28 20:22:31 -06:00
root 67f128c0cf Fixing microcontroller.cpu on muti-core cpus and adding microcontroller.cpus 2021-01-28 14:42:39 -06:00
microDev a54b57ea40
watchdog implementation for rp2040 2021-01-28 15:15:15 +05:30
Bernhard Boser e285b5b98c Merge remote-tracking branch 'adafruit/main' into cp-flow 2021-01-27 09:22:41 -08:00
Bernhard Boser 16d54586c1 remove long read error message 2021-01-27 09:20:45 -08:00
Scott Shawcroft 351a0e747d
Merge pull request #4047 from kmatch98/esp32s2_ParallelBus
Add initial ParallelBus support for ESP32-S2
2021-01-26 13:07:58 -08:00
Dan Halbert 29e672fe86
Merge pull request #4071 from tannewt/rp2040_uart_error
Raise an error on UART use
2021-01-26 15:22:02 -05:00
Lucian Copeland 815ab5277b Fix stubs error, out of sockets error, invalid TLS leak 2021-01-26 14:13:12 -05:00
Dan Halbert a9227e15d0
Merge pull request #4063 from dhalbert/rp2040-gp15 2021-01-26 13:38:41 -05:00
Dan Halbert 13812a788f
Merge pull request #4060 from dhalbert/regularize-extmod-modules
CIRCUITPY_* switches for JSON, RE, etc. Doc cleanup
2021-01-26 12:54:21 -05:00
Scott Shawcroft b42e94ee2c
Raise an error on UART use 2021-01-26 08:48:30 -08:00
Dan Halbert f154ee855d shrink simmel 2021-01-26 10:23:37 -05:00
Dan Halbert be4cfdd3d6 Use TOTAL_GPIO_COUNT instead of magic number 30 2021-01-25 22:16:24 -05:00
Kevin Banks fbfb7b68cc Most of the code we need has been pulled in from the tinyusb webusb_serial demo. Still LOTS to do regarding descriptors. 2021-01-25 20:37:58 -06:00
Kevin Matocha 61850acd14 Fixed bug in pin error handling, deleted debug prints 2021-01-25 16:51:12 -06:00
Scott Shawcroft a2ac2da7cc
Merge pull request #3936 from gamblor21/busdevice_fixes
Changing adafruit_bus_device to duck typing
2021-01-25 14:41:53 -08:00
Scott Shawcroft c075e89258
Merge pull request #4054 from dglaude/patch-1
Permit Gameduino 3X Dazzler support on Metro M4 AirLift Lite.
2021-01-25 14:33:00 -08:00
Kevin Matocha 4140012430 Allow pins >= 32, allow write pin on different register than data pins 2021-01-25 16:25:56 -06:00
Lucian Copeland 9f34ec78c4 Separate Socket and SSLSocket, add LWIP connect 2021-01-25 17:07:25 -05:00
Dan Halbert 0fa5aa359d Stop treating pin 15 specially. 2021-01-25 16:07:01 -05:00
Kamil Tomaszewski c5992a3101 spresense: update Spresense SDK to 2.0.2 2021-01-25 18:40:14 +01:00
Dan Halbert 69c71bd522 fix some build errors 2021-01-25 11:54:10 -05:00
Dan Halbert 1e97d384ff add GP15 2021-01-25 11:02:32 -05:00
Dan Halbert 69869e1439 CIRCUITPY_* switches for JSON, RE, etc. Doc cleanup 2021-01-24 23:10:20 -05:00
David Glaude abd9f7894d
Permit Gameduino 3X Dazzler support on that board.
Totally untested, change request based on change made in #2581.
It might be my first PR in CircuitPython core...
Maybe this should be confirmed by @jamesbowman

Those are the two boards that seems supported:
* Metro M4 Express
* Metro nRF52840 Express

The only Metro that this PR concern:
* Metro M4 AirLift Lite

Other Metro I found and are maybe not supported:
* Metro ESP32-S2
* Metro M0 Express
* Metro M7 1011
2021-01-24 12:53:06 +01:00
Kevin Matocha 10965e5989 Delete unnecessary comments 2021-01-23 11:30:17 -06:00
Dan Halbert dc421a6ca8 squeeze some builds 2021-01-23 06:18:15 -05:00
Vincent Duvert 45f0b6ab63 cc3200: Fix debug build.
* Fix a typo in the Makefile that prevented the debug build to be actually
  enabled when BTYPE=debug is used.

* Add a missing header in modmachine.c that is used when a debug build is
  created.
2021-01-23 17:44:27 +11:00
Vincent Duvert 342dc61784 cc3200/ftp: Add quotes to PWD response and allow FEAT prior to login.
This commit improves some FTP implementation details for better
compatibility with FTP clients:

* The PWD command now puts quotes around the directory name before
  returning it.  This fixes BBEdit’s FTP client, which performs a PWD after
  each CWD and gets confused if the returned directory path is not
  surrounded by quotes.

* The FEAT command is now allowed before logging in. This fixes the lftp
  client, which send FEAT first and gets confused (tries to use TLS) if the
  server responds with 332.
2021-01-23 17:40:53 +11:00
Oliver Joos 290dc1d5ee unix/modtime: Fix time() precision on unix ports with non-double floats.
With MICROPY_FLOAT_IMPL_FLOAT the results of utime.time(), gmtime() and
localtime() change only every 129 seconds.  As one consequence
tests/extmod/vfs_lfs_mtime.py will fail on a unix port with LFS support.

With this patch these functions only return floats if
MICROPY_FLOAT_IMPL_DOUBLE is used.  Otherwise they return integers.
2021-01-23 16:55:24 +11:00
IhorNehrutsa 769e822f19 esp32/modnetwork: Synchronize WiFi AUTH_xxx constants with IDF values. 2021-01-23 16:49:16 +11:00
Yonatan Schachter 063d7cc0e2 zephyr: Add basic UART functionality to machine module.
Currently supports only polling read and write.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2021-01-23 16:31:00 +11:00
Kevin Matocha 34aa01c5f9 Remove redundant clear_write, add make translate 2021-01-22 22:29:51 -06:00
Scott Shawcroft de6b05a17b
Fix DigitalInOut.pull on RP2040
It used to always return None.

Fixes #4035
2021-01-22 19:00:37 -08:00
Kevin Matocha 811a34fc3d Add initial ParallelBus support for ESP32-S2 2021-01-22 14:42:09 -06:00
Dan Halbert 8c49c8df0a shrink arduino_mkr1300 2021-01-22 11:26:33 -05:00
Dan Halbert f50edc2904
Merge pull request #4044 from DavePutz/rp2040_longint
RP2040 longint support
2021-01-22 10:30:12 -05:00
Dan Halbert f72c1474c5
Merge branch 'main' into connect 2021-01-22 03:56:57 -05:00
Dan Halbert e3275be8b1
Merge pull request #3911 from hugodahl/add-translation-for-builtin-object-help
Update built-in help output for localization (Issue #3907)
2021-01-22 03:49:19 -05:00
Dan Halbert 63b5e56c72 shrink feather_m0_adalogger and gemma_m0 2021-01-21 23:49:49 -05:00
Dan Halbert e8e8c593ac move longint choice to mpconfigport.mk 2021-01-21 22:50:15 -05:00
Dan Halbert ea9fe24971 shrink arduino_mkrzero build 2021-01-21 18:02:35 -05:00
root f39ca0a1d6 Adding longing support on RP2040 2021-01-21 16:42:16 -06:00
root 3aab17c98e Adding longint support on RP2040 2021-01-21 16:40:57 -06:00
hierophect f88a896c03
Merge pull request #3854 from hierophect/esp-tcpserver
ESP32S2: Implement TCP Server bindings
2021-01-21 17:25:14 -05:00
Dan Halbert 9b8246f889 shrink sparkfun_samd21_dev de_DE build 2021-01-21 15:56:30 -05:00
anecdata 1f6cd496c7 1. check enabled before scan; 2. make start-station() the single control point for esp_wifi_set_mode() 2021-01-21 13:54:19 -06:00
Scott Shawcroft b73b30ff9f
Switch to upstream TinyUSB 2021-01-21 11:33:13 -08:00
Scott Shawcroft b47fd08b20
copy editing 2021-01-21 10:17:40 -08:00
Scott Shawcroft b0f7fd933f
type fix 2021-01-20 23:33:00 -08:00
Scott Shawcroft 6a6f22b0e6
pre-commit 2021-01-20 23:30:15 -08:00
Scott Shawcroft 48721584f9
Temporarily turn off string op overflow check 2021-01-20 19:16:56 -08:00
Scott Shawcroft 733094aead
Add initial RP2040 support
The RP2040 is new microcontroller from Raspberry Pi that features
two Cortex M0s and eight PIO state machines that are good for
crunching lots of data. It has 264k RAM and a built in UF2
bootloader too.

Datasheet: https://pico.raspberrypi.org/files/rp2040_datasheet.pdf
2021-01-20 19:16:56 -08:00
Scott Shawcroft eff68b0d9f
Merge pull request #4011 from dheera/main
prevents going into safe mode for watchdog resets
2021-01-20 11:30:12 -08:00
Scott Shawcroft f1e4960d14
Merge pull request #4019 from mrangen/QSPI-comment-fix
Fixed comment in mpconfigboard.h
2021-01-19 18:41:50 -08:00
Dan Halbert 409b5ff009
Merge pull request #4028 from djix123/stm32411ce_blackpill_haxpress
Add support for a 'haxpress' external SPI flash build for stm32f411ce Black Pill board
2021-01-19 13:01:56 -05:00
Jonathan Giles 55c6d3e92f 1. Rename 'stm32f411ce_blackpill_haxpress' to 'stm32f411ce_blackpill_with_flash'
2. Add 'W25Q64JV_IQ' to flash chip list (as per commercial version)
2021-01-19 11:48:15 -05:00
djix123 b4bdf55eda
Update ports/stm/boards/stm32f411ce_blackpill_haxpress/mpconfigboard.mk
Update PID for _with_flash version to resolve duplicate PID issue

Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-01-19 11:35:52 -05:00
djix123 4804032f09
Update ports/stm/boards/stm32f411ce_blackpill_haxpress/mpconfigboard.mk
Change name from _haxpress to _with_flash

Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-01-19 11:35:03 -05:00
djix123 c8046af6e7
Update ports/stm/boards/stm32f411ce_blackpill_haxpress/mpconfigboard.h
Change name from _haxpress to _with_flash

Co-authored-by: Dan Halbert <halbert@halwitz.org>
2021-01-19 11:34:47 -05:00
Jonathan Giles ebb4df846f Add support for a 'haxpress' external SPI flash build for the stm32f411ce blackpill board 2021-01-19 07:46:59 -05:00
anecdata a01ff658ea fix case of connecting when wifi is stopped 2021-01-18 19:57:01 -06:00
Bernhard Boser e27dd26dc7 make translate, BEWARE adds the 'world' 2021-01-18 11:26:39 -08:00
Dan Halbert ee48e4b452 ESP32-S2: Initialize touch in proper order 2021-01-18 11:52:03 -05:00
mrangen dea2bcd8f0 Fixed comment in mpconfigboard.h 2021-01-17 21:20:27 -07:00
Bernhard Boser 07a9593abc add flow control info to busio_uart_obj_t 2021-01-17 19:33:32 -08:00
Damien George 49dd9ba1a5 stm32/Makefile: Use MBOOT_PACK_KEYS_FILE as depedency of .pack.dfu.
To match the definition of GENERATE_PACK_DFU, so a board can customise the
location/name of this file if needed.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-18 13:53:54 +11:00
anecdata c524900a1b check connected before connecting 2021-01-17 20:21:31 -06:00
Damien George f6e6ef69e0 stm32/boards/NUCLEO_WB55: Enable MBOOT with packing mode.
To have at least one board configured with MBOOT_ENABLE_PACKING, for CI
testing purposes and demonstration of the feature.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-18 12:43:01 +11:00
Damien George c6f334272a stm32/mboot: Add support for signed and encrypted firmware updates.
This commit adds support to stm32's mboot for signe, encrypted and
compressed DFU updates.  It is based on inital work done by Andrew Leech.

The feature is enabled by setting MBOOT_ENABLE_PACKING to 1 in the board's
mpconfigboard.mk file, and by providing a header file in the board folder
(usually called mboot_keys.h) with a set of signing and encryption keys
(which can be generated by mboot_pack_dfu.py).  The signing and encryption
is provided by libhydrogen.  Compression is provided by uzlib.  Enabling
packing costs about 3k of flash.

The included mboot_pack_dfu.py script converts a .dfu file to a .pack.dfu
file which can be subsequently deployed to a board with mboot in packing
mode.  This .pack.dfu file is created as follows:
- the firmware from the original .dfu is split into chunks (so the
  decryption can fit in RAM)
- each chunk is compressed, encrypted, a header added, then signed
- a special final chunk is added with a signature of the entire firmware
- all chunks are concatenated to make the final .pack.dfu file

The .pack.dfu file can be deployed over USB or from the internal filesystem
on the device (if MBOOT_FSLOAD is enabled).

See #5267 and #5309 for additional discussion.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-18 12:43:01 +11:00
Damien George 09e67de327 stm32/mboot/gzstream: Fix lost data decompressing final part of file.
Prior to this fix, the final piece of data in a compressed file may have
been lost when decompressing.

Signed-off-by: Damien George <damien@micropython.org>
2021-01-18 12:43:01 +11:00
jerryneedell a9389343a8
Revert "UMFEATHERS2 - implement use of DotStar for status led" 2021-01-17 05:15:19 -05:00
gamblor21 41b9196167 Disabling in more small boards 2021-01-17 00:00:06 -06:00
dheera d43eb7e84b prevents going into safe mode for watchdog resets 2021-01-16 17:38:08 -08:00
gamblor21 49e059cdaf Removing frozen libraries 2021-01-16 16:37:42 -06:00
Scott Shawcroft 816cbe4704
Merge pull request #3992 from anecdata/reason4
wifi: more disconnect reasons for retries & include error code in exception
2021-01-15 11:52:34 -08:00
Lucian Copeland 4bc664fe5f Merge remote-tracking branch 'upstream/main' into esp-tcpserver 2021-01-15 12:02:16 -05:00
Dan Halbert c4f0325ff8
Merge pull request #3991 from TG-Techie/main
Revision to TG-Watch
2021-01-14 18:43:52 -05:00
Dan Halbert 8c0a9a2486
Merge pull request #4004 from jepler/fix-parallel-build-main
ports/unix: Fix parallel build problem
2021-01-14 18:00:46 -05:00
Scott Shawcroft e6b49d95ee
Merge pull request #3993 from dhalbert/gattc-write-lengths
don't check length for remote characteristic or descriptor
2021-01-14 12:56:29 -08:00
Jeff Epler 059363f0e2 ports/unix: Fix parallel build problem
This is the same as I added to mpy-cross at e666e86035, see #3074
2021-01-14 14:13:31 -06:00
Dan Halbert aedc8efeda Add pin A1 as alias for AD1; A1 is preferred 2021-01-14 14:43:47 -05:00
Lucian Copeland 287770f885 Merge remote-tracking branch 'upstream/main' into esp-tcpserver 2021-01-14 10:21:08 -05:00
anecdata f75bb5c50f Rename to match WIFI_REASON. Also return specific reason code. 2021-01-13 23:46:35 -06:00
anecdata e519dd3c52 Retry on all disconnect reasons other than: 2 exception reasons & 1 manual disconnect reason. 2021-01-13 23:45:59 -06:00
Jonah Yolles-Murphy c63d5a44a0 restore TG-Watch USB_PID from accidental overwrite 2021-01-14 00:08:34 -05:00
Jonah Yolles-Murphy 5f8ad0c5e6 correct USB_PRODUCT for TG-Watch 2021-01-14 00:02:56 -05:00
Jonah Yolles-Murphy 8f8af90098 final name and extra board 2021-01-13 23:51:34 -05:00
Lucian Copeland 37a8c1c575 Complete non-blocking implementations, add socket close checking 2021-01-13 19:05:07 -05:00
Dan Halbert ccace62ac9 don't check length for remote characteristic or dedescriptor 2021-01-13 15:35:51 -05:00
Dan Halbert 92a4398996
Merge pull request #3982 from jepler/esp32s2-make-flash
esp32s2: Fix 'make flash'
2021-01-13 11:08:15 -05:00
Jeff Epler c44c99398d
Merge pull request #3983 from dhalbert/6.1.0-shrink-builds
shrink some de_DE builds
2021-01-12 20:19:43 -06:00
Jeff Epler 8d24e72981
Merge pull request #3978 from ladyada/neotrinkey
samd21 board with only 4 neopixels + two touchpads
2021-01-12 20:19:01 -06:00
Dan Halbert 4b30412871 shrink some de_DE builds 2021-01-12 18:23:37 -05:00
Jeff Epler ed0cb248e9 esp32s2: Fix 'make flash'
As reported by @jerryneedell, this change was incorrect; the given
ESPTOOL_FLAGS caused `write_flash` to be repeated twice, which doesn't
work.

Closes #3981.
2021-01-12 16:04:29 -06:00
Lucian Copeland 4cdb298a20 WIP of non-blocking calls 2021-01-12 15:05:28 -05:00
Dan Halbert f9c762256f
Merge pull request #3733 from jepler/audioout-esp32
esp32s2: Add I2SAudioOut
2021-01-12 13:25:40 -05:00
Dan Halbert 4be5e914ac
Merge pull request #3966 from dhalbert/samd-dac-channels
fix atmel-samd DAC channel selection logic
2021-01-12 13:01:50 -05:00
lady ada 748d44892d fix some precommit complaints 2021-01-12 12:55:02 -05:00
lady ada f7f97ae1b7 samd21 board with only 4 neopixels + two touchpads 2021-01-12 12:50:08 -05:00
Scott Shawcroft bfdaa6eb9c
Merge pull request #3959 from ladyada/main
try adding new feather def
2021-01-12 08:26:29 -08:00
Jeff Epler 1ca29ec47c Merge remote-tracking branch 'origin/main' into audioout-esp32 2021-01-12 09:23:07 -06:00
microDev cd16f29efd
Merge branch 'main' into TouchAlarm 2021-01-12 18:28:38 +05:30
Scott Shawcroft 4db55652a3
Merge pull request #3964 from dhalbert/ble-timing-fixes
Round BLE timing values; fix timeout check
2021-01-11 16:52:14 -08:00
Dan Halbert 452d66dd0e
Update ports/atmel-samd/common-hal/analogio/AnalogOut.c
whoops, yes!

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-01-11 19:12:52 -05:00
Scott Shawcroft 081249f796
Merge pull request #3944 from BennyE/wifi-authmode
esp32-s2: Adding authmode keyword
2021-01-11 16:05:28 -08:00
Scott Shawcroft 3cf4d9c57f
Merge pull request #3954 from anecdata/mpconfigport
ESP32-S2: added sys.platform
2021-01-11 16:03:17 -08:00
Scott Shawcroft 10093d37c5
Merge pull request #3960 from dhalbert/pwmout-tcc-resolution
Look up TCC resolution as necessary
2021-01-11 15:33:59 -08:00
Scott Shawcroft 3a7755b311
Merge pull request #3930 from jerryneedell/jerryn_feathers2_led
UMFEATHERS2 - implement use of DotStar for status led
2021-01-11 15:29:09 -08:00
Scott Shawcroft 91245297e8
Merge pull request #3659 from iot49/msgpack
module msgpack
2021-01-11 15:22:39 -08:00
Scott Shawcroft b0eb91dfef
Merge pull request #3955 from caiokat/fix_recvfrom_into
Fix socket.recvfrom_into()
2021-01-11 15:20:56 -08:00
microDev 5f448139e0
fixes and enhancement for touch alarm
- prevent touch alarm initialization if not set
- fix wake_alarm is set to touch alarm on autoreload
- add ability to have multiple touch alarms in light sleep
2021-01-11 15:30:45 +05:30
Dan Halbert 316bd0c72d fix atmel-samd DAC channel selection logic 2021-01-10 19:22:15 -05:00
Dan Halbert a397af9bdf Round BLE timing values; fix timeout check 2021-01-10 13:16:19 -05:00
lady ada c87e1a6527 ok lets try without auto-display 2021-01-10 11:58:39 -05:00
BennyE 53e4d78a3c
Update ports/esp32s2/common-hal/wifi/Network.c
Avoid to use yet another variable.

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-01-10 17:18:43 +01:00
Jonah Yolles-Murphy 8652d69614 update TG-Watch pins, name, and frozen libraries 2021-01-10 04:04:50 -05:00
lady ada d036620c70 compilier 2021-01-09 23:19:04 -05:00
lady ada 5b9ce9e7cf fix dup usb 2021-01-09 22:42:43 -05:00
lady ada b5b0d45b73 add tft 2021-01-09 22:36:54 -05:00
lady ada 68a5e6dcba copypaste typo 2021-01-09 15:52:58 -05:00
Dan Halbert 908e02439d Look up TCC resolution as necessary 2021-01-09 15:04:23 -05:00
Jeff Epler e20c65d8f0 background tasks: Add, use port_wake_main_task
Some ports need an extra operation to ensure that the main task is
awoken so that a queued background task will execute during an ongoing
light sleep.

This removes the need to enable supervisor ticks while I2SOut is operating.

Closes: #3952
2021-01-09 14:02:47 -06:00
Jeff Epler 4735cf4747 esp32s2: audiobusio: move i2s_common inside
Originally, I believed the implementation might be shared with AudioOut,
as on the ESP32 (non-S2) the I2S peripheral was also used to drive the DAC.
However, this is not the case on ESP32-S2 and appears it will not be
the case with the ESP32-S3 or -C3, to the extent that there's skeletal
support for either of them in esp-idf master branch.

However, it could still be shared by I2SIn or PDMIn (the latter being
hypothetically implemented as I2SIn + digital postprocessing like we did
in the atmel-sam port, to my understanding), so I moved it to
the common-hal folder.
2021-01-09 14:02:47 -06:00
Jeff Epler 10861b4038 esp32s2: Rename ESP_CALL_RAISE to CHECK_ESP_RESULT
Suggested by @tannewt, thanks!
2021-01-09 13:41:44 -06:00
lady ada a600fd3478 forgot deinit 2021-01-09 14:01:58 -05:00
lady ada 301facf102 newline 2021-01-09 13:36:21 -05:00
lady ada 7de1da45da woops out of sync header, plus... i dunno add some frozen modules cause we have almost no RAM :( 2021-01-09 13:23:17 -05:00
lady ada 813fa671f3 nowhitespace 2021-01-09 12:29:08 -05:00
Limor "Ladyada" Fried 9253351fa4
Merge branch 'main' into main 2021-01-09 12:25:16 -05:00
lady ada 999ee68e12 try adding new feather def 2021-01-09 12:22:53 -05:00
foamyguy 13efbf24e5 disable msgpack on boards without room 2021-01-09 10:33:56 -06:00
Caio Henrique de Queiroz Katayama 7b4558b750 Fix socket.recvfrom_into() 2021-01-08 19:17:17 -05:00
anecdata 06ab848a0d added platform 2021-01-08 16:48:25 -06:00
jerryneedell de5b138dcf remove commented line 2021-01-08 14:46:37 -05:00
jerryneedell 7556f38f04 initialize LDO2 in board_init() 2021-01-08 14:40:06 -05:00
Dan Halbert 39c166ba6a update tinyusb; _ticks_enabled only for SAMD21 2021-01-08 13:30:11 -05:00
Jeff Epler 5f0e41ad60 I2SOut: Enable ticks during audio playback
.. otherwise, the background callback to load the I2S fifos does not get
run.  (I'm not sure this is _correct_ behavior of sleep + background
tasks, but it is the current behavior)
2021-01-08 09:01:34 -06:00
Jeff Epler 430bcdb59d port_i2s_play: fill the initial buffer via background callback
There were _possibly_ problems where this routine was being entered
by direct call AND by background callback.  Schedule the work here,
and it will be done almost immediately, without worry about interference.
I don't know if this is strictly necessary, but it doesn't hurt.  Since
the I2S clock is being run all the time, we have to enter the background
task to fill the FIFO with zeros constantly anyway.
2021-01-08 08:49:25 -06:00
Jeff Epler 12264cca34 port_i2s_play: remove build error 2021-01-08 08:47:13 -06:00
Jeff Epler 0b7a4c4b2b i2s_fill_buffer: remove debug print 2021-01-08 08:46:56 -06:00
Jeff Epler 873a300d02 i2s_fill_buffer: Need to fill with zeros when stopping 2021-01-08 08:46:41 -06:00
Jeff Epler cfd8288dfa esp2s2: enlarge stack-buffer, use it instead of i2s_zero_dma_buffer
.. it's not clear that there was a problem with i2s_zero_dma_buffer, but
just in case.
2021-01-07 16:29:52 -06:00
Jeff Epler d3afda61d8 esp32s2: i2s: must reset buffer, otherwise wave samples don't start
.. and other housekeeping when starting to play a sample
2021-01-07 16:29:08 -06:00
Jeff Epler 352226402c esp32s2: i2s: fix accounting for "stretched" frames 2021-01-07 16:28:33 -06:00
Jeff Epler 010a4e7b0f esp32s2: port: Ensure JTAG pins are available for debugging 2021-01-07 16:23:21 -06:00
Bernhard Boser c7dc5f2507 support RTS/CTS hardware flow control 2021-01-07 14:13:19 -08:00
BennyE 115f3e0867 Updated code as per helpful suggestion 2021-01-07 23:05:16 +01:00
Jeff Epler 7bb196b9d2 esp32s2: 'make flash': Allow customizing the esptool flags
This can be useful so that e.g., on a Kaluga when programming via
the FTDI chip, you can override the variable to specify "--after=hard_reset"
to automatically return to running CircuitPython, choose a different
baud rate (921600 is about 2s faster than 460800), etc:
    make BOARD=espressif_kaluga_1 ESPTOOL_FLAGS="-b 921600 --before=default_reset --after=hard_reset"
2021-01-07 15:01:33 -06:00
Jeff Epler 30c6dd3f76 Merge remote-tracking branch 'origin/main' into audioout-esp32 2021-01-07 14:11:14 -06:00
jerryneedell 6976ec6ef9 Merge remote-tracking branch 'upstream/main' into jerryn_feathers2_led 2021-01-07 15:02:40 -05:00
Scott Shawcroft 55c80754c7
Merge pull request #3945 from 2bndy5/fix-table-in-a-readme
convert esp32s2 port readme to rst
2021-01-07 10:43:34 -08:00
Scott Shawcroft 0b0b476be6
Merge pull request #3940 from caternuson/magtag_accelo_irq_pin
Add MagTag accelo IRQ pin
2021-01-07 10:31:33 -08:00
Dan Halbert 5358524941
Merge pull request #3939 from dhalbert/tick-overflow
overflowed tick counter needs 64 bits everywhere
2021-01-07 13:01:30 -05:00
brendan 18122e0455 missed a couple inline code snippets 2021-01-06 15:28:19 -08:00
brendan 092331eee1 convert esp32s2 readme to rst 2021-01-06 15:19:40 -08:00
BennyE 66d87782be Adding authmode keyword 2021-01-06 23:52:30 +01:00
caternuson 9db0a4f265 add magtag accelo irq pin 2021-01-06 09:17:19 -08:00
Scott Shawcroft a33359762d
Merge pull request #3903 from anecdata/reasons
ESP32-S2: Log all Wi-Fi events & remove unneeded call
2021-01-06 08:41:19 -08:00
Dan Halbert 9a1d864331 overflowed tick counter needs 64 bits everywhere 2021-01-06 11:09:06 -05:00
jerryneedell 14e2a02c04 Merge remote-tracking branch 'upstream/main' into jerryn_feathers2_led 2021-01-06 05:47:37 -05:00
anecdata 98c9492a8c change ESP_EARLY_LOG* to ESP_LOG* throughout event_handler 2021-01-05 18:39:51 -06:00
iot49 1a82555803
Merge branch 'main' into msgpack 2021-01-05 11:19:11 -08:00
Kattni Rembor bbd4de33d1 Add adafruit_bus_device to CPX builds. 2021-01-04 15:53:39 -05:00
jerryneedell ec02102409 implment use of DotStar for staus led 2021-01-04 07:41:25 -05:00
Limor "Ladyada" Fried dcf88e1e91
Merge pull request #3923 from bwshockley/Add_dotstar_mini_sam_m4
Add dotstar mini sam m4
2021-01-03 19:40:43 -05:00
Seon Rozenblum 10f178d162 Fixed incorrect pin assignment on header
IO13 is for blue LED
IO14 is the correct pin header between IO18 and IO12
The silk is wrong (shows IO13), but hardware is correct as IO14, but IO14 was not included in pins.c
Silk will be updated on next PCB production run
2021-01-04 10:06:32 +11:00
Benjamin Shockley 9286f26831
Added CP Dotstart Lib to Build
Added the CircuitPython dotstar library to the Mini SAM M4 build so users do not have to include the library to utilize the built-in APA102 LED.
2021-01-03 10:42:58 -06:00
askpatricw 2ce07209df changes based on UM's input 2021-01-01 17:23:11 -08:00
askpatricw 220501e159 dupe LED entries 2020-12-31 18:02:44 -08:00
askpatricw 43f93b097f release and pre-release FeatherS2 NSync 2020-12-31 17:50:41 -08:00
Jeff Epler 5698b8bb0a
Merge pull request #3850 from microDev1/touch-s2
Support for Touch Alarm
2020-12-30 16:25:11 -06:00
microDev 0bad6110d4
update wake-alarm implementation 2020-12-31 02:44:20 +05:30
microDev b83bdc540d
enable light-sleep functionality 2020-12-31 02:22:20 +05:30
Dan Halbert fb216148ec
Merge pull request #3900 from jepler/restore-frozen-busdevice
Restore frozen adafruit_bus_device module
2020-12-30 13:22:46 -05:00
microDev 28ce5e8988
Merge branch 'main' into touch-s2 2020-12-30 22:44:22 +05:30
Jeff Epler 83c6774a44 Revert "Removing frozen libs"
This reverts commit 23ed3ef971.
2020-12-30 10:55:28 -06:00
microDev c7f68022ef
add pretend-to-sleep functionality 2020-12-30 22:11:22 +05:30
anecdata d537d94a4c see what we're missing 2020-12-30 09:45:15 -06:00
anecdata 0914b71653 remove unneeded set_config (wrong param; called in connect anyway) 2020-12-30 09:26:25 -06:00
Hugo Dahl 72cad49c69
Fix minor typo in ESP32S2 readme 2020-12-29 22:52:59 -06:00
Jeff Epler a7542598a0 esp32s2: add I2SOut 2020-12-29 14:46:38 -06:00
Jeff Epler b40a579d18 esp32s2: espidf: Consistent error checking of esp-idf calls
By surrounding most ESP-IDF API calls with this new macro, their failure will
result in a CircuitPython exception.
2020-12-29 14:06:32 -06:00
Jeff Epler 05ba1431c3 esp32s2: espidf: Add IDFError
this is an exception class for "generic" IDF errors that don't have
their own exception type.
2020-12-29 14:06:32 -06:00
Jeff Epler d024df6b06 esp32s2: Use better optimizer flags in debug builds
(note that the before and after files both lack trailing newlines; this is
how the esp-idf do)

OPTIMIZATION_DEFAULT is -Og, which enables optimizations that do not
interfere with the debugger:
```
    elseif(CONFIG_COMPILER_OPTIMIZATION_DEFAULT)
        list(APPEND compile_options "-Og")
```
2020-12-29 14:06:32 -06:00
Jeff Epler 7401aa8e85
Merge pull request #3888 from microDev1/fix-reset-pin
FIX : common_hal_reset_pin()
2020-12-29 10:08:47 -06:00
Scott Shawcroft f9d9c031a9
Merge pull request #3878 from xobs/fomu-fixes-6.0.0
Fomu fixes for 6.0.0
2020-12-28 11:51:26 -08:00
Scott Shawcroft c3396e4b49
Merge pull request #3868 from BennyE/wifi-enhancement-countrycode
esp32-s2: wifi enhancement to include countrycode
2020-12-28 11:49:41 -08:00
Dan Halbert 171efd55e0
Merge pull request #3830 from tannewt/pin_alarm
Add pin alarming
2020-12-28 12:59:27 -05:00
microDev dc332baa87
update common_hal_reset_pin() 2020-12-28 20:04:00 +05:30
Scott Shawcroft 6c7e6abcfd
Downgrade OTA API for IDF 4.2 2020-12-27 20:30:49 -08:00
Uwe Gartmann 2729666d82
SAMD51: change of DAC power setting
Fixes wrong DAC output levels at high data rate
closes adafruit#3796
2020-12-25 17:53:43 +01:00
BennyE 64bb055700 Updating comment to reflect feedback of espressif from IDFGH-4486 -> works correct as per the protocol 2020-12-24 15:40:53 +01:00
Sean Cross 2f95cc95a4 litex: move more critical code to RAM
The XIP SPI flash on Fomu is slow, which results in certain operations
taking a long time. This becomes a problem for time-critical operations
such as USB.

Move various calls into RAM to improve performance.

This includes the call to __modsi3 and __udivsi3 which are used by the
supervisor handler to determine if periodic callbacks need to be run.

This finishes fixing #3841

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-24 14:06:57 +08:00
Sean Cross f3e54414e5 litex: ensure we don't re-enable interrups during ISR
During an interrupt handler, interrupts are implicitly disabled. They
will be re-enabled when the interrupt handler returns.

Due to some changes that were made, varous calls will re-enable
interrupts after they're finished. Examples of this include calling
`CALLBACK_CRITICAL_END` and getting the number of ticks with
`port_get_raw_ticks()`.

This patch prevents this from happening by doing two things:

1. Use standard calls in `port_get_raw_ticks()` to disable and re-enable
interrupts, preventing nesting issues, and
2. Increase the nesting count inside `isr()`, reflecting the implicit
call that is made by hardware when an interrupt is handled

This helps to address #3841.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-12-24 14:03:10 +08:00
Dan Halbert 8061a2574d
Merge branch 'main' into pin_alarm 2020-12-23 22:05:02 -05:00
BennyE 1a6b1b1953 implementing suggested changes 2020-12-24 00:37:37 +01:00
Dan Halbert a11ad25727 BLE fixes 2020-12-23 16:39:27 -05:00
Scott Shawcroft 1a8033470a
Stub out mp_hal_is_interrupted for UNIX 2020-12-23 12:22:50 -08:00
Scott Shawcroft eb65765d52
Merge pull request #3867 from dhalbert/frequencyin-fix-6.0.x
FrequencyIn: do not raise in interrupt handler
2020-12-23 12:14:16 -08:00
BennyE e9c9fce15d Remove debug log messages 2020-12-23 14:59:09 +01:00
Scott Shawcroft 1fca297a2d
A couple sleep fixes
* Better messaging when code is stopped by an auto-reload.
* Auto-reload works during sleeps on ESP32-S2. Ticks wake up the
  main task each time.
* Made internal naming consistent. CamelCase Python names are NOT
  separated by an underscore.
2020-12-22 16:13:02 -08:00
Dan Halbert 89079039ad FrequencyIn: do not raise in interrupt handler 2020-12-22 18:54:42 -05:00
Scott Shawcroft 8b03951fee
Merge pull request #3866 from jepler/use-stub
esp32s2: make flash: use the stub
2020-12-22 10:16:54 -08:00
Jeff Epler da8f023665 esp32s2: make flash: use the stub
Very long ago, this was apparently not supported in esptool yet, at
least when operating over USB CDC.  This now works just fine, and
our esp webtool relies on it as well.  It makes flashing faster,
too.
2020-12-22 10:27:42 -06:00
Dan Halbert d4e9eea397
mark alarm.wake_alarm during gc sweep 2020-12-22 08:11:01 -08:00
Jonathan Giles aaa3c61819 Add default I2C pins for STM32F411CE 2020-12-22 09:11:05 -05:00
Dan Halbert d6df43b943
Merge pull request #3863 from dhalbert/adafruit-prefix
Add Adafruit to MICROPY_HW_BOARD_NAME for various boards
2020-12-22 08:02:35 -05:00
Dan Halbert 39ca406a31 Add Adafruit to MICROPY_HW_BOARD_NAME for various boards 2020-12-21 23:32:11 -05:00
Scott Shawcroft 6347a3fcdb
Merge pull request #3812 from microDev1/ota-s2
Support for OTA update
2020-12-21 18:46:13 -08:00
Scott Shawcroft fb0c74c5f1
Merge pull request #3662 from ElectronicCats/bastble
Add new board BastBLE
2020-12-21 17:39:08 -08:00
BennyE ae3b440835 more fixes and still with debug 2020-12-22 00:32:48 +01:00
Lucian Copeland 75620884e6 Fix stubs, recv_into error 2020-12-21 13:26:43 -05:00
Lucian Copeland 32736dd2c3 Implement server API 2020-12-20 17:12:03 -05:00
sabas1080 d24a5d6270 update path board.h 2020-12-20 15:52:19 -06:00
BennyE 2e393ed195 adding debug infos 2020-12-20 22:03:38 +01:00
sabas1080 bd3c5c33fb define QSPI pinout 2020-12-20 14:57:10 -06:00
sabas1080 88b1e2fe61 remove Internal flash unnecessary 2020-12-20 13:35:15 -06:00
microDev ecd7c0878e
expose wake pin parameter and more tweaks 2020-12-19 20:54:36 +05:30
microDev a60fabdffa
add touch alarm support for esp32s2 2020-12-19 12:56:34 +05:30
Dan Halbert f202eb734a
Merge pull request #3842 from StackRduino/main
add stackrduino_m0_pro
2020-12-18 12:33:34 -05:00
microDev 8eaf2b0c19
implement touch alarm 2020-12-18 12:54:36 +05:30
Damien George 505a1853b9 teensy: Fix build errors and warnings and enable -Werror.
Changes are:
- Remove include of stm32's adc.h because it was recently changed and is
  no longer compatible with teensy (and not used anyway).
- Remove define of __disable_irq in mpconfigport.h because it was clashing
  with an equivalent definition in core/mk20dx128.h.
- Add -Werror to CFLAGS, and change -std=gnu99 to -std=c99.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-18 13:48:57 +11:00
Damien George e715a8fb9b stm32/boards/PYBD_SF2: Disable SPIFLASH_ENABLE_CACHE for mboot builds.
Mboot builds do not use the external SPI flash in caching mode, and
explicitly disabling it saves RAM and a small bit of flash.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-18 13:39:32 +11:00
Damien George e43a74a4db drivers/memory/spiflash: Add MICROPY_HW_SPIFLASH_ENABLE_CACHE option.
This only needs to be enabled if a board uses FAT FS on external SPI flash.
When disabled (and using external SPI flash) 4k of RAM can be saved.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-18 13:39:32 +11:00
Damien George 061cb1a73a stm32/main: Do extended readblocks call when auto-detecting littlefs.
When littlefs is enabled extended reading must be supported, and using this
function to read the first block for auto-detection is more efficient (a
smaller read) and does not require a cached SPI-flash read.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-18 13:39:28 +11:00
Damien George 80883a82c0 stm32/adc: Deselect VBAT after reading to prevent battery drain.
Signed-off-by: Damien George <damien@micropython.org>
2020-12-18 13:32:02 +11:00
microDev 4512290ba0
Merge branch 'main' into ota-s2 2020-12-18 00:44:00 +05:30
microDev 4863413bc9
rename ota to dualbank 2020-12-18 00:34:56 +05:30
Dan Halbert 8f9cd7075e
Merge pull request #3752 from jepler/gcc10
build: Update to gcc10
2020-12-17 11:03:40 -05:00
Hany Elkomy 7afa1a1d76
Update mpconfigboard.mk
reduced to CFLAGS_INLINE_LIMIT = 35 for tranaslations
2020-12-17 22:47:01 +08:00
Hany Elkomy 06022a5e91
Update mpconfigboard.mk
changed CFLAGS_INLINE_LIMIT = 55
2020-12-17 21:58:24 +08:00
Hany Elkomy 81ff95a8eb
Add files via upload 2020-12-17 20:29:54 +08:00
iabdalkader b603066bc2 stm32/sdram: Add SDRAM enter/leave self-refresh mode functions.
These functions enable SDRAM data retention in stop mode.  Example usage,
in mpconfigboard.h:

    #define MICROPY_BOARD_ENTER_STOP sdram_enter_low_power();
    #define MICROPY_BOARD_LEAVE_STOP sdram_leave_low_power();
2020-12-17 23:19:25 +11:00
iabdalkader 32d76e5de6 stm32/system_stm32: Enable DBGMCU in low-power modes for debug builds. 2020-12-17 23:04:42 +11:00
iabdalkader 20f8ce1982 stm32/pyb_can: Add ability to calculate CAN bit timing from baudrate.
Calculate the bit timing from baudrate if provided, allowing sample point
override.  This makes it a lot easier to make CAN work between different
MCUs with different clocks, prescalers etc.

Tested on F4, F7 and H7 Y/V variants.
2020-12-17 23:01:15 +11:00
Hany Elkomy bc95c7f219
Delete board.c 2020-12-17 17:08:52 +08:00
Hany Elkomy f3fb014166
Delete mpconfigboard.h 2020-12-17 17:08:50 +08:00
Hany Elkomy 1284418fa7
Delete mpconfigboard.mk 2020-12-17 17:08:48 +08:00
Hany Elkomy 736c0d4c3d
Delete pins.c 2020-12-17 17:08:46 +08:00
Hany Elkomy 0a7c74230c
Update mpconfigboard.mk
updated for 6.1
2020-12-17 16:26:54 +08:00
Hany Elkomy 109e147b46
Update board.c
updated path to board.h
2020-12-17 16:22:47 +08:00
Hany Elkomy 23ad9c7402
Update mpconfigboard.h
removed whitespace
2020-12-17 15:17:04 +08:00
Hany Elkomy 3d9e4958c5
Add files via upload 2020-12-17 14:24:24 +08:00
Hany Elkomy f3b7cd6a5d
Delete pins.c 2020-12-17 14:24:07 +08:00
Hany Elkomy 70739ff639
Update pins.c 2020-12-17 13:11:53 +08:00
Hany Elkomy fac0bf1db8
Add files via upload 2020-12-17 12:37:32 +08:00
Scott Shawcroft 0dcc659d53
Swap to IDF release/4.2 branch for stability 2020-12-15 18:12:59 -08:00
Scott Shawcroft 1ad49d9a18
Add alarm.pin that wakes on pin level
Fixes #3787
2020-12-15 18:12:59 -08:00
hierophect 3ad4b12ce1
Merge branch 'main' into esp-analog-hang 2020-12-15 15:08:30 -05:00
Dan Halbert 4521dfb732 squeeze some smaller boards 2020-12-15 13:23:49 -05:00
Dan Halbert fb33c4e1c0 -ftree-vrp better diagnostics on -Os builds; -fno-inline-functions for -O2; fix struct init in HCI bleio 2020-12-15 12:23:56 -05:00
Jeff Epler bbbd621b18 nrf: simmel: remove some unneeded modules to make it fit 2020-12-15 10:54:37 -06:00
Dan Halbert 97947b4fe9 shrink bast_pro_mini_m0; use proper flex-array syntax 2020-12-14 22:07:54 -05:00
Scott Shawcroft d076296659
Merge pull request #3816 from dhalbert/sleepmemory
alarm.sleep_memory + alarm.wake_alarm
2020-12-14 17:40:02 -08:00
Scott Shawcroft d6ee17c6fd
Merge pull request #3817 from BennyE/reserve-pins-only-for-debug
esp32s2: Reserve UART pins only if DEBUG=1 is set to address issue 3811
2020-12-14 17:32:17 -08:00
Scott Shawcroft a1f773d9ed
Merge pull request #3819 from BennyE/issue3663
Fix for issue 3663 by returning early if no scan was started before s…
2020-12-14 17:11:18 -08:00
Scott Shawcroft dc473b29e3
Merge pull request #3643 from hierophect/esp32-pin-reset
ESP32-S2: Add IDF pin resets to Microcontroller
2020-12-14 17:09:29 -08:00
Dan Halbert 6abe3cd0ef -Os for SAMD51; fix CSUPEROPT typo 2020-12-14 18:57:31 -05:00
Lucian Copeland d793ec2872 Change pinfunc to default of 0 at reset 2020-12-14 14:25:38 -05:00
Lucian Copeland cac755ba16 Merge remote-tracking branch 'upstream/main' into esp-analog-hang 2020-12-14 13:00:57 -05:00
Lucian Copeland f15e2d86c0 Reduce samples from 64 to 2 2020-12-14 12:59:20 -05:00
Dan Halbert e0afa32cfa use RTC_DATA_ATTR; address review comments 2020-12-14 11:36:54 -05:00
BennyE 210c0ec89c add country(code) to wifi network objects) 2020-12-13 13:32:12 +01:00
Thea Flowers fe32dd08b8 Update Big Honking Button configuration to support its newest board revision.
v5 of the BHB board has:

* GD25Q64C instead of the GD25Q16C.
* Pin PB10 tied to ground for board revision detection.
2020-12-12 19:16:35 -05:00
microDev 37ee5e683d
Merge branch 'main' into ota-s2 2020-12-12 05:25:46 +05:30
BennyE c5c13620f2 Fix for issue 3663 by returning early if no scan was started before stop is issued 2020-12-12 00:49:53 +01:00
BennyE 81c4871fdf Set DEBUG CFLAG if set in make 2020-12-11 22:11:39 +01:00
BennyE e3194ad54e Reserve UART pins only if DEBUG=1 is set to address issue 3811 2020-12-11 20:35:28 +01:00
Scott Shawcroft 344d3c59cb
Merge branch 'main' into msgpack 2020-12-11 11:10:30 -08:00
Dan Halbert cf938983e9 SleepMemory + set alarm.wake_alarm 2020-12-11 08:10:26 -05:00
microDev cb35abfd04
add docs, update translation & fix ota.flash() 2020-12-11 01:01:01 +05:30
Dan Halbert 55f4110983 fix typo 2020-12-10 14:16:25 -05:00
Dan Halbert 5964163649 Initial SleepMemory code 2020-12-10 13:03:40 -05:00
microDev 6a4f74946f
reset ota module on every vm run 2020-12-10 16:48:58 +05:30
microDev 07015ad527
add ability to switch boot partition 2020-12-10 16:42:45 +05:30
microDev bfa2c604ef
add ability to flash in discontinuous chunks 2020-12-10 15:45:25 +05:30
microDev ed5add37f6
add ability to flash in continuous chunks 2020-12-10 14:36:49 +05:30
microDev dee86a014b
factor out esp_ota_end 2020-12-10 14:04:24 +05:30
microDev 20c3184c87
re-organize and clean-up 2020-12-10 12:34:56 +05:30
Damien George f305c62a5f stm32/usb: Allocate 128 bytes to CDC data out EPs on non-multi-OTG MCUs.
This much buffer space is required for CDC data out endpoints to avoid any
buffer overflows when the USB CDC is saturated with data.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-10 12:26:25 +11:00
Scott Shawcroft e14b148e62
Merge pull request #3803 from skieast/fix_i2c_hang_with_wifi
Working, tested with two i2c busses
2020-12-09 10:03:31 -08:00
Damien George 460a181b77 stm32/mboot: Enable LFS2_READONLY for mboot builds with littlefs.
To reduce code size, since mboot does not modify the filesystem.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-09 13:19:31 +11:00
Scott Shawcroft 133013083a
Merge pull request #3808 from tannewt/panic_safe_mode
Enter safe mode after panic or brownout
2020-12-08 16:31:22 -08:00
Scott Shawcroft 57101d7da6
Merge pull request #3807 from tannewt/sleep_tweaks
Add `board_deinit` for use with sleep
2020-12-08 16:30:41 -08:00
Lucian Copeland 9a5006e241 Remove problematic calloc 2020-12-08 17:43:39 -05:00
Scott Shawcroft 0b4bcd9599
Fix build and more comments 2020-12-08 13:05:21 -08:00
Scott Shawcroft d0a806d797
Enter safe mode after panic or brownout
Uses the IDF's reset reason. Does nothing before reset.

Fixes #3389
2020-12-08 11:03:24 -08:00
Scott Shawcroft 40118bcf57
Add `board_deinit` for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
microDev 2f95c94ad8
esp32s2 - update common_hal_mcu_reset 2020-12-08 18:00:58 +05:30
microDev 602243748b
add ota support for esp32s2 2020-12-08 11:45:00 +05:30
microDev fc23a0cc8a
implement ota module 2020-12-08 11:30:00 +05:30
Reinhard Feger 032e095620 stm32/boards/NUCLEO_H743ZI: Enable ethernet peripheral. 2020-12-08 15:27:51 +11:00
Reinhard Feger d986b20122 stm32/eth: Add support for H7 processors. 2020-12-08 15:27:44 +11:00
Reinhard Feger cd61fc8e44 stm32/boards/stm32h743.ld: Enable D2 RAM and add eth-buffer section. 2020-12-08 15:27:27 +11:00
Bruce Segal 571c063c2a Working, tested with two i2c busses 2020-12-07 17:57:54 -08:00
Scott Shawcroft 44b56f76c4
Store safe mode state in the RTC.
Also print backtrace before reset when DEBUG. This will help debug
safe mode issues which calls reset.
2020-12-07 16:39:54 -08:00
Scott Shawcroft 22ad76bb48
Merge pull request #3800 from BennyE/wifi-better-logs
Enhance debug log for wifi scan, sta_start, sta_stop
2020-12-07 12:32:15 -08:00
Glenn Ruben Bakke d0b8554df4 nrf: Change selected boards to utilize pre-flashed bootloader.
The nrf52840-mdk-usb-dongle and pca10050 comes with a pre-flashed
bootloader (OpenBootloader).

This commit updates the boards "mpconfigboard.mk" to use DFU as
default flashing method and set the corresponding BOOTLOADER
settings such that nrf52840_open_bootloader_1.2.x.ld linker
script is used.

The default DFU flashing method can be disabled by issuing "DFU=0"
when invoking make. This will lead to "segger" being used as default
flashing tool. When using "DFU=0", the linker scripts will not
compensate for any MBR and Bootloader region being present, and might
overwrite them if they were present.

The commit also removes the custom linker script specific to
nrf52840-mdk-usb-dongle as it now points to a generic.

Updated nrf52840-mdk-usb-dongle's README.md to be more clear on
how to deploy the built firmware.

The port README.md has also been updated. In the list of target
boards a new column has been added to indicate which bootloader
is present on the target board. And for consistency, changed all
examples in the README.md to use "deploy" instead of "flash".
2020-12-07 20:04:50 +01:00
Glenn Ruben Bakke 7f405236a3 nrf/boards: Add linker script for nrf52840 Open Bootloader 1.2.0. 2020-12-07 20:04:50 +01:00
Glenn Ruben Bakke 634f6df324 nrf/Makefile: Add support for flashing with nrfutil.
An additional Makefile parameter NRFUTIL_PORT can be set in order
to define the serial port to used for the DFU (Default: /dev/ttyACM0).

The "nrfutil" that is used as flasher towards OpenBootloader is
available for installation through Python "pip".

In case of SD=s140, SoftDevice ID 0xB6 is passed to nrfutil's package
generation which corresponds to SoftDevice s140 v6.1.1.
2020-12-07 20:04:50 +01:00
Glenn Ruben Bakke 718397a37d nrf/Makefile: Add bootloader specific section.
Add the option for "mpconfigboard.mk" to define whether the
board hosts a bootloader or not. The BOOTLOADER make variable
must be set to the name of the bootloader.

When the BOOTLOADER name is set it is also required to supply
the BOOTLOADER_VERSION_MAJOR and the BOOTLOADER_VERSION_MINOR
from the "mpconfigboards.mk". These will be used to resolve which
bootloader linker script that should be passed to the linker.

The BOOTLOADER section also supplies the C-compiler with
BOOTLOADER_<bootloader name>=<version major><version minor>
as a compiler define. This is for future use in case a bootloader
needs to do modification to the startup files or similar (like
setting the VTOR specific to a version of a bootloader).
2020-12-07 20:04:50 +01:00
Glenn Ruben Bakke 2489688635 nrf/boards: Update memory.ld to include bootloader offsets.
Adding variables that can be set from other linker scripts:

- _bootloader_head_size:
    Bootloader flash offset in front of the application.

- _bootloader_tail_size:
    Bootloader offset from the tail of the flash.
    In case the bootloader is located at the end.

- _bootloader_head_ram_size:
    Bootloader RAM usage in front of the application.

Updated calculations of application flash and RAM.
2020-12-07 20:04:50 +01:00
Lucian Copeland c1a2ea27ce Change to config-based resets 2020-12-07 13:57:47 -05:00
Lucian Copeland c7b5928833 Fix submodule desync 2020-12-07 11:47:39 -05:00
Lucian Copeland 40a536904f Merge remote-tracking branch 'upstream/main' into esp32-pin-reset 2020-12-07 11:45:27 -05:00
Dan Halbert 169b487509 Include wifi.radio singleton in gc 2020-12-07 11:07:56 -05:00
Joris Peeraer 5020b14d54 py/mpprint: Fix length calculation for strings with precision-modifier.
Two issues are tackled:

1. The calculation of the correct length to print is fixed to treat the
   precision as a maximum length instead as the exact length.
   This is done for both qstr (%q) and for regular str (%s).

2. Fix the incorrect use of mp_printf("%.*s") to mp_print_strn().

   Because of the fix of above issue, some testcases that would print
   an embedded null-byte (^@ in test-output) would now fail.
   The bug here is that "%s" was used to print null-bytes. Instead,
   mp_print_strn is used to make sure all bytes are outputted and the
   exact length is respected.

Test-cases are added for both %s and %q with a combination of precision
and padding specifiers.
2020-12-07 23:32:06 +11:00
Jonathan Bruchim dde0735ac1 zephyr: Guard I2C code with appropriate ifdef config.
To reduce binary code size when not using I2C.

Signed-off-by: Jonathan Bruchim <yonbruchim@gmail.com>
2020-12-07 23:11:00 +11:00
Maureen Helm 92a5ee6ac1 zephyr: Replace broken shell_net_iface() with more general shell_exec().
The zephyr function net_shell_cmd_iface() was removed in zephyr v1.14.0,
therefore the MicroPython zephyr port did not build with newer zephyr
versions when CONFIG_NET_SHELL=y. Replace with a more general
shell_exec() function that can execute any zephyr shell command. For
example:

>>> zephyr.shell_exec("net")

Subcommands:
  allocs     :Print network memory allocations.
  arp        :Print information about IPv4 ARP cache.
  conn       :Print information about network connections.
  dns        :Show how DNS is configured.
  events     :Monitor network management events.
  gptp       :Print information about gPTP support.
  iface      :Print information about network interfaces.
  ipv6       :Print information about IPv6 specific information and
              configuration.
  mem        :Print information about network memory usage.
  nbr        :Print neighbor information.
  ping       :Ping a network host.
  pkt        :net_pkt information.
  ppp        :PPP information.
  resume     :Resume a network interface
  route      :Show network route.
  stacks     :Show network stacks information.
  stats      :Show network statistics.
  suspend    :Suspend a network interface
  tcp        :Connect/send/close TCP connection.
  vlan       :Show VLAN information.
  websocket  :Print information about WebSocket connections.

>>> zephyr.shell_exec("kernel")

kernel - Kernel commands
Subcommands:
  cycles   :Kernel cycles.
  reboot   :Reboot.
  stacks   :List threads stack usage.
  threads  :List kernel threads.
  uptime   :Kernel uptime.
  version  :Kernel version.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-12-07 23:01:00 +11:00
Damien George cb1bb7592e stm32/Makefile: Change -O0 to -Og for DEBUG=1 builds.
The -Og optimisation level produces a more realistic build, gives a better
debugging experience, and generates smaller code than -O0, allowing debug
builds to fit in flash.

This commit also assigns variables in can.c to prevent warnings when -Og is
used, and builds a board in CI with DEBUG=1 enabled.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-07 22:27:38 +11:00
Damien George 1e4e2644ec stm32: Add support for a board to reserve certain peripherals.
Allows reserving CAN, I2C, SPI, Timer and UART peripherals.  If reserved
the peripheral cannot be accessed from Python.

Signed-off-by: Damien George <damien@micropython.org>
2020-12-07 17:22:08 +11:00
Damien George 4ce6427bd7 stm32/i2c: Factor I2C finding code to i2c_find_peripheral function.
Signed-off-by: Damien George <damien@micropython.org>
2020-12-07 17:21:36 +11:00
iabdalkader 7dc2f4ed38 stm32/powerctrl: Ensure SysTick is disabled on STOP mode entry for H7.
Even though IRQs are disabled this seems to be required on H7 Rev Y,
otherwise Systick interrupt triggers and the MCU leaves the stop mode
immediately.
2020-12-07 17:00:56 +11:00
iabdalkader 7b9b6d080a stm32/powerctrl: Set H7 RTC wakeup flags. 2020-12-07 17:00:42 +11:00
iabdalkader 8add94e94e stm32/powerctrl: Disable RTC write protection before changing flags. 2020-12-07 17:00:21 +11:00
iabdalkader 463a275bc4 stm32/powerctrl: On H7, re-enable disabled OSCs/PLLs on exit from STOP.
This commit saves OSCs/PLLs state before STOP mode and restores them on
exit.  Some boards use HSI48 for USB for example, others have PLL2/3
enabled, etc.
2020-12-07 16:58:38 +11:00
iabdalkader 3e5dd2dbcc stm32/powerctrl: Fix STOP mode voltage scaling on H7 REV V devices. 2020-12-07 16:58:00 +11:00
iabdalkader e9e619fa24 stm32/powerctrl: Define RCC_SR_SFTRSTF flag for H747. 2020-12-07 16:57:29 +11:00
iabdalkader ce9197eb20 stm32/Makefile: Disable text compression in debug builds.
Otherwise the flash overflows.

Fixes issue #6653.
2020-12-07 16:45:15 +11:00
iabdalkader 849748873c stm32/modmachine: Add device and revision ids to machine.info(). 2020-12-07 16:39:18 +11:00
BennyE 70827ac3da debug log for wifi scan, start stop 2020-12-06 23:38:04 +01:00
Scott Shawcroft 1130b80e2a
Merge pull request #3612 from gamblor21/bus_device
Moving Adafruit_CircuitPython_BusDevice to core
2020-12-02 13:23:02 -08:00
Dan Halbert 348392f8cc
Merge pull request #3775 from tannewt/nina_certs
Use nina-fw root certs
2020-12-02 16:13:19 -05:00
Dan Halbert 9b3186b625
Merge pull request #3776 from tannewt/backup_socket_timeout
Two minor socket changes
2020-12-02 16:12:29 -05:00
Scott Shawcroft 608c98501b
Merge remote-tracking branch 'adafruit/main' into msgpack 2020-12-02 13:10:39 -08:00
Dan Halbert 31acfedf93
Merge pull request #3780 from tannewt/block_while_erasing
Block all tasks (not interrupts) during flash erase
2020-12-02 16:10:25 -05:00
Bernhard Boser 34bbcc4910
exclude nrf/simmel due to lack of flash 2020-12-02 13:05:00 -08:00
Scott Shawcroft d7ba641ff6
Merge pull request #3767 from dhalbert/sleep
Initial alarm and sleep PR: time alarms with light and deep sleep; PinAlarms not yet implemented
2020-12-02 12:51:43 -08:00
gamblor21 cb863e4c5c Added to partial builds where frozen removed 2020-12-01 22:19:48 -06:00
Bernhard Boser 546b15bf1a
add trailing newline 2020-12-01 18:42:07 -08:00
Bernhard Boser 87d4184dd5
exclude spresense 2020-12-01 18:42:06 -08:00
Bernhard Boser 582a47d71a
rename read, write to read_bytes, write_bytes 2020-12-01 18:41:11 -08:00
Bernhard Boser 59c3e25168
disable on boards tight on memory. add stddef.h to imports (not actually needed). 2020-12-01 18:39:24 -08:00
Bernhard Boser 513253bc3f
moved logic to shared-module and added documentation 2020-12-01 18:38:14 -08:00
Bernhard Boser 90c203a3dd
add module msgpack 2020-12-01 18:38:14 -08:00
Scott Shawcroft 73e22f9eeb
Block all tasks (not interrupts) during flash erase
Otherwise we risk running code from flash while an erase is in
progress, crashing and corrupting the file system.

Related to #3744
2020-12-01 18:15:06 -08:00
gamblor21 fe1c2fa6f0 Removed bus device from simmel build 2020-12-01 19:11:17 -06:00
Dan Halbert 8b7c23c1ee address review comments 2020-12-01 20:01:14 -05:00
Mark 237385798c
Merge branch 'main' into bus_device 2020-12-01 15:47:16 -06:00
Scott Shawcroft 927624468d
Two minor socket changes
* Remove BrokenPipeError and prefer to return the number of bytes
  received. (May be zero.)
* Add two minute backup timeout to reduce the chance we hang on
  recv accidentally.
2020-11-30 18:39:50 -08:00
Scott Shawcroft 4ac4faaaf6
Use nina-fw root certs
That way we have one set we use for all of Adafruit's connected
devices.
2020-11-30 17:02:26 -08:00
Scott Shawcroft 5b3c930e38
Merge pull request #3738 from microDev1/fix-touch
ESP32S2: Fix multiple touchpad don't work simultaneously
2020-11-30 16:03:16 -08:00
Scott Shawcroft a975ef4971
Merge pull request #3695 from cwalther/movable
Add movable supervisor allocations
2020-11-30 16:00:55 -08:00
Scott Shawcroft 98cf7f67d4
Merge pull request #3773 from dhalbert/no-samd21-complex-arithmetic
Disable complex arithmetic on SAMD21 builds to make space
2020-11-30 13:47:56 -08:00
Dan Halbert dbfabddf58 rename ESP TX and RX pins; remove support 2020-11-30 11:11:04 -05:00
Dan Halbert 9768951a2a Disable complex arithmetic on SAMD21 builds to make space 2020-11-29 15:34:38 -05:00
Dan Halbert 848eb28132 esp-uart-pins 2020-11-28 14:52:56 -05:00
Christian Walther c7404a3ff8 Add movable allocation system.
This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap.

By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review.
2020-11-28 17:50:23 +01:00
Dan Halbert 28d9e9186e Disable complex arithmetic on SAMD21 builds to make space 2020-11-28 10:12:46 -05:00
Dan Halbert 596e0e4bd2 merge from upstream 2020-11-27 16:06:57 -05:00
Dan Halbert e308a9ec11 working! PinAlarm not implemented yet. 2020-11-27 16:03:37 -05:00
Dan Halbert 104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
microDev e90cb3ad86
Merge branch 'main' into fix-touch 2020-11-26 11:33:45 +05:30
microDev 6af48bb24c
reset touchin on every vm run 2020-11-26 11:22:44 +05:30
Jeff Epler 7923aa0a62
Merge pull request #3708 from hierophect/esp32s2-udp
ESP32-S2: Add UDP with recvfrom_into and sendto
2020-11-25 21:11:20 -06:00
Jeff Epler 6fd123a5c4
Merge pull request #3758 from tannewt/update_connect_doc
Update wifi.Radio.connect doc
2020-11-25 21:09:56 -06:00
Scott Shawcroft abff2615cb
Merge pull request #3754 from hierophect/esp-spi-pinclaim
ESP32S2: fix pin claiming bugs
2020-11-25 15:11:29 -08:00
Dan Halbert ef0830bfe2 merge from upstream + wip 2020-11-25 17:52:06 -05:00
Dan Halbert 9dbea36eac changed alarm.time API 2020-11-25 15:09:27 -05:00
Lucian Copeland a854da35d3 Fix masking issue causing pin claim problems 2020-11-25 12:14:56 -05:00
Lucian Copeland c9bc877683 Merge remote-tracking branch 'upstream/main' into esp-spi-pinclaim 2020-11-25 10:43:35 -05:00
Scott Shawcroft 9a692c3222
Exit faster on recv when TLS connection closed
When a TLS connection is closed by the server it usually sends a
notice. We see this incoming byte with lwip_ioctl and try to read
it. The read returns 0 but we keep trying anyway. Now, we quit
trying when we get zero back. If the connection was still alive
it'd either read a byte or delay until a byte could be read.
2020-11-24 18:14:22 -08:00
Scott Shawcroft 4ac11c8d31
Update wifi.Radio.connect doc
Now it includes bssid info.
2020-11-24 17:54:39 -08:00
Jeff Epler e778fc1f87
Merge pull request #3741 from hathach/fix-cdc-connection-race
update tinyusb to fix cdc connection race
2020-11-24 19:11:41 -06:00
hierophect 510f464234
Merge branch 'main' into esp32s2-udp 2020-11-24 18:28:10 -05:00
Scott Shawcroft 8364734ba3
Merge pull request #3749 from skerr92/add-cpsapling-spiflash
Add cpsapling spiflash
2020-11-24 15:22:21 -08:00
Jeff Epler c451b22255 Disable 3-arg pow() function on m0 boards
`pow(a, b, c)` can compute `(a ** b) % c` efficiently (in time and memory).
This can be useful for extremely specific applications, like implementing
the RSA cryptosystem.  For typical uses of CircuitPython, this is not an
important feature.  A survey of the bundle and learn system didn't find
any uses.

Disable it on M0 builds so that we can fit in needed upgrades to the USB
stack.
2020-11-24 16:54:33 -06:00
Scott Shawcroft 669f17e5bf
Merge pull request #3678 from microDev1/nvm-s2
ESP32S2: Support for NVM
2020-11-24 14:45:35 -08:00
Lucian Copeland 59458a9013 Add pin claiming to SPI construct 2020-11-24 16:46:11 -05:00
hierophect d0e75e635a
Merge pull request #3714 from microDev1/ps2io-S2
ESP32S2: Support for PS/2-IO
2020-11-24 14:56:09 -05:00
Lucian Copeland 0c5e0954db Add closed socket identification 2020-11-24 14:51:06 -05:00
Lucian Copeland 1031fe2992 correct submodule 2020-11-24 14:46:43 -05:00
Jeff Epler 0836abba41
Merge pull request #3720 from tannewt/more_wifi_retry
Retry connection when getting NOT_AUTHED
2020-11-24 09:54:54 -06:00
Seth Kerr 686edcef3f fixing PID issues with CI Test (whoops) 2020-11-24 07:41:32 -05:00
jgillick f8499a468e Remove filesystem from linker script. 2020-11-23 22:56:38 -08:00
microDev bbe13490b5
Merge branch 'main' into nvm-s2 2020-11-24 12:24:48 +05:30
jgillick 570353b946 Merge remote-tracking branch 'circuitpython/main' into thunderpack1.2 2020-11-23 22:40:47 -08:00
microDev 6ff24410eb
use values pointer directly 2020-11-24 11:44:11 +05:30
microDev 9dd1783da5
Merge branch 'main' into ps2io-S2 2020-11-24 11:11:11 +05:30
Dan Halbert 7a45afc549 working, but need to avoid deep sleeping too fast before USB ready 2020-11-23 22:44:53 -05:00
Dan Halbert ebdc48ae22
Merge pull request #3745 from kattni/magtag-pin-update
Add pin names from silk
2020-11-23 19:48:12 -05:00
Seth Kerr e5cee98977 removing icy tree files/directory 2020-11-23 19:31:06 -05:00
Seth Kerr 2635132ce5 adding 'haxpress' kind of build for CP Sapling for use with SPI Flash 2020-11-23 19:21:12 -05:00
Lucian Copeland 1c9f33a372 Replace reset with mux change 2020-11-23 19:01:30 -05:00
Lucian Copeland 86694262b8 Merge remote-tracking branch 'upstream/main' into esp32-pin-reset 2020-11-23 18:58:46 -05:00
Lucian Copeland 8ffd973e22 Merge remote-tracking branch 'upstream/main' into esp32s2-udp 2020-11-23 18:40:14 -05:00
Scott Shawcroft a80bf22211
Merge pull request #3727 from BennyE/wifi-full-scan
esp32s2: Do a full scan when channel/BSSID are not given
2020-11-23 15:19:57 -08:00
Scott Shawcroft f8dcb25170
Merge pull request #3694 from jepler/update-ulab2
ulab: Update to release tag 1.1.0
2020-11-23 15:17:46 -08:00
Scott Shawcroft 491e314799
Merge pull request #3718 from jepler/epd-rotation
EPaperDisplay: add rotation property
2020-11-23 15:04:26 -08:00
Scott Shawcroft c67f5892ff
Merge pull request #3704 from microDev1/frequencyio-S2
ESP32S2: Support for FrequencyIO
2020-11-23 14:59:27 -08:00
Kattni Rembor 7928a0d454 Blank lines to group aliases. 2020-11-23 16:02:45 -05:00
Kattni Rembor 3730862362 Update to match silk rev 1 2020-11-23 15:56:36 -05:00
Kattni Rembor efda912437 Add pin names from silk 2020-11-23 15:53:28 -05:00
Jeff Epler 16fe2de703
Merge pull request #3732 from skerr92/add-cpsapling
adding CP-Sapling
2020-11-23 10:29:58 -06:00
Jeff Epler 70e978f48b stm: disable ulab on two resource-constrained boards 2020-11-23 10:23:53 -06:00
Jim Mussared 0e8af2b370 extmod/modbluetooth: Add API for L2CAP channels.
Also known as L2CAP "connection oriented channels". This provides a
socket-like data transfer mechanism for BLE.

Currently only implemented for NimBLE on STM32 / Unix.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24 01:07:17 +11:00
Damien George 64180f0742 extmod/machine_i2c: Add init protocol method for generic I2C bindings.
Hardware I2C implementations must provide a .init() protocol method if they
want to support reconfiguration.  Otherwise the default is that i2c.init()
raises an OSError (currently the case for all ports).

mp_machine_soft_i2c_locals_dict is renamed to mp_machine_i2c_locals_dict to
match the generic SPI bindings.

Fixes issue #6623 (where calling .init() on a HW I2C would crash).

Signed-off-by: Damien George <damien@micropython.org>
2020-11-23 19:45:04 +11:00
jgillick 4c5e7520f5 Fix NVM by clearing FLASH_FLAG_PGPERR 2020-11-23 00:25:41 -08:00
Dan Halbert 3abee9b256 compiles; maybe ready to test, or almost 2020-11-22 21:52:37 -05:00
jgillick 661c20dd18 Create a new linker script with more space for the firmware. 2020-11-22 18:25:37 -08:00
Dan Halbert 25591a3f8a Merge branch 'esp32s2-common-hal-mcu-delay-us' into sleep 2020-11-22 21:01:49 -05:00
Dan Halbert a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert f62ea25331 ESP32S2: common_hal_mcu_delay_us() now calls mp_hal_delay_us() 2020-11-22 19:08:27 -05:00
JPFrancoia 3dcb551d89 nrf/README: Describe Pin numbering scheme for nRF52840.
Clarify that the nRF52840's GPIO 1.00 to 1.15 maps to Pin(32-47) in
MicroPython.
2020-11-22 21:01:49 +01:00
microDev f3b5ca5f01
replace goto with conditional break 2020-11-22 19:20:21 +05:30
microDev 048ca2a570
get multiple touchpad working 2020-11-22 18:54:18 +05:30
jgillick fe6e50b770 Update USB_PID 2020-11-22 01:49:23 -08:00
jgillick 56634eb00e Rename thunderpack to v11 2020-11-22 01:31:41 -08:00
jgillick 381889f6bc Cleanup 2020-11-22 01:19:28 -08:00
jgillick 0b858440b0 Fix formatting. 2020-11-22 01:15:05 -08:00
jgillick 63b0bf9075 Merge remote-tracking branch 'origin/main' into thunderpack1.2 2020-11-22 01:07:03 -08:00
Dan Halbert 75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
Dan Halbert e4c66990e2 compiles 2020-11-20 23:33:39 -05:00
Seth Kerr 1c92b1bf61 forgot to run pre-commit local 2020-11-20 15:35:52 -05:00
Seth Kerr c4f4cdd8c1 readding cp_sapling directory 2020-11-20 15:31:49 -05:00
Seth Kerr 29e91424d4 removing cp sapling temporarily to read 2020-11-20 15:29:35 -05:00
Seth Kerr b69bbfa3d6 fixed issues with trailing whitespace check 2020-11-20 15:17:44 -05:00
Seth Kerr 0a06530d52 adding CP-Sapling 2020-11-20 15:06:57 -05:00
BennyE 2773f534c9
Update ports/esp32s2/common-hal/wifi/Radio.c
adding suggested changes
2020-11-20 09:40:32 +01:00
BennyE 6760cdf678 Let connect() choose strongest AP if channel and BSSID are not given 2020-11-20 00:11:17 +01:00
Dan Halbert 39e1f52e28 wip; not compiling yet 2020-11-19 17:47:12 -05:00
BennyE 17a8bafe05 Choose best AP in range if no channel/bssid given 2020-11-19 23:39:48 +01:00
Scott Shawcroft 2f14609044
Merge pull request #3716 from jepler/keep-event-loop
esp32s2: don't delete the event loop
2020-11-19 14:28:31 -08:00
Jeff Epler aaca3eccf1 samd: PDMIn: Reduce code unrolling on samd21 only
Instead of unrolling the code 16 times, unroll it 4 times and loop
over it 4 times.  This gives the same 16 iterations, but at an expense
of less flash space.
2020-11-19 16:19:37 -06:00
Jeff Epler c06fc8e02d Introduce, use mp_raise_arg1
This raises an exception with a given object value.  Saves a bit of
code size.
2020-11-19 16:15:06 -06:00
Jeff Epler 0556f9f851 Revert "samd21: Enable terse error reporting on resource constrained chip family"
This reverts commit 9a642fc049.
2020-11-19 15:12:56 -06:00
Dan Halbert cd436bad1a Merge remote-tracking branch 'adafruit/main' into sleep 2020-11-19 15:43:49 -05:00
Dan Halbert 649c930536 wip 2020-11-19 15:43:39 -05:00
microDev a25b27520d
update nvm implementation 2020-11-20 00:22:00 +05:30
microDev bc9036f353
use pointer to get nvs handle 2020-11-20 00:15:30 +05:30
Jeff Epler dd108b755d esp32s2: initialize event loop ane netif only once
deinitting these seems to cause problems.
2020-11-19 11:36:02 -06:00
Kamil Tomaszewski 76d4824728 spresense: Return fixed stack 2020-11-19 15:04:52 +01:00
microDev 040eaa0443
re-organize and clean-up 2020-11-19 15:30:15 +05:30
microDev b56645808c
fix crash on user code exit 2020-11-19 11:44:22 +05:30
Dan Halbert 5bb3c321e9 merge from main 2020-11-19 00:29:14 -05:00
Dan Halbert 682054a216 WIP: redo API; not compiled yet 2020-11-19 00:23:27 -05:00
Jeff Epler 9a642fc049 samd21: Enable terse error reporting on resource constrained chip family
This reclaims over 1kB of flash space by simplifying certain exception
messages.  e.g., it will no longer display the requested/actual length
when a fixed list/tuple of N items is needed:

        if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
            mp_raise_ValueError(translate("tuple/list has wrong length"));
        } else {
            mp_raise_ValueError_varg(translate("requested length %d but object has length %d"),
                (int)len, (int)seq_len);

Other chip families including samd51 keep their current error reporting
capabilities.
2020-11-18 20:37:36 -06:00
Scott Shawcroft 081aec4429
Retry connection when getting NOT_AUTHED
I saw it once with a correct password. Retrying may still fail
but at least it'll try first.
2020-11-18 16:39:34 -08:00
Jeff Epler 83d790ad8f esp32s2: don't delete the event loop
.. it seems to make the esp-idf grumpy.
2020-11-18 17:45:42 -06:00
microDev 0d3e81f969
update interrupt handling 2020-11-18 22:22:42 +05:30
microDev bab41afce7
ps2io implementation for esp32s2 2020-11-18 12:34:56 +05:30
microDev c457d373e1
update init_timer & frequency calculation 2020-11-18 12:24:48 +05:30
microDev ff987e7496
add timer peripheral 2020-11-18 12:16:14 +05:30
robert 5af3c046c7 esp32,esp8266: Remove "FAT" from warning message in inisetup.py.
Because FAT is not any more the only filesystem used.
2020-11-18 16:26:19 +11:00
Jim Mussared 240b3de8bc stm32/rfcore: Depend on NimBLE only when BLE enabled.
This fixes the build for non-STM32WB based boards when the NimBLE submodule
has not been fetched, and also allows STM32WB boards to build with BLE
disabled.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-18 14:45:51 +11:00
Jeff Epler 9206925bf8 esp32s2: port_get_raw_ticks: Use a more efficient, monotonic routine
While trying to debug #3572, I noticed that I would frequently break in
the midst of gettimeofday and that the routine get_adjusted_boot_time
had to take and release locks.  Furthermore, we don't want "adjusted"
boot time, which could go forwards or backwards depending on the
adjustment (such as setting the clock used by gettimeofday() to the network
time)
2020-11-17 17:45:41 -06:00
Jeff Epler 1bc770c3dc esp32s2: PulseIn: Fix supervisor tick enabling
Before, there were two problems:
 * Even if a pulsein was never constructed, supervisor_disable_tick
   would occur during restart.  This could cancel out a supervisor_enable_tick
   from someplace else, with unexpected results.
 * If two or more pulseins were constructed, each one would enable ticks,
   but only the last one deinited (or the reset routine) would disable,
   leaving ticks running indefinitely.

In my testing, it seemed that this led to the board sometimes stopping when
it should have auto-reloaded.
2020-11-17 17:45:41 -06:00
Scott Shawcroft e2b5ae2d77
Merge pull request #3689 from jepler/issue-3688
esp32s2: wifi: fix several debug-build errors
2020-11-17 13:26:43 -08:00
Lucian Copeland 0bbdf05936 Implement recvfrom_into and sendto for UDP 2020-11-17 16:11:04 -05:00
jgillick 5f0a372a22 Merge tag '6.0.0' into thunderpack1.2 2020-11-17 00:02:24 -08:00
jgillick 119e9d3820 Add Thunderpack 1.2 2020-11-16 23:50:00 -08:00
sabas1080 33ca357094 fix VID and PID 2020-11-16 22:10:37 -06:00
sabas1080 089fa82067 Fix pre-commit 2020-11-16 21:21:24 -06:00
Scott Shawcroft 66fb095069
Merge pull request #3667 from microDev1/watchdog-s2
ESP32S2: Support for WatchDog
2020-11-16 15:01:54 -08:00
Scott Shawcroft f4fd236605
Merge pull request #3698 from BennyE/disablesoftap
esp32s2: Set station mode early to avoid SoftAP on startup
2020-11-16 14:51:57 -08:00
Scott Shawcroft f8eed1f74c
Merge pull request #3691 from jepler/issue-3424
esp32s2: Update esp-idf submodule to include fix for #3424
2020-11-16 14:21:13 -08:00
microDev 0686cde226
update internal nvm size 2020-11-17 01:19:12 +05:30
microDev 18e463cca5
add pcnt overflow handler & clean-up 2020-11-16 23:32:22 +05:30
Dan Halbert ffff02c053 Merge remote-tracking branch 'adafruit/main' into sleep 2020-11-16 12:06:11 -05:00
Dan Halbert bb77f1d130 wip: initial code changes, starting from @tannewt's sleepio branch 2020-11-16 11:56:20 -05:00
microDev f2824f6a68
update frequency measurement 2020-11-16 12:55:55 +05:30
microDev 2bec02738f
move interrupt handler to iram 2020-11-16 11:44:11 +05:30
Jim Mussared 21c293fbcd stm32/rfcore: Don't send HCI ACL cmds while another is pending.
And, for TX, the next/prev entries ane unused so set them to NULL to
indicate this.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16 17:09:12 +11:00
Jim Mussared 119c88ef17 stm32/flash: Implement WB55 flash locking.
This is needed to moderate concurrent access to the internal flash, as
while an erase/write is in progress execution will stall on the wireless
core due to the bus being locked.

This implements Figure 10 from AN5289 Rev 3.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16 17:08:30 +11:00
Jim Mussared a64121b0d4 stm32/rfcore: Make RX IRQ schedule the NimBLE handler.
This commit switches the STM32WB HCI interface (between the two CPUs) to
require the use of MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS, and as a
consequence to require NimBLE.  IPCC RX IRQs now schedule the NimBLE
handler to run via mp_sched_schedule.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16 17:04:27 +11:00
BennyE d4ab00f734 Set station mode early to avoid SoftAP on startup 2020-11-16 00:31:06 +01:00
microDev c4917cdabd
frequencyio implementation for esp32s2 2020-11-16 00:11:00 +05:30
Jeff Epler 231e3d362d esp32s2: Update esp-idf submodule to include fix for #3424
This re-points the submodule to my personal fork of esp-idf.
Users may need to `git submodule sync` in their existing trees when
this change occurs.

Adds just the following commit in esp-idf:
  > esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD
2020-11-14 10:16:39 -06:00
microDev 146adca060
Add watchdog mode raise 2020-11-14 11:41:14 +05:30
Scott Shawcroft bda3267432
Save flash space
* No weak link for modules. It only impacts _os and _time and is
  already disabled for non-full builds.
* Turn off PA00 and PA01 because they are the crystal on the Metro
  M0 Express.
* Change ejected default to false to move it to BSS. It is set on
  USB connection anyway.
* Set sinc_filter to const. Doesn't help flash but keeps it out of
  RAM.
2020-11-13 18:57:52 -08:00
Scott Shawcroft 68eb809fbf
Update parallel bus signatures 2020-11-13 18:57:52 -08:00
Scott Shawcroft 8d4296f964
Add board.DISPLAY to MagTag. Fix luma computation
* Initialize the EPaper display on the MagTag at start.
* Tweak the display send to take a const buffer.
* Correct Luma math
  * Multiply the blue component, not add.
  * Add all of the components together before dividing. This
    reduces the impact of truncated division.
2020-11-13 18:57:52 -08:00
Jim Mussared 61d1e4b01b extmod/nimble: Make stm32 and unix NimBLE ports use synchronous events.
This changes stm32 from using PENDSV to run NimBLE to use the MicroPython
scheduler instead.  This allows Python BLE callbacks to be invoked directly
(and therefore synchronously) rather than via the ringbuffer.

The NimBLE UART HCI and event processing now happens in a scheduled task
every 128ms.  When RX IRQ idle events arrive, it will also schedule this
task to improve latency.

There is a similar change for the unix port where the background thread now
queues the scheduled task.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13 17:19:05 +11:00
Jim Mussared 81e92d3d6e extmod/modbluetooth: Re-instate optional no-ringbuf modbluetooth.
This requires that the event handlers are called from non-interrupt context
(i.e. the MicroPython scheduler).

This will allow the BLE stack (e.g. NimBLE) to run from the scheduler
rather than an IRQ like PENDSV, and therefore be able to invoke Python
callbacks directly/synchronously.  This allows writing Python BLE handlers
for events that require immediate response such as _IRQ_READ_REQUEST (which
was previous a hard IRQ) and future events relating to pairing/bonding.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13 17:19:05 +11:00
Jim Mussared 4559bcb467 unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13 17:19:05 +11:00
Andrew Leech de60aa7d6b unix: Handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13 17:19:05 +11:00
Jeff Epler 0f7081781e esp32s2: wifi: fix several debug-build errors
Closes #3688

With this change, I don't get the ESP_ERROR_CHECK failed repeatedly
running code that imports wifi.  (I'm not getting a successful connection
but that's probably my own fault, such as a secrets problem)
2020-11-12 20:40:45 -06:00
Damien George cc2a35b7b2 stm32/rtc: Validate the RTC prescaler on boot and change if incorrect.
Devices with RTC backup-batteries have been shown (very rarely) to have
incorrect RTC prescaler values.  Such incorrect values mean the RTC counts
fast or slow, and will be wrong forever if the power/backup-battery is
always present.

This commit detects such a state at start up (hard reset) and corrects it
by reconfiguring the RTC prescaler values.

Signed-off-by: Damien George <damien@micropython.org>
2020-11-13 11:23:52 +11:00
Damien George a0623a081c stm32/Makefile: Allow boards to extend all SRC variables.
And rename SRC_HAL -> HAL_SRC_C and SRC_USBDEV -> USBDEV_SRC_C for
consistency with other source variables.

Follow on from 0fff2e03fe

Signed-off-by: Damien George <damien@micropython.org>
2020-11-13 11:22:28 +11:00
Arrowana 922f81dfd1 extmod/machine_mem: Only allow integers in machine.memX subscript.
Prior to this change machine.mem32['foo'] (or using any other non-integer
subscript) could result in a fault due to 'foo' being interpreted as an
integer.  And when writing code it's hard to tell if the fault is due to a
bad subscript type, or an integer subscript that specifies an invalid
memory address.

The type of the object used in the subscript is now tested to be an
integer by using mp_obj_get_int_truncated instead of
mp_obj_int_get_truncated.  The performance hit of this change is minimal,
and machine.memX objects are more for convenience than performance (there
are many other ways to read/write memory in a faster way),

Fixes issue #6588.
2020-11-13 11:13:37 +11:00
Scott Shawcroft c9952798fb
Merge pull request #3683 from BHDynamics/dynossat_edu
Rename pins on dynossat_edu_eps to make them the same as the Arduino core
2020-11-12 12:33:16 -08:00
Enrique Casado aa68b17223 Freed some more space 2020-11-12 13:26:26 +01:00
Enrique Casado 9774736a50 Rename pins to make them the same as the Arduino core 2020-11-12 12:30:34 +01:00
microDev ff41180237
pcnt reset on reload 2020-11-12 16:30:30 +05:30
Jonathan Hogg 8a917ad252 esp32/machine_pin: Reset pin if init sets mode.
This will forcibly grab the pin back from the ADC if it has previously been
associated with it.

Fixes #5771.
2020-11-12 15:27:41 +11:00
Sébastien NEDJAR b04240cb77 stm32/Makefile: Make the generation of `firmware.bin` explicit.
The file `$(BUILD)/firmware.bin` was used by the target `deploy-stlink` and
`deploy-openocd` but it was generated indirectly by the target
`firmware.dfu`.

As this file could be used to program boards directly by a Mass Storage
copy, it's better to make it explicitly generated.

Additionally, some target are refactored to remove redundancy and be more
explicit on dependencies.
2020-11-12 15:22:44 +11:00
Scott Shawcroft a47dea4922
Merge pull request #3671 from FoamyGuy/um_feathers2_board_spi_i2c
board.SPI() and board.I2C() for UnexpectedMaker Feather S2
2020-11-11 17:22:23 -08:00
microDev 35ef6c687f
nvm implementation for esp32s2 2020-11-11 23:11:12 +05:30
gamblor21 23ed3ef971 Removing frozen libs 2020-11-11 11:36:04 -06:00
gamblor21 f61c4e62c1 Removing from smaller builds 2020-11-11 10:24:33 -06:00
foamyguy 118ca7cff4 adding default uart pins 2020-11-11 06:56:57 -06:00
Damien George b99300b53e stm32/boardctrl: Define MICROPY_BOARD_EARLY_INIT alongside others.
Signed-off-by: Damien George <damien@micropython.org>
2020-11-11 21:47:13 +11:00
Damien George 4c3976bbca stm32: Add MICROPY_BOARD calls in various places in stm32_main.
For a board to have full configurability of the soft reset loop.

Signed-off-by: Damien George <damien@micropython.org>
2020-11-11 21:41:04 +11:00
Damien George 1e297c8898 stm32/main: Move update_reset_mode to outside the soft-reset loop.
Running the update inside the soft-reset loop will mean that (on boards
like PYBD that use a bootloader) the same reset mode is used each
reset loop, eg factory reset occurs each time.

Signed-off-by: Damien George <damien@micropython.org>
2020-11-11 21:41:04 +11:00
microDev f9842566d8
Add default pin definitions 2020-11-11 10:22:48 +05:30
foamyguy 8373146c56 newline end of file 2020-11-10 15:29:17 -06:00
Scott Shawcroft ddb3590944
Merge pull request #3647 from DavePutz/issue3579
Issue3579 - Check for CTRL-C During sleep on esp32s2
2020-11-10 13:09:57 -08:00
foamyguy 1192eebcdf adding spi and i2c to board for um feather s2 2020-11-10 14:12:44 -06:00
Lucian Copeland 21ca1b8c2b Merge remote-tracking branch 'upstream/main' into esp32s2-udp 2020-11-10 14:59:32 -05:00
Lucian Copeland d16d27a449 Merge remote-tracking branch 'tannewt/esp32s2_udp' into esp32s2-udp 2020-11-10 14:51:36 -05:00
Scott Shawcroft 75a977febd
Merge pull request #3668 from jepler/esp32s2-stack-size
esp32s2: Correct port_stack_get_top()
2020-11-10 10:56:12 -08:00
microDev 10e8b8cf45
move port specific check 2020-11-11 00:24:01 +05:30
root fe7ed99939 Split out extern declare to ports/esp32s2/supervisor/esp_port.h 2020-11-10 12:45:39 -06:00
root 44425b8d94 Requested review changes made 2020-11-10 11:32:59 -06:00
Jeff Epler 2d8ebfcf63 esp32s2: Correct port_stack_get_top()
Closes #3649
2020-11-10 10:42:53 -06:00
microDev 6c59836c5d
watchdog implementation for esp32s2 2020-11-10 16:32:46 +05:30
Scott Shawcroft 61bf0e99c6
Merge pull request #3653 from tannewt/magtag
Rebrand EInk Portal to MagTag
2020-11-09 16:00:09 -08:00
Scott Shawcroft d1f15d314b
Rename to include display details 2020-11-09 15:03:22 -08:00
microDev 7ba2c5772c
Update license 2020-11-08 11:18:05 +05:30
microDev 55e0e2c4ba
Update rotaryio implementation 2020-11-08 11:12:32 +05:30
sabas1080 6a6e998ea5 Added BastBLE 2020-11-07 19:21:36 -06:00
microDev 479567059e
Merge branch 'main' into rotaryio-S2 2020-11-08 00:00:01 +05:30
Scott Shawcroft b2e83952c0
Rebrand EInk Portal to MagTag 2020-11-06 15:27:16 -08:00
Scott Shawcroft 01c7a06dcc
Merge pull request #3615 from microDev1/CountIO-S2
ESP32S2: Support for CountIO
2020-11-06 12:29:13 -08:00
root d948e6570f Changes to handle Ctrl-C during sleep 2020-11-05 21:27:21 -06:00
Dan Halbert 36a8828fa3
Merge pull request #3632 from dhalbert/add-binascii
add binascii to most builds
2020-11-05 16:16:41 -05:00
microDev ac8a0faa0d
update peripherals_pcnt_init() 2020-11-06 01:42:20 +05:30
Dan Halbert 81bb92bdd2
Merge pull request #3639 from tannewt/fix_recv
Rework socketpool.Socket.recv to return sooner
2020-11-05 14:11:13 -05:00
Scott Shawcroft 8fc1be5ef2
Merge pull request #3645 from BradChan/main
Modify the pins of the hiibot_bluefi.
2020-11-05 11:02:40 -08:00
root c2aa54ae66 Check for Ctrl-C during sleeps 2020-11-05 11:10:40 -06:00
microDev d8ef9a127b
rename pcnt_handler to pcnt 2020-11-05 10:10:39 +05:30
cyz 92cd599ea3 Modify the pins of the hiibot_bluefi. 2020-11-05 09:14:53 +08:00
Scott Shawcroft e02539bdf5
Merge pull request #3633 from ITACAInnovation/patch-2
Update pins.c
2020-11-04 10:30:09 -08:00
microDev fe6bfde590
move pcnt handler 2020-11-04 21:20:24 +05:30
Lucian Copeland 472a5a99ec Add API reset to reset_pin_number 2020-11-03 16:31:53 -05:00
Scott Shawcroft 5a079256d5
Merge pull request #3642 from ehagerty/patch-1
Update README.md
2020-11-03 13:02:58 -08:00
ITACA Innovation S.R.L ca935c0daf
Update pins.c
Changed builtin to standard
2020-11-03 21:22:19 +01:00
Scott Shawcroft 441c2c41fb
Merge pull request #3641 from adafruit/6.0.x
Merge 6.0.x bugfixes to main
2020-11-03 09:46:44 -08:00
Ed Hagerty 4055c5ac61
Update README.md 2020-11-03 17:14:58 +00:00
Limor "Ladyada" Fried 4938054c05
Merge pull request #3638 from ladyada/main
io naming for gpio (credit to @kattni)
2020-11-03 09:17:33 -05:00
Limor "Ladyada" Fried 0d0436bf69
Merge pull request #3637 from hierophect/esp32s2-neopixel-parallel
ESP32S2: Fix parallel strip issue with Neopixels
2020-11-02 23:39:37 -05:00
lady ada c4521287e3 add rx/tx default uart names 2020-11-02 23:22:53 -05:00
Scott Shawcroft 7441344c6f
Add new config options to default 2020-11-02 17:22:24 -08:00
Scott Shawcroft 18838e390a
reduce connection footprint and fix recv 2020-11-02 16:44:55 -08:00
lady ada 6c61a53e0f io naming for gpio (credit to @kattni) 2020-11-02 18:38:23 -05:00
Lucian Copeland 23afe08b6f Add GPIO reset to end of neopixel-write 2020-11-02 17:15:19 -05:00
Dan Halbert 1f7a3f0dfa Rev C Feather M4 CAN pin changes 2020-11-02 15:28:30 -05:00
Brian Dean 041c2a9f61 .../boards/bdmicro_vina_d51: PAD updates for better resource flexibility. 2020-11-02 08:35:25 -05:00
ITACA Innovation S.R.L 4e52757f26
Update pins.c
Added LED, BOOST_EN and VEXT_SELECT pins.
2020-11-01 22:22:55 +01:00
Dan Halbert 72b829dff0 add binascii to most builds 2020-11-01 14:52:03 -05:00
microDev 4438050f79
Add pcnt handler 2020-11-01 18:00:07 +05:30
Jerry Needell 1762a36438 restore analogio to feather_m0_rfm9x/rfm69 builds 2020-11-01 05:46:13 -05:00
Dan Halbert 144eb131ae
Merge pull request #3627 from adafruit/6.0.x
Merge 6.0.x bugfixes to main
2020-10-31 12:28:20 -04:00
ITACA Innovation S.R.L 9a8484b853
Update mpconfigboard.h
Removed ignore PA30 PA31 in order to allow using them as pinout
2020-10-31 11:06:56 +01:00
ITACA Innovation S.R.L a7616808e9
Updated pinout 2020-10-31 10:12:49 +01:00
Scott Shawcroft 09ae9aefa8
Merge pull request #3610 from Edrig/main
Add new board to nrf port: holyiot_nrf52840
2020-10-30 12:03:34 -07:00
Damien George 97960dc7de stm32: Support C++ code and user C modules written in C++.
Also build user C modules as part of the stm32 CI.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 23:35:36 +11:00
Damien George df3b466d6c stm32/boards: Factor out common data/bss/heap/stack linker sections.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 23:31:59 +11:00
Damien George a866f868f8 unix/Makefile: Move coverage.c and coveragecpp.cpp to coverage variant.
So that g++ is not needed to build a non-coverage unix variant.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 23:30:04 +11:00
stijn 25c4563f26 examples: Add example code for user C modules, both C and C++.
Add working example code to provide a starting point for users with files
that they can just copy, and include the modules in the coverage test to
verify the complete user C module build functionality.  The cexample module
uses the code originally found in cmodules.rst, which has been updated to
reflect this and partially rewritten with more complete information.
2020-10-29 15:30:42 +11:00
stijn fad4079778 esp32,unix: Support building C++ code.
Support building .cpp files and linking them into the micropython
executable in a way similar to how it is done for .c files.  The main
incentive here is to enable user C modules to use C++ files (which are put
in SRC_MOD_CXX by py.mk) since the core itself does not utilize C++.

However, to verify build functionality a unix overage test is added.  The
esp32 port already has CXXFLAGS so just add the user modules' flags to it.
For the unix port use a copy of the CFLAGS but strip the ones which are not
usable for C++.
2020-10-29 15:29:50 +11:00
stijn f1666419a8 py/mkrules.mk: Add target for compiling C++ files.
Move the target from the ESP32 Makefile since that does what is needed
already, but also include files from user C modules as is done for the C
files.
2020-10-29 15:27:18 +11:00
Damien George 3e455e9792 stm32/rng: Use SysTick+RTC+unique-id to seed pRNG for MCUs without RNG.
The same seed will only occur if the board is the same, the RTC has the
same time (eg freshly powered up) and the first call to this function (eg
via an "import random") is done at exactly the same time since reset.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 14:14:40 +11:00
robert 59019d7f75 stm32/mpconfigport.h: Seed the urandom module on import.
For seeding the rng_get function is used, which is also the heart of
uos.urandom and pyb.rng, and is a hardware RNG where available.
2020-10-29 14:12:53 +11:00
robert 057193e855 esp8266/mpconfigport.h: Seed the urandom module on import.
For seeding, the hardware RNG of the esp8266 is used.
2020-10-29 14:12:44 +11:00
robert b4062894df esp32/mpconfigport.h: Seed the urandom module on import.
For seeding, the RNG function of the ESP-IDF is used, which is told to be a
true RNG, at least when WiFi or Bluetooth is enabled.  Seeding on import is
as per CPython.  To obtain a reproducible sequence of pseudo-random numbers
one must explicitly seed with a known value.
2020-10-29 14:11:08 +11:00
Scott Shawcroft 7fd73c7d39
Initial UDP work. Need to test 2020-10-28 18:08:31 -07:00
Dan Halbert 59b9ca409c matrixportal ESP TX and RX pins were swapped 2020-10-28 20:33:10 -04:00
Damien George 0118c07916 stm32/machine_adc: Fix ADC auto-calibration to run when ADC not enabled.
Prior to this commit, the ADC calibration code was never executing because
ADVREGEN bit was set making the CR register always non-zero.

This commit changes the logic so that ADC calibration is always run when
the ADC is disabled and an ADC channel is initialised.  It also uses the LL
API functions to do the calibration, to make sure it is done correctly on
each MCU variant.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-29 11:09:43 +11:00
lady ada 25bad660c6 add light sensor, move batt monitor 2020-10-28 19:23:18 -04:00
Scott Shawcroft 7cbc50962b
Merge pull request #3611 from tannewt/esp32s2_eink_portal
Add Adafruit ESP EInk Portal and grayscale EInk support
2020-10-28 14:45:29 -07:00
Gaetan 5ab2f16f64 Change Board Name to ADM_B_NRF52840_1
edit   :         .github/workflows/build.yml
rename :         ports/nrf/boards/holyiot_nrf52840/board.c -> ports/nrf/boards/ADM_B_NRF52840_1/board.c
rename :         ports/nrf/boards/holyiot_nrf52840/mpconfigboard.h -> ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.h
rename :         ports/nrf/boards/holyiot_nrf52840/mpconfigboard.mk -> ports/nrf/boards/ADM_B_NRF52840_1/mpconfigboard.mk
rename :         ports/nrf/boards/holyiot_nrf52840/pins.c -> ports/nrf/boards/ADM_B_NRF52840_1/pins.c
2020-10-28 22:08:10 +01:00
microDev 5e3bfa1956
countio implementation for esp32s2 2020-10-28 20:08:25 +05:30
Scott Shawcroft 9a4efed8cb
Start tweaking the workflow to sleep 2020-10-27 17:55:03 -07:00
Gaetan b44011d196 fix railing Whitespace pin.c 2020-10-28 01:43:42 +01:00
Gaetan b5c95e3b1a Merge branch 'main' of https://github.com/Edrig/circuitpython into main
modifié :         boards/holyiot_nrf52840/pins.c
2020-10-28 00:40:46 +01:00
Gaetan 9b911b2211 modifié : pins.c 2020-10-28 00:38:07 +01:00
Gaetan 27827a4fef Fix EOF error
modifié :         mpconfigboard.mk
modifié :         pins.c
2020-10-28 00:34:07 +01:00
microDev 930cf14dce
Add check for invalid io, function to disable all alarms 2020-10-27 16:17:26 -07:00
microDev e35938971a
Add description of alarm modules 2020-10-27 16:16:55 -07:00
microDev 59df1a11ad
Add alarm_touch module 2020-10-27 16:16:52 -07:00
microDev da449723df
Fix build error 2020-10-27 16:16:15 -07:00
microDev 4d8ffdca8d
restructure alarm modules 2020-10-27 16:15:09 -07:00
microDev e5ff55b15c
Renamed alarm modules 2020-10-27 16:13:25 -07:00
microDev 21ba61afbb
Add function to disable alarm 2020-10-27 16:13:25 -07:00
microDev 05a3f203db
Add function to get time elapsed during sleep 2020-10-27 16:13:25 -07:00
microDev e310b871c8
Get io wake working 2020-10-27 16:13:25 -07:00
microDev 90b9ec6f2c
Initial Sleep Support 2020-10-27 16:13:22 -07:00
Noel Gaetan d0426b3438
Update pins.c
fix mistake
2020-10-27 23:54:46 +01:00
Scott Shawcroft 557a58b244
Merge pull request #3591 from microDev1/TouchIO-S2
ESP32S2: Support for native TouchIO
2020-10-27 14:11:39 -07:00
Scott Shawcroft 73162bda85
Merge pull request #3584 from jepler/can-esp32s2
esp32s2: implement canio
2020-10-27 14:01:07 -07:00
Scott Shawcroft 54c0e98a37
Fix openbook build 2020-10-27 13:58:23 -07:00
microDev 80029f6929
rotaryio implementation for esp32s2 2020-10-28 00:12:13 +05:30
Jeff Epler 5110fec312
Merge pull request #3608 from adafruit/6.0.x
Update main with latest 6.0.x
2020-10-27 11:47:44 -05:00
Jeff Epler 3a501a0495 esp32s2: canio: respond to review comments
* explain the introduction of the temporary variable in get_t_config
 * get rid of unneeded __attribute__
 * get rid of unneeded members of canio_can_obj_t
 * get rid of unneeded header inclusion
2020-10-26 19:18:37 -05:00
Jeff Epler 2ba6659967 esp32s2: Makefile: restore --no-stub 2020-10-26 19:07:37 -05:00
Scott Shawcroft 95cb5961d2
Fix ESP32-S2 SPI when DMA is sometimes used 2020-10-26 16:59:59 -07:00
Scott Shawcroft fc591c8d84
Add EInk Portal 2020-10-26 16:59:59 -07:00
Gaetan 5deb045a81 Ready to PR
* ../../.github/workflows/build.yml
	+ boards/holyiot_nrf52840/board.c
	+ boards/holyiot_nrf52840/mpconfigboard.h
	+ boards/holyiot_nrf52840/mpconfigboard.mk
	+ boards/holyiot_nrf52840/pins.c
2020-10-26 23:32:57 +01:00
Jeff Epler caca0609bd
Merge pull request #3607 from hierophect/esp32-readme-clarity
ESP32-S2: Fix readme link, improve instruction clarity
2020-10-26 12:43:51 -05:00
Lucian Copeland 32f2a8d54c Fix readme link 2020-10-26 11:03:54 -04:00
Jeff Epler 396d92f867 esp32s2: Add canio
This works in loopback mode, though the hardware filtering only permits a
single address or mask filter.
2020-10-26 09:54:58 -05:00
microDev ef97ed6ab6
Update touchio implementation 2020-10-23 13:17:49 +05:30
Scott Shawcroft c8808f41a5
Merge pull request #3580 from astrobokonon/esp32s2-FixSTAMODE
ESP32S2: Reset sta_mode and ap_mode flags
2020-10-22 13:48:45 -07:00
microDev f431f859e7
Initial support for native touchio 2020-10-22 21:32:44 +05:30
Emil Renner Berthing 05f95682e7 unix: Enable more warnings. 2020-10-22 11:54:11 +02:00
Damien George 581d43b774 stm32/usbd_cdc_interface: Check and handle CDC TX wrap-overflow.
If the device is not connected over USB CDC to a host then all output to
the CDC (eg initial boot messages) is written to the CDC TX buffer with
wrapping, so that the most recent data is retained when the USB CDC is
eventually connected (eg so the REPL banner is displayed upon connection).

This commit fixes a bug in this behaviour, which was likely introduced in
e4fcd216e0, where the initial data in the CDC
TX buffer is repeated multiple times on first connection of the device to
the host.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-22 15:32:41 +11:00
iabdalkader a93d9b8c2d stm32: Fix broken build when FAT FS multi-partition is disabled. 2020-10-22 14:58:29 +11:00
Jeff Epler fa4c4c2c10
Merge pull request #3587 from adafruit/6.0.x
Merge in two fixes from 6.0.x
2020-10-21 20:12:20 -05:00
Jerry Needell ff69ab603d fix CPB SPI pin definitions 2020-10-21 17:07:30 -04:00
Scott Shawcroft 50e90088a2
Merge pull request #3586 from Targett363/esp32s2_module_clip
Esp32s2 module clip
2020-10-21 12:58:23 -07:00
Andrew Leech 97108fce57 esp32/mpconfigport.h: Enable MICROPY_PY_DELATTR_SETATTR.
To align with unix and stm32 ports.
2020-10-21 11:11:48 +11:00
Ryan T. Hamilton e202da4dad Change comment wording 2020-10-20 15:14:35 -07:00
Ryan T. Hamilton c58b0adf64 Reset sta_mode and ap_mode flags 2020-10-20 14:49:57 -07:00
Scott Shawcroft 1a677406bf
Merge pull request #3529 from jensechu/color-converter-transparency
displayio: Pass transparent_color to ColorConverter
2020-10-20 10:41:57 -07:00
Scott Shawcroft 8beb36c240
Use one lto partition
This leads to smaller code size at the expense of slower linking.

We can turn partitioning back on with GCC10 because it produces smaller code.
2020-10-20 09:24:03 -07:00
Christian Walther 1eab0692b5 Fix missing `nproc` on macOS.
396979a breaks building on macOS: `nproc` is a Linux thing, use a cross-platform alternative.
2020-10-20 16:39:32 +02:00
Andrew Leech 32c99174e1 unix/mpconfigport.h: Enable MICROPY_PY_DELATTR_SETATTR.
This is a generally useful feature and because it's part of the object
model it cannot be added at runtime by some loadable Python code, so enable
it on the standard unix build.
2020-10-20 23:47:50 +11:00
Targett363 a2fce305d6 Replacing placeholder PIDs with correct PIDs 2020-10-20 10:42:14 +01:00
Scott Shawcroft eb139c9bab
Correct pins to not reset.
They must have the PORT_ prefix otherwise they mask the wrong pins.

Fixes #3552
2020-10-19 17:41:16 -07:00
Scott Shawcroft d606a3e968
Merge pull request #3484 from astrobokonon/esp32s2-morenet
Esp32s2: Expose more network parameters
2020-10-19 15:07:20 -07:00
Scott Shawcroft d98b312886
Merge pull request #3541 from jepler/lto-parallel
atmel-samd: parallelize lto linking
2020-10-19 15:05:45 -07:00
askpatricw d6805c0dd4 SDA and SCL were flipped 2020-10-18 17:15:59 -07:00
Jeff Epler cc411f47eb samd: Update peripherals submodule
(https://github.com/adafruit/samd-peripherals/pull/37)
2020-10-17 20:08:32 -05:00
Jeff Epler fb768dfc14 samd: AnalogOut: Better handle boards which IGNOREd analog pins 2020-10-17 20:08:32 -05:00
Jeff Epler 194d99f588 sparkfun_lumidrive: Can't IGNORE pins that are default bus pins
The SDA, SCL, and MISO pins were ignored.  This error was not diagnosed
before now.
2020-10-17 20:08:32 -05:00
Jeff Epler eb0b023dee samd: extend IGNORE_PIN_foo to all sam e5x/e5x pins 2020-10-17 20:08:32 -05:00
Jeff Epler 4b9fc5de53 samd: update peripherals submodule
this is possible now that the undefined reference to pin_PA30 has been
resolved.
2020-10-17 20:08:32 -05:00
Jeff Epler aa3c890ead samd: pin: Fix 'undefined reference to pin_PA30'
.. when PA30 is IGNOREd
2020-10-17 20:08:32 -05:00
Jeff Epler 396979a67e atmel-samd: parallelize lto linking
This decreases the link time, especially on desktop machines with many CPU
cores.  However, it does come at a slight cost in binary size, making the flash
section about 200 bytes bigger for circuitplayground_express.

Before, linking build-circuitplayground_express/firmware.elf takes
8.8s elapsed time, leaving 3128 bytes free in flash.

After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed
time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free)

If necessary, we can make this per-board or even per-translation to squeeze full
builds.
2020-10-17 20:08:32 -05:00
Ryan T. Hamilton 76f1db7a87 Set sta_mode flag for actual use/checking 2020-10-17 00:23:31 -07:00
Damien George 18518e26a7 ports: Use correct in/out endpoint size in TUD_CDC_DESCRIPTOR.
The last argument of TUD_CDC_DESCRIPTOR() is the endpoint size (or
wMaxPacketSize), not the CDC RX buffer size (which can be larger than the
endpoint size).

Signed-off-by: Damien George <damien@micropython.org>
2020-10-17 15:49:16 +11:00
Scott Shawcroft 878f2322e7
Merge pull request #3564 from BHDynamics/dynossat_edu
Add DynOSSAT-EDU boards
2020-10-16 11:30:42 -07:00
Scott Shawcroft 6e355ec598
Merge pull request #3560 from dhalbert/pervasive-bleio-hci
enable CIRCUITPY_BLEIO_HCI on non-nRF boards where it will fit
2020-10-16 10:00:50 -07:00
Enrique Casado 6631c8d393 Add USB VID&PID 2020-10-16 13:52:46 +02:00
Ryan T. Hamilton 9d840aab0b Cleaned up and now testing 2020-10-15 23:45:11 -07:00
Ryan T. Hamilton b336039aab Disable the long way and return an ap_info object
still needs work and cleanup
2020-10-15 23:18:30 -07:00
Jim Mussared 893f75546c stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Increase GET_STATE timeout.
When installing WS firmware, the very first GET_STATE can take several
seconds to respond (especially with the larger binaries like
BLE_stack_full).

Allows stm.rfcore_sys_hci to take an optional timeout, defaulting to
SYS_ACK_TIMEOUT_MS (which is 250ms).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-16 10:45:03 +11:00
Jim Mussared dfb63b5613 stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Fix bad variable name.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-16 10:44:58 +11:00
Jim Mussared 520bb88d70 stm32/boards/NUCLEO_WB55/rfcore_firmware.py: Fix flash unlock.
The flash can sometimes be in an already-unlocked state, and attempting to
unlock it again will cause an immediate reset.  So make _Flash.unlock()
check FLASH_CR_LOCK to get the current state.

Also fix some magic numbers for FLASH_CR_LOCK AND FLASH_CR_STRT.

The machine.reset() could be removed because it no longer crashes now that
the flash unlock is fixed.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-16 10:43:36 +11:00
Dan Halbert 12ed3fc72f disable on winterbloom_sol and thunderpack 2020-10-15 18:48:28 -04:00
Scott Shawcroft 6b272eeb27
Merge pull request #3555 from UnexpectedCircuitPython/main
Added default LWIP hostnames to FeatherS2 boards
2020-10-15 15:12:40 -07:00
Scott Shawcroft 31223e4ae5
Merge pull request #3530 from askpatrickw/hostname-example
Set default hostname
2020-10-15 15:11:58 -07:00
Dan Halbert 1d05ad6b22 no _bleio for litex; ESP32S2 defines BIT() already 2020-10-15 16:34:19 -04:00
Seon Rozenblum 45a3bd1c04 Added default LWIP hostnames to FeatherS2 boards 2020-10-16 06:47:59 +11:00
Dan Halbert f51e75c1d2 cxd56 needed more precise include for __packed; needed SRC_C += on some ports 2020-10-15 15:24:24 -04:00
Scott Shawcroft b67acea587
Merge pull request #3547 from microDev1/wifiHost
Add method to set custom hostname
2020-10-15 11:17:07 -07:00
Dan Halbert 82b49afe43 enable CIRCUITPY_BLEIO_HCI on non-nRF boards where it will fit 2020-10-15 11:27:21 -04:00
Enrique Casado 97fae54659 Add DynOSSAT-EDU boards 2020-10-15 12:39:14 +02:00
Dan Halbert f1e8f2b404
Merge pull request #3554 from gamblor21/move_ordereddict
Moved ORDEREDDICT define to central location
2020-10-14 22:39:04 -04:00
gamblor21 0a9bcc538b Removed ordered dict for all SAMD21 2020-10-14 20:15:21 -05:00
gamblor21 e6d0b207ec Removed MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT from unix coverage 2020-10-14 14:06:34 -05:00
Scott Shawcroft cc8f8d8604
Merge pull request #3549 from tannewt/stm_alarm_tweak
Fix stm sleep too long
2020-10-14 11:12:26 -07:00
Brian Dean 852a91e1b7 boards/bdmicro_vina_d51/pins.c: Fix illegal QSTR name (hyphen). 2020-10-14 08:29:28 -04:00
microDev 18fbff4f57
Update wifi hostname method 2020-10-14 11:11:59 +05:30
Limor "Ladyada" Fried e9c04bc1f0
Merge pull request #3550 from bd34n/bdmicro_vina_d51
Add new board to atmel-samd port: bdmicro_vina_d51
2020-10-13 23:15:25 -04:00
gamblor21 4270061db4 Moved ORDEREDDICT define to central location 2020-10-13 18:52:27 -05:00
Scott Shawcroft 56427d9abe
Fix stm sleep too long 2020-10-13 14:02:29 -07:00
Brian Dean 2b33968a1e Add new board to atmel-samd port: bdmicro_vina_d51 2020-10-13 16:46:25 -04:00
Scott Shawcroft 3d21eec3cd
Merge pull request #3546 from tannewt/rtc_irq
Finer grained, per port tick locking
2020-10-13 13:39:32 -07:00
Scott Shawcroft 2bc40bcadf
Remove readreq when changing continuous 2020-10-13 10:15:34 -07:00
Scott Shawcroft 33dee4ae07
Merge pull request #3545 from tannewt/stm_rtc
Fix STM RTC read so it's atomic.
2020-10-13 10:10:50 -07:00
microDev ceb531086e
Add method to set custom hostname 2020-10-13 14:22:02 +05:30
Scott Shawcroft 379e73af2e
Finer grained, per port tick locking
Fixes #3504 hopefully.
2020-10-12 18:43:21 -07:00
Scott Shawcroft a0e5e961c5
Fix STM RTC read so it's atomic.
Fixes #3376
2020-10-12 17:43:25 -07:00
Scott Shawcroft 9de96786ad
Merge pull request #3538 from jepler/parallel-qstrlast
build: parallelize the qstr build steps
2020-10-12 15:52:43 -07:00
Scott Shawcroft bb046f9983
Merge pull request #3540 from WarriorOfWire/async_syntax
__await__ magic method and async/await
2020-10-12 15:31:43 -07:00
Scott Shawcroft 638c7f7b57
Merge pull request #3514 from hierophect/esp32-analogout
ESP32-S2: AnalogOut
2020-10-12 15:08:50 -07:00
Jeff Epler 8ddbebd2c1 esp32s2: fix build after qstr rule changes 2020-10-12 13:35:15 -05:00
Kenny 10badd93c3 leftover newlines 2020-10-11 22:52:27 -07:00
Kenny 94beeabc51 remove unnecessary board configuration and address feedback 2020-10-11 22:42:59 -07:00
Kenny 3c46e3a6aa
Turn off async for circuitplayground express
Firmware too large
2020-10-11 08:16:36 -07:00
Targett363 60deb321d1 adding USB PID VID 2020-10-10 23:55:05 +01:00
warriorofwire f5f1e29dc0 disable async/await on a several small ucontrollers 2020-10-10 15:43:12 -07:00
Radomir Dopieralski 3f6ca7bd32 Make end-of-line-fixer happy 2020-10-10 23:59:44 +02:00
Targett363 5721cf0710 tidying up board names 2020-10-10 22:42:24 +01:00
Targett363 ead0d51fd7 Commenting out Neopixel in pins.c 2020-10-10 22:22:01 +01:00
Targett363 74954286f0 Putting the Saola Wrover files back and adding my Wrover board files this time 2020-10-10 21:44:14 +01:00
Targett363 f38e868e90 Actually adding Wrover board files this time 2020-10-10 21:28:26 +01:00
Targett363 b9e308c248 Adding Wroom and Wrover board files 2020-10-10 21:11:06 +01:00
Radomir Dopieralski b227b79dec Fix #3504: Don't use time module in pew.tick()
The time.sleep() and time.monotonic() functions break the timer
interrupt on which PewPew10 display relies, so we can't use them
anymore. Instead I'm adding a time-keeping function to the display
code itself, which then can be used in pew.tick() internally.
2020-10-10 20:26:33 +02:00
lady ada 70a94c8d2d fix for https://github.com/adafruit/circuitpython/issues/3534 2020-10-10 12:27:35 -04:00
Scott Shawcroft c7d87cea62
Merge pull request #3532 from tannewt/samd21_autoreload
Fix autoreload on SAMD21
2020-10-09 14:49:48 -07:00
Lucian Copeland b435ef0272 Merge remote-tracking branch 'upstream/main' into esp32-analogout 2020-10-09 17:19:46 -04:00
Scott Shawcroft 375676ff58
Merge pull request #3501 from hierophect/esp32-analogin
ESP32S2: Add AnalogIn
2020-10-09 14:10:24 -07:00
Scott Shawcroft 699f19f44a
Merge pull request #3522 from tannewt/imx_metro
Unify iMX RT flash config and add Metro M7 1011
2020-10-09 13:48:58 -07:00
Scott Shawcroft 3ccf644dd0
Fix autoreload on SAMD21
The issue was that a time.sleep() would set the RTC wake up
further into the future even if we wanted to tick every ms. Ticking
every ms is used to time the autoreload delay and without it,
autoreload doesn't work.

Fixes #3528
2020-10-09 12:53:00 -07:00
Lucian Copeland ccbc15046a Fix submodule issue 2020-10-09 13:29:35 -04:00
Scott Shawcroft 506936ea2e
Merge pull request #3525 from UnexpectedCircuitPython/UM_S2_Boards
Fixed the FeatherS2 prerelease hardware name
2020-10-09 10:20:13 -07:00
Jim Mussared fa12bfc227 stm32/rfcore: Update to support WS=1.9.0.0.4.
This WS update to 1.9.0.0.4 broke the workaround used in rfcore for
OCF_CB_SET_EVENT_MASK2, so fix it to support WS 1.8 and 1.9.
2020-10-09 23:52:35 +11:00
askpatricw 2b2003f3e7 Set default hostname 2020-10-08 22:46:10 -07:00
Scott Shawcroft b578afa02f
Merge pull request #3523 from tannewt/ble_connectionerror
Replace _bleio.ConnectionError with the native version
2020-10-08 13:00:06 -07:00
Ryan T. Hamilton 99f27bea61 Merge branch 'main' of https://github.com/adafruit/circuitpython into esp32s2-morenet 2020-10-08 12:43:52 -07:00
Lucian Copeland 5af1e054a7 Fix strange merge submodule edit 2020-10-08 14:57:41 -04:00
Lucian Copeland b5f8321d37 Merge branch 'esp32-analogin' into esp32-analogout 2020-10-08 12:42:00 -04:00
Lucian Copeland 97d217a764 Merge remote-tracking branch 'upstream/main' into esp32-analogin 2020-10-08 12:34:58 -04:00
hierophect 4bec77652b
Merge pull request #3519 from hathach/fix-idf-latest
fix espressif latest idf
2020-10-08 12:22:24 -04:00
Jim Mussared 222ec1a4a8 stm32/boards/NUCLEO_WB55: Add standalone WB55 FUS/WS firmware updater.
This commit adds a script that can be run on-device to install FUS and WS
binaries from the filesystem.  Instructions for use are provided in
the rfcore_firmware.py file.

The commit also removes unneeded functionality from the existing rfcore.py
debug script (and renames it rfcore_debug.py).
2020-10-08 17:39:15 +11:00
Jim Mussared 7c76a2dfcf stm32/rfcore: Add Python API for basic rfcore operations.
The new functions provide FUS/WS status, version and SYS HCI commands:
- stm.rfcore_status()
- stm.rfcore_fw_version(fw_id)
- stm.rfcore_sys_hci(ogf, ocf, cmd)
2020-10-08 17:37:11 +11:00
hathach e1fc85c56b fix usb issue with latest idf 2020-10-08 13:30:32 +07:00
Seon Rozenblum d93a1961c4 Fixed the FeatherS2 prerelease hardware name 2020-10-08 14:03:16 +11:00
Scott Shawcroft 9fcf96cb64
Replace _bleio.ConnectionError with the native version
Replace uses of _bleio.ConnectionError with regular ConnectionError

Fixes #3008
2020-10-07 17:11:32 -07:00
Scott Shawcroft ef42d6bb6c
Update USB PID 2020-10-07 16:12:07 -07:00
Scott Shawcroft 09bc415751
Unify iMX flash config and add Metro M7 1011
This unifies the flash config to the settings used by the Boot ROM.
This makes the config unique per board which allows for changing
quad enable and status bit differences per flash device. It also
allows for timing differences due to the board layout.

This change also tweaks linker layout to leave more ram space for
the CircuitPython heap.
2020-10-07 15:23:47 -07:00
gamblor21 085d2a2274 Update submodule to merge commit 2020-10-07 14:09:26 -05:00
hathach b7ed18d622 change idf to espressif
fix hal includes
2020-10-08 00:52:00 +07:00
Lucian Copeland 9ac0aae5a9 Merge remote-tracking branch 'upstream/main' into esp32-analogout 2020-10-07 12:21:04 -04:00
Lucian Copeland 7386a948bd Merge remote-tracking branch 'upstream/main' into esp32-analogin 2020-10-07 12:20:30 -04:00
Jeff Epler 16ed875f4e canio: remove unused fields
these relate to properties that were removed as well
2020-10-06 20:14:50 -05:00
Jeff Epler 81d7ef0256 stm: canio: remove stray optimization flag for debugging 2020-10-06 20:13:23 -05:00
Jeff Epler eed3387f4e stm32: canio: Fix message cancellation
.. it's necessary to wait for a cancellation request to actually free
the respective Tx mailbox
2020-10-06 20:12:10 -05:00
Jeff Epler abe0405d6e stm32: canio: Fix canio.CAN.restart() 2020-10-06 20:12:06 -05:00
Jeff Epler e5a0af9216 stm32: canio: When Tx mailboxes are full, cancel an old message
.. also add the 8ms wait for transmission that the atmel sam port
has
2020-10-06 20:11:58 -05:00
Jeff Epler a7dccb39a4 stm32: canio: remove unused functions 2020-10-06 20:11:51 -05:00
Jeff Epler 23bd2496de stm32: canio: remove some unneeded declarations 2020-10-06 20:11:43 -05:00
Jeff Epler 7df01d3fbd stm32: canio: enable on all stm32f405 boards 2020-10-06 20:11:39 -05:00
Jeff Epler 01e9e355ce canio: implement for stm32f405
The has successfully run my loopback self-test program for CAN,
which tests transmission, reception, and filtering.  The 1M baud rate setting
was also verified on saleae to be accurate.
2020-10-06 20:11:35 -05:00
Scott Shawcroft 8c428a3bdd
Merge pull request #3492 from hierophect/esp32-update-idf
ESP32S2: move to official IDF submodule
2020-10-06 16:53:32 -07:00
Lucian Copeland d5c8e55769 Add AnalogIO 2020-10-06 15:13:50 -04:00
Lucian Copeland 68cb384f8f Remove logging from shared-bindings, fix translations, revert config target macro 2020-10-06 13:29:12 -04:00
Lucian Copeland f90eb23db1 Merge branch 'esp32-update-idf' into esp32-analogin 2020-10-06 12:52:40 -04:00
Lucian Copeland 0d7552b67e Update ESP-IDF to newer fixed fork 2020-10-06 12:48:28 -04:00
iabdalkader 9855b9cd82 stm32/sdcard: Fix H7 build when using SDMMC2.
Changes are:
- Fix missing IRQ handler when SDMMC2 is used instead of SDMMC1 with H7
  MCUs.
- Removed outdated H7 series compatibility macros.
- Defined common IRQ handler macro for F4 series.
2020-10-06 23:33:38 +11:00
iabdalkader 7497d891a7 stm32/sdio: Don't change any DMA2 settings on H7 MCUs.
DMA2 clock and registers should be left in their current state in the H7
build.
2020-10-06 23:31:08 +11:00
Damien George 1dc64359da esp32: Use path relative to root for netutils/timeutils headers.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-06 12:32:20 +11:00
Seon Rozenblum 5c00ba8592 Removed hardware APA settings from mpconfigboard.h because they make the APA flicker on boot. I need to look into why, but I don't think they are being used for anything right now anyway. 2020-10-06 07:40:20 +11:00
hierophect e93a274f2f
Merge branch 'main' into esp32-analogin 2020-10-05 13:02:42 -04:00
Lucian Copeland 0467a82880 Fix/remove various style issues 2020-10-05 13:00:42 -04:00
Damien George 0fff2e03fe stm32/Makefile: Allow boards to extend SRC_C, SRC_O and OBJ variables.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-02 15:46:13 +10:00
Lucian Copeland a8dfae58d9 Add ADC calibration module support 2020-10-01 17:17:39 -04:00
Scott Shawcroft d62ac24493
Merge pull request #3469 from jepler/noreturn
Add some NORETURN attributes
2020-10-01 11:18:36 -07:00
Scott Shawcroft 2ad54f8413
Merge pull request #3463 from UnexpectedCircuitPython/UM_S2_Boards
Updated UM FeatherS2 boards
2020-10-01 10:56:55 -07:00
Lucian Copeland 9a3bd82f40 Update TinyUSB include compatibility 2020-10-01 13:19:54 -04:00
Lucian Copeland 0bbd067a17 Revert ADC calibration removal, complete merge 2020-10-01 13:06:48 -04:00
Damien George 817b80a102 unix/variants: Enable MICROPY_DEBUG_PARSE_RULE_NAME on coverage build.
Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 15:26:43 +10:00
Damien George d4b61b0017 extmod/utime_mphal: Add generic utime.time_ns() function.
It requires mp_hal_time_ns() to be provided by a port.  This function
allows very accurate absolute timestamps.

Enabled on unix, windows, stm32, esp8266 and esp32.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 14:20:42 +10:00
Damien George 905a18aafe unix,windows: Implement mp_hal_time_ns using gettimeofday.
This provides microsecond accuracy.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 14:20:42 +10:00
Damien George 71f3ade770 ports: Support legacy soft I2C/SPI construction via id=-1 arg.
With a warning that this way of constructing software I2C/SPI is
deprecated.  The check and warning will be removed in a future release.

This should help existing code to migrate to the new SoftI2C/SoftSPI types.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
Damien George 39d50d129c ports: Add SoftI2C and SoftSPI to machine module where appropriate.
Previous commits removed the ability for one I2C/SPI constructor to
construct both software- or hardware-based peripheral instances.  Such
construction is now split to explicit soft and non-soft types.

This commit makes both types available in all ports that previously could
create both software and hardware peripherals: machine.I2C and machine.SPI
construct hardware instances, while machine.SoftI2C and machine.SoftSPI
create software instances.

This is a breaking change for use of software-based I2C and SPI.  Code that
constructed I2C/SPI peripherals in the following way will need to be
changed:

    machine.I2C(-1, ...)            ->  machine.SoftI2C(...)
    machine.I2C(scl=scl, sda=sda)   ->  machine.SoftI2C(scl=scl, sda=sda)

    machine.SPI(-1, ...)            ->  machine.SoftSPI(...)
    machine.SPI(sck=sck, mosi=mosi, miso=miso)
                        ->  machine.SoftSPI(sck=sck, mosi=mosi, miso=miso)

Code which uses machine.I2C and machine.SPI classes to access hardware
peripherals does not need to change.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
Damien George 9e0533b9e1 extmod/machine_spi: Remove "id" arg in SoftSPI constructor.
The SoftSPI constructor is now used soley to create SoftSPI instances, it
can no longer delegate to create a hardware-based SPI instance.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
Damien George aaed33896b extmod/machine_i2c: Remove "id" arg in SoftI2C constructor.
The SoftI2C constructor is now used soley to create SoftI2C instances, it
can no longer delegate to create a hardware-based I2C instance.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
Damien George c35deb2625 extmod/machine_i2c: Rename type to SoftI2C and add custom print method.
Also rename machine_i2c_type to mp_machine_soft_i2c_type.  These changes
make it clear that it's a soft-I2C implementation, and match SoftSPI.

Signed-off-by: Damien George <damien@micropython.org>
2020-10-01 12:57:10 +10:00
Lucian Copeland c624c1e838 Merge branch 'esp32-update-idf' into esp32-analogin 2020-09-30 16:51:19 -04:00
Lucian Copeland e01e8dd6b9 Revert HAL refactor changes to avoid USB breaking changes past esp-idf dde6222cd 2020-09-30 16:36:13 -04:00
Scott Shawcroft a739d314f1
Add Metro ESP32S2
Also fix two bugs:
* Crash when resetting board.SPI when it hasn't been inited.
* Reading back the output value is always false. Fixes #3353
2020-09-30 12:57:39 -07:00
Scott Shawcroft 7f803c0b51
Merge pull request #3489 from astrobokonon/esp32s2-fixconnection
ESP32S2: Enter station mode before connecting
2020-09-30 12:16:15 -07:00
Scott Shawcroft 5ac3c36d64
Merge pull request #3450 from mdroberts1243/New_quirk_for_SH1107
New quirk for sh1107
2020-09-30 12:03:10 -07:00
Scott Shawcroft a09a158ddc
Fix trailing line 2020-09-30 11:36:51 -07:00
Lucian Copeland 66b8559fd4 Change submodule, rework all includes 2020-09-30 11:26:07 -04:00
Maureen Helm 997ec9e8cc zephyr: Update build instructions to v2.4.0.
Updates the zephyr port build instructions to use the latest zephyr
release tag.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30 23:21:53 +10:00
Maureen Helm f842e32155 zephyr: Const-ify struct device instance pointers.
Zephyr v2.4.0 added a const qualifier to usages of struct device to
allow storing device driver instances exclusively in flash and thereby
reduce ram footprint.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30 23:21:53 +10:00
Maureen Helm ce49be43b1 zephyr: Replace zephyr integer types with C99 types.
Zephyr v2.4.0 stopped using custom integer types in favor of C99 types
instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-30 23:21:53 +10:00
Jeff Epler c129c8f296 Merge remote-tracking branch 'origin/main' into canbus-api-changes 2020-09-29 20:15:11 -05:00
Seon Rozenblum 819b5faa71 Removed ProS2 board files for now 2020-09-30 10:23:54 +10:00
Seon Rozenblum 4b1a7d812e Updated UM boards 2020-09-30 10:16:24 +10:00
Seon Rozenblum a2a0aa058f Updated UM boards 2020-09-30 10:13:05 +10:00
Ryan T. Hamilton 2f6d7c9002 Make sure you're a STA before connecting 2020-09-29 13:41:56 -07:00
Jeff Epler 2bb44f6c4d
Merge pull request #3486 from microDev1/fixTranslate
Update make translate script
2020-09-29 14:32:49 -05:00
Jeff Epler 611f81ac1a canio: actually drop the _error_count properties
thanks @tannewt
2020-09-29 14:25:53 -05:00
microDev 4c7d9e3aaf
Update make translate script 2020-09-29 11:14:30 +05:30
Jeff Epler d4ee440a91
Merge pull request #3475 from tannewt/esp_uf2
Reorganize sdkconfigs and release UF2s
2020-09-28 20:39:37 -05:00
Ryan T. Hamilton 2a4a244245 Add ap_ssid and ap_bssid 2020-09-28 17:25:09 -07:00
Jeff Epler dd6e7f5a8a mimxrt10xx: Add required header for NORETURN definition 2020-09-28 18:56:01 -05:00
Jeff Epler 1dbb59271c esp32: Use esp_restart from reset_to_bootloader; redeclare it NORETURN 2020-09-28 18:56:01 -05:00
Jeff Epler 726dcdb60a Add some NORETURN attributes
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom:
```
int find_unused_slot(void) {
    // precondition: you already verified that a slot was available
    for (int i=0; i<NUM_SLOTS; i++) {
        if( slot_free(i)) {
            return i;
        }
    }
    safe_mode_reset(MICROPY_FATAL_ERROR);
}
```
However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN.

So I started by teaching the compiler that reset_into_safe_mode never returned.  This leads at least one level deeper due to reset_cpu needing to be a NORETURN function.  Each port is a little different in this area.  I also marked reset_to_bootloader as NORETURN.
Additional notes:

 * stm32's reset_to_bootloader was not implemented, but now does a bare reset.  Most stm32s are not fitted with uf2 bootloaders anyway.
 * ditto cxd56
 * esp32s2 did not implement reset_cpu at all.  I used esp_restart().  (not tested)
 * litex did not implement reset_cpu at all.  I used reboot_ctrl_write.  But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested).  reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added.
 * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added.
 * In several places, NVIC_SystemReset is redeclared with NORETURN applied.  This is accepted just fine by gcc.  I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared.
 * the stub safe_mode reset simply aborts.  This is used in mpy-cross.
2020-09-28 18:55:56 -05:00
Ryan T. Hamilton 7b7ef8edde Merge branch 'main' of https://github.com/adafruit/circuitpython into esp32s2-morenet 2020-09-28 16:50:02 -07:00
Ryan T. Hamilton 66d55738c1 Enable DNS info 2020-09-28 16:49:20 -07:00
mdroberts1243 b1e1237887
Merge branch 'main' into New_quirk_for_SH1107 2020-09-28 19:40:47 -04:00
Jeff Epler f4e36fc7f6 CAN: Use mp_obj_t insteaed of canio_message_obj_t, get rid of rtr field 2020-09-28 17:22:00 -05:00
Jeff Epler 3e97e9c4be canio: Listener: shuffle function declarations around 2020-09-28 17:22:00 -05:00
Jeff Epler 48bda589b8 Listerner: read -> receive, drop readinto
This prepares for creating a separate RemoteTransmissionRequest class
2020-09-28 17:22:00 -05:00
Jeff Epler 79ca430ddf Match: address -> id 2020-09-28 17:22:00 -05:00
Scott Shawcroft abdbbf9e24
One grep 2020-09-28 15:10:12 -07:00
Lucian Copeland 128b4a013b Add non-calibrated ADC 2020-09-28 12:11:08 -04:00
Anson He 96323ac3ac Default power on Wio Terminal's 40 Pin 2020-09-27 10:21:25 +08:00
Ryan T. Hamilton b9968ea801 Merge branch 'main' of https://github.com/adafruit/circuitpython into esp32s2-morenet 2020-09-26 13:37:14 -07:00
Jeff Epler 791d20f16c give qtpy haxpress its own USB PID 2020-09-26 11:45:53 -05:00
Jeff Epler 9944935fde qtpy haxpress: enable RTC 2020-09-26 11:33:10 -05:00
Mark Roberts 22a7696fac Changes take 2: missed ugame10 board 2020-09-25 22:17:59 -04:00
Mark Roberts b921543571 Requested changes take 1 2020-09-25 21:27:29 -04:00
Jeff Epler eadb4de144 qtpy_m0_haxpress: add 2020-09-24 16:58:24 -05:00
Scott Shawcroft dd86cb00ad
Merge pull request #3448 from hierophect/esp32-sd-fix
ESP32S2 - Fix SPI's SD card issue, add pin protections
2020-09-23 12:30:01 -07:00
Scott Shawcroft bcabf5e019
Merge pull request #3457 from ladyada/qtpy_m0
fix pins for rev C
2020-09-23 11:31:28 -07:00
Lucian Copeland 00517b2600 Move missing pin warning to shared-bindings 2020-09-23 11:39:39 -04:00
lady ada 9db7625717 neopix is default on! 2020-09-23 11:19:01 -04:00
stijn bada8c9231 windows: Update build instructions in README.
Make the instructions more complete by documenting all needed steps for
starting from scratch.  Also add a section for MSYS2 since the Travis build
uses it as well and it's a good alternative for Cygwin.  Remove the mingw32
reference since it's not readily available anymore in most Linux distros
nor compiles successfully.
2020-09-23 22:22:13 +10:00
lady ada 5384479a61 fix pins for rev C 2020-09-22 23:28:23 -04:00
Scott Shawcroft 98185e914b
Merge pull request #3425 from jepler/canbus
canio: Initial implementation for SAM E5x MCUs
2020-09-22 12:39:52 -07:00
Jeff Epler 59580d0f2d canio: Fix implementation bugs in atmel-sam 2020-09-22 09:36:29 -05:00
microDev add230b4da
Update port.c 2020-09-22 11:37:12 +05:30
Ryan T. Hamilton a77966a736 Try to reuse/share existing objects 2020-09-21 21:36:46 -07:00
Damien George 3e16763201 stm32/rfcore: Fix FUS layout and size of ipcc_device_info_table_t.
The device info table has a different layout when core 2 is in FUS mode.
In particular it's larger than the 32 bytes used when in WS mode and if the
correct amount of space is not allocated then the end of the table may be
overwritten with other data (eg with FUS version 0.5.3).  So update the
structure to fix this.

Also update rfcore.py to disable IRQs (which are enabled by rfcore.c), to
not depend on uctypes, and to not require the asm_thumb emitter.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-22 14:08:22 +10:00
Ryan T. Hamilton 2fa269ccbc Additional error handling 2020-09-21 20:56:03 -07:00
Jeff Epler 4869dbdc67 canio: rename from _canio
This reflects our belief that the API is stable enough to avoid incompatible changes during 6.x.
2020-09-21 16:44:26 -05:00
Jeff Epler 9e8f1820c8 canio.CAN: switch rx/tx, make both mandatory, move declarations around 2020-09-21 16:44:26 -05:00
Jeff Epler 4e4853dcb2 common.template.ld: remove unneeded line 2020-09-21 16:44:26 -05:00
Jeff Epler df379b84cb remove unneeded symbols 2020-09-21 16:44:26 -05:00
Jeff Epler 7fd6cab2ac canio: Make both tx and rx (but not both) optional
.. loopback and silent come from the (optional) constructor parameters
not guessing based on the pin specification

.. docstring & comment improvements
2020-09-21 16:44:26 -05:00
Jeff Epler 09f8a83a75 samd: template.ld: put canram in its own output section 2020-09-21 16:44:26 -05:00
Jeff Epler a76119afcb add _canio to Feather M4 CAN 2020-09-21 16:44:26 -05:00
Jeff Epler 67d8f108bb Add CAN to SAM E51 clock config 2020-09-21 16:44:26 -05:00
Jeff Epler 44c5b2bbb1 Respond to review comments
Thanks @tannewt!
2020-09-21 16:44:26 -05:00
Jeff Epler 58b920ed97 fix whitespace 2020-09-21 16:44:26 -05:00
Jeff Epler 27cbb690e5 _canio: Add listener matching
Lightly tested:
 * no matches (catch-all)
 * standard address single address matches (even and odd positions)
 * standard address mask matches
 * only tested that extended doesn't match non-extended
2020-09-21 16:44:26 -05:00
Jeff Epler 635fcadb59 _canio.CAN: add error handling & bus state 2020-09-21 16:44:26 -05:00
Jeff Epler a2e1867f69 _canio: Minimal implementation for SAM E5x MCUs
Tested & working:

 * Send standard packets
 * Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and
MicroPython running on STM32F405 Feather with an external
transceiver was also tested.

Many other aspects of a full implementation are not yet present,
such as error detection and recovery.
2020-09-21 16:44:26 -05:00
Jeff Epler 183649aad8 samd: move mcu_find_pin_function to header
.. it'll be used in can as well as sdio
2020-09-21 16:44:07 -05:00
Lucian Copeland 22d9a94f2b Use write_value, add missing pin exceptions 2020-09-21 13:47:14 -04:00
Scott Shawcroft c963771b4b
Merge pull request #3445 from microDev1/boardInfo
Update microS2 config files
2020-09-21 10:33:38 -07:00
microDev 40ec7a66e4
Update microS2 config files 2020-09-21 14:39:31 +05:30
Jeff Epler ce266425e1
Merge pull request #3441 from hierophect/stm32-rgbmatrix-crashfix
STM32: Add never_reset reservation to RGBMatrix init
2020-09-20 07:51:09 -05:00
Ryan T. Hamilton bc8863a3c7 Simplify now that I have it working
still need to figure out the bound method business
2020-09-19 21:04:07 -07:00
Ryan T. Hamilton 04ffd0dca0 Add gateway, subnet, and rssi info for current connected AP
ap_rssi is a bound method, which I'm not keen on, but it works
2020-09-19 13:38:04 -07:00
Dan Halbert 9cc803eb95
Merge pull request #3432 from bd34n/rename-bdmicro-vina-m0-d21
Rename board bdmicro_vina_m0 to bdmicro_vina_d21 and update boardfiles.
2020-09-19 13:41:21 -04:00
Dan Halbert b28b31196d
Merge pull request #3438 from nitz/patch-1
[Makerdiary nRF52840 M.2 Devkit] Add SDA & SDL, RX & TX to pins.c
2020-09-18 21:51:22 -04:00
Dan Halbert dfd09bba57
Merge pull request #3433 from astrobokonon/esp32s2-bssid
ESP32S2: Allow connecting to specific bssid
2020-09-18 21:31:15 -04:00
Dan Halbert 8cf0171c06
Merge pull request #3431 from hierophect/stm32-spi-writevalue
STM32: Change SPI Read to acknowledge write_value
2020-09-18 19:46:21 -04:00
Dan Halbert 5116375604
Merge pull request #3436 from jepler/fix-spi-sercom4
samd: SPI: improve conditional code
2020-09-18 19:14:39 -04:00
Dan Halbert 23dd7c7c96
Merge pull request #3435 from jepler/fix-sdhc1
sdioio: fix code for the case where there is no SDHC1
2020-09-18 17:10:59 -04:00
nitz 8d6a28a9ff
Update user button names. 2020-09-18 17:01:44 -04:00
Dan Halbert 550b42e4d3
Merge pull request #3434 from jepler/same54-disable-cpu-voltage
sam e54: disable microcontroller.cpu.voltage
2020-09-18 15:20:43 -04:00
nitz 5249a228a0
More pin names cleanup. 2020-09-18 14:27:00 -04:00
Lucian Copeland 3a59d30e1a Remove timer debug messages 2020-09-18 12:48:15 -04:00
Lucian Copeland c58bd4c047 Add never_reset reservation to RGBMatrix init 2020-09-18 12:38:15 -04:00
Damien George 42342fa3cb tests/basics: Add test for MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS ops.
And enable this feature on unix, the coverage variant.  The .exp test file
is needed so the test can run on CPython versions prior to "@=" operator
support.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-18 18:40:42 +10:00
Tweako 8af9796b16 stm32/led: Support PWM output without TIM3.
For example, the STM32WB55 doesn't have TIM3 but can still drive LEDs using
PWM on other timers.
2020-09-18 18:37:11 +10:00
Damien George 8f20cdc353 all: Rename absolute time-based functions to include "epoch".
For time-based functions that work with absolute time there is the need for
an Epoch, to set the zero-point at which the absolute time starts counting.
Such functions include time.time() and filesystem stat return values.  And
different ports may use a different Epoch.

To make it clearer what functions use the Epoch (whatever it may be), and
make the ports more consistent with their use of the Epoch, this commit
renames all Epoch related functions to include the word "epoch" in their
name (and remove references to "2000").

Along with this rename, the following things have changed:

- mp_hal_time_ns() is now specified to return the number of nanoseconds
  since the Epoch, rather than since 1970 (but since this is an internal
  function it doesn't change anything for the user).

- littlefs timestamps on the esp8266 have been fixed (they were previously
  off by 30 years in nanoseconds).

Otherwise, there is no functional change made by this commit.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-18 17:20:34 +10:00
Damien George bd7af6151d ports: Add utime.gmtime() function.
To portably get the Epoch.  This is simply aliased to localtime() on ports
that are not timezone aware.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-18 16:25:36 +10:00
Damien George b28758054b esp8266: Remove release-specific manifest, disable osdebug by default.
This commit removes release-specific builds for the esp8266 and makes the
normal build of the GENERIC board more like the release build.  This makes
esp8266 like all the other ports, for which there is no difference between
a daily build and a release build, making things less confusing.

Release builds were previously defined by UART_OS=-1 (disable OS messages)
and using manifest_release.py to include more frozen modules.

The changes in this commit are:
- Remove manifest_release.py.
- Add existing modules from manifest_release.py (except example code)
  to the GENERIC board's manifest.py file.
- Change UART_OS default to -1 to disable OS messages by default.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-18 16:01:42 +10:00
Mirko Vogt ecb36d2439 esp32/modnetwork: Re-enable PPP support for IDF-SDK >=v4.
PPP support was disabled in 96008ff59a -
marked as "unsupported" due to an early IDF v4 release.  With the currently
supported IDF v4.x version - 4c81978a - it appears to be working just fine.
2020-09-18 15:57:21 +10:00
Jim Mussared 52d6eeb409 esp32/boards/sdkconfig.base: Set default IDF log level to ERROR.
This commit changes the default logging level on all esp32 boards to ERROR.
The esp32 port is now stable enough that it makes sense to remove the info
logs to make the output cleaner, and to match other ports.  More verbose
logging can always be reenabled via esp.osdebug().

This also fixes issue #6354, error messages from NimBLE: the problem is
that ble.active(True) will cause the IDF's NimBLE port to reset the
"NimBLE" tag back to the default level (which was INFO prior to this
commit).  Even if the user had previously called esp.osdebug(None), because
the IDF is setting the "NimBLE" tag back to the default (INFO), the
messages will continue to be shown.

The one quirk is that if the user does want to see the additional logging,
then they must call esp.osdebug(0, 3) after ble.active(True) to undo the
IDF setting the level back to the default (now ERROR).  This means that
it's impossible (via Python/esp.osdebug) to see stack-startup logging,
you'd have to recompile with the default level changed back to INFO.
2020-09-18 15:53:56 +10:00
nitz db078922e4
Removed TXD/RXD, fixed whitespace. 2020-09-17 21:32:19 -04:00
Chris Dailey be3e478fce
Add SDA & SDL, RX & TX to pins.c
Despite the [silk on the dock board](https://wiki.makerdiary.com/nrf52840-m2-devkit/resources/nrf52840_m2_devkit_hw_diagram_v1_0.pdf), the SDA/SCL pins weren't defined. Though, they were already defined in `mpconfigboard.h`.

Same for RX/TX. It looks like it declared `TXD` and `RXD`, so I didn't want to remove those, but I think it makes sense to have the "standard" pin names, but I moved ithem to illustrate they were all referencing the same pins.

I mimicked the whitespace I saw in the metro_nrf52840_express port.
2020-09-17 20:46:59 -04:00
Jeff Epler 45eec5b5a5 samd: SPI: improve conditional code
I recently misdiagnosed a "maybe-uninitialized" diagnostic as a bug in
asf4.  However, the problem was in our SPI code.

A special case for samr21 MCUs was being applied to same54p20a and possibly
other D5x/E5x MCUs, since the check was simply for pin PC19 existing at all.

Change the check to use the macro PIN_PC19F_SERCOM4_PAD0 which is only
defined if special function F of pin PC19 is SERCOM4 PAD0.

Reorganize the code a little bit so that brace-matching in editors is
not confused by the conditionalized code, including an unrelated change
for APA102_SCK's condition.

Revert the change to the Makefile that incorrectly attempted to silence
the diagnostic.
2020-09-17 18:30:22 -05:00
Jeff Epler c73182803d sdioio: fix code for the case where there is no SDHC1
.. it doesn't really make a difference (the old code created an empty
else{} statement) but this is more correct.
2020-09-17 18:29:31 -05:00
Jeff Epler 1b29ceaf1a sam e54: disable microcontroller.cpu.voltage
This hangs, and the usual workarounds didn't work.
2020-09-17 18:27:43 -05:00
Scott Shawcroft 17bdc969db
Reorganize sdkconfigs and release UF2s 2020-09-17 16:01:23 -07:00
Ryan T. Hamilton 1805e92038 Add else case for non-bssid usage 2020-09-17 15:04:27 -07:00
Scott Shawcroft 7f60ebd6c7
Merge pull request #3426 from tannewt/esp_flash_sizes
Add partition layouts for 8 and 16 MB as well.
2020-09-17 13:27:58 -07:00
Scott Shawcroft 4b827b25ad
Merge pull request #2966 from sommersoft/ci_check_vid_pid
Automate USB VID/PID Uniqueness Check
2020-09-17 11:48:46 -07:00
Scott Shawcroft 9cf9441ba6
Merge pull request #3393 from tannewt/fix_spi_psram
Add non-DMA SPI support.
2020-09-17 11:11:56 -07:00
Scott Shawcroft 78338ac12b
Merge pull request #3417 from hierophect/esp32s2-readme
ESP32S2: Add Readme
2020-09-17 10:58:17 -07:00
Ryan T. Hamilton 1e3241ec6d
Merge branch 'main' into esp32s2-bssid 2020-09-16 17:15:01 -07:00
Ryan T. Hamilton daa1dd278d connect now accepts bssid 2020-09-16 16:25:17 -07:00
Brian Dean 81ee874531 pins.c: fix trailing whitespace 2020-09-16 16:40:04 -04:00
Brian Dean 847d609ddc rename board bdmicro_vina_m0 to bdmicro_vina_d21 and update boardfiles appropriately 2020-09-16 16:27:24 -04:00
Scott Shawcroft c55deb54f0
Merge pull request #3427 from usini/muselab_nanoesp32_s2
Added board - Muselab nanoESP32-S2
2020-09-16 12:23:41 -07:00
Lucian Copeland 00ee94d24b Add SPI memset, optional flags 2020-09-16 14:22:18 -04:00
Scott Shawcroft fb90daa0ff
Merge pull request #3422 from askpatrickw/rtc-support
RTC enabled
2020-09-16 11:12:00 -07:00
askpatricw 18285f96e8 RTC is pickd up automatically 2020-09-16 10:13:07 -07:00
Dan Halbert d774678a0f
Merge pull request #3369 from kamtom480/camera
Add camera module
2020-09-16 12:29:58 -04:00
Lucian Copeland 478a4b6405 Clarify location of port root 2020-09-16 10:51:08 -04:00
Jeff Epler 1fc797132a
Merge pull request #3237 from DavePutz/issue3216
Issue#3216 - Needed an alternate way to check if background tasks were run
2020-09-16 08:47:33 -05:00
Kamil Tomaszewski 61687c81d8 camera: Pass width and height to take_picture() 2020-09-16 13:55:57 +02:00
Rémi Sarrailh c06aeda399 Add Muselab nanoesp32 s2 definition 2020-09-16 13:10:01 +02:00
Ryan T. Hamilton fead60d2d8 Add BSSID to Network 2020-09-15 23:32:53 -07:00
Scott Shawcroft 2bd169ec32
Add partition layouts for 8 and 16 MB as well. 2020-09-15 18:12:06 -07:00
Scott Shawcroft 95e27bb8bf
Add more PIDs for unique boards 2020-09-15 13:43:35 -07:00
askpatricw bd381e434f Revert "code review feedback"
This reverts commit f9f614b3a2.
2020-09-15 13:02:26 -07:00
askpatricw f9f614b3a2 code review feedback 2020-09-15 11:28:31 -07:00
askpatricw 8fcdc7da16 RTC enabled 2020-09-14 23:24:44 -07:00
Dan Halbert 3c6af94fb3
Merge pull request #3384 from jepler/feather_m4_can
atmel-samd: add same51, feather_m4_can
2020-09-14 23:57:51 -04:00
Jeff Epler 067a975875 update submodules to merge commits 2020-09-14 17:22:30 -05:00
DavePutz 2a2a8d6457
Merge pull request #28 from adafruit/main
Merge from adafruit/main
2020-09-14 16:50:40 -05:00
Lucian Copeland 3640ef2b7f Fix toctree, incorrect flash port assumptions 2020-09-14 17:37:55 -04:00
Lucian Copeland 6ecfdda580 Add Readme 2020-09-14 13:18:51 -04:00
DavePutz 2eca4ee902
Update PulseIn.c 2020-09-14 11:04:45 -05:00
Lucian Copeland e504438fd2 Remove unlicensed file, fix reset pin type check 2020-09-14 11:58:13 -04:00
DavePutz c014ac3089
Reworked check for input taking too long 2020-09-14 10:54:57 -05:00
Lucian Copeland ecc219fe50 Merge remote-tracking branch 'upstream/main' into esp32-displayio-fix 2020-09-14 10:44:31 -04:00
Kamil Tomaszewski ce7ee58e92 camera: Update camera module 2020-09-14 13:12:20 +02:00
Kamil Tomaszewski c2fc592c2c camera: Change API 2020-09-14 13:11:15 +02:00
Kamil Tomaszewski 143a1ff94a spresense: change the GC to do 32-byte blocks 2020-09-14 13:11:15 +02:00
Kamil Tomaszewski 1fde8ef9bc spresense: Add support for camera 2020-09-14 13:11:15 +02:00
Jeff Epler b3bdd4686b PacketBuffer: add missing 'break's, remove unneeded {} 2020-09-13 15:10:38 -05:00
Jeff Epler af24c8ae06 Merge remote-tracking branch 'origin/main' into implicit-fallthrough-diagnostic
Conflict in locale/circuitpython.pot resolved with 'make translate'
2020-09-13 14:21:21 -05:00
Jeff Epler 73ad78ed1b
Merge pull request #3395 from microDev1/safeMode
Add esp32s2 safe mode support & fix user_safe_mode output
2020-09-13 14:18:59 -05:00
Jeff Epler 90f7340bfc move implicit-fallthrough warning enable to defns.mk 2020-09-13 13:13:09 -05:00
microDev 36da92075b Update safe mode reason 2020-09-13 22:57:24 +05:30
microDev 5deac8d249 Update board specific safe mode message 2020-09-13 18:22:40 +05:30
lady ada 2fac4851a5 fix typo, tested hardware, neopixel doesnt work tho 2020-09-12 19:56:13 -04:00
lady ada 6fff4ec00d cutie variant 2020-09-12 19:00:26 -04:00
Jeff Epler 01fdd9598a disable iimplicit-fallthrough warning inside asf4
.. there is an instance of it that looks like a "true positive", but it only
affects sdhc transfers that are not a multiple of 4 bytes, which I don't think
happens. (sd card blocks are always 512 bytes)  I can fix this in our
asf4 repo but that would mean this should be deferred until after #3384 is
merged, since that also touches asf4 very invasively by adding a whole new
chip family.
2020-09-12 17:48:42 -05:00
Jeff Epler 5729097bc4 atmel-samd: enable build error for implicit fallthrough
If any diagnostics occur, we will want to either add `/* FALLTHROUGH */`
or `break;` as appropriate.  I only tested a few builds (trinket m0
and metro m4 express)
2020-09-12 15:11:29 -05:00
microDev 4da478382d Fix serial console output & add more boards 2020-09-12 17:46:52 +05:30
Damien George b31cb21a39 stm32/servo: Fix angle and speed methods to work again with -ve args.
Fixes a regression introduced by 70affd9ba2

Fixes issue #6403

Signed-off-by: Damien George <damien@micropython.org>
2020-09-12 13:47:59 +10:00
microDev 305bed6d9e Added esp32s2 safe_mode & fixed user_safe_mode 2020-09-11 21:06:54 +05:30
Damien George acdb0608b7 py/parse: Pass in an mp_print_t to mp_parse_node_print.
So the output can be redirected if needed.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-11 23:00:03 +10:00
Jeff Epler cacb0124ac feather_m4_express: Use quad data mode on flash
Limor confirmed that the all shipping revisions starting with Rev D had QSPI flash chips installed.

Note that when neither EXTERNAL_FLASH_QSPI_SINGLE nor EXTERNAL_FLASH_QSPI_DUAL is specified quad mode is assumed, so this is addressed by removing the setting altogether.
2020-09-10 20:20:21 -05:00
Jim Mussared 50efce8174 esp32/mpconfigport.h: Remove duplicate uhashlib registration. 2020-09-11 11:03:29 +10:00
stijn 70bec41089 windows: Show test failures in the Appveyor builds. 2020-09-11 10:56:02 +10:00
stijn 5b94c61097 windows/Makefile: Support freezing modules.
Alter the build flags as needed to support freezing modules with a
manifest.  This makes freezing works just like it does for e.g. the unix
port.
2020-09-11 10:52:52 +10:00
stijn 2a9ea69fa9 windows/msvc: Support freezing modules.
Support freezing modules via manifest.py for consistency with the other
ports.  In essence this comes down to calling makemanifest.py and adding
the resulting .c file to the build.  Note the file with preprocessed qstrs
has been renamed to match what makemanifest.py expects and which is also
the name all other ports use.
2020-09-11 10:52:35 +10:00
Scott Shawcroft c7c90f47b0
Add non-DMA SPI support.
This fixes SPI with PSRAM allocated buffers. DMA with SPI2 was
attempted but produced junk output. This manual copy is less than
2x slower than DMA when not interrupted.

Fixes #3339
2020-09-10 17:32:20 -07:00
stijn 2e54d9d146 py: Fix handling of NaN in certain pow implementations.
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with
toolchains that don't handle pow-of-NaN correctly.
2020-09-11 10:04:57 +10:00
Scott Shawcroft 9e722c8c99
Merge pull request #3375 from DavePutz/issue3296
Correction for Issue #3296 - ble hanging on nrf52840
2020-09-10 12:36:17 -07:00
Scott Shawcroft e5dd2a32f4
Merge pull request #3388 from jerryneedell/jerryn_rfm69
freeze rfm69 and bus_device libraries into feather_m0_rfm69
2020-09-10 11:49:37 -07:00
Scott Shawcroft 683462c1b1
Merge pull request #3326 from tannewt/native_wifi
Add native wifi API with ESP32S2 support
2020-09-10 11:20:44 -07:00
Damien George 709398daae stm32/rtc.h: Include py/obj.h to make header self contained.
Signed-off-by: Damien George <damien@micropython.org>
2020-09-10 20:46:40 +10:00
Damien George 547688c58c stm32/usb: Don't nul pyb_hid_report_desc if MICROPY_HW_USB_HID disabled.
So this code can be used if pyb_hid_report_desc is not included in the
port's root pointer list.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-10 20:46:35 +10:00
Jerry Needell 2529ee2359 freeze rfm69 and bus_device libraries int feather_m0_rfm69 2020-09-09 14:54:20 -04:00
Lucian Copeland be199983c1 Merge remote-tracking branch 'upstream/main' into esp32-displayio-fix 2020-09-09 13:24:30 -04:00
Scott Shawcroft 99f5011d74
Fix heap without PSRAM. Never set heap_size. 2020-09-08 17:06:09 -07:00
Jeff Epler b49099c8f3 additional asf4 updates 2020-09-08 15:31:13 -05:00
Jeff Epler e066448e36 atmel-samd: add same51, feather_m4_can
This is compile-tested, and requires updates in the related submodules:

https://github.com/adafruit/samd-peripherals/pull/35
https://github.com/adafruit/asf4/pull/37

This should not be merged until those can also be merged.
2020-09-08 13:06:45 -05:00
microDev 14af8e4b42
Added temp_sensor_stop
Co-authored-by: hierophect <hierophect@gmail.com>
2020-09-08 21:07:00 +05:30
Damien George 27e117307d nrf: Remove unnecessary includes of mpconfigport.h and its header guard.
The mpconfigport.h file is an internal header and should only ever be
included once by mpconfig.h.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-09 00:13:34 +10:00
Damien George 75344af4ca nrf/main: Make mp_builtin_open signature match that in py/builtin.h.
Signed-off-by: Damien George <damien@micropython.org>
2020-09-09 00:13:34 +10:00
Albort Xue 5f50568b1f mimxrt/boards: Add MIMXRT1064_EVK board. 2020-09-09 00:06:33 +10:00
Jim Mussared 632e3b7acc stm32/boards/NUCLEO_WB55: Add Python helper code for rfcore.
This allows prototyping rfcore.c improvements from Python.

This was mostly written by @dpgeorge with small modifications to work after
rfcore_init() by @jimmo.
2020-09-08 23:54:02 +10:00
Jim Mussared e2390d5a2f stm32/rfcore: Enable RX IRQ on BLE IPCC channel for better performance.
Before this change there was up to a 128ms delay on incoming payloads from
CPU2 as it was polled by SysTick.  Now the RX IRQ immediately schedules the
PendSV.
2020-09-08 23:53:12 +10:00
Jim Mussared 8b4ebd7166 stm32/rfcore: Refactor some helper funcs, and remove some magic numbers.
Also explain what the payload fixup code is doing.
2020-09-08 23:53:12 +10:00
Jim Mussared 01f2d77614 stm32/rfcore: Fix length matching in HCI parser. 2020-09-08 23:53:12 +10:00
Jim Mussared 0f28020a68 stm32/powerctrlboot: Acquire HSEM5 on STM32WB during SystemClock_Config.
This is required to allow using WS firmware newer than 1.1.1 concurrently
with USB (e.g. USB VCP).  It prevents CPU2 from modifying the CLK48 config
on boot.

Tested on WS=1.8 FUS=1.1.

See AN5289 and https://github.com/micropython/micropython/issues/6316
2020-09-08 23:53:12 +10:00
Jim Mussared 9c9cc7a02f stm32/boards/USBDONGLE_WB55: Add USE_MBOOT support. 2020-09-08 23:53:12 +10:00
Jim Mussared 30e8162ac4 stm32/rfcore: Update rfcore.c to match how ST examples work.
- Split tables and buffers into SRAM2A/2B.
- Use structs rather than word offsets to access tables.
- Use FLASH_IPCCDBA register value rather than option bytes directly.
2020-09-08 23:53:02 +10:00
Jim Mussared b27edb8073 stm32/make-stmconst.py: Add support for WB55 header files. 2020-09-08 23:23:23 +10:00
microDev c68723db3c
Update Processor.c 2020-09-08 15:13:48 +05:30
Jim Mussared 126f972c34 extmod/nimble: Add timeout for HCI sync on startup.
This allows `ble.active(1)` to fail correctly if the HCI controller is
unavailable.

It also avoids an infine loop in the NimBLE event handler where NimBLE
doesn't correctly detect that the HCI controller is unavailable and keeps
trying to reset.

Furthermore, it fixes an issue where GATT service registrations were left
allocated, which led to a bad realloc if the stack was activated multiple
times.
2020-09-08 12:53:24 +10:00
Jim Mussared 311b8519af esp32: Pin MicroPython and NimBLE tasks to core 0.
MicroPython and NimBLE must be on the same core, for synchronisation of the
BLE ringbuf and the MicroPython scheduler.  However, in the current IDF
versions (3.3 and 4.0) there are issues (see e.g. #5489) with running
NimBLE on core 1.

This change - pinning both tasks to core 0 - makes it possible to reliably
run the BLE multitests on esp32 boards.
2020-09-08 12:53:24 +10:00
Jim Mussared 99a29ec705 extmod/btstack: Detect HCI UART init failure. 2020-09-08 12:53:24 +10:00
Andrew Leech 6077c63a45 stm32/mpbthciport: Increase char timeout of BT HCI UART.
The 2ms used previously was not long enough and it could lose HCI sync.

Also print error on tx failure to make this more obvious in the future.
2020-09-08 12:53:24 +10:00
Jim Mussared c4af714d58 extmod/modbluetooth: Implement configuration of address modes.
Changes `BLE.config('mac')` to return a tuple (addr_mode, addr).

Adds `BLE.config(addr_mode=...)` to set the addressing mode.
2020-09-08 12:53:24 +10:00
Jim Mussared 1b1b22905e unix: Implement BLE H4 HCI UART for btstack/nimble.
This commit adds support for using Bluetooth on the unix port via a H4
serial interface (distinct from a USB dongle), with both BTstack and NimBLE
Bluetooth stacks.

Note that MICROPY_PY_BLUETOOTH is now disabled for the coverage variant.
Prior to this commit Bluetooth was anyway not being built on Travis because
libusb was not detected.  But now that bluetooth works in H4 mode it will
be built, and will lead to a large decrease in coverage because Bluetooth
tests cannot be run on Travis.
2020-09-08 12:53:24 +10:00
Jim Mussared feed69aa5c unix/Makefile: Always enable -f*-sections regardless of DEBUG setting. 2020-09-08 12:53:16 +10:00
Jim Mussared f3f31ac959 extmod/nimble: Make nimble_malloc work with allocated size. 2020-09-08 11:41:31 +10:00
Jim Mussared ed14435a8e extmod/modbluetooth: Refactor stack/hci/driver/port bindings.
Previously the interaction between the different layers of the Bluetooth
stack was different on each port and each stack.  This commit defines
common interfaces between them and implements them for cyw43, btstack,
nimble, stm32, unix.
2020-09-08 11:41:31 +10:00
Jim Mussared 5ff265a3db stm32/modbluetooth_hci: Use a static mp_irq_obj_t for BT HCI UART IRQ.
So that the IRQ handler does not need to be traced by the GC.
2020-09-08 10:47:27 +10:00
Jim Mussared 23109988c2 stm32/uart: Allow static IRQ handler registration.
This will allow the HCI UART to use a non-heap mp_irq_obj_t, which avoids
needing to make a root pointer for it.
2020-09-08 10:46:30 +10:00
root 2690faec43 Moved checks for invalid pin to common-hal/microcontroller/Pin.c 2020-09-05 11:42:06 -05:00
root ed6cc64c49 Corrected issue with BLE not working on nrf52840 2020-09-04 16:59:41 -05:00
Dan Halbert 42df254683
Merge pull request #3373 from dhalbert/trellis-m4-board-i2c
fix pins for trellis_m4 board.I2C()
2020-09-04 11:15:18 -04:00
Damien George 3ff7079277 lib/utils/mpirq: Add mp_irq_init func, and clean up unused init method.
mp_irq_init() is useful when the IRQ object is allocated by the caller.

The mp_irq_methods_t.init method is not used anywhere so has been removed.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-04 12:40:38 +10:00
Damien George 5e69926ea0 stm32/mpconfigport.h: Enable MICROPY_PY_REVERSE_SPECIAL_METHODS.
It's a useful core feature.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-04 10:45:39 +10:00
Scott Shawcroft 96cf60fbbd
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-09-03 16:34:56 -07:00
Scott Shawcroft 0b94638aeb
Changes based on Dan's feedback 2020-09-03 16:32:12 -07:00
Dan Halbert 960888a3bd fix pins for trellis_m4 board.I2C() 2020-09-03 14:22:18 -04:00
Scott Shawcroft 786f4ed114
Merge pull request #3344 from jepler/issue-3184
Fix RGBMatrix, FrameBufferDisplay bugs
2020-09-02 15:32:30 -07:00
Lucian Copeland 4733a67226 Add GDB debugging capability 2020-09-02 11:27:42 -04:00
Scott Shawcroft f0e60da51f
Merge pull request #3310 from dhalbert/ble_hci
_bleio HCI implementation
2020-09-01 11:28:05 -07:00
Jeff Epler 952d9bbb4a samd: Ignore a maybe-uninitialized diagnostic in asf4
I encountered this when changing optimization flags for debugging
purposes.  The diagnostic appears spurious and unrelated to what
I'm debugging.
2020-09-01 10:55:45 -05:00
Jeff Epler ad4bf75367 samd: only set NDEBUG for non-debug builds 2020-09-01 10:55:45 -05:00
Damien George a909c21587 unix/fatfs_port: Fix month offset in timestamp calculation.
Signed-off-by: Damien George <damien@micropython.org>
2020-09-02 00:19:06 +10:00
Dan Halbert 4ac7650f22 matrix portal board 2020-08-31 23:56:38 -04:00
Damien George 2a72e90ab8 extmod/vfs: Add option to use 1970 as Epoch.
By setting MICROPY_EPOCH_IS_1970 a port can opt to use 1970/1/1 as the
Epoch for timestamps returned by stat().  And this setting is enabled on
the unix and windows ports because that's what they use.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-01 12:36:28 +10:00
Damien George 0385b21597 unix/modos: Support larger integer range in uos.stat fields.
On 32-bit builds these stat fields will overflow a small-int, so use
mp_obj_new_int_from_uint to construct the int object.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-01 12:36:28 +10:00
Dan Halbert 6dbd369272 merge from upstream 2020-08-30 14:39:03 -04:00
Damien George 40153b800a esp32/mphalport: Fix mp_hal_time_ns offset.
gettimeofday returns seconds since 2000/1/1 so needs to be adjusted to
seconds since 1970/1/1 to give the correct return value of mp_hal_time_ns.

Signed-off-by: Damien George <damien@micropython.org>
2020-08-31 00:49:58 +10:00
Damien George 836bca9956 unix/variants: Fix fast and freedos variants so they build again.
This regressed in bd2fff6687

Signed-off-by: Damien George <damien@micropython.org>
2020-08-30 13:48:26 +10:00
Limor "Ladyada" Fried 0adccc50dc
Merge pull request #3346 from tannewt/add_kaluga
Add Kaluga board definition
2020-08-29 21:05:20 -04:00
Damien George 06659077a8 all: Update Python code to conform to latest black formatting.
Updating to Black v20.8b1 there are two changes that affect the code in
this repository:

- If there is a trailing comma in a list (eg [], () or function call) then
  that list is now written out with one line per element.  So remove such
  trailing commas where the list should stay on one line.

- Spaces at the start of """ doc strings are removed.

Signed-off-by: Damien George <damien@micropython.org>
2020-08-29 15:18:01 +10:00
Damien George 40d174ac7d stm32/powerctrl.h: Include stdbool.h to get definition of bool.
Signed-off-by: Damien George <damien@micropython.org>
2020-08-29 14:00:24 +10:00
Scott Shawcroft 7b59ede25e
Add remaining pins 2020-08-28 18:22:22 -07:00
Scott Shawcroft 0bb5c6c07f
Add unique USB PID 2020-08-28 16:37:25 -07:00
lady ada 81870413af add default I2C 2020-08-28 19:08:36 -04:00
Scott Shawcroft a09243472c
Add Kaluga board definition 2020-08-28 16:08:24 -07:00
Dan Halbert 893a125dd0
Merge pull request #3338 from jepler/endpoint-count-checking-stm32f405
add endpoint count checking on stm32f405
2020-08-28 11:12:31 -04:00
Dan Halbert ac06202c21
Merge pull request #3238 from ElectronicCats/bastwifi
Add Bastwifi by Electronic Cats
2020-08-28 11:03:52 -04:00
Damien George a93a378e93 zephyr/README: Update required Zephyr version and mention new features.
Signed-off-by: Damien George <damien@micropython.org>
2020-08-28 16:42:32 +10:00
Scott Shawcroft 5d8ac0428b
-Os espruino_pico to save space 2020-08-27 13:34:37 -07:00
Jeff Epler 563e038c0d stm: Specify max endpoints for stm32f405xx
.. which is why we can't have HID or MIDI on the stm32f405 feather
2020-08-27 15:11:17 -05:00
Scott Shawcroft 2b71635c49
Fix esp-idf requirements 2020-08-27 11:45:51 -07:00
Scott Shawcroft fd6e63d806
Hopefully final partition scheme. 2020-08-27 11:43:06 -07:00
Scott Shawcroft 767ca5c3dc
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-08-27 11:42:31 -07:00
Jeff Epler 49a22b0c55
Merge pull request #3320 from hierophect/stm32-meowbit-fix
STM32: Fix Meowbit startup and associated bugs
2020-08-27 13:05:56 -05:00
Dan Halbert 24fb08dbd9
Merge pull request #3337 from hierophect/pulseout-errorstyle
Fix problematic whitespace on pulseout parameter errors
2020-08-27 13:22:26 -04:00
Dan Halbert 350e88d4b9
Merge pull request #3324 from hierophect/esp32-random
Add random to ESP32-S2, fix it on STM32
2020-08-27 13:22:05 -04:00
Dan Halbert 6100027243
Merge pull request #3315 from tannewt/add_psram
Add PSRAM support to ESP32S2
2020-08-27 11:58:59 -04:00
Lucian Copeland 8021da08d3 Fix problematic whitespace on pulseout parameter errors 2020-08-27 11:07:47 -04:00
hierophect 772052598d
Merge branch 'main' into stm32-meowbit-fix 2020-08-27 11:00:29 -04:00
hierophect a15f948a40
Merge branch 'main' into esp32-random 2020-08-27 10:49:14 -04:00
Dan Halbert fe73cfb922
Merge pull request #3333 from hierophect/esp32-enable-ulab
Fix all assignments affected by inline makefile comments
2020-08-27 10:36:59 -04:00
Lucian Copeland 8d2299e61e Merge remote-tracking branch 'upstream/main' into stm32-meowbit-fix 2020-08-26 18:50:26 -04:00
Lucian Copeland c229345741 improve efficiency of stm32 random gen 2020-08-26 18:47:19 -04:00
Lucian Copeland 553ac576eb Disable ulab 2020-08-26 17:48:29 -04:00
Roberto Colistete Jr 91c5d168c0 nrf/Makefile: Improve user C modules support.
Add CFLAGS_EXTRA to CFLAGS. Include LDFLAGS_MOD to the compilation.
And, add SRC_MOD to SRC_QSTR.
2020-08-26 22:14:40 +02:00
Lucian Copeland c77523503b Fix trailing whitespace errors across ports and docs 2020-08-26 14:48:46 -04:00
Jeff Epler 44342732a4 Fix DOS line endings, they give my git fits 2020-08-26 10:56:00 -05:00
Dan Halbert 5755160720
Merge pull request #3322 from microDev1/microS2
Added board - microS2
2020-08-26 11:03:46 -04:00
microDev f26d15c5c9
Added PSRAM support 2020-08-26 18:39:30 +05:30
Dan Halbert 01ddb177fc Remove whitespace in sdkconfig 2020-08-26 09:07:54 -04:00
Dan Halbert f7d224705f
Trim trailing whitespace in pins.c 2020-08-26 09:01:27 -04:00
microDev 0425305a73
Change microS2 board name 2020-08-26 08:40:46 +05:30
microDev b019ef2e43
Change microS2 board name 2020-08-26 08:38:42 +05:30
microDev f1f316c502
Change microS2 board name 2020-08-26 08:37:36 +05:30
microDev 3f699024d9
Change microS2 board name 2020-08-26 08:36:38 +05:30
microDev 1dce6bd7ca
Change microS2 board name 2020-08-26 08:35:09 +05:30
microDev bf2b594066
Change microS2 board name 2020-08-26 08:33:21 +05:30
Scott Shawcroft 8b71e26abd
Merge remote-tracking branch 'adafruit/main' into native_wifi 2020-08-25 16:39:23 -07:00
Scott Shawcroft 380cbfba55
Add hash to Socket so it can be used in dicts 2020-08-25 16:15:45 -07:00
Scott Shawcroft 69fc872944
Fix espidf.MemoryError print 2020-08-25 16:14:31 -07:00
Lucian Copeland f71f6631cc Enable ulab 2020-08-25 14:24:35 -04:00
Lucian Copeland 05bde255f7 Add random to ESP32-S2, fix it on STM32 2020-08-25 14:00:29 -04:00
microDev 89c6a44e4e
Added microS2 specific config files 2020-08-25 20:35:08 +05:30
microDev 645adaadb0
Added microS2 specific config files 2020-08-25 20:32:44 +05:30
Lucian Copeland de9fd4a0fb Fix null dereference, invert auto_brightness to reenable screen 2020-08-25 10:37:55 -04:00
Scott Shawcroft 0cc438e6b9
Fix pycubed pwm use 2020-08-24 18:29:34 -07:00
Scott Shawcroft 1527a3ce92
Merge remote-tracking branch 'adafruit/main' into add_pwmio 2020-08-24 18:25:18 -07:00
Lucian Copeland c137a16121 Remove Meowbit LSE flag, harsher failure for LSE issues 2020-08-24 14:49:06 -04:00
microDev 3eea3b5311
Added microS2 specific config files 2020-08-24 11:12:35 +05:30
Damien George ee50a6effe py/mphal.h: Introduce mp_hal_time_ns and implement on various ports.
This should return a 64-bit value being the number of nanoseconds since
1970/1/1.

Signed-off-by: Damien George <damien@micropython.org>
2020-08-22 16:13:44 +10:00
Damien George 92899354d9 unix/fatfs_port: Implement get_fattime.
Signed-off-by: Damien George <damien@micropython.org>
2020-08-22 14:45:57 +10:00
root fe0f79adce Making requested modifications 2020-08-21 20:38:19 -05:00
Scott Shawcroft f39708abb2
Add PSRAM support to ESP32S2
When configured the CircuitPython heap will be on the external RAM.
When not available, the heap will be 48k inside the IDF heap.
2020-08-21 16:20:58 -07:00
Scott Shawcroft da61845f56
Add missing include 2020-08-21 13:32:59 -07:00
Scott Shawcroft 644d2ba7a2 Add more "extern" declarations for gcc10 compat
gcc has tightened the restrictions on forward declarations that lack
"extern".  Fix them up.
2020-08-21 14:39:37 -05:00
Scott Shawcroft 83deea0e03
Fix copy pasta and stub build 2020-08-21 11:17:42 -07:00
Scott Shawcroft a5b01f7361
Merge remote-tracking branch 'adafruit/main' into add_pwmio 2020-08-21 11:13:53 -07:00
Scott Shawcroft 701e80a025
Make socket reads interruptable 2020-08-21 11:00:02 -07:00
Dan Halbert 58573a70e1 bring submodules up to date 2020-08-21 11:10:33 -04:00
Dan Halbert f714f53552 Merge remote-tracking branch 'adafruit/main' into ble_hci 2020-08-21 10:45:05 -04:00
Dave Hylands 8727c4e2ec stm32/pin_defs_stm32: Fix pin printing to show IN mode correctly.
Prior to this commit, if you configure a pin as an output type (I2C in this
example) and then later configure it back as an input, then it will report
the type incorrectly.  Example:

    >>> import machine
    >>> b6 = machine.Pin('B6')
    >>> b6
    Pin(Pin.cpu.B6, mode=Pin.IN)
    >>> machine.I2C(1)
    I2C(1, scl=B6, sda=B7, freq=420000)
    >>> b6
    Pin(Pin.cpu.B6, mode=Pin.ALT_OPEN_DRAIN, pull=Pin.PULL_UP, af=Pin.AF4_I2C1)
    >>> b6.init(machine.Pin.IN)
    >>> b6
    Pin(Pin.cpu.B6, mode=Pin.ALT_OPEN_DRAIN, af=Pin.AF4_I2C1)

With this commit the last print now works:

    >>> b6
    Pin(Pin.cpu.B6, mode=Pin.IN)
2020-08-21 13:42:47 +10:00
Maureen Helm ac94e06f0b zephyr: Include storage/flash_map.h unconditionally.
Include storage/flash_map.h unconditionally so we always have access to the
FLASH_AREA_LABEL_EXISTS macro, even if CONFIG_FLASH_MAP is not defined.

This fixes a build error for the qemu_x86 board:

main.c:108:63: error: missing binary operator before token "("
  108 |     #elif defined(CONFIG_FLASH_MAP) && FLASH_AREA_LABEL_EXISTS(storage)
      |                                                               ^
../../py/mkrules.mk:88: recipe for target 'build/genhdr/qstr.i.last' failed

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-08-21 11:23:43 +10:00
Dan Halbert 0e30dd8bcc merge from upstream; working; includes debug_out code for debugging via Saleae for posterity 2020-08-20 20:29:57 -04:00
Jeff Epler ba2db853a4
Merge pull request #3308 from bwshockley/update_Mini_sam_m4_memory
Update mini sam m4 memory
2020-08-20 19:05:39 -05:00
root 6eae7ce78f Requested changes to pulsein 2020-08-20 16:57:00 -05:00
Benjamin Shockley 135626a038
Update mpconfigboard.mk
Added support for second type of memory chip.
2020-08-20 13:50:52 -05:00
Scott Shawcroft 400701004b
Merge pull request #3279 from hierophect/esp32-pulseinout
ESP32-S2: Add PulseOut and PulseIn
2020-08-20 11:24:08 -07:00
Scott Shawcroft e47447ba59
Merge pull request #3306 from kamtom480/usb_fix
spresense: call usb_background function
2020-08-20 11:23:16 -07:00
Scott Shawcroft 31a3d0e815
Merge pull request #3304 from jepler/count-usb-descriptors
Add usb-endpoint-count checking
2020-08-20 11:21:01 -07:00
Scott Shawcroft a86d6aeac4
Merge pull request #3303 from jepler/samd-tinyusb-family
SAM E54: Use correct CFG_TUSB_MCU
2020-08-20 11:13:05 -07:00
Kamil Tomaszewski e2891bc7d4 spresense: call usb_background function 2020-08-20 16:21:25 +02:00
Scott Shawcroft 80b15f6b3b
Add error handling w/temp debug logs 2020-08-19 17:51:33 -07:00
Jeff Epler 23aefe9509 Add usb-endpoint-count checking
.. however, the number of endpoints is only set for SAMD (8).
Other ports need to set the value.  Otherwise, the build will show
the message
```
Unable to check whether maximum number of endpoints is respected
```
2020-08-19 16:47:40 -05:00
Scott Shawcroft eb8b42aff1
Add basic error handling 2020-08-19 14:23:28 -07:00
Scott Shawcroft 9602ee6265
Disable wifi debug logging and memory log 2020-08-19 14:23:28 -07:00
Scott Shawcroft dcc42f6281
Remove debug prints 2020-08-19 14:23:28 -07:00
Scott Shawcroft 1034cc1217
Add espidf module. 2020-08-19 14:23:28 -07:00
Scott Shawcroft b3a449c276
Turn on json and enable socket.close 2020-08-19 14:23:28 -07:00
Scott Shawcroft 430530c74b
SSL works until it runs out of memory 2020-08-19 14:23:28 -07:00
Scott Shawcroft eb2c38825e
HTTP works with my adafruit_requests 2020-08-19 14:23:18 -07:00
Scott Shawcroft c9ece21c28
SocketPool stubbed out 2020-08-19 14:22:13 -07:00
Scott Shawcroft 7bdd243bf6
Ping works! 2020-08-19 14:22:13 -07:00
Scott Shawcroft 3860991111
Ping work and start to add socketpool 2020-08-19 14:22:13 -07:00
Scott Shawcroft cdab5e793e
Update to latest idf 2020-08-19 14:22:13 -07:00
Scott Shawcroft c62ab6e09a
Add ipaddress 2020-08-19 14:22:12 -07:00
Scott Shawcroft ddcff85fa2
Add debugging. Scanning doesn't crash but returns no results. Need to config station. 2020-08-19 14:22:12 -07:00
Scott Shawcroft 1a6f4e0fe0
Scanning WIP. Need to sort out supervisor memory 2020-08-19 14:22:12 -07:00
Scott Shawcroft c5b8401a15
First crack at native wifi API 2020-08-19 14:21:59 -07:00
Jeff Epler 6ae5bedf3b SAM E54: Use correct CFG_TUSB_MCU
This doesn't actually change the code that is built, but it is
"more correct".
2020-08-19 11:27:52 -05:00
Scott Shawcroft 6857f98426
Split pulseio.PWMOut into pwmio
This gives us better granularity when implementing new ports because
PWMOut is commonly implemented before PulseIn and PulseOut.

Fixes #3211
2020-08-18 13:08:33 -07:00
Scott Shawcroft 8e77981ad5
Merge pull request #3297 from simmel-project/i2c
Update Simmel board definition to reflect DVT hardware
2020-08-18 12:55:45 -07:00
Lucian Copeland dd425ee6c5 Remove breaking parenthesis 2020-08-18 15:54:50 -04:00
Scott Shawcroft 24ca5c0218
Merge pull request #3295 from tannewt/turn_off_terminalio
Turn off terminalio for ja and ko
2020-08-18 12:10:31 -07:00
Scott Shawcroft 771388cde2
Remove trailing space. 2020-08-18 11:44:31 -07:00
Lucian Copeland da75445cd5 Style changes, reposition runtime errors 2020-08-18 11:42:06 -04:00
bunnie 211c134950 add I2C, remove unused pins 2020-08-18 19:02:23 +08:00
bunnie a4508f846d stash config 2020-08-18 18:16:49 +08:00
Scott Shawcroft d01f5dc0bd
Turn off terminalio for ja and ko
The font is missing many characters and the build needs the space.
We can optimize font storage when we get a good font.

The serial output will work as usual.
2020-08-17 17:17:59 -07:00
Dan Halbert 94ecf33a5c
Merge pull request #3281 from dhalbert/fix-spim3-buffer-location
SPIM3 buffer must be in first 64kB of RAM
2020-08-17 19:28:03 -04:00
Scott Shawcroft 19706a7eec
Merge pull request #3280 from hierophect/esp32-wroom-neopixel
ESP32-S2: Add Neopixel to Wroom
2020-08-17 15:07:19 -07:00
Scott Shawcroft 377503e61c
Merge pull request #3284 from dhalbert/fix-3171-evt-handler
Remove event handler before setting it to NULL
2020-08-17 15:02:29 -07:00
Brent Rubell b1a8fb83fa
Merge pull request #3251 from jerryneedell/jerryn_rfm9x
RFM9x -- freeze library into build
2020-08-17 17:11:35 -04:00
Dan Halbert 6e5c2b3fe2
Merge pull request #3260 from rhooper/pixelbuf-iterable
Make pixelbuf support iterables and floats
2020-08-17 11:56:31 -04:00
Dan Halbert 16ff7b167c
bdmicro_vina_m0: inline limit 60 -> 50
The ja translation was not fitting.
2020-08-17 10:05:25 -04:00
Dan Halbert ef40f83f99 Remove event handler before setting it to NULL 2020-08-15 14:39:53 -04:00
Dan Halbert cf0f3d70b5 SPIM3 buffer must be in first 64kB of RAM 2020-08-15 10:31:56 -04:00
Lucian Copeland 7078c63062 Add missing Neopixel pin definition 2020-08-14 16:58:24 -04:00
Lucian Copeland 0fc730bc5a Expand PulseOut API, debug cleanup 2020-08-14 16:36:02 -04:00
Lucian Copeland 88fcc19e24 Add PulseIn 2020-08-14 15:30:48 -04:00
Lucian Copeland f9512983ff Add PulseOut 2020-08-14 12:21:41 -04:00
Dan Halbert 98469322b7
Merge pull request #3276 from xiongyihui/main
support to change ble mac address
2020-08-14 11:14:36 -04:00
Yihui Xiong 52990a332d fix 2020-08-14 17:48:15 +08:00
Dan Halbert a28d0f6c80
Merge pull request #3273 from jepler/ja-firmware-size
Squeeze firmwares to fit the new ja translation
2020-08-13 12:19:28 -04:00
Dan Halbert 329f4fb2e6
Update mpconfigboard.mk
The stm boards default to `-O2`. Changing to `-Os` brings it back to ~43kB (!) free even for ja.
2020-08-13 10:09:46 -04:00
Jeff Epler 42b860e91a stm: meowbit_v121: remove _pixelbuf to fit ja translation 2020-08-13 07:49:45 -05:00
Yihui Xiong e7da652711 able to change ble mac address 2020-08-13 16:54:29 +08:00
Dan Halbert 44c9c43cd1 ble_uart_echo_test works 2020-08-13 00:03:39 -04:00
Jeff Epler 239c8ff87f metro_m0_express: put back audiobusio
this now fits locally (though it's very close to capacity);
let's see what the CI says.

```
make BOARD=metro_m0_express clean && make BOARD=metro_m0_express  TRANSLATION=ja
...
253448 bytes used, 248 bytes free in flash firmware space out of 253696 bytes (247.75kB).
```
2020-08-12 19:11:33 -05:00
Scott Shawcroft 7ffa2a103c
Merge pull request #3269 from jepler/sharpdisplay-v2
Sharp Memory Display displayio support (v2)
2020-08-12 16:53:09 -07:00
Jeff Epler aa0b4f7045 cpx_display: Put back AUDIOBUSIO, take away ROTARYIO
AUDIOBUSIO is needed for the on-board mic using PDMIn
2020-08-12 16:17:48 -05:00
Jeff Epler ea8e9b8cef metro_m0_express: Put back GAMEPAD, take away AUDIOBUSIO
Dan notes that this is more frequently the solution we've chosen
2020-08-12 16:17:13 -05:00
Jeff Epler 299894025a stringcar_m0_express: make ja translation fit 2020-08-12 13:47:10 -05:00
Jeff Epler f08ee0db20 itsybitsy_m0_express: make ja translation fit again 2020-08-12 13:44:00 -05:00
Jeff Epler 7bd42244c9 snekboard: make ja translation fit 2020-08-12 13:34:36 -05:00
Jeff Epler 45f6bc1f3e serpente: make ja translation fit 2020-08-12 13:32:08 -05:00
Jeff Epler 36bfbaae69 feather_radiofruit_zigbee: make ja translation fit 2020-08-12 13:28:30 -05:00
Jeff Epler 58a1361d3e Merge remote-tracking branch 'origin/main' into ja-firmware-size 2020-08-12 13:26:12 -05:00
Jeff Epler 06f6cd067d nrf: Improve commenting about disabled warnings 2020-08-12 12:59:48 -05:00
Jeff Epler 813dcd1b73 trinket_m0_haxpress: make ja translation fit 2020-08-12 12:44:17 -05:00
Jeff Epler 88f222f1a1 metro_m0_express: make ja translation fit 2020-08-12 12:38:17 -05:00
Jeff Epler ba91023fff itsybitsy_m0_express: make ja translation fit 2020-08-12 12:35:29 -05:00
Jeff Epler 6b9f7c9047 hallowing_m0_express: make ja translation fit 2020-08-12 12:29:30 -05:00
Jeff Epler 58afda342d feather_m0_supersized: make ja translation fit 2020-08-12 11:53:34 -05:00
Jeff Epler 27c2eb1869 feather_m0_express: make ja translation fit 2020-08-12 11:51:56 -05:00
Jeff Epler 8865e4ca97 circuitplayground_express_displayio: make ja translation fit 2020-08-12 11:46:52 -05:00
Jeff Epler f3748fe20d circuitbrains_basic_m0: Use optimization flags to let ja translation fit 2020-08-12 11:46:31 -05:00
Jeff Epler f9d1d9d114 atmel-samd: disable FRAMEBUFFERIO on samd21
.. this disables SHARPMEMORY as well.
2020-08-12 11:15:34 -05:00
Jeff Epler 454e616d13 atmel-samd: disable FRAMEBUFFERIO on samd21
.. this disables SHARPMEMORY as well.
2020-08-12 10:46:56 -05:00
Scott Shawcroft 3197c579e0
Merge pull request #3262 from tannewt/fix_fs_corruption
Fix writing sector 0 as the first write.
2020-08-12 08:14:55 -07:00
Jeff Epler 32fc8b0676 nrf: reset_pin_number: reset pin clears never-reset, mirroring samd 2020-08-12 07:32:18 -05:00
Jeff Epler 760a171903 nrf: Make port build with -Werror=undef
.. build-tested on particle_xenon
2020-08-12 07:32:18 -05:00
bleeptrack 49407b6c06 trailing spaces fix 2020-08-12 13:42:45 +02:00
bleeptrack e34fac6645
Whitespace and Newline fix 2020-08-11 23:59:32 +02:00
Dan Halbert 06f3b4048a fix #3228 for nrf; still needs to be fixed for HCI; tested 2020-08-11 16:21:16 -04:00
bleeptrack 228d9b5a12
Fixing indentation 2020-08-11 22:18:15 +02:00
bleeptrack 22ae1dbac8
Removing unnecessary pin ignored 2020-08-11 22:17:17 +02:00
bleeptrack 00676ff5a9
PicoPlanet 2020-08-11 21:49:52 +02:00
Scott Shawcroft 8488b31aa0
Init directly 2020-08-11 11:19:40 -07:00
Scott Shawcroft bbac68e77c
Merge pull request #3232 from hierophect/esp32-neopixel
ESP32-S2: Add Neopixel support
2020-08-11 11:04:39 -07:00
Scott Shawcroft 87c78be8f4
Fix writing sector 0 as the first write.
This was the FS issue I saw when debugging wifi and only happens
when the first write is to sector 0. It causes issues because it
blanks all of sector 0 after the first block.

Fixes #3133
2020-08-10 17:14:49 -07:00
Jeff Epler 807f049dc3
Merge pull request #3244 from xiongyihui/main
add an option to turn off QSPI when sleep
2020-08-10 16:06:57 -05:00
Jeff Epler 1cf3762392 Merge remote-tracking branch 'origin/main' into stm32-sdioio 2020-08-10 12:54:12 -05:00
Lucian Copeland d47bd5529c Fix neopixel macro issue, set default neopixel color 2020-08-10 13:16:20 -04:00
Dan Halbert 0f4b969d62 discovery of Nordic UART service working 2020-08-08 00:29:37 -04:00
Jerry Needell 1d980d527e Merge remote-tracking branch 'upstream/main' into jerryn_rfm9x 2020-08-07 12:48:41 -04:00
Yihui Xiong af1291ec28 dynamically enable or disable QSPI by default 2020-08-07 16:23:42 +08:00
Jerry Needell f7961b96a9 update comment 2020-08-06 10:05:18 -04:00
Jerry Needell c42ffb8f3d remove usb_hid 2020-08-06 05:44:26 -04:00
Yihui Xiong d8257380d7 add qspi_disable() 2020-08-06 09:56:05 +08:00
Lucian Copeland 78d049d0f1 Fix pwm reset spew, protect against null reference in led status 2020-08-05 14:05:53 -04:00
Jerry Needell 432f43a472 freeze rfm9x and BusDevice, remove many built-in modules 2020-08-05 11:37:57 -04:00
root c7b6e66426 Fixes for pulsein tick handling 2020-08-05 10:03:20 -05:00
Yihui Xiong 7854625c4e avoid using the RGB LEDs to save energy 2020-08-05 16:08:13 +08:00
Yihui Xiong dbe47a6a2a adjust 2020-08-05 16:07:18 +08:00
Jeff Epler 93b373d617 "pop from empty %q"
Saves 12 bytes code on trinket m0
2020-08-04 18:42:09 -05:00
Lucian Copeland 14b3b51c58 Rework build flags, prevent idf errors 2020-08-04 18:40:24 -04:00
Dan Halbert ac95106b88 service discovery works; need to work on char and descriptor discovery 2020-08-04 18:24:37 -04:00
Jeff Epler c849b781c0 Combine 'index out of range' messages 2020-08-04 14:45:45 -05:00
Jeff Epler 89797fd3f9 various: Use mp_obj_get_type_qstr more widely
This removes runtime allocations of the cstring version of the qstring.

It is not a size improvement
2020-08-04 14:45:45 -05:00
Jeff Epler dddd25a776 Combine similar strings to reduce size of translations
This is a slight trade-off with code size, in places where a "_varg"
mp_raise variant is now used.  The net savings on trinket_m0 is
just 32 bytes.

It also means that the translation will include the original English
text, and cannot be translated.  These are usually names of Python
types such as int, set, or dict or special values such as "inf" or
"Nan".
2020-08-04 13:34:29 -05:00
Yihui Xiong 6dc0f4f1b6 add an option to turn off QSPI when sleep 2020-08-05 01:10:58 +08:00
Jeff Epler 0e2d231445 Merge remote-tracking branch 'origin/main' into stm32-sdioio 2020-08-03 21:01:53 -05:00
Dan Halbert a995a5c58f wip: partial discovery responses; compiles; not tested 2020-08-03 21:02:57 -04:00
DavePutz d7eedc5e38
Merge pull request #20 from adafruit/main
Update from main
2020-08-03 13:14:01 -05:00
root 9203a77804 Turn off interrupts while in handler 2020-08-03 11:31:12 -05:00
Lucian Copeland 4900668778 Merge remote-tracking branch 'upstream/main' into esp32-neopixel 2020-08-03 12:26:37 -04:00
sabas1080 0e30fe1cc5 Update VID & PID codes 2020-08-02 19:54:11 -05:00
Dan Halbert 0a60aee3e4 wip: compiles 2020-08-02 11:36:38 -04:00
sabas1080 b074f8a161 update for build test 2020-08-02 00:42:36 -05:00
sabas1080 fea1cad02c add support for Bast Wifi Electronic Cats 2020-08-01 17:51:45 -05:00
root 12b81618a3 Changes for getting supervisor ticks 2020-08-01 13:27:02 -05:00
Dan Halbert 1771858f4a add RELEASE_NEEDS_CLEAN_BUILD for lang-specific CFLAGS_INLINE_LIMIT changes 2020-08-01 13:20:46 -04:00
Dan Halbert 4b71831d8b
SUPEROPT_VM = 0 for de_DE 2020-08-01 12:36:20 -04:00
Lucian Copeland 94b2561860 Fix include error 2020-08-01 09:22:18 -04:00
Lucian Copeland 1c1df053d5 Add neopixel support 2020-07-31 15:34:12 -04:00
Jeff Epler 27c6ffb9a2 atmel-samd: gemma, trinket: Make space for de_DE translation 2020-07-30 11:29:47 -05:00
Jeff Epler d69f081c04 Merge remote-tracking branch 'origin/main' into blm_badge 2020-07-30 07:24:48 -05:00
Jeff Epler 531c1e046c
Merge pull request #3226 from joeycastillo/main
Small updates to Open Book board
2020-07-30 07:21:50 -05:00
Jeff Epler f175a49444 stm: sdioio: include header for common_hal_mcu_pin_claim 2020-07-30 07:18:12 -05:00
Jeff Epler b57e6e9856 stm: sdioio: call common_hal_mcu_pin_claim 2020-07-30 07:18:12 -05:00
Jeff Epler d73505a027 stm: fix if-guard of conditional code 2020-07-30 07:18:12 -05:00
Jeff Epler 60dd5a8d7d stm: sdioio: remove unused code related to "SD Card detect pin"
.. this probably came from the examples that I studied at the beginning
of implementation.

The card detection feature is unused.  As a "detect pin" is not
sent from the shared-bindings, there is no way to get the correct pin
anyway.  Instead, if code needs to detect the insertion state it can
directly use the pin as GPIO in Python code.
2020-07-30 07:18:02 -05:00
Jeff Epler ccd3013396 stm: stioio: correctly claim pins 2020-07-30 07:18:02 -05:00
Jeff Epler 3cf1258c87 stm: sdioio: Get rid of debug code and useless comments 2020-07-30 07:18:02 -05:00
Jeff Epler 6a99a7b551 stm: Use 'Invalid %q pin selection' more places 2020-07-30 07:18:02 -05:00
Jeff Epler 92d2f47503 feather_stm32f405_express: sdio_data_tuple should be static 2020-07-30 07:18:02 -05:00
Jeff Epler 4adbd23b75 stm: Add sdioio support for feather_stm32f405_express
Currently, only the bus specs of the stm32f405xx have been coded.
Other stm-family chips need (at a minimum) the specs added in their
periph.[ch] files.
2020-07-30 07:18:02 -05:00
Jeff Epler d30f11163c stm: enable SD module in HAL 2020-07-30 07:18:02 -05:00
Jeff Epler af135a7560 atmel-samd: move samd-specific script 2020-07-30 07:18:02 -05:00
Joey Castillo 8acec2ca35 add descriptive pin names 2020-07-29 13:49:08 -04:00
Joey Castillo ea9bc9b4b6 set screen orientation to portrait 2020-07-29 13:46:10 -04:00
hathach b2ec77e554 Merge remote-tracking branch 'adafruit/main' into improve-highspeed-usb 2020-07-29 23:14:52 +07:00
hathach b6724e843c
update CDC/MIDI bufsize to at least 512 for highspeed port 2020-07-29 16:22:27 +07:00
hathach 6063828279 replace USB_MSC_MAX_PACKET_SIZE with USB_HIGHSPEED in descriptor gen tool 2020-07-29 15:38:55 +07:00
Dan Halbert ca9eae8eea
Merge pull request #3209 from pewpew-game/fluff-m0-pins
fluff_m0: add pin aliases
2020-07-28 15:15:15 -04:00
Dan Halbert 824a57c6f4
Merge pull request #3218 from tannewt/use_gcc10_peripherals
Use samd peripherals fixed for gcc 10
2020-07-28 15:14:20 -04:00
Scott Shawcroft b30d89131b
Merge pull request #3215 from ansonhe97/main
Added display QSTR to Wio Terminal
2020-07-28 11:53:17 -07:00
Dan Halbert aa97ea2501 Merge remote-tracking branch 'adafruit/main' into blm_badge 2020-07-28 14:15:02 -04:00
Scott Shawcroft 92216d6417
Use samd peripherals fixed for gcc 10 2020-07-28 11:14:25 -07:00
Dan Halbert e5e132a364 add blm_badge; add CIRCUITPY_AUDIOBUSIOIO_I2SOUT 2020-07-28 11:49:54 -04:00
ansonhe97 e15bcebb6e Added display QSTR to Wio Terminal 2020-07-28 17:31:17 +08:00
sabas1080 d37326326d init bastwifi 2020-07-28 00:56:37 -05:00
Jerry Needell 945736e9bb add adjustments for crickit and displayio variants of CPX 2020-07-27 22:13:04 -04:00
Jerry Needell 2bdd62220e adjust stack for SAMD21 to accomodate larger pystack -- update frozen module adafruit_busdevice 2020-07-27 21:50:36 -04:00
Scott Shawcroft debbf1028a
Merge pull request #3196 from IkigaiSense/ikigaisense_vita
add-ikigaisense_vita-nRF52840
2020-07-27 16:10:57 -07:00
Scott Shawcroft f4f2018952
Merge pull request #3101 from ndGarage/ndgarage_ndbit6_v2
ndgGarage ndbit6 v2
2020-07-27 15:51:23 -07:00
Scott Shawcroft 7be9837f73
Merge pull request #3193 from ciscorn/type-annotations
More type hints
2020-07-27 14:26:54 -07:00
Taku Fukada d356581651 Fix several type hints 2020-07-27 18:05:13 +09:00
Radomir Dopieralski b2c4b0bcfa fluff_m0: don't exclude portb pins explicitly 2020-07-26 17:26:32 +02:00
Radomir Dopieralski b1b253c012 fluff_m0: add pin aliases
Add aliases for SDI, SDO and EN, so that pin names match the text on the
PCB to avoid confusion.

Also disable all pins from port B, because that package of SAMD21
doesn't have port B.
2020-07-26 13:39:42 +02:00
Dan Halbert 7ab5c520e6
Merge pull request #3190 from DavePutz/opt-test
Changes to allow different compiler optimizations per board
2020-07-25 17:03:10 -04:00
Dan Halbert b7e6bf959e
Merge pull request #3205 from burtyb/commander-2
Add GamePad to Commander board
2020-07-25 16:57:58 -04:00
Chris Burton c4a5297ee2 Add GamePad to Commander 2020-07-25 17:53:27 +00:00
ikigaisense 6696915801 fix-ndbit6-for-ndbit6_v2 2020-07-25 10:07:33 -06:00
root c4817968ee Merge branch 'opt-test' of https://github.com/DavePutz/circuitpython into opt-test 2020-07-24 23:28:41 -05:00
DavePutz 3dfed3c4aa
Merge pull request #15 from adafruit/main
update from main
2020-07-24 20:29:53 -05:00
root 739981b34e update for pewpew 2020-07-24 17:27:25 -05:00
DavePutz a14101cd13
Use current mpconfigboard.mk with optimization change 2020-07-24 14:09:09 -05:00
Lucian Copeland 356b1a8d6d Finish common-hal pin API 2020-07-24 12:29:18 -04:00
hierophect c735dceed5
Merge pull request #3099 from hierophect/stm32-timer-allocator
STM32: Add timer allocator, PulseIO adjustments
2020-07-24 11:16:39 -04:00
Damien George fd2ff867a0 stm32/usbdev: Fix calculation of SCSI LUN size with multiple LUNs.
The SCSI driver calls GetCapacity to get the block size and number of
blocks of the underlying block-device/LUN.  It caches these values and uses
them later on to verify that reads/writes are within the bounds of the LUN.
But, prior to this commit, there was only one set of cached values for all
LUNs, so the bounds checking for a LUN could use incorrect values, values
from one of the other LUNs that most recently updated the cached values.
This would lead to failed SCSI requests.

This commit fixes this issue by having separate cached values for each LUN.

Signed-off-by: Damien George <damien@micropython.org>
2020-07-25 01:12:07 +10:00
root b9cdf195e2 board mk file changes 2020-07-24 10:00:42 -05:00
root 204cdada7c remove unnecessary mk files parameters 2020-07-24 09:53:40 -05:00
Taku Fukada 54a342a7f5 Add and correct some type hints 2020-07-24 18:20:03 +09:00
root ce37a442e8 format fix 2020-07-23 19:35:04 -05:00
root c937fa1760 fix formatting 2020-07-23 19:29:57 -05:00
root 778e8bfda9 Changes to optimization option 2020-07-23 19:27:02 -05:00
ikigaisense 703fb9d4a1 update-ndGarage_ndbit6_v2 2020-07-23 16:08:30 -06:00
Scott Shawcroft 060ab8a1f0
Merge pull request #3194 from tannewt/gcc10
Prep for GCC10
2020-07-23 14:39:21 -07:00
ikigaisense 1ee8a09da2 add-ikigaisense_vita-nRF52840 2020-07-23 14:39:59 -06:00
Scott Shawcroft 6a46fd5b91
Merge pull request #3185 from hierophect/esp32-pulseio
ESP32-S2: PWMOut
2020-07-23 13:11:33 -07:00
Lucian Copeland cf0a4d208e Fix unintended timer reset, style changes 2020-07-23 14:01:10 -04:00
Scott Shawcroft 2bd6d05663
Add externs. GCC10 complains about duplicate defines 2020-07-22 16:26:46 -07:00
Lucian Copeland 61a2e4f94b Add PWMOut 2020-07-22 16:34:18 -04:00
Lucian Copeland c1f731d62e Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
hierophect e232ec10ce
Merge branch 'main' into stm32-timer-allocator 2020-07-22 13:59:39 -04:00
Lucian Copeland 138189bad1 Free timers when modules de-init 2020-07-22 13:58:57 -04:00
root d83a4ac72d Changes to add compiler optimization option 2020-07-22 12:44:41 -05:00
DavePutz 39e01c3938
Merge pull request #14 from adafruit/main
update from main
2020-07-22 11:30:49 -05:00
Glenn Ruben Bakke caaaa2b1f4 nrf: Enable more features for all targets.
Enabling the following features for all targets, except for nrf51
targets compiled to be used with SoftDevice:

- MICROPY_PY_ARRAY_SLICE_ASSIGN
- MICROPY_PY_SYS_STDFILES
- MICROPY_PY_UBINASCII
2020-07-22 12:54:20 +02:00
Glenn Ruben Bakke 0a79e18398 nrf: Split mpconfigport.h into multiple files.
Splitting mpconfigport.h into multiple device specific
files in order to facilitate variations between devices.

Due to the fact that the devices might have variations in
features and also variations in flash size it makes sense
that some devices offers more functionality than others
without being limited by restricted devices.

For example more micropython features can be activated for
nrf52840 with 1MB flash, compared to nrf51 with 256KB.
2020-07-22 12:54:20 +02:00
Scott Shawcroft 8ff2846bb2
Disable countio on circuitbrains basic 2020-07-21 16:21:49 -07:00
root db5c3c9676 dded optimization for esp32s2 2020-07-21 17:54:47 -05:00
Scott Shawcroft cb7df2e1ed
Merge pull request #3160 from tannewt/enable_pystack
Enable PYSTACK to keep function state out of the heap
2020-07-21 13:38:52 -07:00
Scott Shawcroft 5e3a853db4
Turn off GC opt on uchip board 2020-07-21 12:51:59 -07:00
Scott Shawcroft 678faff464
Be more aggressive with uChip build 2020-07-21 11:02:23 -07:00
root 49decf90c9 Add option for higher optimization levels 2020-07-21 10:11:08 -05:00
Zoltán Vörös 27767aafa2 lib/libm_dbl: Add round.c source code.
This code is imported from musl, to match existing code in libm_dbl.

The file is also added to the build in stm32/Makefile.  It's not needed by
the core code but, similar to c5cc64175b,
allows round() to be used by user C modules or board extensions.
2020-07-21 11:07:19 +10:00
Scott Shawcroft 0c6935e336
Merge branch 'main' into disable_network 2020-07-20 16:28:22 -07:00
Scott Shawcroft 12edb57aac
Merge pull request #3166 from theacodes/bhb-adc
Add _bhb user module for Big Honking Button
2020-07-20 16:24:36 -07:00
Kenneth Ryerson 76fefad18b esp32/network_lan: Add support for IP101 PHY.
Signed-off-by: Kenneth Ryerson <kenneth.ryerson@gmail.com>
2020-07-21 00:59:47 +10:00
Jonathan Hogg 7dbef5377c esp32/esp32_rmt: Properly fix looping behaviour of RMT.
A previous commit 3a9d948032 can cause
lock-ups of the RMT driver, so this commit reverses that, adds a loop_en
flag, and explicitly controls the TX interrupt in write_pulses().  This
provides correct looping, non-blocking writes and sensible behaviour for
wait_done().

See also #6167.
2020-07-21 00:57:14 +10:00
Thorsten von Eicken 5264478007 extmod/modussl_mbedtls: Integrate shorter error strings.
The stm32 and esp32 ports now use shorter error strings for mbedtls errors.
Also, MBEDTLS_ERROR_C is enabled on stm32 by default to get these strings.
2020-07-21 00:31:05 +10:00
Thea Flowers 7ba89f5330 Add _bhb user module for Big Honking Button
BHB needs better accuracy from the ADC readings. To avoid changing the ADC configuration for all boards or adding complexity to AnalogIn, I implemented a custom user module to allow the BHB to talk to the ADC in the way that it needs to. I'm open to other approaches here, but this seemed like the least invasive and complex option.
2020-07-18 22:45:08 -07:00
Radomir Dopieralski 11ef43b071 pewpew_m4: Disable USB_HID back
German translation fails to build, so I have to disabled USB_HID after
all.
2020-07-18 20:09:30 +02:00
Radomir Dopieralski 8d692f33a8 pewpew_m4: Enable analogio and usb_hid
The newest version for the Stage library for PewPewM4 no longer contains
embedded graphics, which frees enough space in flash to enabled back
AnalogIO and also add USB_HID. There is still ~192 bytes left free.

If new additions to CircuitPython make it grow further, we can disable
USB_HID again.
2020-07-18 19:30:40 +02:00
Jim Mussared 5d0be97bd9 unix: Make the MICROPY_xxx_ATOMIC_SECTION mutex recursive.
This mutex is used to make the unix port behave more like bare metal, i.e.
it allows "IRQ handlers" to run exclusively by making the mutex recursive.
2020-07-18 14:22:06 +10:00
Scott Shawcroft 610e0171aa
Disable existing native networking.
We're moving towards a co-processor model and a Wiznet library is
already available.

New native APIs will replace these for chips with networking like the
ESP32S2 but they won't be these.
2020-07-17 17:43:02 -07:00
Lucian Copeland 207369ec09 Add boilerplate, create basic PWMOut test 2020-07-17 17:28:23 -04:00
Jeff Epler 9cdf5e148a
Merge pull request #2879 from jepler/background-callback
Use a linked list of background tasks to perform
2020-07-17 15:46:03 -05:00
Jeff Epler 6912d31560 uchip: reclaim some flash space 2020-07-17 14:32:05 -05:00
Dan Halbert 6494bbdc64 snapshot 2020-07-16 23:14:49 -04:00
Lucian Copeland dc6902a33e Exclude timers from H7 builds 2020-07-16 17:11:24 -04:00
Lucian Copeland 6a49766df0 Fix pulseIO reset and frequency issues, remove IRQ conflict 2020-07-16 15:45:18 -04:00
Scott Shawcroft 72f6d7ee21
Merge pull request #3155 from jepler/esp32s2-parallel-build
esp32s2: Take care to invoke the sub-build-system only once
2020-07-16 11:26:53 -07:00
Scott Shawcroft 7bb508bf43
Merge pull request #3157 from tinkeringtech/tinkeringtech-scoutmakes-azul
Addition of Tinkeringtech ScoutMakes Azul nRF52840 based platform to CircuitPython
2020-07-16 11:03:31 -07:00
Matt Trentini 486cb6dd4a nrf: Add board definition for nRF52840-MDK-USB-Dongle. 2020-07-16 23:47:13 +10:00
Glenn Ruben Bakke 95d0d1c486 nrf/boards: Enable RTCounter machine module for nrf9160 boards.
Resolves dependencies for MICROPY_PY_TIME_TICKS which
requires to link against nrfx_rtc.c functions by setting
MICROPY_PY_MACHINE_RTCOUNTER to 1.
2020-07-16 11:48:52 +02:00
Glenn Ruben Bakke b776fe6969 nrf/nrfx_config: Disable RTC2 for nRF9160 targets.
nRF9160 does not have any RTC2. Disable the configuration in
case of NRF9160_XXAA.
2020-07-16 11:44:44 +02:00
TinkeringTech 49fcfd14d2 Added the TinkeringTech ScoutMakes Azul platform to CircuitPython 2020-07-15 21:49:34 -04:00
Jeff Epler 1df48176ce supervisor: factor supervisor_background_tasks from sundry ports 2020-07-15 11:49:44 -05:00
Jeff Epler 6160d11c5a supervisor: factor out, Handle USB via background callback 2020-07-15 11:49:44 -05:00
Jeff Epler a2919a6fb2 esp32s2: Use the device's EUI-48 address as unique ID
On my hardware, esptool reports
    MAC: 7c:df:a1:02:6c:b8
after this change, the USB descriptor says SerialNumber: 7CDFA1026CB8
and microcontroller.cpu.id has
    >>> "".join("%02x" % byte for byte in microcontroller.cpu.uid)
    'c7fd1a20c68b'

Note that the nibble-swapping between USB and cpu.uid is typical.
For instance, an stm32 board has USB SerialNumber
24002500F005D42445632302 but hex-converted microcontroller.cpu.id
420052000f504d4254363220.
2020-07-15 11:45:13 -05:00
Jeff Epler 910f69c42b esp32s2: Take care to invoke the sub-build-system only once
This allows "make -j" in the outer build system to function properly,
with a potentially large decrease in build times on high end desktop
systems.
2020-07-15 10:30:07 -05:00
Jeff Epler 742aa740f6 samd: audio: Move to background callback
Testing performed: Played half of the Bartlebeats album :) :)
2020-07-15 09:26:47 -05:00
Jeff Epler dc74ae83da nRF: Always use sd_nvic_critical_region calls
The motivation for doing this is so that we can allow
common_hal_mcu_disable_interrupts in IRQ context, something that works
on other ports, but not on nRF with SD enabled.  This is because
when SD is enabled, calling sd_softdevice_is_enabled in the context
of an interrupt with priority 2 or 3 causes a HardFault.  We have chosen
to give the USB interrupt priority 2 on nRF, the highest priority that
is compatible with SD.

Since at least SoftDevice s130 v2.0.1, sd_nvic_critical_region_enter/exit
have been implemented as inline functions and are safe to call even if
softdevice is not enabled.  Reference kindly provided by danh:
 https://devzone.nordicsemi.com/f/nordic-q-a/29553/sd_nvic_critical_region_enter-exit-missing-in-s130-v2

Switching to these as the default/only way to enable/disable interrupts
simplifies things, and fixes several problems and potential problems:
 * Interrupts at priority 2 or 3 could not call common_hal_mcu_disable_interrupts
   because the call to sd_softdevice_is_enabled would HardFault
 * Hypothetically, the state of sd_softdevice_is_enabled
   could change from the disable to the enable call, meaning the calls
   would not match (__disable_irq() could be balanced with
   sd_nvic_critical_region_exit).

This also fixes a problem I believe would exist if disable() were called
twice when SD is enabled.  There is a single "is_nested_critical_region"
flag, and the second call would set it to 1.  Both of the enable()
calls that followed would call critical_region_exit(1), and interrupts
would not properly be reenabled.  In the new version of the code,
we use our own nesting_count value to track the intended state, so
now nested disable()s only call critical_region_enter() once, only
updating is_nested_critical_region once; and only the second enable()
call will call critical_region_exit, with the right value of i_n_c_r.

Finally, in port_sleep_until_interrupt, if !sd_enabled, we really do
need to __disable_irq, rather than using the common_hal_mcu routines;
the reason why is documented in a comment.
2020-07-15 09:26:47 -05:00
Lucian Copeland 818b96ae61 Fix IRQ enum protections 2020-07-14 16:33:36 -04:00
Scott Shawcroft 90ad9beff5
Merge pull request #3136 from xiongyihui/master
Add 2 boards nRF52840 M.2 devkit and M60 Keyboard
2020-07-13 17:14:18 -07:00
Scott Shawcroft 51c888d4be
Merge pull request #3003 from Flameeyes/master
License tagging according to REUSE specifications.
2020-07-13 16:28:49 -07:00
Scott Shawcroft d712d1281c
Merge branch 'main' into master 2020-07-13 15:53:44 -07:00
Dan Halbert 3fcd999130
Merge pull request #3130 from pewpew-game/brownout-level
SAMD: make the brownout detection level configurable per board
2020-07-13 16:26:11 -04:00
Lucian Copeland b8910676db Add missing enum preprocessor protection 2020-07-13 11:52:30 -04:00
Dan Halbert f6869c69c5 wip: advertising; not tested 2020-07-12 19:45:23 -04:00
Yihui Xiong c8752ff93e use RGB LEDs as status indicators 2020-07-11 21:25:32 +08:00
Yihui Xiong 8e26fdc0e9 add LED status, remove unused macros 2020-07-11 10:51:31 +08:00
Radomir Dopieralski 742f9cfdb0 Fluff M0: additional pins on version 1.3 of the board 2020-07-10 20:40:58 +02:00
Yihui Xiong 7ff499046b use VID & PIDs granted by Seeed 2020-07-11 00:37:45 +08:00
Lucian Copeland eb86010176 Enable RGB Matrix 2020-07-10 11:06:12 -04:00
Alex Tsamakos f743bd3d25
nrf/boards: Add initial support for Actinius Icarus.
Example make command:

make BOARD=actinius_icarus
2020-07-10 03:48:30 +02:00
Scott Shawcroft 0068c76fa6
Merge pull request #3135 from arms22/bless_dev_board_multi_sensor
Add new board BLE-SS dev board Multi Sensor
2020-07-09 10:29:57 -07:00
Lucian Copeland edc48a505f Complete F405 pin and periph definitions 2020-07-09 13:10:18 -04:00
Lucian Copeland 2bcc5c06c2 Fix advanced claimed pin/package timer search 2020-07-09 11:42:37 -04:00
Yihui Xiong 678f266394 fix pre-commit check 2020-07-09 10:25:46 +00:00
Radomir Dopieralski e0733d153e SAMD: configurable brownout, separate the variables 2020-07-09 12:17:07 +02:00
Yihui Xiong 96f6ce222c add makerdiary m60 keyboard
Signed-off-by: Yihui Xiong <yihui.xiong@hotmail.com>
2020-07-09 10:02:27 +00:00
Yihui Xiong e81d22cd67 add makerdiary nrf52840 m.2 devkit
Signed-off-by: Yihui Xiong <yihui.xiong@hotmail.com>
2020-07-09 10:01:04 +00:00
arms22 bb5cdcf954 Add new board BLE-SS dev board Multi Sensor 2020-07-09 11:26:45 +09:00
Lucian Copeland 9c38f5dcb1 Merge remote-tracking branch 'upstream/main' into stm32-timer-allocator 2020-07-08 16:03:12 -04:00
Scott Shawcroft ce214e82a5
Merge pull request #3127 from Arudinne/Raytac_MDBT50Q-DB-40
Add new board Raytac MDBT50Q-DB-40
2020-07-08 11:34:56 -07:00
Radomir Dopieralski 83a27edd20 SAMD: make the brownout detection level configurable per board
Not all boards have external flash or other components that make them
require 2.7V -- sometimes we can get considerably longer battery life
by decreasing this requirement.

In particular, pewpew10 and pewpew_m4 are powered directly from
battery, with no LDO, and should work fine down to 1.6V.
2020-07-08 19:59:53 +02:00
Arudinne 768149fb01 modified: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c 2020-07-08 10:36:41 -05:00
iabdalkader c299cc94e3 stm32/pyb_can: Handle timeout arg for FDCAN in pyb_can_send.
Following the documented pyb can_send behavior in pyb.CAN docs.
2020-07-09 00:38:56 +10:00
iabdalkader d07073f4e2 stm32/fdcan: Support maximum timeout of HAL_MAX_DELAY in can_receive. 2020-07-09 00:38:40 +10:00
iabdalkader 63b2eb27d4 stm32/fdcan: Use FDCAN_RXFxS_FxFL instead of hard-coded value. 2020-07-09 00:38:33 +10:00
iabdalkader 8594389fe7 stm32/fdcan: Use the right FIFO to calc element address in can_receive. 2020-07-09 00:37:50 +10:00
Damien George f5dd46b479 unix/variants: Enable VFS and all supported filesystems on dev variant.
So that micropython-dev can be used to test VFS code, and inspect and build
filesystem images that are compatible with bare-metal systems.

Signed-off-by: Damien George <damien@micropython.org>
2020-07-08 23:57:25 +10:00
Martin Fischer 59ed3bdd9f nrf: Enable nrf tick support on all boards by default.
Having time.ticks_ms/us/add/diff is very useful and used by many drivers,
libraries and components.
2020-07-08 23:47:08 +10:00
Martin Fischer 15574cd665 nrf: Add support for time.ticks_xxx functions using RTC1.
This commit adds time.ticks_ms/us support using RTC1 as the timebase.  It
also adds the time.ticks_add/diff helper functions.  This feature can be
enabled using MICROPY_PY_TIME_TICKS.  If disabled the system uses the
legacy sleep methods and does not have any ticks functions.

In addition support for MICROPY_EVENT_POLL_HOOK was added to the
time.sleep_ms(x) function, making this function more power efficient and
allows support for select.poll/asyncio.  To support this, the RTC's CCR0
was used to schedule a ~1msec event to wakeup the CPU.

Some important notes about the RTC timebase:

- Since the granularity of RTC1's ticks are approx 30usec, time.ticks_us is
not perfect, does not have 1us resolution, but is otherwise quite usable.
For tighter measurments the ticker's 1MHz counter should be used.

- time.ticks_ms(x) should *not* be called in an IRQ with higher prio than
the RTC overflow irq (3).  If so it introduces a race condition and
possibly leads to wrong tick calculations.

See #6171 and #6202.
2020-07-08 23:47:02 +10:00
Arudinne 5a9aac472a modified: ports/nrf/boards/raytac_mdbt50q-db-40/pins.c 2020-07-07 14:37:59 -05:00
Jeff Epler 57ab4f1329 stm: SPI: revamp pin search code
I discussed with Hierophect on Discord about how to "de-nest" the code
for configuring SPI objects on STM, because the problems with one
nesting level per pin becomes unmanageable with the up to 10 pins of
SDIO.

This code (which is only compile-tested so far) demonstrates the concept
we discussed.

The SCK pin is always required.  Loop over all possibilities of the SCK
pin.  When we are considering a particular item in the mcu_spi_sck_list
we have now become committed to using a particular periph_index.  If all
the other pins can be satisfied by that periph_index, then we have a
working combination.  Once we have a working combination that is not
reserved, we can return that combination.  On reaching the end, we have
checked all the possible possibilities and can give the same errors as
before: One if there was a possibility that worked but was reserved;
and another if no possibility worked.
2020-07-07 14:37:50 -05:00
Arudinne dc2f729d19 modified: ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk
modified:   ports/nrf/boards/raytac_mdbt50q-db-40/pins.c
2020-07-07 14:37:08 -05:00
Arudinne b5af05cd31 new file: ports/nrf/boards/raytac_mdbt50q-db-40/board.c
new file:   ports/nrf/boards/raytac_mdbt50q-db-40/bootloader/6.0.0/pca10056_bootloader_6.0.0_s140.zip
	new file:   ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h
	new file:   ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.mk
	new file:   ports/nrf/boards/raytac_mdbt50q-db-40/pins.c
2020-07-07 12:27:23 -05:00
Scott Shawcroft 965a4961ce
Merge pull request #3120 from DavePutz/issue#3049
Issue#3049 -PulseIn not working in CP5.4
2020-07-07 08:59:22 -07:00
DavePutz 0932b64ae7
Correct for SAMD51 build 2020-07-06 23:25:33 -05:00
DavePutz 1b3cb17abd
Corrected file for SAMD51 build 2020-07-06 21:47:11 -05:00
DavePutz ab4a453006
Made requested changes 2020-07-06 21:40:38 -05:00
Scott Shawcroft a7844205bd
Merge pull request #3123 from kamtom480/sdk2.0
spresense: update SDK to 2.0.1
2020-07-06 15:09:46 -07:00
Scott Shawcroft 846f01b2c8
Merge pull request #3113 from ansonhe97/main
ADD: Added Wio Terminal's functional pins and LCD driver to board init
2020-07-06 14:50:47 -07:00
Diego Elio Pettenò 34b4993d63 Add license to some obvious files. 2020-07-06 19:16:25 +01:00
Radomir Dopieralski 2f80460a2f Fluff M0: additional pins on version 1.3 of the board 2020-07-06 19:15:41 +01:00
Kamil Tomaszewski 97355f8fb7 spresense: update SDK to 2.0.1 2020-07-06 17:13:28 +02:00
DavePutz ac33c3fe2c
Implementation of continuous synchronization of RTC during pulsein
Flags and code to implement continuous synchronization of RTC during pulsein
2020-07-04 21:17:19 -05:00
DavePutz 94d90742dd
Implementation of RTC continuous synchronization during pulsein
Flags and code to implement RTC continuous synchronization during pulsein
2020-07-04 21:15:38 -05:00
ndgarage e514782cc6 update-with-new-usb-PID 2020-07-04 10:39:21 -06:00
ansonhe97 36ef3476de Fix depreciate terminology 2020-07-04 11:21:58 +08:00
Lucian Copeland c72e3536f1 Merge remote-tracking branch 'upstream/main' into stm32-timer-allocator 2020-07-03 09:50:05 -04:00
ansonhe97 2ecb46f192 Fix CI 2020-07-03 13:42:27 +08:00
ansonhe97 2a92cf8d8b ADD: Added LCD driver to board init 2020-07-03 12:44:20 +08:00
ansonhe97 49aacc8596 ADD: Fixed wrong SPI pins and added more functional pins 2020-07-03 12:43:21 +08:00
Scott Shawcroft 4d7b9cde33
Merge pull request #3109 from pewpew-game/fluff_m0
Fluff M0: additional pins on version 1.3 of the board
2020-07-02 15:43:32 -07:00
Radomir Dopieralski fce35c3481 Fluff M0: additional pins on version 1.3 of the board 2020-07-02 22:57:58 +02:00
Scott Shawcroft 4a21426377
Merge pull request #3103 from hierophect/stm32-simplex-spi-fix
STM32: add debug flags, fix hang in simplex SPI
2020-07-02 13:42:08 -07:00
Lucian Copeland 4b66483757 Update submodule, revert direction change 2020-07-02 15:38:37 -04:00
Kamil Tomaszewski f4a2474447 spresense: Add support for sdioio 2020-07-02 15:26:59 +02:00
Jeff Epler fcddfd0f39
Merge pull request #3083 from tannewt/esp32s2_busio
Add busio support for the ESP32-S2
2020-07-01 21:02:08 -05:00
Lucian Copeland 87d58b3b0a STM32: add debug flags, fix hang in simplex SPI 2020-07-01 17:48:10 -04:00
Scott Shawcroft 367d3800fc
Return false if we already have the lock 2020-07-01 14:35:25 -07:00
ndgarage 0537f4e775 restore-ndgarage_ndbit6-to-original 2020-07-01 14:12:52 -06:00
ndgarage c759c9a2aa add-ndgarage_ndbit6_v2-update 2020-07-01 13:58:07 -06:00
svgops b80dbb4b2c add-ndgarage_ndbit6_v2 2020-07-01 12:06:59 -06:00
Lucian Copeland ab9a64eafa Add timer allocator, adjust pulsio to use general purpose timers 2020-07-01 10:35:49 -04:00
Glenn Ruben Bakke c2317a3a8d nrf/Makefile: Disable ROM text compression when compiling for debug.
When compiling for debug (-O0) the .text segment cannot fit the flash
region when MICROPY_ROM_TEXT_COMPRESSION=1, because the compiler does not
optimise away the large if-else chain used to select the correct compressed
string.

This commit enforces MICROPY_ROM_TEXT_COMPRESSION=0 when compiling for
debug (DEBUG=1).
2020-07-01 22:54:52 +10:00
Glenn Ruben Bakke f22f7b285e nrf/bluetooth/ble_uart: Swap end character on cooked strings.
Changing line ending character of cooked strings makes rshell/pyboard.py
work correctly over Bluetooth socat/pts devices.
2020-07-01 22:51:30 +10:00
Glenn Ruben Bakke 5996bf72f1 nrf/bluetooth/ble_uart: Fix random advertisement name.
The storage space of the advertisement name is not declared static, leading
to a random advertisement name.  This commit fixes the issue by declaring
it static.
2020-07-01 22:50:56 +10:00
Glenn Ruben Bakke ab0c14dba0 nrf/bluetooth/ble_uart: Add mp_hal_stdio_poll function.
This adds support for enabling MICROPY_PY_SYS_STDFILES when running UART
over Bluetooth (NUS).
2020-07-01 22:50:41 +10:00
Glenn Ruben Bakke fc1f22a097 nrf/bluetooth: Handle data length update request.
The Bluetooth link gets disconnected when connecting from a PC after 30-40
seconds.  This commit adds handling of the data length update request.  The
data length parameter pointer is set to NULL in the reply,  letting the
SoftDevice automatically set values and use them in the data length update
procedure.
2020-07-01 22:49:04 +10:00
Glenn Ruben Bakke 9dfb4ae6aa nrf/bluetooth/ble_uart: Fix implicit declaration of function.
mp_keyboard_interrupt() triggers a compiler error because the function is
implicitly declared.  This commit adds "py/runtime.h" to the includes.

Fixes issue #5732.
2020-07-01 22:48:25 +10:00
Jim Mussared 4050281311 unix: Enable uasyncio on dev variant. 2020-07-01 22:44:41 +10:00
Jim Mussared 27abac95d8 unix: Make manifest selection match other ports.
Changes are:
- The default manifest.py is moved to the variants directory (it's in
  "boards" in other ports).
- The coverage variant now uses a custom manifest in its variant directory
  to add frzmpy/frzstr.
- The frzmpy/frzstr tests are moved to variants/coverage/.
2020-07-01 22:42:55 +10:00
Jeff Epler 3a17a79bf2
Merge pull request #3094 from kamtom480/mkspk
spresense: add elf32.h for mkspk
2020-07-01 06:58:40 -05:00
ansonhe97 d4e28dd233 ADD: added more special pins on Wio Terminal 2020-07-01 17:06:26 +08:00
Andrew Leech 494bcad8ab stm32/mboot: Disable polling mode by default and use IRQ mode instead.
Polling mode will cause failures with the mass-erase command due to USB
timeouts, because the USB IRQs are not being serviced.  Swiching from
polling to IRQ mode fixes this because the USB IRQs can be serviced between
page erases.

Note that when the flash is being programmed or erased the MCU is halted
and cannot respond to USB IRQs, because mboot runs from flash, as opposed
to the built-in bootloader which is in system ROM.  But the maximum delay
in responding to an IRQ is the time taken to erase a single page, about
100ms for large pages, and that is short enough that the USB does not
timeout on the host side.

Recent tests have shown that in the current mboot code IRQ mode is pretty
much the same speed as polling mode (within timing error), code size is
slightly reduced in IRQ mode, and IRQ mode idles at about half of the power
consumption as polling mode.
2020-07-01 16:54:03 +10:00
Andrew Leech 95ec0debec stm32/mboot: Remove the use of timeout in DFU_GETSTATUS.
This is treated more like a "delay before continuing" in the spec and
official tools and does not appear to be really needed.  In particular,
downloading firmware is much slower with non-zero timeouts because the host
must pause by the timeout between sending each DFU_GETSTATUS to poll for
download/erase complete.
2020-07-01 16:33:10 +10:00
Dan Halbert 11cb3e3b4b hci skeleton done; not working yet 2020-06-30 23:19:40 -04:00
Scott Shawcroft 5028804878
Remove fixed pointers and check UART return 2020-06-30 15:29:42 -07:00
Scott Shawcroft 74ad5e80ce
Merge pull request #3089 from ansonhe97/main
Add: added Seeed's Wio Terminal Board Support
2020-06-30 10:58:24 -07:00
Damien George 41b7734c46 zephyr/make-minimal: Disable FAT and LFS2 options to make it build.
Signed-off-by: Damien George <damien@micropython.org>
2020-06-30 22:33:41 +10:00
Damien George f84145bea1 zephyr: Implement machine.Pin.irq() for setting callbacks on pin change.
Supports hard and soft interrupts.  In the current implementation, soft
interrupt callbacks will only be called when the VM is executing, ie they
will not be called during a blocking kernel call like k_msleep.  And the
behaviour of hard interrupt callbacks will depend on the underlying device,
as well as the amount of ISR stack space.

Soft and hard interrupts tested on frdm_k64f and nucleo_f767zi boards.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-30 22:33:41 +10:00
Damien George 65a7e00078 stm32/mboot: Add DFU logic to respond to DFU_GETSTATE request.
This is required for some DFU programmers, eg ST's DfuSe demo PC app.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-30 21:28:24 +10:00
Andrew Leech 40006813c3 stm32/flash: Update flash_get_sector_info to return -1 on invalid addr.
So the caller can tell when an invalid address is used and can take
appropriate action.
2020-06-30 21:24:28 +10:00
Andrew Leech 8bbaa20227 stm32/mboot: Implement DFU mass erase.
The implementation internally uses sector erase to wipe everything except
the sector(s) that mboot lives in (by erasing starting from
APPLICATION_ADDR).

The erase command can take some time (eg an STM32F765 with 2MB of flash
takes 8 to 10 seconds).  This time is normally enough to make pydfu.py fail
with a timeout.  The DFU standard includes a mechanism for the DFU device
to request a longer timeout as part of the get-status response just before
starting an operation.  This timeout functionality has been implemented
here.
2020-06-30 21:22:21 +10:00
Scott Shawcroft 69b3d47564
Fix other esp builds 2020-06-29 18:21:53 -07:00
Scott Shawcroft 965a40b6a1
Fix cxd56 function signature 2020-06-29 17:17:46 -07:00
Scott Shawcroft 111f7ddf69
Merge pull request #2863 from jepler/sdcard-in-core
Sdcard in core
2020-06-29 16:49:58 -07:00
ansonhe97 4613f80d7a Fix end of line 2020-06-29 17:41:48 +08:00
ansonhe97 0dd17f4418 Add: Added Seeed Wio Terminal board support 2020-06-29 16:22:41 +08:00
Damien George 048a1d675d stm32/timer: Properly initialise timer deadtime/brk on WB MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2020-06-29 17:35:42 +10:00
Andrew Leech e4fcd216e0 stm32/usbd_cdc_interface: Remove full==size-1 limitation on tx ringbuf.
Before this commit the USB VCP TX ring-buffer used the basic implementation
where it can only be filled to a maximum of buffer size-1.  For a 1024 size
buffer this means the largest packet that can be sent is 1023.  Once a
packet of this size is sent the next byte copied in goes to the final byte
in the buffer, so must be sent as a 1 byte packet before the read pointer
can be wrapped around to the beginning.  So in large streaming transfers,
watching the USB sniffer you basically get alternating 1023 byte packets
then 1 byte packets.

This commit changes the ring-buffer implementation to a scheme that doesn't
have the full-size limitation, and the USB VCP driver can now achieve a
constant stream of full-sized packets.  This scheme introduces a
restriction on the size of the buffer: it must be a power of 2, and the
maximum size is half of the size of the index (in this case the index is
16-bit, so the maximum size would be 32767 bytes rounded to 16384 for a
power-of-2).  But this is not a big limitation because the size of the
ring-buffer prior to this commit was restricted to powers of 2 because it
was using a mask-based method to wrap the indices.

For an explanation of the new scheme see
https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/

The RX buffer could likely do with a similar change, though as it's not
read from in chunks like the TX buffer it doesn't present the same issue,
all that's lost is one byte capacity of the buffer.

USB VCP TX throughput is improved by this change, potentially doubling the
speed in certain cases.
2020-06-29 17:21:37 +10:00
jerryneedell bbedd43273 change CMake verision requirement 2020-06-27 13:27:42 -04:00
Scott Shawcroft 7f6bef3251
Remove debug prints 2020-06-26 16:56:17 -07:00
Scott Shawcroft 08749630a2
Fix SPI RX and remove debug prints 2020-06-26 16:30:24 -07:00
Scott Shawcroft 2d579cc995
Use NULL for deinited DigitalInOut
This fixes a Display issue where no backlight pin is given but it's
still deinitialized.
2020-06-26 12:33:50 -07:00
Scott Shawcroft a9f257bcd6
Store host_id so that never reset works 2020-06-26 12:32:56 -07:00
Jeff Epler c5db97c50f atmel-sam: sdio: disable debug prints by default 2020-06-26 13:16:16 -05:00
Scott Shawcroft 0f074fb956
Merge pull request #3072 from PTS93/patch-2
Update minimum required cmake to 3.16
2020-06-26 10:02:24 -07:00
Jeff Epler f496c0b58d atmel-samd: Add SDIO SD card interface 2020-06-26 11:50:42 -05:00
Jeff Epler d4b9458512 samd: sdio: Add needed files from atmel start 2020-06-26 11:50:41 -05:00
Jeff Epler 57fde2e07b sdcardio: implement new library for SD card I/O
Testing performed: That a card is successfully mounted on Pygamer with
the built in SD card slot

This module is enabled for most FULL_BUILD boards, but is disabled for
samd21 ("M0"), litex, and pca10100 for various reasons.
2020-06-26 11:50:23 -05:00
Scott Shawcroft 9ec9644928
Merge pull request #3071 from jgillick/jeremy/stm-nvm-flash
STM32 (ThunderPack) - Move NVM sector to increase program size.
2020-06-26 09:45:26 -07:00
Dan Halbert 3e616ccead update submodules 2020-06-26 12:21:57 -04:00
Damien George 137df81757 stm32/i2cslave: Pass I2C instance to callbacks to support multi I2Cs.
By passing through the I2C instance to the application callbacks, the
application can implement multiple I2C slave devices on different
peripherals (eg I2C1 and I2C2).

This commit also adds a proper rw argument to i2c_slave_process_addr_match
for F7/H7/WB MCUs, and enables the i2c_slave_process_tx_end callback.
Mboot is also updated for these changes.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-26 23:56:45 +10:00
Damien George 0a8ce0d568 stm32/mboot: Update README to describe WB and littlefs support.
Signed-off-by: Damien George <damien@micropython.org>
2020-06-26 21:26:06 +10:00
Damien George 67fd58bbd2 stm32/mboot: Add support for littlefs.
Mboot now supports FAT, LFS1 and LFS2 filesystems, to load firmware from.
The filesystem needed by the board must be explicitly enabled by the
configuration variables MBOOT_VFS_FAT, MBOOT_VFS_LFS1 and MBOOT_VFS_LFS2.
Boards that previously used FAT implicitly (with MBOOT_FSLOAD enabled) must
now add the following config to mpconfigboard.h:

    #define MBOOT_VFS_FAT (1)

Signed-off-by: Damien George <damien@micropython.org>
2020-06-26 21:17:02 +10:00
Damien George 390f32922d stm32/mboot: Decouple stream, filesystem and top-level loading code.
This commit factors the code for files and streaming to separate source
files (vfs_fat.c and gzstream.c respectively) and introduces an abstract
gzstream interface to make it easier to plug in different filesystems.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-26 21:15:30 +10:00
Damien George 763bd448a4 stm32/mboot: Don't search for firmware on FS, just attempt to open it.
There's no need to do a directory listing to search for the given firmware
filename, it just takes extra time and code size.  Instead this commit
changes it so that the requested firmware file is opened immediately and
will abort if the file couldn't be opened.  This also allows to specify
files in a directory.

Signed-off-by: Damien George <damien@micropython.org>
2020-06-26 21:11:03 +10:00
jgillick 017c188ab5 Move NVM block to increase program size. 2020-06-25 21:46:15 -07:00
Dan Halbert 759929c24a hci early wip; refactor supervisor bluetooth.c for nrf: tested 2020-06-25 20:57:17 -04:00
Timon a80d7479d0
Update minimum required cmake to 3.16
Earliest tested version that compiles.
Failed with version 3.10
2020-06-26 02:04:14 +02:00
Timon 0a41b86f6b
Fix typo inserting IDF_PATH variable 2020-06-26 01:36:03 +02:00
Lucian Copeland 6c91af7d56 WIP 2020-06-25 17:27:01 -04:00
Jeff Epler 103ad9966a remove machine_i2c, machine_spi
This micropython code is not used in circuitpython
2020-06-25 11:44:21 -05:00
Jeff Epler 1d2cc0b968 I2CPeripheral: Rename class and its module
This is an incompatible change.
2020-06-25 11:44:19 -05:00