Skip to content

Commit 918732c

Browse files
Merge branch 'master' into fscharwrite
2 parents a969879 + 2dff28a commit 918732c

File tree

7 files changed

+77
-35
lines changed

7 files changed

+77
-35
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Documentation: [https://arduino-esp8266.readthedocs.io/en/2.5.1/](https://arduin
4848
```bash
4949
cd <application-directory>/Arduino.app/Contents/Java
5050
```
51-
- For Linux, it is ~/arduino by default.
51+
- For Linux, it is ~/Arduino by default.
5252
```bash
53-
cd ~arduino
53+
cd ~/Arduino
5454
```
5555
- Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
5656
```bash

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ bool WiFiClientSecure::_clientConnected() {
255255
}
256256

257257
uint8_t WiFiClientSecure::connected() {
258-
if (available() || (_clientConnected() && _handshake_done)) {
258+
if (available() || (_clientConnected() && _handshake_done && (br_ssl_engine_current_state(_eng) != BR_SSL_CLOSED))) {
259259
return true;
260260
}
261261
return false;
@@ -1003,6 +1003,12 @@ bool WiFiClientSecure::_connectSSL(const char* hostName) {
10031003
DEBUG_BSSL("Connected!\n");
10041004
}
10051005
#endif
1006+
1007+
// Session is already validated here, there is no need to keep following
1008+
_x509_minimal = nullptr;
1009+
_x509_insecure = nullptr;
1010+
_x509_knownkey = nullptr;
1011+
10061012
return ret;
10071013
}
10081014

tests/device/Makefile

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ TEST_LIST ?= $(wildcard test_*/*.ino)
44
ESP8266_CORE_PATH ?= ../..
55
BUILD_DIR ?= $(PWD)/.build
66
HARDWARE_DIR ?= $(PWD)/.hardware
7-
ESPTOOL ?= $(ESP8266_CORE_PATH)/tools/esptool/esptool
7+
#PYTHON ?= python3
8+
PYTHON ?= python
9+
ESPTOOL ?= $(PYTHON) $(ESP8266_CORE_PATH)/tools/esptool/esptool.py
810
MKSPIFFS ?= $(ESP8266_CORE_PATH)/tools/mkspiffs/mkspiffs
911
UPLOAD_PORT ?= $(shell ls /dev/tty* | grep -m 1 -i USB)
10-
UPLOAD_BAUD ?= 921600
12+
UPLOAD_BAUD ?= 460800
1113
UPLOAD_BOARD ?= nodemcu
1214
BS_DIR ?= libraries/BSTest
1315
DEBUG_LEVEL ?= DebugLevel=None____
@@ -24,7 +26,7 @@ ifneq ("$(V)","1")
2426
else
2527
BUILDER_DEBUG_FLAG = -verbose
2628
RUNNER_DEBUG_FLAG = -d
27-
UPLOAD_VERBOSE_FLAG = -v
29+
#UPLOAD_VERBOSE_FLAG = -v
2830
endif
2931

3032

@@ -57,28 +59,34 @@ endif
5759
ifneq ("$(NO_UPLOAD)","1")
5860
@test -n "$(UPLOAD_PORT)" || (echo "Failed to detect upload port, please export UPLOAD_PORT manually" && exit 1)
5961
@test -e $(dir $@)/make_spiffs.py && (echo "Generating and uploading SPIFFS" && \
60-
(cd $(dir $@) && python ./make_spiffs.py) && \
61-
$(MKSPIFFS) --create $(dir $@)data/ --size 0xFB000 \
62+
(cd $(dir $@) && $(PYTHON) ./make_spiffs.py) && \
63+
$(SILENT)$(MKSPIFFS) --create $(dir $@)data/ --size 0xFB000 \
6264
--block 8192 --page 256 $(LOCAL_BUILD_DIR)/spiffs.img && \
63-
$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) \
64-
-cp $(UPLOAD_PORT) \
65-
-cb $(UPLOAD_BAUD) \
66-
-cd $(UPLOAD_BOARD) \
67-
-ca 0x300000 \
68-
-cf $(LOCAL_BUILD_DIR)/spiffs.img ) || (echo "No SPIFFS to upload")
65+
$(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) \
66+
--chip esp8266 \
67+
--port $(UPLOAD_PORT) \
68+
--baud $(UPLOAD_BAUD) \
69+
--after no_reset \
70+
write_flash 0x300000 $(LOCAL_BUILD_DIR)/spiffs.img ) \
71+
|| (echo "No SPIFFS to upload")
6972
@echo Uploading binary
7073
$(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) \
71-
-cp $(UPLOAD_PORT) \
72-
-cb $(UPLOAD_BAUD) \
73-
-cd $(UPLOAD_BOARD) \
74-
-cf $(LOCAL_BUILD_DIR)/$(notdir $@).bin
74+
--chip esp8266 \
75+
--port $(UPLOAD_PORT) \
76+
--baud $(UPLOAD_BAUD) \
77+
--after no_reset \
78+
write_flash 0x0 $(LOCAL_BUILD_DIR)/$(notdir $@).bin # no reset
7579
endif
7680
ifneq ("$(NO_RUN)","1")
7781
@test -n "$(UPLOAD_PORT)" || (echo "Failed to detect upload port, please export UPLOAD_PORT manually" && exit 1)
7882
@echo Running tests
79-
$(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) -cp $(UPLOAD_PORT) -cd $(UPLOAD_BOARD) -cr
83+
$(SILENT)$(ESPTOOL) $(UPLOAD_VERBOSE_FLAG) \
84+
--chip esp8266 \
85+
--port $(UPLOAD_PORT) \
86+
--baud $(UPLOAD_BAUD) \
87+
read_flash_status # reset
8088
@source $(BS_DIR)/virtualenv/bin/activate && \
81-
python $(BS_DIR)/runner.py \
89+
$(PYTHON) $(BS_DIR)/runner.py \
8290
$(RUNNER_DEBUG_FLAG) \
8391
-p $(UPLOAD_PORT) \
8492
-n $(basename $(notdir $@)) \
@@ -88,10 +96,10 @@ ifneq ("$(NO_RUN)","1")
8896
endif
8997

9098
$(TEST_REPORT_XML): $(HARDWARE_DIR) virtualenv
91-
@$(BS_DIR)/virtualenv/bin/xunitmerge $(shell find $(BUILD_DIR) -name 'test_result.xml' | xargs echo) $(TEST_REPORT_XML)
99+
$(SILENT)$(BS_DIR)/virtualenv/bin/xunitmerge $(shell find $(BUILD_DIR) -name 'test_result.xml' | xargs echo) $(TEST_REPORT_XML)
92100

93101
$(TEST_REPORT_HTML): $(TEST_REPORT_XML) | virtualenv
94-
@$(BS_DIR)/virtualenv/bin/junit2html $< $@
102+
$(SILENT)$(BS_DIR)/virtualenv/bin/junit2html $< $@
95103

96104
test_report: $(TEST_REPORT_HTML)
97105
@echo "Test report generated in $(TEST_REPORT_HTML)"
@@ -104,13 +112,17 @@ $(HARDWARE_DIR):
104112
cd $(HARDWARE_DIR)/esp8266com && ln -s $(realpath $(ESP8266_CORE_PATH)) esp8266
105113

106114
virtualenv:
107-
@make -C $(BS_DIR) virtualenv
115+
@make -C $(BS_DIR) PYTHON=$(PYTHON) virtualenv
108116

109117
clean:
110118
rm -rf $(BUILD_DIR)
111119
rm -rf $(HARDWARE_DIR)
112120
rm -f $(TEST_REPORT_HTML) $(TEST_REPORT_XML)
113121

122+
distclean: clean
123+
rm -rf libraries/BSTest/virtualenv/
124+
find . -name "*pyc" -exec rm -f {} \;
125+
114126
$(TEST_CONFIG):
115127
@echo "****** "
116128
@echo "****** $(TEST_CONFIG) does not exist"

tests/device/libraries/BSTest/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PYTHON_ENV_DIR=virtualenv
22
TEST_EXECUTABLE=test/test
3+
PYTHON ?= python3
34

45
all: test
56

@@ -10,7 +11,7 @@ clean:
1011
rm -rf $(TEST_EXECUTABLE)
1112

1213
$(PYTHON_ENV_DIR):
13-
virtualenv --no-site-packages $(PYTHON_ENV_DIR)
14+
virtualenv --python=$(PYTHON) --no-site-packages $(PYTHON_ENV_DIR)
1415
. $(PYTHON_ENV_DIR)/bin/activate && pip install -r requirements.txt
1516

1617
test: $(TEST_EXECUTABLE) $(PYTHON_ENV_DIR)

tests/device/libraries/BSTest/runner.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414
except:
1515
from ConfigParser import ConfigParser
1616
import itertools
17-
from urlparse import urlparse
17+
try:
18+
from urllib.parse import urlparse, urlencode
19+
except ImportError:
20+
from urlparse import urlparse
1821
from junit_xml import TestSuite, TestCase
1922
try:
2023
from cStringIO import StringIO
2124
except:
22-
from StringIO import StringIO
25+
try:
26+
from StringIO import StringIO
27+
except ImportError:
28+
from io import StringIO
2329
import mock_decorators
2430

2531
debug = False

tools/platformio-build.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@
2424

2525
# Extends: https://github.com/platformio/platform-espressif8266/blob/develop/builder/main.py
2626

27-
import os
28-
import subprocess
29-
3027
from os.path import isdir, join
3128

32-
from SCons import Builder, Util
33-
from SCons.Script import DefaultEnvironment
29+
from SCons import Util
30+
from SCons.Script import Builder, DefaultEnvironment
3431

3532

3633
def scons_patched_match_splitext(path, suffixes=None):
@@ -127,7 +124,26 @@ def scons_patched_match_splitext(path, suffixes=None):
127124

128125
LIBSOURCE_DIRS=[
129126
join(FRAMEWORK_DIR, "libraries")
130-
]
127+
],
128+
129+
BUILDERS=dict(
130+
ElfToBin=Builder(
131+
action=env.VerboseAction(" ".join([
132+
'"$PYTHONEXE"',
133+
'"%s"' % env.subst(join(FRAMEWORK_DIR, "tools", "elf2bin.py")),
134+
"--eboot", '"%s"' % env.subst(join(
135+
FRAMEWORK_DIR, "bootloaders", "eboot", "eboot.elf")),
136+
"--app", '"%s"' % "$SOURCE",
137+
"--flash_mode", "$BOARD_FLASH_MODE",
138+
"--flash_freq", "${__get_board_f_flash(__env__)}",
139+
"--flash_size", "${__get_flash_size(__env__)}",
140+
"--path", '"%s"' % env.subst(join(
141+
platform.get_package_dir("toolchain-xtensa"), "bin")),
142+
"--out", '"$TARGET"'
143+
]), "Building $TARGET"),
144+
suffix=".bin"
145+
)
146+
)
131147
)
132148

133149
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
@@ -141,18 +157,18 @@ def scons_patched_match_splitext(path, suffixes=None):
141157
if "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3" in flatten_cppdefines:
142158
env.Append(
143159
CPPDEFINES=[("NONOSDK3V0", 1)],
144-
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK3V0"),]
160+
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK3V0")]
145161
)
146162
elif "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x" in flatten_cppdefines:
147163
env.Append(
148164
CPPDEFINES=[("NONOSDK22x", 1)],
149-
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK22x"),]
165+
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK22x")]
150166
)
151167
# PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x (default)
152168
else:
153169
env.Append(
154170
CPPDEFINES=[("NONOSDK221", 1)],
155-
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK221"),]
171+
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK221")]
156172
)
157173

158174
#

tools/sdk/ld/eagle.app.v6.common.ld.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ SECTIONS
137137
*(.ver_number)
138138
*.c.o( EXCLUDE_FILE (umm_malloc.c.o) .literal*, EXCLUDE_FILE (umm_malloc.c.o) .text* )
139139
*.cpp.o(.literal*, .text*)
140+
*.cc.o(.literal*, .text*)
140141
#ifdef VTABLES_IN_FLASH
141142
*(.rodata._ZTV*) /* C++ vtables */
142143
#endif

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