Commit Graph

29 Commits

Author SHA1 Message Date
Scott Shawcroft d6344812e8
Lots of web workflow, C3 and title bar fixes
* Fixes #6221 - C3 hang on `import wifi`. Enabling the WiFi PHY was
  disabling USB. Now boards that use it set CONFIG_ESP_PHY_ENABLE_USB
  explicitly.
* Fixes #6655 - Allows pasting into the web serial page. Fixes reading
  more than 0xf bytes at a time.
* Fixes #6653 - Fixes web socket encoding of payloads >125 bytes. Can
  happen when printing a long string.
* Fixes C3 responsiveness when waiting for key to enter REPL. (It
  now correctly stops sleeping.)
* Disables title bar updates when in raw REPL. Related to #6548.
* Adds version to title bar.
2022-07-28 16:06:56 -07:00
Scott Shawcroft e9dd254127
Add socket select task to wake CP
This fixes the web workflow on boards without a display.

Fixes #6552
2022-07-13 17:35:35 -07:00
Jeff Epler 09b754ffa0
espressif: Set heap size automatically, like micropython
rather than setting the heap size statically, micropython allocates
the biggest contiguous chunk possible, but in no event more than half the
total internal sram. On esp32 this gives 123728 bytes of `gc.mem_free`
in the repl.
2022-07-13 14:00:59 -05:00
Jeff Epler 09d1c846c4
Set heap size to 0 when heap allocation fails 2022-07-13 13:53:22 -05:00
Jeff Epler c1b6c367ff
esp32 can allocate 88kB successfully 2022-07-13 13:53:08 -05:00
Jeff Epler 13be10ef14
rename function to avoid confusion 2022-07-13 13:28:51 -05:00
Jeff Epler f620c2901c
Set a small but working heap size for esp32 without psram 2022-07-13 11:10:00 -05:00
Jeff Epler 953f44b46e
Fix spiram limit calculation on esp32
esp32 places the psram start at SOC_EXTRAM_DATA_LOW and it can extend
up to SOC_EXTRAM_DATA_SIZE. This is different than esp32-s2 and later,
which place the end at EXTRAM_DATA_HIGH and the limitation of
SOC_EXTRAM_DATA_SIZE was not previously identified as important.
Additionally, the esp32 has a reserved area within himem which was
not being accounted for.

With this change, the Feather ESP32 V2 feather can be used via thonny,
and the other "quick memory corruption tests" I was performing
also all succeed instead of failing.

Before this change, the incorrect address being used for spiram was
0x3fa00000..0x3fc00000 (2MiB). Now, it's 0x3f800000..0x3f9c0000 (1.75MiB)
due to the reserved area and the changed start address.

This is intended to be a no-effect change for other espressif chips besides
original esp32.
2022-07-13 10:52:15 -05:00
Dan Halbert c316b950c7 merge from adafruit/main 2022-07-08 15:42:19 -04:00
Dan Halbert 4e88d795e1 Thonny causing crash emitglue.c:199: 2022-07-06 23:01:19 -04:00
Scott Shawcroft d42c811fb9
Safe mode when ESP interrupt watchdog fires
This makes us enter safe mode when sleep on the S3 fails. The
task watchdog is used for the user watchdog.
2022-06-29 12:31:18 -07:00
Dan Halbert 780c4963cb wip; change never-ever reset pin mechanism 2022-06-28 23:06:49 -04:00
Dan Halbert 55784c93de wip; compiles 2022-06-26 21:22:22 -04:00
Scott Shawcroft 6446010753
Wi-Fi autoconnect and title bar status
This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD
in `/.env`. When both are defined, CircuitPython will attempt to
connect to the network even when user code isn't running. If the
user code attempts to a network with the same SSID, it will return
immediately. Connecting to another SSID will disconnect from the
auto-connected network. If the user code initiates the connection,
then it will be shutdown after user code exits. (Should match <8
behavior.)

This PR also reworks the default displayio terminal. It now supports
a title bar TileGrid in addition to the (newly renamed) scroll area.
The default title bar is the top row of the display and is positioned
to the right of the Blinka logo when it is enabled. The scroll area
is now below the Blinka logo.

The Wi-Fi auto-connect code now uses the title bar to show its
state including the IP address when connected. It does this through
the "standard" OSC control sequence `ESC ] 0 ; <s> ESC \` where <s>
is the title bar string. This is commonly supported by terminals
so it should work over USB and UART as well.

Related to #6174
2022-06-09 14:55:54 -07:00
Scott Shawcroft 269d51d023
Add two stage reset for BLE
This lets the BLE stack run through the wait period after a VM run
when it may be waiting for more writes due to an auto-reload.

User BLE functionality will have their events stopped. Scanning and
advertising is also stopped.
2022-05-12 13:20:44 -07:00
Scott Shawcroft 5a6f456dbb
Add BLE scanning for S3 and C3.
Everything else should raise NotImplementedError.

First step in #5926
2022-01-25 16:28:46 -08:00
MicroDev dab35f7c72
Merge pull request #5880 from jepler/espressif-serial-trick-uf2
Request ROM bootloader when resetting using the 'serial trick'
2022-01-21 09:56:12 +05:30
Jeff Epler ea30a8ac04
Reboot into the ROM bootloader from 1200 baud
Per Scott, the purpose of this trick is to make the board programmable from Arduino even when CP is installed, so my convenience of escaping into UF2 is not going to work out.
2022-01-20 18:50:50 -06:00
Scott Shawcroft 78942112c7
Ensure supervisor_tick is run on the same core as CP 2022-01-19 11:36:40 -08:00
Jeff Epler 872beeccfe
Merge remote-tracking branch 'origin/main' into espressif-serial-trick-uf2 2022-01-18 19:07:05 -06:00
Scott Shawcroft 679f4b30ba
Tweak heap sizes for different targets 2022-01-18 15:23:19 -08:00
Jeff Epler 49b8579bcd
Request UF2 bootloader when resetting using the 'serial trick' 2022-01-17 17:14:31 -06:00
Jeff Epler 1207bfced9 espressif: Use detected size of spiram 2021-12-04 09:14:22 -06:00
microDev 7ba5513f9a
update espressif port
- update esp-idf to v4.4
- add esp32s3 support
- add analogio on esp32c3
- disable rgbmatrix on all espressif soc

Co-authored-by: Scott Shawcroft <scott@adafruit.com>
Co-authored-by: Seon Rozenblum <seon@unexpectedmaker.com>
2021-11-24 18:01:34 +05:30
Jeff Epler c9475adb00
Enable -Werror=missing-prototypes on espressif port 2021-11-10 11:07:45 -06:00
Jeff Epler 6351de6ad1 espressif: Allow -DENABLE_JTAG=0 to force JTAG off
With the Kaluga devkit, the camera interferes with the JTAG function.
However, having DEBUG turned on e.g., to get extended debug information
on the UART debug connection remains useful.

Now, by arranging to add to CFLAGS += -DDEBUG -DENABLE_JTAG=0, this
configuration is easy to achieve.
2021-11-08 10:38:05 -06:00
microDev 3da86b0ac2
add initial esp32c3 support 2021-09-26 09:39:40 +05:30
microDev 1536ec0123
rename left over esp32s2 to espressif 2021-09-18 19:42:18 +05:30
Scott Shawcroft 973a90f2aa
Rename esp32s2 port to espressif
This is in preparation for ESP32-S3 support and potentially others.

Related to #4363
2021-09-13 16:44:55 -07:00