Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .crit.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "base_branch": "adafruit/main" }
27 changes: 15 additions & 12 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
#: ports/cxd56/common-hal/pulseio/PulseIn.c
#: ports/espressif/common-hal/mii/RMII.c
#: ports/raspberrypi/common-hal/picodvi/Framebuffer_RP2350.c
#: ports/zephyr-cp/common-hal/busio/I2C.c
#: ports/zephyr-cp/common-hal/busio/SPI.c
Expand Down Expand Up @@ -1786,13 +1787,11 @@ msgstr ""

#: ports/espressif/common-hal/socketpool/Socket.c
#: ports/raspberrypi/common-hal/socketpool/Socket.c
#: ports/zephyr-cp/common-hal/socketpool/Socket.c
msgid "Out of sockets"
msgstr ""

#: ports/espressif/common-hal/socketpool/SocketPool.c
#: ports/raspberrypi/common-hal/socketpool/SocketPool.c
msgid "SocketPool can only be used with wifi.radio"
msgid "SocketPool can only be used with %q.%q or any %q.%q"
msgstr ""

#: ports/espressif/common-hal/watchdog/WatchDogTimer.c
Expand Down Expand Up @@ -2238,6 +2237,10 @@ msgstr ""
msgid "Only IPv4 sockets supported"
msgstr ""

#: ports/raspberrypi/common-hal/socketpool/SocketPool.c
msgid "SocketPool can only be used with wifi.radio"
msgstr ""

#: ports/raspberrypi/common-hal/usb_host/Port.c
msgid "All dma channels in use"
msgstr ""
Expand Down Expand Up @@ -2419,8 +2422,12 @@ msgstr ""
msgid "Use device tree to define %q devices"
msgstr ""

#: ports/zephyr-cp/common-hal/mii/Ethernet.c
msgid "cannot construct ethernet interfaces; use board.ETHERNET"
msgstr ""

#: ports/zephyr-cp/common-hal/socketpool/SocketPool.c
msgid "SocketPool can only be used with wifi.radio or hostnetwork.HostNetwork"
msgid "SocketPool can only be used with %q.%q, %q.%q, or %q.%q"
msgstr ""

#: ports/zephyr-cp/common-hal/usb_hid/Device.c shared-module/usb_hid/Device.c
Expand Down Expand Up @@ -4277,6 +4284,10 @@ msgstr ""
msgid "%q and %q contain duplicate pins"
msgstr ""

#: shared-bindings/mii/Ethernet.c shared-bindings/wifi/Radio.c
msgid "invalid hostname"
msgstr ""

#: shared-bindings/msgpack/ExtType.c
msgid "code outside range 0~127"
msgstr ""
Expand Down Expand Up @@ -4416,10 +4427,6 @@ msgstr ""
msgid "Invalid hex password"
msgstr ""

#: shared-bindings/wifi/Radio.c
msgid "invalid hostname"
msgstr ""

#: shared-bindings/wifi/Radio.c
msgid "Invalid MAC address"
msgstr ""
Expand Down Expand Up @@ -4684,10 +4691,6 @@ msgstr ""
msgid "Invalid socket for TLS"
msgstr ""

#: shared-module/ssl/SSLSocket.c
msgid "invalid key"
msgstr ""

#: shared-module/ssl/SSLSocket.c
msgid "invalid cert"
msgstr ""
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.16)
set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf)

# The component list here determines what options we get in menuconfig and what the ninja file can build.
set(COMPONENTS bt driver esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_pcnt esp_driver_rmt esp_driver_sdmmc esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp-tls esp_adc esp_event esp_netif esp_psram esp_security esp_wifi esptool_py freertos log lwip main mbedtls mdns pthread soc ulp wpa_supplicant esp_lcd vfs esp_stdio sdmmc esp-camera)
set(COMPONENTS bt driver esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_pcnt esp_driver_rmt esp_driver_sdmmc esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp_eth esp-tls esp_adc esp_adc_cal esp_event esp_netif esp_psram esp_security esp_wifi esptool_py freertos log lwip main mbedtls mdns pthread soc ulp wpa_supplicant esp-camera esp_lcd vfs esp_vfs_console esp_stdio sdmmc usb)
set(EXTRA_COMPONENT_DIRS "esp-protocols/components/mdns" "esp-camera")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
Expand Down
21 changes: 21 additions & 0 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ INC += \
-isystem esp-idf/components/esp_hw_support/port/$(IDF_TARGET)/private_include \
-isystem esp-idf/components/esp_hw_support/etm/include \
-isystem esp-idf/components/esp_mm/include \
-isystem esp-idf/components/esp_eth/include \
-isystem esp-idf/components/esp_netif/include \
-isystem esp-idf/components/esp_blockdev/include \
-isystem esp-idf/components/esp_partition/include \
Expand Down Expand Up @@ -128,6 +129,8 @@ INC += \
-isystem esp-idf/components/esp_hal_gpspi/$(IDF_TARGET)/include \
-isystem esp-idf/components/esp_hal_dma/include \
-isystem esp-idf/components/esp_hal_dma/$(IDF_TARGET)/include \
-isystem esp-idf/components/esp_hal_emac/include \
-isystem esp-idf/components/esp_hal_emac/$(IDF_TARGET)/include \
-isystem esp-idf/components/esp_hal_lcd/include \
-isystem esp-idf/components/esp_hal_lcd/$(IDF_TARGET)/include \
-isystem esp-idf/components/esp_hal_sd/include \
Expand Down Expand Up @@ -367,6 +370,7 @@ CFLAGS += -isystem esp-idf/components/esp_driver_touch_sens/hw_ver1/include
CHIP_COMPONENTS = \
esp_driver_dac \
esp_driver_touch_sens \
esp_hal_emac \
esp_hal_i2s \
esp_hal_lcd \
esp_hal_pcnt \
Expand Down Expand Up @@ -505,6 +509,7 @@ CHIP_COMPONENTS = \
esp_driver_tsens \
esp_driver_usb_serial_jtag \
esp_hal_dma \
esp_hal_emac \
esp_hal_i2s \
esp_hal_lcd \
esp_hal_pcnt \
Expand Down Expand Up @@ -957,9 +962,25 @@ LDFLAGS += -Trom.regi2c.ld
else
ESP_IDF_COMPONENTS_LINK += esp_hal_regi2c
endif
# Only targets with EMAC support (per SOC_EMAC_SUPPORTED in soc_caps.h) build
# libesp_hal_emac.a; those targets list it in their CHIP_COMPONENTS above. The
# component is interface-only elsewhere, so it must not appear in the list of
# components to link.
ifneq ($(CIRCUITPY_WIFI),0)
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp_security esp-tls esp_wifi lwip mdns wpa_supplicant esp_phy
endif
# mdns registers handlers on ETH_EVENT, which is defined by esp_eth. On EMAC-capable
# targets, esp_eth's compiled EMAC sources reference the esp_hal_emac symbols; that
# library comes via CHIP_COMPONENTS.
ifneq ($(CIRCUITPY_MDNS),0)
ESP_IDF_COMPONENTS_LINK += esp_eth
endif
ifneq ($(CIRCUITPY_MII),0)
ESP_IDF_COMPONENTS_LINK += esp_eth
ifeq ($(CIRCUITPY_WIFI),0)
ESP_IDF_COMPONENTS_LINK += esp_netif lwip mbedtls
endif
endif
ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
BLE_IMPL_esp32 := esp32
BLE_IMPL_esp32s3 := esp32c3
Expand Down
24 changes: 23 additions & 1 deletion ports/espressif/boards/espressif_esp32p4_function_ev/board.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
// SPDX-FileCopyrightText: Copyright (c) 2026 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include "supervisor/board.h"

#if CIRCUITPY_MII
#include "common-hal/mii/__init__.h"
#include "shared-bindings/mii/Ethernet.h"
#include "shared-bindings/mii/RMII.h"
#include "shared-bindings/microcontroller/Pin.h"

// The board owns its ethernet instance and the RMII bus wiring.
mii_rmii_obj_t board_rmii_obj;
mii_ethernet_obj_t board_ethernet_obj;

void board_init(void) {
common_hal_mii_rmii_construct(&board_rmii_obj,
&pin_GPIO31, &pin_GPIO52, // MDC, MDIO
&pin_GPIO29, &pin_GPIO30, &pin_GPIO28, // RXD0, RXD1, RX_DV
&pin_GPIO34, &pin_GPIO35, &pin_GPIO49, // TXD0, TXD1, TX_EN
&pin_GPIO50, // REFCLK
&pin_GPIO51); // PHY reset (active low)
common_hal_mii_ethernet_construct(&board_ethernet_obj, &board_rmii_obj, 1);
mii_set_default_instance(&board_ethernet_obj);
}
#endif

// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_PSRAM_SIZE = 32MB
CIRCUITPY_ESP_PSRAM_MODE = hpi
CIRCUITPY_ESP_PSRAM_FREQ = 200m

CIRCUITPY_MII = 1
CIRCUITPY_SSL = 1

# mdns on Espressif requires the wifi-based ESP-IDF mdns component
CIRCUITPY_MDNS = 0
12 changes: 12 additions & 0 deletions ports/espressif/boards/espressif_esp32p4_function_ev/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

#include "shared-bindings/board/__init__.h"

#if CIRCUITPY_MII
#include "common-hal/mii/Ethernet.h"

extern mii_ethernet_obj_t board_ethernet_obj;
extern mii_rmii_obj_t board_rmii_obj;
#endif

static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

Expand Down Expand Up @@ -86,5 +93,10 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {

{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

#if CIRCUITPY_MII
{ MP_ROM_QSTR(MP_QSTR_ETHERNET), MP_ROM_PTR(&board_ethernet_obj) },
{ MP_ROM_QSTR(MP_QSTR_RMII), MP_ROM_PTR(&board_rmii_obj) },
#endif
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
CONFIG_ESP32P4_REV_MIN_100=y
CONFIG_ETH_USE_ESP32_EMAC=y
28 changes: 22 additions & 6 deletions ports/espressif/boards/espressif_esp32p4x_function_ev/board.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT

Comment on lines -1 to -6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines 1-6 header seems to have been deleted inadvertently.

#include "supervisor/board.h"

#if CIRCUITPY_MII
#include "common-hal/mii/__init__.h"
#include "shared-bindings/mii/Ethernet.h"
#include "shared-bindings/mii/RMII.h"
#include "shared-bindings/microcontroller/Pin.h"

// The board owns its ethernet instance and the RMII bus wiring.
mii_rmii_obj_t board_rmii_obj;
mii_ethernet_obj_t board_ethernet_obj;

void board_init(void) {
common_hal_mii_rmii_construct(&board_rmii_obj,
&pin_GPIO31, &pin_GPIO52, // MDC, MDIO
&pin_GPIO29, &pin_GPIO30, &pin_GPIO28, // RXD0, RXD1, RX_DV
&pin_GPIO34, &pin_GPIO35, &pin_GPIO49, // TXD0, TXD1, TX_EN
&pin_GPIO50, // REFCLK
&pin_GPIO51); // PHY reset (active low)
common_hal_mii_ethernet_construct(&board_ethernet_obj, &board_rmii_obj, 1);
mii_set_default_instance(&board_ethernet_obj);
}
#endif

// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ CIRCUITPY_ESP_PSRAM_MODE = hpi
CIRCUITPY_ESP_PSRAM_FREQ = 200m

CIRCUITPY_ESP32P4_REV = 3

CIRCUITPY_MII = 1
CIRCUITPY_SSL = 1

# mdns on Espressif requires the wifi-based ESP-IDF mdns component
CIRCUITPY_MDNS = 0
12 changes: 12 additions & 0 deletions ports/espressif/boards/espressif_esp32p4x_function_ev/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

#include "shared-bindings/board/__init__.h"

#if CIRCUITPY_MII
#include "common-hal/mii/Ethernet.h"

extern mii_ethernet_obj_t board_ethernet_obj;
extern mii_rmii_obj_t board_rmii_obj;
#endif

static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

Expand Down Expand Up @@ -86,5 +93,10 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {

{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

#if CIRCUITPY_MII
{ MP_ROM_QSTR(MP_QSTR_ETHERNET), MP_ROM_PTR(&board_ethernet_obj) },
{ MP_ROM_QSTR(MP_QSTR_RMII), MP_ROM_PTR(&board_rmii_obj) },
#endif
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=6
# end of Component config

# end of Espressif IoT Development Framework Configuration
CONFIG_ETH_USE_ESP32_EMAC=y
Loading
Loading