wip; change never-ever reset pin mechanism
This commit is contained in:
parent
ca64950503
commit
780c4963cb
@ -247,7 +247,6 @@ SRC_C += \
|
||||
bindings/espidf/__init__.c \
|
||||
boards/$(BOARD)/board.c \
|
||||
boards/$(BOARD)/pins.c \
|
||||
modules/$(CIRCUITPY_MODULE).c \
|
||||
shared/netutils/netutils.c \
|
||||
peripherals/i2c.c \
|
||||
peripherals/rmt.c \
|
||||
|
@ -9,6 +9,7 @@ Support Status:
|
||||
.. csv-table::
|
||||
:header: SoC, Status
|
||||
|
||||
ESP, "beta"
|
||||
ESP32-C3, "beta"
|
||||
ESP32-S2, "stable"
|
||||
ESP32-S3, "beta"
|
||||
@ -20,13 +21,17 @@ How this port is organized:
|
||||
- **boards/** contains the configuration files for each development board and breakout available on the port.
|
||||
- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings.
|
||||
- **esp-idf/** contains the Espressif IoT Development Framework installation, including all the drivers for the port.
|
||||
- **modules/** contains information specific to certain Espressif SoC based hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM.
|
||||
- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**.
|
||||
- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup.
|
||||
- **tools/** includes useful Python scripts for debugging and other purposes.
|
||||
|
||||
At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled CircuitPython modules.
|
||||
|
||||
Connecting to the ESP32
|
||||
---------------------------------------
|
||||
The ESP32 chip itself has no USB support. On many boards there is a USB-serial adapter chip, such as a CP2102N, CP2104 or CH9102F, usually connected to the ESP32 TXD0 (GPIO1)and RXD0 (GPIO3) pins, for access to the bootloader. CircuitPython also uses this serial channel for the REPL.
|
||||
|
||||
|
||||
Connecting to the ESP32-C3
|
||||
---------------------------------------
|
||||
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -14,4 +14,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 8MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32_pico_mini_02
|
||||
CIRCUITPY_ESP_PSRAM = 1
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s3_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s3_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
# Include these Python libraries in firmware.
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
|
||||
|
@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
# Include these Python libraries in firmware.
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -17,4 +17,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -18,7 +18,7 @@ CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_BITBANG_APA102 = 1
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
# Include these Python libraries in firmware.
|
||||
# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
|
||||
|
@ -18,4 +18,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
|
@ -16,7 +16,7 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wroom
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -16,4 +16,4 @@ CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 40m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
CIRCUITPY_MODULE = esp32s2_wrover
|
||||
CIRCUITPY_ESP_PSRAM = 0
|
||||
|
@ -40,6 +40,73 @@
|
||||
STATIC uint32_t never_reset_pins[2];
|
||||
STATIC uint32_t in_use[2];
|
||||
|
||||
// Bit mask of all pins that should never ever be reset.
|
||||
// Typically these are SPI flash and PSRAM control pins, and communication pins.
|
||||
static const uint64_t pin_mask_reset_forbidden =
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
// Never ever reset serial pins for bootloader and possibly USB-serial converter.
|
||||
GPIO_SEL_1 | // TXD0
|
||||
GPIO_SEL_3 | // RXD0
|
||||
// Never ever reset pins used to communicate with SPI flash and PSRAM.
|
||||
GPIO_SEL_6 | // CLK
|
||||
GPIO_SEL_9 | // (PSRAM) SD2
|
||||
GPIO_SEL_10 | // (PSRAM) SD3
|
||||
GPIO_SEL_11 | // CMD
|
||||
GPIO_SEL_16 | // SPIHD
|
||||
GPIO_SEL_17 | // SPIDO
|
||||
GPIO_SEL_18 | // SPIWP
|
||||
GPIO_SEL_23 | // SPIDI
|
||||
#endif // ESP32
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
// Never ever reset pins used to communicate with SPI flash.
|
||||
GPIO_SEL_11 | // VDD_SPI
|
||||
GPIO_SEL_12 | // SPIHD
|
||||
GPIO_SEL_13 | // SPIWP
|
||||
GPIO_SEL_14 | // SPICS0
|
||||
GPIO_SEL_15 | // SPICLK
|
||||
GPIO_SEL_16 | // SPID
|
||||
GPIO_SEL_17 | // SPIQ
|
||||
#if CIRCUITPY_ESP_USB_SERIAL_JTAG
|
||||
// Never ever reset serial/JTAG communication pins.
|
||||
GPIO_SEL_18 | // USB D-
|
||||
GPIO_SEL_19 | // USB D+
|
||||
#endif
|
||||
#endif // ESP32C3
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
// Never ever reset pins used to communicate with SPI flash and PSRAM.
|
||||
GPIO_SEL_19 | // USB D-
|
||||
GPIO_SEL_20 | // USB D+
|
||||
#if CIRCUITPY_ESP_PSRAM
|
||||
// Board uses PSRAM, and needs another chip select.
|
||||
GPIO_SEL_26 | // SPICS1
|
||||
#endif
|
||||
GPIO_SEL_27 | // SPIHD
|
||||
GPIO_SEL_28 | // SPIWP
|
||||
GPIO_SEL_29 | // SPICS0
|
||||
GPIO_SEL_30 | // SPICLK
|
||||
GPIO_SEL_31 | // SPIHD
|
||||
GPIO_SEL_32 | // SPIQ
|
||||
#if defined(CONFIG_SPIRAM_MODE_OCT)
|
||||
// Never reset octal SPI flash pins DQ4-DQ7 and DQS/DM.
|
||||
GPIO_SEL_33 | // SPIIO4
|
||||
GPIO_SEL_34 | // SPIIO5
|
||||
GPIO_SEL_35 | // SPIIO6
|
||||
GPIO_SEL_36 | // SPIIO7
|
||||
GPIO_SEL_37 | // SPIDQS
|
||||
#endif
|
||||
#if CIRCUITPY_USB
|
||||
// Never ever reset USB pins.
|
||||
GPIO_SEL_19 | // USB D-
|
||||
GPIO_SEL_20 | // USB D+
|
||||
#endif
|
||||
#endif // ESP32S2, ESP32S3
|
||||
|
||||
0; // Terminate last "|".
|
||||
|
||||
|
||||
|
||||
void never_reset_pin_number(gpio_num_t pin_number) {
|
||||
if (pin_number == NO_PIN) {
|
||||
return;
|
||||
@ -59,40 +126,10 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
|
||||
}
|
||||
|
||||
STATIC void _reset_pin(gpio_num_t pin_number) {
|
||||
// Never ever reset pins used for flash and RAM.
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
if (pin_number == 1 || pin_number == 6 || pin_number == 11 || pin_number == 9 || pin_number == 10 || pin_number == 17 || pin_number == 23) {
|
||||
// Never ever reset pins used for flash, RAM, and basic communication.
|
||||
if (pin_mask_reset_forbidden & (((uint64_t)1) << pin_number)) {
|
||||
return;
|
||||
}
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
// Never ever reset pins used for flash and RAM.
|
||||
if (26 <= pin_number && pin_number <= 32) {
|
||||
return;
|
||||
}
|
||||
#ifdef CONFIG_SPIRAM_MODE_OCT
|
||||
// Octal DQ4-DQ7 and DQS/DM
|
||||
if (33 <= pin_number && pin_number <= 37) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_USB
|
||||
// Never reset USB pins.
|
||||
if (pin_number == 19 || pin_number == 20) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
// Never ever reset pins used for flash and RAM.
|
||||
if (11 <= pin_number && pin_number <= 17) {
|
||||
return;
|
||||
}
|
||||
#if CIRCUITPY_ESP_USB_SERIAL_JTAG
|
||||
if (pin_number == 18 || pin_number == 19) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Give the board a chance to reset the pin in a particular way.
|
||||
if (espressif_board_reset_pin_number(pin_number)) {
|
||||
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
// SPI Flash and PSRAM
|
||||
common_hal_never_reset_pin(&pin_GPIO6);
|
||||
common_hal_never_reset_pin(&pin_GPIO9);
|
||||
common_hal_never_reset_pin(&pin_GPIO10);
|
||||
common_hal_never_reset_pin(&pin_GPIO11);
|
||||
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
// SPI Flash
|
||||
common_hal_never_reset_pin(&pin_GPIO27);
|
||||
common_hal_never_reset_pin(&pin_GPIO28);
|
||||
common_hal_never_reset_pin(&pin_GPIO29);
|
||||
common_hal_never_reset_pin(&pin_GPIO30);
|
||||
common_hal_never_reset_pin(&pin_GPIO31);
|
||||
common_hal_never_reset_pin(&pin_GPIO32);
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
// SPI Flash and RAM
|
||||
common_hal_never_reset_pin(&pin_GPIO26);
|
||||
common_hal_never_reset_pin(&pin_GPIO27);
|
||||
common_hal_never_reset_pin(&pin_GPIO28);
|
||||
common_hal_never_reset_pin(&pin_GPIO29);
|
||||
common_hal_never_reset_pin(&pin_GPIO30);
|
||||
common_hal_never_reset_pin(&pin_GPIO31);
|
||||
common_hal_never_reset_pin(&pin_GPIO32);
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
// SPI Flash
|
||||
common_hal_never_reset_pin(&pin_GPIO27);
|
||||
common_hal_never_reset_pin(&pin_GPIO28);
|
||||
common_hal_never_reset_pin(&pin_GPIO29);
|
||||
common_hal_never_reset_pin(&pin_GPIO30);
|
||||
common_hal_never_reset_pin(&pin_GPIO31);
|
||||
common_hal_never_reset_pin(&pin_GPIO32);
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
// SPI Flash and RAM
|
||||
common_hal_never_reset_pin(&pin_GPIO26);
|
||||
common_hal_never_reset_pin(&pin_GPIO27);
|
||||
common_hal_never_reset_pin(&pin_GPIO28);
|
||||
common_hal_never_reset_pin(&pin_GPIO29);
|
||||
common_hal_never_reset_pin(&pin_GPIO30);
|
||||
common_hal_never_reset_pin(&pin_GPIO31);
|
||||
common_hal_never_reset_pin(&pin_GPIO32);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
|
||||
#define MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
|
||||
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
void never_reset_module_internal_pins(void);
|
||||
|
||||
#endif // MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "modules/module.h"
|
||||
|
||||
void never_reset_module_internal_pins(void) {
|
||||
}
|
@ -31,8 +31,6 @@ CIRCUITPY_WATCHDOG ?= 1
|
||||
|
||||
CIRCUITPY_ESPIDF ?= 1
|
||||
|
||||
CIRCUITPY_MODULE ?= none
|
||||
|
||||
ifeq ($(IDF_TARGET),esp32)
|
||||
CIRCUITPY_BLEIO = 0
|
||||
CIRCUITPY_BLEIO_HCI = 0
|
||||
@ -82,3 +80,8 @@ endif
|
||||
# only if something else is turned off, such as HID.
|
||||
USB_NUM_ENDPOINT_PAIRS = 7
|
||||
USB_NUM_IN_ENDPOINTS = 5
|
||||
|
||||
#ifndef CIRCUITPY_ESP_PSRAM
|
||||
#error CIRCUITPY_ESP_PSRAM must be specified in mpconfigboard.mk as 0 or 1. Use 1 if the board has PSRAM.
|
||||
#endif
|
||||
CFLAGS += -DCIRCUITPY_ESP_PSRAM=$(CIRCUITPY_ESP_PSRAM)
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <sys/time.h>
|
||||
#include "supervisor/board.h"
|
||||
#include "supervisor/port.h"
|
||||
#include "modules/module.h"
|
||||
#include "py/runtime.h"
|
||||
#include "supervisor/esp_port.h"
|
||||
|
||||
@ -162,7 +161,6 @@ safe_mode_t port_init(void) {
|
||||
#endif
|
||||
|
||||
heap = NULL;
|
||||
never_reset_module_internal_pins();
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG (0)
|
||||
|
Loading…
Reference in New Issue
Block a user