Skip to content

Commit 7f7fb2a

Browse files
committed
Merge branch 'dev-ethernet' into dev-x
2 parents 36082c6 + fa22572 commit 7f7fb2a

File tree

12 files changed

+76
-17
lines changed

12 files changed

+76
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ This repository is a clone of the main, upstream repository found at
1717
https://github.com/micropython/micropython. This repository adds a new
1818
branch called `esp32` which contains a port of MicroPython to the ESP32
1919
microcontroller, under the MIT license. Please see the `README.md` file
20-
in the `esp32/` subdirectory for details of this port.
20+
in the `ports/esp32/` subdirectory for details of this port.
2121

2222
This `esp32` branch is the default branch and all pull requests should be
2323
made to this branch, and any issues should discuss only the code developed
24-
in the `esp32/` subdirectory.
24+
in the `ports/esp32/` subdirectory.
2525

2626
The `esp32` branch will not be rebased so it is safe to clone/fork it and
2727
base your work on it. New commits from the upstream repository will

ports/esp32/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ESPCOMP = $(ESPIDF)/components
2929
ESPTOOL ?= $(ESPCOMP)/esptool_py/esptool/esptool.py
3030

3131
# verify the ESP IDF version
32-
ESPIDF_SUPHASH := 9a26296a0e88a4c3ae27e9c848be970946fff87e
32+
ESPIDF_SUPHASH := 2c95a77cf93781f296883d5dbafcdc18e4389656
3333
ESPIDF_CURHASH := $(shell git -C $(ESPIDF) show -s --pretty=format:'%H')
3434
ifneq ($(ESPIDF_CURHASH),$(ESPIDF_SUPHASH))
3535
$(info ** WARNING **)
@@ -136,12 +136,11 @@ SRC_C = \
136136
machine_uart.c \
137137
modmachine.c \
138138
modnetwork.c \
139-
network_lan.c \
139+
network_lan.c \
140140
modsocket.c \
141141
modesp.c \
142142
moduhashlib.c \
143143
espneopixel.c \
144-
machine_rtc.c \
145144
machine_hw_spi.c \
146145
machine_wdt.c \
147146
mpthreadport.c \
@@ -216,6 +215,7 @@ ESPIDF_DRIVER_O = $(addprefix $(ESPCOMP)/driver/,\
216215

217216
$(BUILD)/$(ESPCOMP)/esp32/dport_access.o: CFLAGS += -Wno-array-bounds
218217
ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
218+
brownout.o \
219219
panic.o \
220220
esp_timer.o \
221221
esp_timer_esp32.o \
@@ -242,7 +242,7 @@ ESPIDF_ESP32_O = $(addprefix $(ESPCOMP)/esp32/,\
242242
intr_alloc.o \
243243
dport_access.o \
244244
wifi_init.o \
245-
sleep_modes.o \
245+
wifi_internal.o \
246246
)
247247

248248
ESPIDF_HEAP_O = $(addprefix $(ESPCOMP)/heap/,\
@@ -287,6 +287,7 @@ ESPIDF_EXPAT_O = $(addprefix $(ESPCOMP)/expat/,\
287287

288288
ESPIDF_PTHREAD_O = $(addprefix $(ESPCOMP)/pthread/,\
289289
pthread.o \
290+
pthread_local_storage.o \
290291
)
291292

292293
# Assembler .S files need only basic flags, and in particular should not have
@@ -453,6 +454,7 @@ ESPIDF_LWIP_O = $(addprefix $(ESPCOMP)/lwip/,\
453454
port/freertos/sys_arch.o \
454455
port/netif/wlanif.o \
455456
port/netif/ethernetif.o \
457+
port/vfs_lwip.o \
456458
)
457459

458460
ESPIDF_MBEDTLS_O = $(addprefix $(ESPCOMP)/mbedtls/,\
@@ -621,7 +623,7 @@ APP_LD_ARGS += -L$(dir $(LIBSTDCXX_FILE_NAME)) -lstdc++
621623
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a
622624
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a
623625
APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a
624-
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist
626+
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist -lwps -lwpa2
625627
APP_LD_ARGS += $(OBJ)
626628
APP_LD_ARGS += --end-group
627629

ports/esp32/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ a task under FreeRTOS.
77

88
Supported features include:
99
- REPL (Python prompt) over UART0.
10-
- 16k stack for the MicroPython task and 64k Python heap.
10+
- 16k stack for the MicroPython task and 96k Python heap.
1111
- Many of MicroPython's features are enabled: unicode, arbitrary-precision
1212
integers, single-precision floats, complex numbers, frozen bytecode, as
1313
well as many of the internal modules.
14-
- Internal filesystem using the flash (currently 256k in size).
15-
- The machine module with basic GPIO and bit-banging I2C, SPI support.
14+
- Internal filesystem using the flash (currently 2M in size).
15+
- The machine module with GPIO, UART, SPI, software I2C, ADC, DAC, PWM,
16+
TouchPad, WDT and Timer.
17+
- The network module with WLAN (WiFi) support.
1618

1719
Development of this ESP32 port was sponsored in part by Microbric Pty Ltd.
1820

ports/esp32/esp32.custom_common.ld

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ SECTIONS
8989
*esp32/core_dump.o(.literal .text .literal.* .text.*)
9090
*app_trace/*(.literal .text .literal.* .text.*)
9191
*xtensa-debug-module/eri.o(.literal .text .literal.* .text.*)
92-
*esp32/app_trace.o(.literal .text .literal.* .text.*)
9392
*libphy.a:(.literal .text .literal.* .text.*)
9493
*librtc.a:(.literal .text .literal.* .text.*)
9594
*libsoc.a:(.literal .text .literal.* .text.*)
9695
*libhal.a:(.literal .text .literal.* .text.*)
9796
*libgcc.a:lib2funcs.o(.literal .text .literal.* .text.*)
9897
*spi_flash/spi_flash_rom_patch.o(.literal .text .literal.* .text.*)
98+
*libgcov.a:(.literal .text .literal.* .text.*)
99+
INCLUDE esp32.spiram.rom-functions-iram.ld
99100
*py/scheduler.o*(.literal .text .literal.* .text.*)
100101
_iram_text_end = ABSOLUTE(.);
101102
} > iram0_0_seg
@@ -117,9 +118,12 @@ SECTIONS
117118
*(.dram1 .dram1.*)
118119
*esp32/panic.o(.rodata .rodata.*)
119120
*libphy.a:(.rodata .rodata.*)
120-
*app_trace/app_trace.o:(.rodata .rodata.*)
121+
*soc/esp32/rtc_clk.o(.rodata .rodata.*)
122+
*app_trace/app_trace.o(.rodata .rodata.*)
123+
*libgcov.a:(.rodata .rodata.*)
121124
*heap/multi_heap.o(.rodata .rodata.*)
122125
*heap/multi_heap_poisoning.o(.rodata .rodata.*)
126+
INCLUDE esp32.spiram.rom-functions-dram.ld
123127
_data_end = ABSOLUTE(.);
124128
. = ALIGN(4);
125129
} >dram0_0_seg

ports/esp32/machine_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
131131
}
132132
channel = avail;
133133
}
134+
self->channel = channel;
134135

135136
// New PWM assignment
136137
self->active = 1;
@@ -148,7 +149,6 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
148149
"PWM not supported on pin %d", self->pin));
149150
}
150151
chan_gpio[channel] = self->pin;
151-
self->channel = channel;
152152
}
153153

154154
// Maybe change PWM timer

ports/esp32/machine_wdt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ STATIC mp_obj_t machine_wdt_make_new(const mp_obj_type_t *type_in, size_t n_args
5454
esp_task_wdt_feed();
5555
return &wdt_default;
5656
default:
57-
mp_raise_ValueError("");
57+
mp_raise_ValueError(NULL);
5858
}
5959
}
6060

@@ -65,7 +65,6 @@ STATIC mp_obj_t machine_wdt_feed(mp_obj_t self_in) {
6565
}
6666
STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_wdt_feed_obj, machine_wdt_feed);
6767

68-
6968
STATIC const mp_map_elem_t machine_wdt_locals_dict_table[] = {
7069
{ MP_OBJ_NEW_QSTR(MP_QSTR_feed), (mp_obj_t)&machine_wdt_feed_obj },
7170
};

ports/esp32/modmachine.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
157157

158158
{ MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&machine_wdt_type) },
159159
{ MP_ROM_QSTR(MP_QSTR_Timer), MP_ROM_PTR(&machine_timer_type) },
160+
{ MP_ROM_QSTR(MP_QSTR_WDT), MP_ROM_PTR(&machine_wdt_type) },
160161
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) },
161162
{ MP_ROM_QSTR(MP_QSTR_Signal), MP_ROM_PTR(&machine_signal_type) },
162163
{ MP_ROM_QSTR(MP_QSTR_TouchPad), MP_ROM_PTR(&machine_touchpad_type) },

ports/esp32/modmachine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "py/obj.h"
55

66
extern const mp_obj_type_t machine_timer_type;
7+
extern const mp_obj_type_t machine_wdt_type;
78
extern const mp_obj_type_t machine_pin_type;
89
extern const mp_obj_type_t machine_touchpad_type;
910
extern const mp_obj_type_t machine_adc_type;

ports/esp32/modnetwork.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <stdint.h>
3636
#include <string.h>
3737

38-
3938
#include "py/nlr.h"
4039
#include "py/objlist.h"
4140
#include "py/runtime.h"
@@ -54,7 +53,6 @@
5453

5554
#define MODNETWORK_INCLUDE_CONSTANTS (1)
5655

57-
5856
NORETURN void _esp_exceptions(esp_err_t e) {
5957
switch (e) {
6058
case ESP_ERR_WIFI_NOT_INIT:

ports/esp32/modules/ntptime.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../esp8266/modules/ntptime.py

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy