Commit Graph

7291 Commits

Author SHA1 Message Date
Mark e326d7ca80
Merge branch 'main' into rp_dp_parallel 2021-03-15 20:00:13 -05:00
Scott Shawcroft f7a988b9b3
Merge pull request #4405 from DavePutz/issue_4237
Issue 4237 - Changed initial setting in program_struct
2021-03-15 17:51:36 -07:00
Scott Shawcroft 9cb8ce67ed
Merge pull request #4412 from kamtom480/spi_and_i2c
spresense: minor changes for i2c, spi and uart
2021-03-15 17:35:06 -07:00
Jeff Epler d3bf1fe15d modifications by pre-commit 2021-03-15 18:11:00 -05:00
Kamil Tomaszewski ed3f636be5 spresense: empty rx uart fifo after initialization 2021-03-15 16:14:16 +01:00
Kamil Tomaszewski 22ed0abf6c spresens: configure pin mode for i2c and spi 2021-03-15 16:14:16 +01:00
mintakka 0567d06936 added board configuration for Sparkfun ThingPlus RP2040 2021-03-15 10:27:21 -04:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
felixerdy 6c32a1f67f update pins of senseBox MCU 2021-03-15 10:27:50 +01:00
Jeff Epler b33d77bfe8 disable bitmaptools on over-full board 2021-03-14 20:08:09 -05:00
root 9a83501982 Fixed initial settings for program_struct to allow more than 1 program per pio 2021-03-14 15:05:56 -05:00
Damien George a9140ab09b rp2: Use core-provided cmake fragments instead of custom ones.
Signed-off-by: Damien George <damien@micropython.org>
2021-03-14 15:53:18 +11:00
Damien George eccd73a403 extmod/extmod.cmake: Add modonewire.c to MICROPY_SOURCE_EXTMOD list.
Signed-off-by: Damien George <damien@micropython.org>
2021-03-14 15:51:28 +11:00
Dan Halbert 8e425a9354
Merge pull request #4393 from tannewt/raise_default_flash_speed
Speed up a bit more
2021-03-13 12:50:29 -05:00
Damien George dcaf702578 rp2/modmachine: Enable machine.Signal class.
Fixes issue #6863.

Signed-off-by: Damien George <damien@micropython.org>
2021-03-14 00:19:04 +11:00
Damien George 8010b15968 rp2: Enabled more core Python features.
This brings the port's configuration closer to the stm32 and esp32 ports.

Signed-off-by: Damien George <damien@micropython.org>
2021-03-14 00:17:22 +11:00
Kevin Köck af45d511f1 rp2: Enable uerrno module.
Fixes #6991.
2021-03-13 23:34:50 +11:00
Scott Shawcroft 1b106de4e0
Merge pull request #4262 from DavePutz/issue_4111
Issue 4111 - Implement pulseio(pulsein) for RP2040
2021-03-12 16:48:57 -08:00
Scott Shawcroft 45487f14a0
Speed up a bit more 2021-03-12 16:00:16 -08:00
DavePutz 96ce43e6d6
Added the correct files 2021-03-12 16:18:33 -06:00
DavePutz 6628f49852
Use StateMachine.c interrupt setup and simplify SM program 2021-03-12 16:06:57 -06:00
Jeff Epler a5c6759325
Merge pull request #4392 from tannewt/lower_default_flash_speed
Lower default flash speed.
2021-03-12 13:58:44 -06:00
Scott Shawcroft aec03a409f
Lower default flash speed.
/ 6 leads to ~40mhz. 2M and 4M have a max 0x03 read speed of 60mhz.
If the divisor is / 4 then the speed is just over 60mhz.

Fixes #4377
2021-03-12 11:06:39 -08:00
felixerdy 2009aecac3 Merge branch 'main' of github.com:felixerdy/circuitpython 2021-03-12 17:59:44 +01:00
felixerdy de93df6444 add senseBox MCU 2021-03-12 17:57:55 +01:00
Dan Halbert 0ce5b2f594 put back pullup setting 2021-03-12 08:20:09 -05:00
Damien George 6129b8e401 tests: Rename run-tests to run-tests.py for consistency.
Signed-off-by: Damien George <damien@micropython.org>
2021-03-12 19:56:09 +11:00
gamblor21 307d2a99fe Fix after rebase 2021-03-11 20:06:50 -06:00
gamblor21 5689307798 Changed frequency to match PIO having 2 instructions 2021-03-11 19:32:44 -06:00
gamblor21 b02b1e9979 Set frequency default 60Mhz 2021-03-11 19:32:44 -06:00
gamblor21 1658fe04f9 Set the statemachine to never reset so REPL works 2021-03-11 19:32:44 -06:00
gamblor21 c384ebe5c0 Updated to initalize pindirs 2021-03-11 19:32:44 -06:00
gamblor21 7321411962 Added frequency to parallel display 2021-03-11 19:32:43 -06:00
gamblor21 56a219911f Add frequency support to parallel bus 2021-03-11 19:32:43 -06:00
gamblor21 b080d6207b Removing debug info and clean up 2021-03-11 19:32:43 -06:00
gamblor21 c6aaab6f64 Initial commit 2021-03-11 19:32:43 -06:00
Dan Halbert c71b6cb699 move to esp-idf PR merge 2021-03-11 20:05:31 -05:00
Damien George b24fcd7aec esp32/machine_hw_spi: Use default pins when making SPI if none given.
The default pins can be optionally configured by a board.

Fixes issue #6974.

Signed-off-by: Damien George <damien@micropython.org>
2021-03-12 10:56:25 +11:00
Lucian Copeland 6b2c9985ff Extract RTC, implement fake RTC deepsleep 2021-03-11 17:50:05 -05:00
Dan Halbert f75a009ed4 fix unnecessary statement order change 2021-03-11 15:16:32 -05:00
Dan Halbert b5d2cc6f46 Merge remote-tracking branch 'adafruit/main' into esp32s2-i2c-bug 2021-03-11 15:09:18 -05:00
Jeff Epler 24f4d981bd
Merge pull request #4380 from jepler/rp2040-audiomp3
raspberrypi: Enable mp3 playback
2021-03-11 12:53:46 -06:00
Scott Shawcroft 0e451a1681
Merge pull request #4383 from hierophect/stm32-uart-dereserve
STM32: Fix UART deinit
2021-03-11 10:48:01 -08:00
Scott Shawcroft 40886d198d
Merge pull request #4385 from hierophect/stm32-f407-can
STM32: add all F405 modules to F407
2021-03-11 10:45:08 -08:00
Dan Halbert de88fa37fb Merge remote-tracking branch 'adafruit/main' into esp32s2-i2c-bug 2021-03-11 12:27:29 -05:00
Dan Halbert 061d5910cb use fixed esp-idf 2021-03-11 12:09:01 -05:00
Kamil Tomaszewski 18668f6e28 spresense: fix spi to work with only one data pin 2021-03-11 18:06:49 +01:00
Kamil Tomaszewski 76d0870fba spresense: return error as positive value for i2c 2021-03-11 18:04:01 +01:00
Lucian Copeland 0b73c7a212 Update F407 to match F405 2021-03-11 11:27:17 -05:00
Lucian Copeland 1ebbd14d0f Fix UART deinit 2021-03-11 11:02:13 -05:00
Jeff Epler 15e97f12a1
Merge pull request #4379 from jepler/rp2040-rtc
raspberrypi: RTC: Ensure a time is set
2021-03-11 09:00:31 -06:00
Andrew Scheller b6489425c6 rp2/rp2_flash: Prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative. 2021-03-12 00:57:29 +11:00
Dan Halbert 08c5dbb003 use return values in STM PWMOut constructor, not exceptions 2021-03-11 08:52:47 -05:00
robert-hh c675452566 rp2/modmachine: Re-init UART for REPL on frequency change.
When UART is used for REPL and the MCU frequency is changed, the UART
has to be re-initialised.  Besides that the UART may have to be recreated
after a frequency change, but with USB REPL this is not a problem.

Thanks to @HermannSW for spotting and providing the change.
2021-03-12 00:49:30 +11:00
robert-hh 11cf742524 rp2/modmachine: Allow changing CPU clock frequency.
Using the standard machine.freq().

The safe ranges tested were 10 and 12-270MHz, at which USB REPL still
worked.  Requested settings can be checked with the script:
pico-sdk/src/rp2_common/hardware_clocks/scripts/vcocalc.py.  At frequencies
like 300MHz the script still signaled OK, but USB did not work any more.
2021-03-12 00:48:46 +11:00
robert-hh 0461640983 rp2/rp2_pio: Fix sm.get(buf) to not wait after getting last item.
sm.get(buf) was waiting for one item more than the length of the supplied
buffer.  Even if this item was not stored, sm_get would block trying to get
an item from the RX fifo.

As part of the fix, the edge case for a zero length buffer was moved up to
the section where the function arguments are handled.  In case of a zero
length buffer, sm.get() now returns immediately that buffer.
2021-03-12 00:39:26 +11:00
robert-hh a075e0b7d8 rp2/rp2_pio: Allow more than 8 consecutive pins for PIO out/set/sideset.
The bitmasks supplied for initialization of out/set/sideset were only 8 bit
instead of 32.  This resulted in an error, that not more than 8 consecutive
pins would get initialized.

Fixes issue #6933.
2021-03-12 00:26:32 +11:00
robert-hh da85cb014a rp2/machine_uart: Add support for inverted TX and RX lines.
Usage as in the other ports:

    keyword "invert"
    constants: INV_TX and INV_RX

Sample: uart = UART(1, invert=UART.INV_TX | UART.INV_RX)
2021-03-11 18:27:53 +11:00
robert-hh 8ade163fff rp2/machine_uart: Add timeout/timeout_char to read and write. 2021-03-11 18:19:15 +11:00
StereoRocker 8610bababe rp2: Enable VfsFat class for FAT filesystem support.
Allows interfacing with SD cards, for example.
2021-03-11 17:56:21 +11:00
svetelna 23ce25a7c3 mimxrt/boards: Add MIMXRT1050_EVK board, based on MIMXRT1060_EVK. 2021-03-11 16:42:38 +11:00
Mike Causer 8785acac22 esp32/Makefile: Specify port and baud on erase_flash command. 2021-03-11 15:49:10 +11:00
Jeff Epler 16bfe3b41c raspberrypi: RTC: Ensure a time is set
Until a time is set, the RTC is not running, and rtc_get_datetime()
returns false without assigning to the out-parameter.

In CircuitPython, this would manifest as arbitrary values being returned,
since uninitialized storage on the stack was being converted into a timestamp.
2021-03-10 20:20:40 -06:00
Scott Shawcroft f0965b1ef7
Merge pull request #4350 from nitz/board-add-sparkfun-micromod-nrf52840
Add new nRF port for SF MicroMod nRF52840.
2021-03-10 18:13:11 -08:00
Jeff Epler c95def0b32 raspberrypi: Enable mp3 playback
The rp2040 is _very_ marginal for mp3 playback, and currently sometimes triggers a bug that gives garbled audio output.  However, it does work for some limited situations.
2021-03-10 18:44:10 -06:00
Damien George c33c749f64 stm32/boardctrl: Add MICROPY_BOARD_STARTUP hook.
Signed-off-by: Damien George <damien@micropython.org>
2021-03-11 09:04:36 +11:00
Reinhard Feger 79c186f5c9 stm32/spi: Fix baudrate calculation for H7 series.
Fixes issue #6342.
2021-03-11 01:06:52 +11:00
Peter Hinch 0facd891e7 stm32/powerctrl: Save and restore EWUP state when configuring standby.
This allows the user to enable wake-up sources using the EWUP bits, on F7
MCUs.

Disabling the wake-up sources while clearing the wake-up flags follows the
reference manual and ST examples.
2021-03-11 00:56:01 +11:00
Braiden Kindt 85ea4ac0e5 stm32/main: Fix passing state.reset_mode to init_flash_fs.
state.reset_mode is updated by `MICROPY_BOARD_BEFORE_SOFT_RESET_LOOP` but
not passed to `init_flash_fs`, and so factory reset is not executed on
boards that do not have a bootloader.  This bug was introduced by
4c3976bbca

Fixes #6903.
2021-03-10 23:50:40 +11:00
Herwin Grobben 35c602d3b8 stm32/make-stmconst.py: Allow "[]" chars when parsing source comments.
For STM32WB MCUs, EXTI offset addresses were not parsed due to the
appearance of "[31:0]" in a comment in the .h file.
2021-03-10 23:44:02 +11:00
hathach 58fb011070 clean up 2021-03-10 19:03:27 +07:00
hathach d1c6bb0927 rp2040 add double reset to uf2, also update pico-sdk to 1.1.0 2021-03-10 18:58:23 +07:00
DavePutz a3c3e8a0fa
fix trailing whitespace 2021-03-09 22:41:08 -06:00
nitz d5365cb066
SDIO/QSPI pin names. ¯\_(ツ)_/¯ 2021-03-09 18:36:29 -05:00
nitz 5beb529f61
Update pins, remove unused defs from board config. 2021-03-09 17:43:13 -05:00
nitz fe0655e121
Update pins, remove unused defs from board config. 2021-03-09 17:39:50 -05:00
DavePutz 0c58cc4772
Moved pin wait to an initial exec 2021-03-09 16:37:29 -06:00
nitz 1ae858126a
Fix the mpconfigboard.mk that was screwy? 2021-03-09 17:29:10 -05:00
Scott Shawcroft d650849581
Merge pull request #4348 from FBSeletronica/franzininhoWIFI_wrover
Franzininho wifi ESP32-S2 Wrover
2021-03-09 13:07:19 -08:00
Scott Shawcroft 2c3002b327
Merge pull request #4370 from jposada202020/i2cperipheral_ctrlc
I2CPeripheral samd51 corrections in the CTRLC bit
2021-03-09 12:58:59 -08:00
Chris Dailey a61db7f12e
Updated SparkFun MicroMod USB PID
As per the PID provide by TheHoff, [here](https://forum.sparkfun.com/viewtopic.php?p=223812#p223812)
2021-03-09 12:54:52 -05:00
DavePutz f0e3274a33
Update to agree with modified StateMachine.h 2021-03-09 11:13:09 -06:00
FBSeletronica c6eb3f98be Fixing build.yml 2021-03-09 13:55:20 -03:00
jposada202020 be90fa80e8 Initial Changes 2021-03-09 10:48:33 -05:00
DavePutz 6f4510d7aa
Merge branch 'main' into issue_4111 2021-03-08 23:28:21 -06:00
root 576da73a17 Added check for maxlen 2021-03-08 23:23:51 -06:00
root 95b7a59156 Merge branch 'issue_4111' of https://github.com/DavePutz/circuitpython into issue_4111 2021-03-08 23:22:05 -06:00
root 3db0fec267 Added check for maxlen 2021-03-08 23:20:57 -06:00
DavePutz 88650bc4d0
Removed leftover debug code 2021-03-08 22:48:57 -06:00
Andrew Leech 59a129f22f stm32/storage: Prevent attempts to read/write invalid block addresses.
A corrupt filesystem may lead to a request for a block which is out of
range of the block device limits.  Return an error instead of passing the
request down to the lower layer.
2021-03-09 15:32:50 +11:00
Dan Halbert 7029783985 funhouse board 2021-03-08 21:24:28 -05:00
Scott Shawcroft 775f1b9e0d
Merge pull request #4329 from jepler/rp2-rotaryio
raspberrypi: Implement rotaryio, improve StateMachine
2021-03-08 17:49:45 -08:00
Scott Shawcroft 4fc6c7d8c9
Merge pull request #4347 from FBSeletronica/franzininhoWIFI
Adding Circuitpython port for Franzininho WIFI board with the ESP32-S2 wroom module
2021-03-08 15:37:42 -08:00
jun2sak c8f36e604c reset myself, not go REPL, after wakeup from deep sleep. 2021-03-09 00:42:22 +09:00
FBSeletronica 27703f3156 fix quote error 2021-03-08 10:32:37 -03:00
FBSeletronica fe29780afb updating USB_VID and USB_PID for Espressif modules 2021-03-08 08:51:48 -03:00
FBSeletronica 2771e7fe75 Updating USB vendor ID and producfor Espressif modules 2021-03-08 08:47:33 -03:00
Jeff Epler cdb0fda72a Merge remote-tracking branch 'origin/main' into count-flash-devices 2021-03-07 20:26:04 -06:00
Dan Halbert 26eb429cc6 restore install/delete for i2c driver 2021-03-07 18:23:14 -05:00
Jeff Epler f1ada8e880 Automatically count EXTERNAL_FLASH_DEVICES 2021-03-07 11:48:39 -06:00
jerryneedell a23129bc49 add GD25Q16C flash to BlackPill 2021-03-07 17:23:39 +00:00
Jeff Epler a4133c4545
Merge pull request #4344 from jepler/vm-size-optimizations
Vm size optimizations: Get back 1500 bytes for 3.2% VM speed decrease
2021-03-07 10:09:51 -06:00
jun2sak 51c7a49853 Merge branch 'main' into nrf52-sleep 2021-03-07 20:50:53 +09:00
jun2sak 5bd1107fec Clean up. 2021-03-07 20:38:04 +09:00
jun2sak 2eed9a1735 old System OFF sleep code for future reference. 2021-03-07 20:21:33 +09:00
jun2sak 7430b92d27 address hw pin-reset while sleep. 2021-03-07 20:20:29 +09:00
jun2sak 2795c002ad disable QSPI while system ON idle loop. 2021-03-07 19:14:04 +09:00
jun2sak cd5c0e99f7 Clean up. 2021-03-07 19:09:01 +09:00
nitz 3b76299f39
Add new nRF port for SF MicroMod nRF52840. 2021-03-07 01:06:50 -05:00
FBSeletronica 17aa9ae3f6 Update vendor ID for Espressif ESP32S2 Modules 2021-03-06 18:43:34 -03:00
FBSeletronica 4a50f1dd6f Update Vendor ID for Espressif 2021-03-06 18:36:53 -03:00
FBSeletronica 48e727f7d6 adding port for Franzininho WIFI board ESP32S2 w/Wrover 2021-03-06 17:47:27 -03:00
FBSeletronica 6cf9c5158c adding port for Franzininho WIFI board 2021-03-06 17:15:54 -03:00
jun2sak 3fab9f8b1b new wait-until-alarm design, don't use System OFF. 2021-03-07 01:09:54 +09:00
Jeff Epler 4f040af481 vm: Make the speed-size trade-off compile time settable
.. and enable for all samd21 boards
2021-03-05 18:29:27 -06:00
Jeff Epler 67fb3054b4
Merge pull request #4342 from jamesbowman/main
Enable EVE low-level for Teensy 4.0 and 4.1
2021-03-05 17:25:00 -06:00
Jeff Epler d2056a46ee
Merge pull request #4335 from tyomitch/main
[nrf] No need to store `buffer_length` as part of `audiopwmio_pwmaudioout_obj_t`
2021-03-05 15:54:10 -06:00
Jeff Epler bed96a98d2
Merge pull request #4337 from tyomitch/patch-1
[stm] `curr_pulseout` can be `STATIC`
2021-03-05 15:53:31 -06:00
James Bowman bff585ffd2 Enable EVE low-level for Teensy 4.0 and 4.1 2021-03-05 11:32:58 -08:00
Jeff Epler cd1f19020f raspberrypi: move landmine Makefile comments 2021-03-05 12:59:55 -06:00
Jeff Epler 2ae1e7de61 WIPrp2040: Implement IncrementalEncoder
Any two consecutive pins can be used for an IncrementalEncoder

Testing performed: Put a synthesized (few hundred counts per second) quadrature signal into GP2/3 and read the encoder out.  Performed filesystem operations at the same time to stress test it.

The reasons for not using common_hal_rp2pio_statemachine_readinto are commented on.
2021-03-05 10:31:29 -06:00
Dan Halbert 4cf6579e22 remove general changes; not consistent across builds 2021-03-05 10:10:50 -05:00
Artyom Skrobov e0b96c0f43 [nrf] No need to store `buffer_length` as part of `audiopwmio_pwmaudioout_obj_t` 2021-03-05 06:01:58 -05:00
Artyom Skrobov 4720dc179a
[stm] `curr_pulseout` can be `STATIC`
Not used outside of PulseOut.c
2021-03-05 12:52:13 +02:00
Dan Halbert c97721455a Shrink the smallest builds with compile options 2021-03-04 23:07:06 -05:00
DavePutz a4dda3a5ba
Merge branch 'main' into issue_4111 2021-03-04 14:38:00 -06:00
DavePutz c5c297d2c0
Update PulseOut.c 2021-03-04 13:53:19 -06:00
DavePutz b7f03f9487
Update PulseOut.h 2021-03-04 13:52:40 -06:00
DavePutz 2d941b070f
Changed interrupt to per-word basis; cleaned up other small items 2021-03-04 13:51:46 -06:00
Jeff Epler bc14ed31f6 StateMachine.h: Add header for declaration of mcu_pin_obj_t typedef 2021-03-04 12:28:46 -06:00
Jeff Epler c023ec03ff PDMIn: Add missing deinit call 2021-03-04 12:28:06 -06:00
Jeff Epler bd01d31542 rp2pio: Add pins_are_sequential
This can be used where the standard API calls for a list of pins, to check that they satisfy the requirements of the rp2pio state machine, e.g.,
```python
    def __init__(self, pin_a, pin_b):
        if not rp2pio.pins_are_sequential([pin_a, pin_b]):
            raise ValueError("Pins must be sequential")
```
2021-03-04 11:26:33 -06:00
Jeff Epler ff62b0d2c0 StateMachine: Add pull up/down for inputs 2021-03-04 11:26:29 -06:00
Jeff Epler 68ac14b309 StateMachine: Add in_available property
I named the property `in_available` because it is similar to pyserial.
However, it indicates the number of words in the fifo, not the number
of bytes.
2021-03-04 11:14:09 -06:00
Dan Halbert 2ae8a44b2a
Merge pull request #4325 from microDev1/fix-wdt
ESP32S2: Fix watchdog deinit
2021-03-04 11:04:01 -05:00
hathach 6f99026a64 rp2040 use normal usb_irq_handler() 2021-03-04 21:29:04 +07:00
microDev 13453d35c6
fix watchdog deinit 2021-03-04 13:23:34 +05:30
Dan Halbert 71c43ca2dd
Merge pull request #4319 from jepler/feather-default-uart
feather rp2040: enable default board.UART
2021-03-03 16:46:00 -05:00
Jeff Epler b0fca4fcda feather rp2040: enable default board.UART 2021-03-03 13:13:06 -06:00
Dan Halbert cd48c5ee83
Merge pull request #4315 from dhalbert/rp2040-i2c-short-writes
RP2040: Implement short I2C writes (2 bytes or less) using bitbangio
2021-03-03 12:42:47 -05:00
DavePutz 88353f2f5b
Update mpconfigport.mk 2021-03-03 11:00:58 -06:00
DavePutz ced707ed32
Update call to rp2pio_statemachine_construct 2021-03-03 10:55:08 -06:00
Scott Shawcroft 514b73bcf8
Merge pull request #4254 from gamblor21/rp2040_countio
Rp2040 countio
2021-03-03 08:47:24 -08:00
Scott Shawcroft 1d8933dd05
Merge pull request #4265 from DavePutz/pio_soft_reset
Clear out PIOs and State Machines on RP2040 soft reset
2021-03-03 08:43:57 -08:00
Dan Halbert fb7a0f7efc add 1sec timeouts for I2C read and write 2021-03-03 09:43:57 -05:00
gamblor21 98075c5255 Fixed merge 2021-03-02 22:32:59 -06:00
Dan Halbert e3ab394cd6 works on nearly all sensors 2021-03-02 23:27:37 -05:00
Dan Halbert 4167778bbc
Merge pull request #4312 from jepler/feather-rp2040-led
feather rp2040: add board.LED
2021-03-02 23:19:14 -05:00
DavePutz 9b96bae668
Update mpconfigport.mk 2021-03-02 21:36:00 -06:00
DavePutz 30d491e136
Update mpconfigport.mk 2021-03-02 21:30:49 -06:00
DavePutz 58fb7b9b32
Update mpconfigport.mk to get builds working 2021-03-02 21:27:46 -06:00
DavePutz 6046d37f31
Update PulseIn.c 2021-03-02 21:23:45 -06:00
Mark 37ee18349f
Merge branch 'main' into rp2040_countio 2021-03-02 19:47:53 -06:00
gamblor21 4246cc3f6d Counter and PWMOut slice conflict check 2021-03-02 19:32:06 -06:00
Jeff Epler b27afad9cb move LED to the right spot in the file 2021-03-02 19:02:38 -06:00
Jeff Epler efc2667b5f
Merge pull request #4186 from jepler/update-protomatter-rp2
Enable protomatter on RP2040 builds
2021-03-02 19:01:37 -06:00
Dan Halbert 15615effc2
Merge pull request #4276 from bergdahl/patch-1
Update StateMachine.c
2021-03-02 17:11:45 -05:00
Dan Halbert 0a58d451ad
Merge pull request #4306 from Neradoc/fix-reset-to-safe
press reset to safe mode on ports where reset reason is not implemented
2021-03-02 15:44:52 -05:00
Dan Halbert f31b472309 Merge remote-tracking branch 'adafruit/main' into rp2040-i2c-short-writes 2021-03-02 15:17:12 -05:00
Dan Halbert 9939c59caa wip 2021-03-02 15:16:55 -05:00
Jeff Epler 8bfd308d37 feather rp2040: add board.LED 2021-03-02 13:16:09 -06:00
Scott Shawcroft e4f0e47d9f
Merge pull request #4233 from pewpew-game/displayio-group-list
displayio: make Group use a python list internally
2021-03-02 09:59:58 -08:00
Scott Shawcroft ce70b95990
Merge pull request #4177 from microDev1/nvm-rp
RP2040: Support for NVM
2021-03-02 09:57:36 -08:00
Dan Halbert 248acd07c8 shrink builds 2021-03-02 12:25:42 -05:00
Dan Halbert f41fb6fafc
Apply suggestions from code review
copyediting
2021-03-02 12:01:50 -05:00
Dan Halbert 9f6ebf3012
Merge pull request #4310 from kamtom480/spresense_analogin
spresense: return valid reference voltage
2021-03-02 11:55:42 -05:00
Scott Shawcroft 2651e15a52
Merge pull request #4309 from jepler/rp2040-interrupt-pio
rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall)
2021-03-02 08:55:27 -08:00
Scott Shawcroft 722a7150ca
Merge pull request #4308 from jepler/rp2040-build-boot2
raspberrypi: allow directly specifying the original boot .S file
2021-03-02 08:54:30 -08:00
Lucian Copeland f1792c8474 Extract EXTI, create base sleep framework 2021-03-02 11:41:53 -05:00
Jeff Epler f560b5f3a3 raspberry: switch pico back to the boot2 for W25Q16
Presumably, switching it to generic hurt performance a bit.

I verified that the build-raspberry_pi_pico/boot2_padded_checksummed.S
built file has the same checksum as the old
bs2_default_padded_checksummed.S
2021-03-02 08:08:41 -06:00
Kamil Tomaszewski 7c921b808b spresense: Define LONGINT_IMPL as MPZ 2021-03-02 14:25:22 +01:00
Kamil Tomaszewski f9d21637a3 spresense: return valid reference voltage 2021-03-02 14:25:22 +01:00
Radomir Dopieralski cb2cf81136 ugame10 - disable pulseio to make more room for the French 2021-03-02 11:11:55 +01:00
microDev b029031286
minor structural modification 2021-03-02 14:36:28 +05:30
Dan Halbert 54d11a8e2d
Merge pull request #4299 from jamesbowman/main
Add EVE support for Feather M4 Express
2021-03-01 22:56:50 -05:00
Jeff Epler 5a00862b1d raspberrypi: allow directly specifying the original boot .S file
.. all the necessary steps to transform it into a padded, checksummed
file are now done by the build system.

Since it is assigned by "?=", it _should_ be the case that individual
builds can override it.

I did not "test" this per se, but it gives the same content and checksum
(except for the identifying comment with a path) as #4302.
2021-03-01 21:08:19 -06:00
Jeff Epler 4b63a8c9b4 rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall) 2021-03-01 21:07:04 -06:00
Scott Shawcroft d0eab5c561
Merge pull request #4256 from kmatch98/bt_cleanup
Add `bitmaptools` module
2021-03-01 18:24:12 -08:00
Damien George 680ce45323 stm32/rfcore: Allow BLE settings to be changed by a board.
Two of the defaults have also changed in this commit:

- MICROPY_HW_RFCORE_BLE_LSE_SOURCE changed from 1 to 0, which configures
  the LsSource to be LSE (needed due to errata 2.2.1).

- MICROPY_HW_RFCORE_BLE_VITERBI_MODE changed from 0 to 1, which enables
  Viterbi mode, following all the ST examples.

Signed-off-by: Damien George <damien@micropython.org>
2021-03-02 12:14:54 +11:00
James Bowman 0dabd1ace2 Add EVE support for Feather M4 Express 2021-03-01 14:42:48 -08:00
Scott Shawcroft 1b3bca14cb
Merge pull request #4294 from kamtom480/spresense_analogin
spresense: return the correct value for Analog In
2021-03-01 13:21:15 -08:00
Scott Shawcroft 21a8752166
Merge pull request #4297 from adafruit/tannewt-patch-1
Update flash sizes for Adafruit RP2040 boards
2021-03-01 13:19:50 -08:00
Jeff Epler 238484ec26 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-03-01 15:18:32 -06:00
Scott Shawcroft 532e7db293
Merge pull request #4267 from dhalbert/rp2040-digitalinout-fixes
RP2040: change DigitalInOut direction only when necessary; strong drive strength
2021-03-01 13:14:13 -08:00
Scott Shawcroft af9dfccab1
Update QT Py flash size 2021-03-01 10:34:25 -08:00
Scott Shawcroft dac047db61
Update Feather RP2040 to 8MB 2021-03-01 10:33:04 -08:00
Kamil Tomaszewski d68fdf3a3d spresense: return the correct value for Analog In 2021-03-01 15:45:10 +01:00
jun2sak 7cecd99658 remove unused debug printf's. 2021-02-28 16:04:29 +09:00
jun2sak 3e47e00291 address the pretending-to-deep-sleep issue. 2021-02-28 15:57:37 +09:00
jun2sak 498debc826 remove unused debug printf's. 2021-02-28 15:37:25 +09:00
jun2sak 9b34726c0d GPIO and GPIOTE reg dump for debug. 2021-02-28 15:36:14 +09:00
gamblor21 d7bc8a46a5 Added counters per slice 2021-02-27 15:17:27 -06:00
root 29c89a2487 Removed more includes 2021-02-26 22:35:38 -06:00
root f3515502b7 Removed unecessary includes 2021-02-26 22:33:50 -06:00
root 6374408c06 Changed reset_rp2pio_statemachine to clean up any PIO interrupts. 2021-02-26 22:28:50 -06:00
Jonny Bergdahl f7eac46c78
Update StateMachine.c
Changed woring to use max instead
2021-02-27 00:07:30 +01:00
Scott Shawcroft 776301c932
Typo fix: direcion -> direction 2021-02-26 15:03:56 -08:00
Scott Shawcroft 888a0c5f08
Merge pull request #4224 from microDev1/busio-uart-rp
RP2040: Support for UART
2021-02-26 14:57:23 -08:00
Dan Halbert d9234ffa82 need to gpio_set_dir() at some point 2021-02-26 15:27:35 -05:00
root 7942932176 Requested changes 2021-02-26 14:14:55 -06:00
Scott Shawcroft 7562b0cbb8
Turn off GC opt on catwan_usbstick 2021-02-26 12:00:01 -08:00
Scott Shawcroft 2e6e91dc5c
Merge pull request #4253 from tannewt/rp2040_fix_pwm_reuse
Fix second shared PWM
2021-02-26 11:53:54 -08:00
Scott Shawcroft 7c8d7d77dd
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp 2021-02-26 09:04:42 -08:00
Limor "Ladyada" Fried caedc3bba6
Merge pull request #4270 from tannewt/rp2040_feather_pinout
Update RP2040 Feather pinout for production rev
2021-02-26 11:11:44 -05:00
Jeff Epler 1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Scott Shawcroft 3f08cb47b8
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp 2021-02-25 16:59:15 -08:00
Scott Shawcroft 52bc935fa7
A few minor fixes for corner cases
* Always clear the peripheral interrupt so we don't hang when full
* Store the ringbuf in the object so it gets collected when we're alive
* Make UART objects have a finaliser so they are deinit when their
  memory is freed
* Copy bytes into the ringbuf from the FIFO after we read to ensure
  the interrupt is enabled ASAP
* Copy bytes into the ringbuf from the FIFO before measuring our
  rx available because the interrupt is based on a threshold (not
  > 0). For example, a single byte won't trigger an interrupt.
2021-02-25 16:50:57 -08:00
Scott Shawcroft f0432b9d6f
Remove neopixel power 2021-02-25 16:37:34 -08:00
jun2sak 0f8c96f424 remove trailing whitespaces. 2021-02-26 09:11:35 +09:00
jun2sak 7fd4648cd5 rase error if Alarm time >= 512 sec. 2021-02-26 09:06:11 +09:00
Kevin Matocha ec4cd68edc More mpconfigboard.mk corrections for small builds 2021-02-25 17:48:50 -06:00
Dan Halbert d0f1cfb039 address review; use gpio_set() carefully 2021-02-25 18:41:22 -05:00
jun2sak 277a67d876 call touchalarm funcs as well as pin/timealarm. 2021-02-26 08:11:50 +09:00
Scott Shawcroft 2b163ccd6a
Fix incorrect deinit mask 2021-02-25 14:57:46 -08:00
Scott Shawcroft 1b00d94b23
Fix second shared PWM
Fixes #4210
2021-02-25 14:49:09 -08:00
Scott Shawcroft 80f7972f72
Update RP2040 Feather pinout for production rev 2021-02-25 14:46:08 -08:00
Jeff Epler 22276710e6 rp2pio: Fix writing where the stride was 2 or 4
The wrong stride value was being checked.
2021-02-25 15:50:49 -06:00
Kevin Matocha a7a4f93ff8 Updated build configs to turn off BITMAPTOOLS for smaller builds 2021-02-25 15:44:32 -06:00
Dan Halbert 94d7bfb1c9
Merge pull request #4264 from UnexpectedCircuitPython/main
Expanded pin names for TinyS2 + FeatherS2 pin additions for DAC1 & DAC2
2021-02-25 15:13:18 -05:00
Dan Halbert 199a8ce8b0 change DigitalInOut direction only when necessary; strong drive strength 2021-02-25 14:10:19 -05:00
root f8eb5bc275 Cleanup PIOs and State Machines on soft reset 2021-02-25 12:38:43 -06:00
microDev 8170e26a86
more uart improvements
- address suggested changes
- refine uart instance availibility checks
- improve pin validation and rx buffer handling
2021-02-25 23:46:00 +05:30
jun2sak 2aa5aec0d5 cleanup. 2021-02-26 01:45:12 +09:00
jun2sak c713d31d0d move externs to .h 2021-02-26 01:20:55 +09:00
Dan Halbert bbe0602738
Merge pull request #4245 from kamtom480/spresense_usb_speed
spresense: Pass the correct USB bus speed after restart
2021-02-25 11:02:33 -05:00
jun2sak c86ca2a4ff move externs to .h 2021-02-26 00:51:52 +09:00
jun2sak 9328d09a7a re-enable parameters check. 2021-02-26 00:50:44 +09:00
Kamil Tomaszewski fb32e0a7fd qtpy_m0_haxpress: Change config to make it fit. 2021-02-25 09:44:33 +01:00
Seon Rozenblum 69b10d7925 Added DAC1 & DAC2 pin names for FeatherS2
Expanded pin names for TinyS2 and added some new ones for functionality I forgot to add pin names for
Cleaned up mpconfigboard
2021-02-25 17:32:34 +11:00
root 86e60f5f35 Clean up formatting 2021-02-24 17:26:35 -06:00
jun2sak 61a69daae1 raise NotImplementedError when construct TouchAlarm. 2021-02-25 08:19:03 +09:00
root 17ff5dcc99 Return NotImplementedError for PulseOut 2021-02-24 17:04:05 -06:00
root 8e15f36baa pulseio (pulsein) for RP2040 2021-02-24 16:58:29 -06:00
microDev 5d7fdafcde
implement suggested changes
- add internal buffering
- rtc initialization fix
2021-02-25 00:48:36 +05:30
jun2sak f66896ce32 use nRF SDK function to set up memory retention. 2021-02-25 02:34:43 +09:00
Kamil Tomaszewski e369473794 spresense: change RX and TX buffer size for CDC 2021-02-24 18:19:18 +01:00
jun2sak 9661d67cd3 replace MY_DEBUG_UART -> NRF_DEBUG_PRINT. 2021-02-25 01:49:57 +09:00
jun2sak 72b5f1a9a6 clean up my personal settings. 2021-02-25 01:38:23 +09:00
Mark b935dcafdc
Merge branch 'main' into rp2040_countio 2021-02-23 19:46:41 -06:00
gamblor21 379f454ce6 Adding countio to rp2040 2021-02-23 19:38:05 -06:00
Scott Shawcroft abbbb91fa8
Add state machine divisor check
This causes an exception when setting a state machine too slow or
too fast.

Fixes #4222
2021-02-23 16:30:46 -08:00
Scott Shawcroft 360475e266
Implement audiobusio and enhance PIO for it
This adds I2SOut and PDMIn support via PIO.

StateMachines can now:
 * read and read while writing
 * transfer in 1, 2 or 4 byte increments
 * init pins based on expected defaults automatically
 * be stopped and restarted
 * rxfifo can be cleared and rxstalls detected (good for tracking when
   the reading code isn't keeping up)

Fixes #4162
2021-02-23 15:50:00 -08:00
Scott Shawcroft e41137c745
Merge pull request #4244 from UnexpectedCircuitPython/main
Added Unexpected Maker TinyS2 board definition
2021-02-23 10:40:06 -08:00
Scott Shawcroft 001d7299b2
Merge pull request #4228 from ZodiusInfuser/rp2040-boards
Added definitions for Pimoroni RP2040-based boards
2021-02-23 10:00:19 -08:00
jun2sak 0f188befb6 set RAM retention just before deep sleep 2021-02-24 00:12:25 +09:00
ZodiusInfuser 1a0bf4c33f
Added flash size for PicoSystem 2021-02-23 11:04:20 +00:00
ZodiusInfuser a9951c9b6c
Added flash size for Keybow2040 2021-02-23 11:01:40 +00:00
ZodiusInfuser ca9b7debe0
Added flash size for Tiny2040 2021-02-23 10:43:35 +00:00
Seon Rozenblum 78b2daa2a7 Added Unexpected Maker TinyS2 board definition 2021-02-23 17:55:17 +11:00
Dan Halbert a30d4ad25d set SUPEROPT_VM = 0 on most non-Express SAMD21 boards 2021-02-22 23:03:11 -05:00
jun2sak ec64fa6a29 move dump_xxx functions to debug_uart.c. 2021-02-23 12:16:37 +09:00
jun2sak 372c98626a move all the debug codes from port.c to debug_uart.c. 2021-02-23 11:56:40 +09:00
Scott Shawcroft 3fdf29e773
More parens 2021-02-22 18:35:09 -08:00
Scott Shawcroft 863981a5b8
Parens 2021-02-22 18:31:45 -08:00
jun2sak 9df0f439f3 alarm/pin/__init__.c is no longer used. 2021-02-23 10:31:49 +09:00
Scott Shawcroft 0aafeac209
Board specific flash sizes for RP2040
Stop-gap solution for #4041. Comment is there to provide info
needed in the future. (We currently run the generic "safe" settings.)
2021-02-22 17:19:18 -08:00
Damien George 53f5bb05a9 rp2,stm32: Enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32().
These ports already have uzlib enabled so this additional ubinascii.crc32
function only costs about 90 bytes of flash.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-23 10:13:25 +11:00
Dan Halbert 8470f0fdb7 SAMD21: one endpoint pair for MSC now instead of two 2021-02-21 12:37:59 -05:00
jun2sak 5c858a1925 add weak board_deinit(). 2021-02-21 16:27:21 +09:00
Damien George 75db0b9079 esp32: Define MICROPY_QSTRDEFS_PORT to include special qstrs.
Fixes issue #6942.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-21 15:56:54 +11:00
Damien George 03a64f2077 stm32/boards/NUCLEO_WB55: Enable LPUART1 on PA2/PA3.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-21 15:49:33 +11:00
Chris Mason 9d674cf7ab stm32/uart: Add support for LPUART1 on L0, L4, H7 and WB MCUs.
Add LPUART1 as a standard UART.  No low power features are supported, yet.
LPUART1 is enabled as the next available UART after the standard U(S)ARTs:

    STM32WB:      LPUART1 = UART(2)
    STM32L0:      LPUART1 = UART(6)
    STM32L4:      LPUART1 = UART(6)
    STM32H7:      LPUART1 = UART(9)

On all ports: LPUART1 = machine.UART('LP1')

LPUART1 is enabled by defining MICROPY_HW_LPUART1_TX and
MICROPY_HW_LPUART1_RX in mpconfigboard.h.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2021-02-21 15:49:32 +11:00
jun2sak 1da8b9900a Merge branch 'main' into nrf52-sleep 2021-02-21 13:35:06 +09:00
jun2sak 36c59250dd some cleanups. 2021-02-21 09:57:14 +09:00
jun2sak d659c2ce34 move port-specific debug functions from supervisor/shared/serial.c to ports/nrf/supervisor/port.c 2021-02-21 09:55:10 +09:00
jun2sak 793198909e set SleepMemory size to 256 bytes. 2021-02-21 08:19:39 +09:00
jun2sak 41d9d4e0ab call sd API only when sd enabled. 2021-02-21 08:17:57 +09:00
Dan Halbert cf3217e6d4
Merge pull request #4232 from TG-Techie/fix_tg_watch
fix TG-Watch ble issue
2021-02-20 18:10:52 -05:00
Jonah Yolles-Murphy a9a2145238 fix TG-Watch ble issue 2021-02-20 15:46:33 -05:00
ZodiusInfuser 52f2fd6d53
Removed trailing white space 2021-02-20 17:25:26 +00:00
ZodiusInfuser 417173b752
Removed trailing white space 2021-02-20 17:24:26 +00:00
ZodiusInfuser 9a4b8c5ed9
Removed trailing white space 2021-02-20 17:23:23 +00:00
ZodiusInfuser dea498a51f
Added new line 2021-02-20 17:20:28 +00:00
ZodiusInfuser 9fbeb0baea
Added new line 2021-02-20 17:20:06 +00:00
ZodiusInfuser 03577ec81c
Added new line 2021-02-20 17:19:45 +00:00
ZodiusInfuser dac81ea545
Added new line 2021-02-20 17:19:31 +00:00
ZodiusInfuser 0a00f91979
Added new line 2021-02-20 17:15:42 +00:00
ZodiusInfuser f1df07002f
Added new line 2021-02-20 17:15:20 +00:00
jun2sak 26f8f532f1 safe mode fix. 2021-02-21 00:47:07 +09:00
ZodiusInfuser 27bc5492f5
Added other files for PicoSystem 2021-02-20 13:37:08 +00:00
ZodiusInfuser e9c7af1dee
Added board.c for PicoSystem 2021-02-20 13:36:46 +00:00
ZodiusInfuser fb7cce6503
Added other files for Keybow2040 2021-02-20 13:35:27 +00:00
ZodiusInfuser 7ac20bfb8b
Added board.c for Keybow2040 2021-02-20 13:35:06 +00:00
ZodiusInfuser 66dd74cd12
Added other files for Tiny2040 2021-02-20 13:33:54 +00:00
ZodiusInfuser ad8916499d
Added board.c for Tiny2040 2021-02-20 13:32:54 +00:00
Dan Halbert 985e020936 shrink simmel build 2021-02-19 18:41:27 -05:00
Dan Halbert 67406488d1 merge from upstream; re-alphabetize 2021-02-19 14:22:50 -05:00
ZodiusInfuser ee5a48fece
Delete pimoroni_tiny2040 2021-02-19 18:30:29 +00:00
ZodiusInfuser db102ab1ad
Create pimoroni_tiny2040 2021-02-19 18:29:57 +00:00
microDev b12ccefbe6
uart implementation for rp2040 2021-02-19 18:36:00 +05:30
Thorsten von Eicken d28dbcd6c7 esp32: Make machine.soft_reset() work in main.py and reset_cause().
This commit fixes two issues on the esp32:
- it enables machine.soft_reset() to be called in main.py;
- it enables machine.reset_cause() to correctly identify a soft reset.

The former is useful in that it enables soft resets in applications that
are started at boot time.  The support is patterned after the stm32 port.
2021-02-19 15:15:11 +11:00
Thorsten von Eicken c10d431819 esp32: Add basic support for Non-Volatile-Storage in esp32 module.
This commit implements basic NVS support for the esp32.  It follows the
pattern of the esp32.Partition class and exposes an NVS object per NVS
namespace.  The initial support provided is only for signed 32-bit integers
and binary blobs.  It's easy (albeit a bit tedious) to add support for
more types.

See discussions in: #4436, #4707, #6780
2021-02-19 15:05:19 +11:00
Jeff Epler 1cd4e4552e
Merge pull request #4219 from jepler/bit_transpose
Add Bit transpose function to support piopixl8
2021-02-18 20:29:05 -06:00
Damien George 143372ab5e esp32: Add support to build with ESP-IDF v4.3 pre-release.
The esp32 port now builds against IDF v4.3-beta1, as well as v4.4-dev.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-19 10:58:52 +11:00
Damien George 466ad35a72 esp32/boards: Enable size optimisation for builds.
This enables -Os for compilation, but still keeps full assertion messages.
With IDF v4.2, -Os changes the GENERIC firmware size from 1512176 down to
1384640, and the GENERIC_SPIRAM firmware is now 1452320 which fits in the
allocated partition.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-19 10:42:16 +11:00
Jeff Epler 7fd4567893 bitops: rename from _bit_transpose, describe the algorithm 2021-02-18 15:41:23 -06:00
Lucian Copeland 0ecb24c3e5
Merge pull request #4169 from hierophect/stm32-i2cstart
STM32: Fix I2C repeated start by converting to IT mode
2021-02-18 15:19:00 -05:00
Dan Halbert e344c6d684 fix some builds 2021-02-18 14:24:58 -05:00
Dan Halbert 53a002a096 Initial fix, but bitbangio timing may be off 2021-02-18 13:14:51 -05:00
Jeff Epler 9cf7d73c6c core: add bit_transpose function
.. this version can only handle exactly 8 bits "across".  The restriction
may be relaxed in a future revision.
2021-02-18 11:32:47 -06:00
Dan Halbert 5c37b73c6d fix typo to fix nrf builds 2021-02-18 11:09:32 -05:00
microDev 696d212dc7
fix nvm rewrite 2021-02-18 18:42:00 +05:30
Damien George d4b45898f5 stm32/mboot: After sig verify, only write firmware-head if latter valid.
So that mboot can be used to program encrypted/signed firmware to regions
of flash that are not the main application, eg that are the filesystem.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-18 13:59:03 +11:00
Jeff Epler ab5eb86118 raspberrypi: implement os.urandom
Since the datasheet cast some doubt on the strength of the "rosc_hw->randombit",
I use the SHA256 hash function to create a high quality random seed
from random values of uncertain entropy, as well as to generate a sequence
of random values from that seed using SHA256 as a cryptographically-secure
random number generator.

In practice, it produces over 100kB/s of random data which does not
have any gross problems according to _PractRand_.
2021-02-17 17:49:25 -06:00
jun2sak cf2427c561 light sleep reason fix. 2021-02-17 21:51:28 +09:00
jun2sak e6350ff834 Initial commit. 2021-02-17 20:53:18 +09:00
Damien George 301fe805ca stm32/mpbtstackport: Allow chipset and secondary baudrate to be set.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-17 15:47:17 +11:00
Damien George 89cb2c6b80 stm32/mpbthciport: Use mp_printf instead of printf for error message.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-17 15:47:17 +11:00
Andrew Leech 629fdc366a stm32/mpbthciport: Fix initial baudrate to use provided value.
Fixes bug introduced in the recent bffb71f523
2021-02-17 14:50:38 +11:00
Damien George 5c92ff53fe stm32/boards: Disable onewire module on boards with small flash.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-17 14:42:46 +11:00
Damien George 9b78f3e6c6 stm32: Make pyb, uos, utime, machine and onewire modules configurable.
The default for these is to enable them, but they can now be disabled
individually by a board configuration.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-17 14:42:46 +11:00
Damien George caeec80a9c stm32/usb: Allow a board to configure USBD_VID and all PIDs.
If a board defines USBD_VID then that will be used instead of the default.
And then the board must also define all USBD_PID_xxx values that it needs.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-17 14:40:43 +11:00
Scott Shawcroft 261b077209
Merge pull request #4192 from dhalbert/pico-pwmout-top-fix-4189
RP2040: fix off-by-one PWM top issue
2021-02-16 17:38:09 -08:00
Thorsten von Eicken 2c1299b007 extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.
Also fix related problems with socket on esp32, improve docs for
wrap_socket, and add more tests.
2021-02-17 11:50:54 +11:00
David Michieli 2eed9780ba stm32/mboot: Add unpack-dfu command to mboot_pack_dfu.py tool.
This command unpacks a previously packed DFU file, writing out a DFU which
should be the same as the original (before packing).
2021-02-17 11:36:44 +11:00
PTH 5cb91afb9b zephyr/modusocket: Fix parameter in calls to net_context_get_XXX().
The following simple usocket example throws an error EINVAL on connect

    import usocket
    s = usocket.socket()
    s.connect(usocket.getaddrinfo('www.micropython.org', 80)[0][-1])

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: [Errno 22] EINVAL

Fixing the context parameter in calls of net_context_get_family() and
net_context_get_type(), the connect works fine.

Tested on a nucleo_h743zi board.
2021-02-17 10:42:43 +11:00
PTH 6c4a5d185d zephyr/boards: Add support for the nucleo_h743zi board. 2021-02-17 10:38:00 +11:00
Dan Halbert c26de0136a works! no timeouts 2021-02-16 17:39:36 -05:00
Maureen Helm f573e73bae zephyr: Build MicroPython as a cmake target.
Refactors the zephyr build infrastructure to build MicroPython as a
cmake target, using the recently introduced core cmake rules.

This change makes it possible to build the zephyr port like most other
zephyr applications using west or cmake directly. It simplifies building
with extra cmake arguments, such as specifying an alternate conf file or
adding an Arduino shield. It also enables building the zephyr port
anywhere in the host file system, which will allow regressing across
multiple boards with the zephyr twister script.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-02-16 18:49:30 +11:00
Maureen Helm 51fa1339f1 zephyr: Remove unused build files.
Removes zephyr port build files that aren't being used anymore.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-02-16 18:49:12 +11:00
Maureen Helm f49a73641a zephyr: Disable frozen source modules.
Disables frozen source modules in the zephyr port. They are deprecated
in the makefile rules and not implemented in the new cmake rules.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-02-16 18:38:13 +11:00
Maureen Helm 2aa57931a6 zephyr: Update to zephyr v2.5.0.
Updates the zephyr port build instructions and CI to use the latest
zephyr release tag.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-02-16 18:38:13 +11:00
Jim Mussared 4c54012373 unix/moduselect: Don't allow both posix and non-posix configurations.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-02-16 14:59:52 +11:00
Dan Halbert 0b8f1b9a90 wip: usb_cdc.serials 2021-02-15 20:06:18 -05:00
Dan Halbert 93d788543c Merge remote-tracking branch 'adafruit/main' into secondary-cdc 2021-02-15 20:03:53 -05:00
Lucian Copeland 6d5ffc677b is_free should not check never_reset 2021-02-15 10:29:05 -05:00
Thorsten von Eicken 902da05a18 esp32: Set MICROPY_USE_INTERNAL_ERRNO=0 to use toolchain's errno.h.
The underlying OS (the ESP-IDF) uses it's own internal errno codes and so
it's simpler and cleaner to use those rather than trying to convert
everything to the values defined in py/mperrno.h.
2021-02-15 23:47:02 +11:00
Thorsten von Eicken 771376a0cb esp32/modsocket: Remove unix socket error code translation.
The ESP-IDF has its own errno codes which should propagate out to the user.
2021-02-15 23:45:14 +11:00
Damien George f12462ddc4 esp32: Remove obsolete IDF v3 code wrapped in MICROPY_ESP_IDF_4.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 23:22:05 +11:00
Damien George a915002177 esp32: Add support to build with ESP-IDF v4.2.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 23:12:20 +11:00
Damien George d191d88cab esp32: Add support to build with ESP-IDF v4.1.1.
ESP-IDF v4.0.2 is still supported.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 23:11:26 +11:00
Damien George e017f276f7 esp32/README: Update based on new IDF v4 cmake build process.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:40:11 +11:00
Damien George da2b5fa1c1 esp32/boards: Enable BLE on all boards.
BLE was enabled by default on all boards in the existing make build.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:40:07 +11:00
Damien George 26b17fd28a esp32/boards: Remove old IDF v3 sdkconfig values.
IDF v3 is no longer supported with the move to cmake.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:40:03 +11:00
Damien George 9f035d6bb7 esp32: Remove traditional "make" capability.
It's now replaced by cmake/idf.py.  But a convenience Makefile is still
provided with traditional targets like "all" and "deploy".

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:37:58 +11:00
Damien George 97072b7224 esp32: Add explicit initialisers to silence compiler warnings.
This makes no functional change.  See similar commit
9aa58cf8ba

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:37:58 +11:00
Damien George 9c2231f47a esp32/esp32_rmt: Don't do unnecessary check for unsigned less than zero.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:37:52 +11:00
Damien George 9b90882146 esp32: Add support to build using IDF with cmake.
This commit adds support for building the esp32 port with cmake, and in
particular it builds MicroPython as a component within the ESP-IDF.  Using
cmake and the ESP-IDF build infrastructure makes it much easier to maintain
the port, especially with the various new ESP32 MCUs and their required
toolchains.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 12:48:39 +11:00
Seth Kerr 9e626fdd5c new cp sapling board 2021-02-14 20:00:32 -05:00
Damien George bffb71f523 stm32/mpbthciport: Only init the uart once, then use uart_set_baudrate.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-14 18:32:05 +11:00
Damien George d2a34c62e7 stm32/uart: Add uart_set_baudrate function.
This allows changing the baudrate of the UART without reinitialising it
(reinitialising can lead to spurious characters sent on the TX line).

Signed-off-by: Damien George <damien@micropython.org>
2021-02-14 18:30:49 +11:00
Dan Halbert 0ec99b37e0 handle 100% duty cycle; improve actual_frequency calc 2021-02-13 13:16:49 -05:00
Damien George 701fdcacaf nrf/drivers/usb: Add USBD_IRQHandler which calls tud_int_handler.
This is needed for TinyUSB to process USB device IRQs.

Related to #6325.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-13 13:52:53 +11:00
Dan Halbert d54b5861a3 wip 2021-02-12 19:01:14 -05:00
Dan Halbert 3e4328140c fix off-by-one PWM top issue 2021-02-12 15:53:31 -05:00
Jeff Epler ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
microDev f2d7a5f1e1
Merge branch 'main' into nvm-rp 2021-02-12 18:36:54 +05:30
microDev 527b11f99e
implement suggested changes
- update FLASH_FIRMWARE length
- use linker script define value
2021-02-12 18:28:48 +05:30
Dan Halbert 08f30fedf5
Merge pull request #4188 from ladyada/main
QT Py with RP2040
2021-02-11 22:19:56 -05:00
Damien George ede6b86a08 samd/mphalport: Fix USB CDC tx handling to work reliably.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-12 14:09:01 +11:00
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