Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 01f49f7

Browse files
authored
Merge pull request #416 from pycom/rc6
1.20.2.rc6
2 parents 2037465 + 867d922 commit 01f49f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+730
-419
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ user.props
3636
.pydevproject
3737
.settings
3838
.launch
39+
.vscode
3940

4041
# Key files (for Flash Encryption and Secure Boot)
4142
secure_boot_signing_key.pem

Jenkinsfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def flashBuild(short_name, version, variant) {
8585
unstash 'esp32Tools'
8686
unstash 'tests'
8787
unstash 'tools'
88-
sh 'python esp32/tools/fw_updater/updater.py --port ' + device_name +' flash -t esp32/build-' + variant + '/' + board_name + '-' + version + '.tar.gz'
88+
sh 'python esp32/tools/fw_updater/updater.py --noexit --port ' + device_name +' flash -t esp32/build-' + variant + '/' + board_name + '-' + version + '.tar.gz'
89+
sh 'python esp32/tools/fw_updater/updater.py --port ' + device_name +' pybytes --auto_start False'
8990
}
9091
}
9192
}

docs/library/ussl.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ network sockets, both client-side and server-side.
114114

115115
SSL sockets inherit all methods and from the standard sockets, see the :mod:`usocket` module.
116116

117+
.. function:: ssl.save_session(sock)
118+
119+
Takes an instance sock of ssl.SSLSocket, and returns an instance of ssl.SSLSession representing saved session data from the socket, which can be used to resume a SSL session later. Example::
120+
121+
import socket
122+
import ssl
123+
addr = socket.getaddrinfo('www.google.com', 443)[0][-1]
124+
sock_one = ssl.wrap_socket(socket.socket())
125+
sock_one.connect(addr) # performs a full ssl handshake
126+
session = ssl.save_session(sock_one)
127+
sock_one.close()
128+
sock_one = None
129+
sock_two = ssl.wrap_socket(socket.socket(), saved_session=session)
130+
sock_two.connect(addr) # resumes using saved session, resulting in a faster handshake
131+
117132
Exceptions
118133
----------
119134

esp32/PyJTAG/Readme.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
# Short readme for how to use the PyJTAG
22

3+
## Setup
4+
Generally follow these rules to setup JTAG debugging on your OS: https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/jtag-debugging/index.html
5+
6+
Download link for OpenOCD for ESP32 from Espressif: https://github.com/espressif/openocd-esp32/releases
7+
8+
9+
## Build the firmware
310
Create the firmware with `BTYPE=debug` flag.
4-
Do not use the default pins assigned to UART, SPI, CAN because they are used by the JTAG. Pins not to be used: P4, P9, P10, P23
511

6-
Detailed information are here: https://pycomiot.atlassian.net/wiki/spaces/FIR/pages/966295564/Usage+of+PyJTAG
12+
Note: Do not use the default pins assigned to UART, SPI, CAN because they are used by the JTAG. Pins not to be used: P4, P9, P10, P23.
13+
14+
## Setup the PyJTAG board
715

8-
Setup the PyJTAG board's switches:
16+
PyJTAG's switches:
917
* ESP32 JTAG: all turned ON
1018
* ESP32 B.LOADER: all turned ON except SAFE_BOOT_SW which is OFF
1119
* TO LTE UART 1/2: does not matter
1220
* CURRENT SHUNTS: connected
1321

14-
Place the Pycom board with the reset button towards the Current Shunts.
15-
16-
Generally follow these rules to setup JTAG debugging on your OS: https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/jtag-debugging/index.html
17-
18-
(Download link of OpenOCD for ESP32 from Espressif: https://github.com/espressif/openocd-esp32/releases)
19-
20-
Connect the PyJTAG via usb. You see four new USB devices:
22+
Place the Pycom board with the reset button towards the Current Shunts. Now connect the PyJTAG via usb. You will see four new USB devices. On Linux this will look like this:
2123
```
2224
$ lsusb -d 0403:
2325
Bus 001 Device 010: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
2426
$ ls /dev/ttyUSB?
2527
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
2628
```
2729

30+
## Start OCD
31+
2832
Go to `esp32` folder in Firmware-Development repository and run:
2933
```
3034
PATH_TO_OPENOCD/bin/openocd -s PATH_TO_OPENOCD/share/openocd/scripts -s PyJTAG -f PyJTAG/interface/ftdi/esp32-pycom.cfg -f PyJTAG/board/esp32-pycom.cfg
@@ -49,9 +53,33 @@ Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica)
4953
Info : Listening on port 3333 for gdb connections
5054
```
5155

56+
## Start GDB
57+
5258
When OpenOCD is running, start GDB from `esp32` folder. Assuming you have a FIPY:
5359
```
5460
xtensa-esp32-elf-gdb -x PyJTAG/gdbinit build/FIPY/debug/application.elf
5561
```
5662

57-
In `PyJTAG/gdbinit` a breakpoint is configured at `TASK_Micropython`, so execution should stop there first.
63+
In `PyJTAG/gdbinit` a breakpoint is configured at `TASK_Micropython`, so execution should stop there first:
64+
65+
```
66+
Thread 1 hit Temporary breakpoint 1, TASK_Micropython (pvParameters=0x0) at mptask.c:136
67+
```
68+
69+
70+
## REPL
71+
72+
Connect to `/dev/ttyUSB2` to reach the REPL terminal over usb serial. E.g. using pymakr in Atom.
73+
74+
## Troubleshooting
75+
If openocd says "Error: Connect failed", try to close gdb and openocd and start over.
76+
77+
If `/dev/ttyUSB0` doesn't show up or disappears, disconnect the PyJTAG board, reconnect and start over.
78+
79+
It can be advisable to use the `gdb` from the latest xtensa toolchain, even if an earlier version is used to build the firmware.
80+
81+
If `gdb` does not reach the `Thread 1 hit Temporary breakpoint ...` line, close and reopen `gdb`.
82+
83+
## Extra
84+
A few more details are here: https://pycomiot.atlassian.net/wiki/spaces/FIR/pages/966295564/Usage+of+PyJTAG
85+

esp32/application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ SRC_QSTR_AUTO_DEPS +=
369369
BOOT_LDFLAGS = $(LDFLAGS) -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.bootloader.rom.ld -T esp32.rom.spiram_incompatible_fns.ld
370370

371371
# add the application linker script(s)
372-
APP_LDFLAGS += $(LDFLAGS) -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld
372+
APP_LDFLAGS += $(LDFLAGS) -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld
373373

374374
# add the application specific CFLAGS
375375
CFLAGS += $(APP_INC) -DMICROPY_NLR_SETJMP=1 -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM -DFFCONF_H=\"lib/oofatfs/ffconf.h\" -DWITH_POSIX
-2.04 KB
Binary file not shown.

esp32/bootloader/lib/libefuse.a

-584 Bytes
Binary file not shown.

esp32/bootloader/lib/liblog.a

-120 Bytes
Binary file not shown.

esp32/bootloader/lib/libmicro-ecc.a

-68 Bytes
Binary file not shown.

esp32/bootloader/lib/libsoc.a

-1.35 KB
Binary file not shown.

esp32/bootloader/lib/libspi_flash.a

-84 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)