Skip to content

Commit 524cc5e

Browse files
authored
Merge pull request #6685 from tannewt/esp32_ww
Enable Web Workflow on Feather ESP32 V2
2 parents febedeb + 74e841d commit 524cc5e

File tree

20 files changed

+696
-27
lines changed

20 files changed

+696
-27
lines changed

locale/circuitpython.pot

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,6 @@ msgstr ""
958958
msgid "Failed to connect: timeout"
959959
msgstr ""
960960

961-
#: ports/espressif/common-hal/wifi/__init__.c
962-
msgid "Failed to init wifi"
963-
msgstr ""
964-
965961
#: shared-module/audiomp3/MP3Decoder.c
966962
msgid "Failed to parse MP3 file"
967963
msgstr ""
@@ -1548,7 +1544,7 @@ msgstr ""
15481544
msgid "Only IPv4 addresses supported"
15491545
msgstr ""
15501546

1551-
#: ports/espressif/common-hal/socketpool/SocketPool.c
1547+
#: ports/espressif/common-hal/socketpool/Socket.c
15521548
msgid "Only IPv4 sockets supported"
15531549
msgstr ""
15541550

@@ -1616,7 +1612,7 @@ msgstr ""
16161612
msgid "Out of memory"
16171613
msgstr ""
16181614

1619-
#: ports/espressif/common-hal/socketpool/SocketPool.c
1615+
#: ports/espressif/common-hal/socketpool/Socket.c
16201616
msgid "Out of sockets"
16211617
msgstr ""
16221618

@@ -3759,11 +3755,20 @@ msgstr ""
37593755
msgid "pow() with 3 arguments requires integers"
37603756
msgstr ""
37613757

3758+
#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h
3759+
msgid "pressing BOOT button at start up.\n"
3760+
msgstr ""
3761+
37623762
#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h
37633763
msgid "pressing SW38 button at start up.\n"
37643764
msgstr ""
37653765

3766+
#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h
3767+
msgid "pressing VOLUME button at start up.\n"
3768+
msgstr ""
3769+
37663770
#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h
3771+
#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h
37673772
#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h
37683773
#: supervisor/shared/safe_mode.c
37693774
msgid "pressing boot button at start up.\n"

ports/atmel-samd/boards/pybadge/board.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
#include "shared-module/displayio/mipi_constants.h"
3434
#include "supervisor/shared/board.h"
3535

36-
displayio_fourwire_obj_t board_display_obj;
37-
3836
#define DELAY 0x80
3937

4038
uint8_t display_init_sequence[] = {

ports/espressif/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ INC += \
9898
-isystem esp-idf/components/bt/host/nimble/port/include \
9999
-isystem esp-idf/components/driver/include \
100100
-isystem esp-idf/components/driver/$(IDF_TARGET)/include \
101+
-isystem esp-idf/components/efuse/include \
102+
-isystem esp-idf/components/efuse/$(IDF_TARGET)/include \
101103
-isystem esp-idf/components/$(IDF_TARGET)/include \
102104
-isystem esp-idf/components/esp_adc_cal/include \
103105
-isystem esp-idf/components/esp_common/include \

ports/espressif/boards/adafruit_feather_esp32_v2/board.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,19 @@ void reset_board(void) {
4747

4848
void board_deinit(void) {
4949
}
50+
51+
bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
52+
// Pull LED down on reset rather than the default up
53+
if (pin_number == 13) {
54+
gpio_config_t cfg = {
55+
.pin_bit_mask = BIT64(pin_number),
56+
.mode = GPIO_MODE_DISABLE,
57+
.pull_up_en = false,
58+
.pull_down_en = true,
59+
.intr_type = GPIO_INTR_DISABLE,
60+
};
61+
gpio_config(&cfg);
62+
return true;
63+
}
64+
return false;
65+
}

ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ LONGINT_IMPL = MPZ
1010
# so increase it to 32.
1111
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
1212

13-
CIRCUITPY_STATUS_BAR = 0
14-
CIRCUITPY_WEB_WORKFLOW = 0
15-
1613
CIRCUITPY_ESP_FLASH_MODE = dio
1714
CIRCUITPY_ESP_FLASH_FREQ = 40m
1815
CIRCUITPY_ESP_FLASH_SIZE = 8MB
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
#include "mpconfigboard.h"
29+
#include "shared-bindings/microcontroller/Pin.h"
30+
#include "components/driver/include/driver/gpio.h"
31+
#include "components/hal/include/hal/gpio_hal.h"
32+
#include "common-hal/microcontroller/Pin.h"
33+
34+
void board_init(void) {
35+
reset_board();
36+
}
37+
38+
bool board_requests_safe_mode(void) {
39+
return false;
40+
}
41+
42+
void reset_board(void) {
43+
// Turn on NeoPixel power by default.
44+
gpio_set_direction(8, GPIO_MODE_DEF_OUTPUT);
45+
gpio_set_level(8, true);
46+
}
47+
48+
void board_deinit(void) {
49+
// Turn off NeoPixel
50+
gpio_set_direction(8, GPIO_MODE_DEF_OUTPUT);
51+
gpio_set_level(8, false);
52+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2022 Dan Halbert for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#define MICROPY_HW_BOARD_NAME "Adafruit QT Py ESP32 PICO"
28+
#define MICROPY_HW_MCU_NAME "ESP32"
29+
30+
#define MICROPY_HW_NEOPIXEL (&pin_GPIO5)
31+
32+
#define CIRCUITPY_BOARD_I2C (2)
33+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO33, .sda = &pin_GPIO4}, \
34+
{.scl = &pin_GPIO19, .sda = &pin_GPIO22}}
35+
36+
#define CIRCUITPY_BOARD_SPI (1)
37+
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO14, .mosi = &pin_GPIO13, .miso = &pin_GPIO12}}
38+
39+
#define CIRCUITPY_BOARD_UART (1)
40+
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO32, .rx = &pin_GPIO7}}
41+
42+
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
43+
44+
// Explanation of how a user got into safe mode
45+
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n")
46+
47+
// UART pins attached to the USB-serial converter chip
48+
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1)
49+
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CIRCUITPY_CREATOR_ID = 0x0000239A
2+
CIRCUITPY_CREATION_ID = 0x00320003
3+
4+
IDF_TARGET = esp32
5+
6+
INTERNAL_FLASH_FILESYSTEM = 1
7+
LONGINT_IMPL = MPZ
8+
9+
# The default queue depth of 16 overflows on release builds,
10+
# so increase it to 32.
11+
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
12+
13+
CIRCUITPY_ESP_FLASH_MODE = dio
14+
CIRCUITPY_ESP_FLASH_FREQ = 40m
15+
CIRCUITPY_ESP_FLASH_SIZE = 8MB
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
CIRCUITPY_BOARD_BUS_SINGLETON(stemma_i2c, i2c, 1)
4+
5+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
6+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
7+
8+
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) },
9+
{ MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) },
10+
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) },
11+
12+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
13+
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO26) },
14+
15+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) },
16+
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO25) },
17+
18+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) },
19+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO27) },
20+
21+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) },
22+
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO15) },
23+
24+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) },
25+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO4) },
26+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) },
27+
28+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) },
29+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO33) },
30+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) },
31+
32+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO32) },
33+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO32) },
34+
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO32) },
35+
36+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO7) },
37+
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO7) },
38+
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO7) },
39+
40+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO13) },
41+
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO13) },
42+
43+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) },
44+
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO14) },
45+
46+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO12) },
47+
{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO12) },
48+
49+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO8) },
50+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO5) },
51+
52+
{ MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO19) },
53+
{ MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO19) },
54+
55+
{ MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO22) },
56+
{ MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO22) },
57+
58+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
59+
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_stemma_i2c_obj) },
60+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
61+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
62+
};
63+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Partition Table
3+
#
4+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
5+
CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv"
6+
# end of Partition Table
7+
8+
#
9+
# SPI RAM config
10+
#
11+
# CONFIG_SPIRAM_TYPE_AUTO is not set
12+
CONFIG_SPIRAM_TYPE_ESPPSRAM16=y
13+
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
14+
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
15+
CONFIG_SPIRAM_SIZE=2097152
16+
CONFIG_SPIRAM_SPEED_40M=y
17+
CONFIG_SPIRAM=y
18+
CONFIG_SPIRAM_BOOT_INIT=y
19+
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
20+
CONFIG_SPIRAM_USE_MEMMAP=y
21+
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
22+
# CONFIG_SPIRAM_USE_MALLOC is not set
23+
CONFIG_SPIRAM_MEMTEST=y
24+
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
25+
# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set
26+
CONFIG_SPIRAM_CACHE_WORKAROUND=y
27+
28+
#
29+
# SPI RAM config
30+
#
31+
CONFIG_ESP32_SPIRAM_SUPPORT=y
32+
# CONFIG_SPIRAM_TYPE_AUTO is not set
33+
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
34+
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
35+
36+
### # Uncomment to send log output to TX/RX pins on Feather ESP32V2
37+
### #
38+
### # ESP System Settings
39+
### #
40+
### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
41+
### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set
42+
### CONFIG_ESP_CONSOLE_UART_CUSTOM=y
43+
### # CONFIG_ESP_CONSOLE_NONE is not set
44+
### CONFIG_ESP_CONSOLE_UART=y
45+
### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y
46+
### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set
47+
### CONFIG_ESP_CONSOLE_UART_NUM=0
48+
### CONFIG_ESP_CONSOLE_UART_TX_GPIO=8
49+
### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7
50+
### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
51+
### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set
52+
### # end of ESP System Settings

0 commit comments

Comments
 (0)