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

Commit f727d7c

Browse files
committed
Initial development branch source release
1 parent 4481a1c commit f727d7c

File tree

2,492 files changed

+132669
-451117
lines changed

Some content is hidden

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

2,492 files changed

+132669
-451117
lines changed

.gitmodules

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
url = https://github.com/atgreen/libffi
88
[submodule "lib/lwip"]
99
path = lib/lwip
10-
url = http://git.savannah.gnu.org/r/lwip.git
10+
url = https://git.savannah.gnu.org/r/lwip.git
1111
[submodule "lib/berkeley-db-1.xx"]
1212
path = lib/berkeley-db-1.xx
1313
url = https://github.com/pfalcon/berkeley-db-1.xx
14+
[submodule "lib/stm32lib"]
15+
path = lib/stm32lib
16+
url = https://github.com/micropython/stm32lib
17+
branch = work-F4-1.16.0+F7-1.7.0+L4-1.8.1

Jenkinsfile

Lines changed: 39 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@ node {
77
stage('Checkout') {
88
checkout scm
99
sh 'rm -rf esp-idf'
10-
sh 'git clone --recursive -b master https://github.com/pycom/pycom-esp-idf.git esp-idf'
11-
sh 'git -C esp-idf checkout 4eab4e1b0e47c73b858c6b29d357f3d30a69c074'
12-
sh 'git -C esp-idf submodule update'
10+
sh 'git clone --depth=1 --recursive -b idf_dev https://github.com/pycom/pycom-esp-idf.git esp-idf'
1311
}
1412

15-
PYCOM_VERSION=get_version()
16-
GIT_TAG = sh (script: 'git rev-parse --short HEAD', returnStdout: true).trim()
13+
PYCOM_VERSION=get_version()
14+
GIT_TAG = sh (script: 'git rev-parse --short HEAD', returnStdout: true).trim()
1715

1816
stage('mpy-cross') {
1917
// build the cross compiler first
20-
sh 'git tag -fa v1.8.6-849-' + GIT_TAG + ' -m \\"v1.8.6-849-' + GIT_TAG + '''\\";
18+
sh 'git tag -fa v1.9.4-' + GIT_TAG + ' -m \\"v1.9.4-' + GIT_TAG + '''\\";
2119
cd mpy-cross;
2220
make clean;
2321
make all'''
2422
}
2523

26-
for (board in boards_to_build) {
27-
stage(board) {
28-
def parallelSteps = [:]
29-
parallelSteps[board] = boardBuild(board)
30-
parallel parallelSteps
31-
}
32-
}
24+
for (board in boards_to_build) {
25+
stage(board) {
26+
def parallelSteps = [:]
27+
parallelSteps[board] = boardBuild(board)
28+
parallel parallelSteps
29+
}
30+
}
3331

3432
stash includes: '**/*.bin', name: 'binary'
3533
stash includes: 'tests/**', name: 'tests'
@@ -39,19 +37,19 @@ node {
3937
}
4038

4139
stage ('Flash') {
42-
def parallelFlash = [:]
43-
for (board in boards_to_test) {
44-
parallelFlash[board] = flashBuild(board)
45-
}
46-
parallel parallelFlash
40+
def parallelFlash = [:]
41+
for (board in boards_to_test) {
42+
parallelFlash[board] = flashBuild(board)
43+
}
44+
parallel parallelFlash
4745
}
4846

4947
stage ('Test'){
50-
def parallelTests = [:]
51-
for (board in boards_to_test) {
52-
parallelTests[board] = testBuild(board)
53-
}
54-
parallel parallelTests
48+
def parallelTests = [:]
49+
for (board in boards_to_test) {
50+
parallelTests[board] = testBuild(board)
51+
}
52+
parallel parallelTests
5553
}
5654

5755

@@ -60,7 +58,7 @@ def boardBuild(name) {
6058
def name_short = name_u.split('_')[0]
6159
def app_bin = name.toLowerCase() + '.bin'
6260
return {
63-
release_dir = "${JENKINS_HOME}/release/${JOB_NAME}/" + PYCOM_VERSION + "/" + GIT_TAG + "/"
61+
release_dir = "${JENKINS_HOME}/release/${JOB_NAME}/" + PYCOM_VERSION + "/" + GIT_TAG + "/"
6462
sh '''export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
6563
export IDF_PATH=${WORKSPACE}/esp-idf;
6664
cd esp32;
@@ -69,24 +67,9 @@ def boardBuild(name) {
6967
sh '''export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
7068
export IDF_PATH=${WORKSPACE}/esp-idf;
7169
cd esp32;
72-
make TARGET=boot -j2 BOARD=''' + name_short
70+
make -j3 release BOARD=''' + name_short + ' RELEASE_DIR=' + release_dir
7371

74-
sh '''export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
75-
export IDF_PATH=${WORKSPACE}/esp-idf;
76-
cd esp32;
77-
make TARGET=app -j2 BOARD=''' + name_short
78-
79-
sh '''cd esp32/build/'''+ name_u +'''/release;
80-
mkdir -p firmware_package;
81-
mkdir -p '''+ release_dir + ''';
82-
cd firmware_package;
83-
cp ../bootloader/bootloader.bin .;
84-
mv ../application.elf ''' + release_dir + name + "-" + PYCOM_VERSION + '''-application.elf;
85-
cp ../''' + app_bin + ''' appimg.bin;
86-
cp ../lib/partitions.bin .;
87-
cp ../../../../boards/''' + name_short + '''/''' + name_u + '''/script .;
88-
cp ../''' + app_bin + ''' .;
89-
tar -cvzf ''' + release_dir + name + "-" + PYCOM_VERSION + '''.tar.gz appimg.bin bootloader.bin partitions.bin script ''' + app_bin
72+
sh 'mv esp32/build/'+ name_u + '/release/application.elf ' + release_dir + name + "-" + PYCOM_VERSION + '-application.elf'
9073
}
9174
}
9275

@@ -114,17 +97,17 @@ def testBuild(short_name) {
11497
return {
11598
String device_name = get_device_name(short_name)
11699
String board_name_u = get_firmware_name(short_name)
117-
node(get_remote_name(short_name)) {
118-
sleep(5) //Delay to skip all bootlog
119-
dir('tests') {
120-
timeout(30) {
121-
// As some tests are randomly failing... enforce script always returns 0 (OK)
122-
sh './run-tests --target=esp32-' + board_name_u + ' --device ' + device_name + ' || exit 0'
123-
}
124-
}
125-
sh 'python esp32/tools/pypic.py --port ' + device_name +' --enter'
126-
sh 'python esp32/tools/pypic.py --port ' + device_name +' --exit'
127-
}
100+
node(get_remote_name(short_name)) {
101+
sleep(5) //Delay to skip all bootlog
102+
dir('tests') {
103+
timeout(30) {
104+
// As some tests are randomly failing... enforce script always returns 0 (OK)
105+
sh './run-tests --target=esp32-' + board_name_u + ' --device ' + device_name + ' || exit 0'
106+
}
107+
}
108+
sh 'python esp32/tools/pypic.py --port ' + device_name +' --enter'
109+
sh 'python esp32/tools/pypic.py --port ' + device_name +' --exit'
110+
}
128111
}
129112
}
130113

@@ -135,16 +118,16 @@ def get_version() {
135118

136119
def get_firmware_name(short_name) {
137120
node {
138-
def node_info = sh (script: 'cat ${JENKINS_HOME}/pycom-ic.conf || exit 0', returnStdout: true).trim()
139-
def matcher = node_info =~ short_name + ':(.+):.*'
121+
def node_info = sh (script: 'cat ${JENKINS_HOME}/pycom-ic.conf || exit 0', returnStdout: true).trim()
122+
def matcher = node_info =~ short_name + ':(.+):.*'
140123
matcher ? matcher[0][1] : "WIPY"
141124
}
142125
}
143126

144127
def get_remote_name(short_name) {
145128
node {
146-
def node_info = sh (script: 'cat ${JENKINS_HOME}/pycom-ic.conf || exit 0', returnStdout: true).trim()
147-
def matcher = node_info =~ short_name + ':.*:(.+)'
129+
def node_info = sh (script: 'cat ${JENKINS_HOME}/pycom-ic.conf || exit 0', returnStdout: true).trim()
130+
def matcher = node_info =~ short_name + ':.*:(.+)'
148131
matcher ? matcher[0][1] : "RPI3"
149132
}
150133
}

README.md

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,13 @@ The following components are actively maintained by Pycom:
3030
- tests/ -- test framework and test scripts.
3131

3232
Additional components:
33-
- stmhal/ -- a version of MicroPython that runs on the PyBoard and similar
34-
STM32 boards (using ST's Cube HAL drivers).
35-
- minimal/ -- a minimal MicroPython port. Start with this if you want
36-
to port MicroPython to another microcontroller.
37-
- bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
38-
mostly to control code size.
39-
- teensy/ -- a version of MicroPython that runs on the Teensy 3.1
40-
(preliminary but functional).
41-
- pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
42-
- cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
43-
- esp8266/ -- an experimental port for ESP8266 WiFi modules.
33+
- ports/ -- versions of MicroPython that runs on other hardware
34+
- drivers/ -- hardware drivers
4435
- tools/ -- various tools, including the pyboard.py module.
4536
- examples/ -- a few example Python scripts.
4637
- docs/ -- user documentation in Sphinx reStructuredText format.
38+
- mpy-cross/ -- micropython cross-compiler
39+
- extmod/ -- external micropython modules
4740

4841
The subdirectories above may include READMEs with additional info.
4942

@@ -81,9 +74,9 @@ Then when you need the toolchain you can type ``get_esp32`` on the command line
8174
You also need the ESP IDF along side this repository in order to build the ESP32 port.
8275
To get it:
8376

84-
$ git clone https://github.com/pycom/pycom-esp-idf.git
77+
$ git clone --recursive -b idf_dev https://github.com/pycom/pycom-esp-idf.git
8578

86-
After cloning, make sure to checkout all the submodules:
79+
After cloning, if you did not specify the --recursive option, make sure to checkout all the submodules:
8780

8881
$ cd pycom-esp-idf
8982
$ git submodule update --init
@@ -92,12 +85,32 @@ Finally, before building, export the IDF_PATH variable
9285

9386
$ export IDF_PATH=~/pycom-esp-idf
9487

88+
This repository contains submodules! Either clone using the --recursive option:
89+
90+
$ git clone --recursive https://github.com/pycom/pycom-micropython-sigfox.git
91+
92+
Alternative checkout the modules manually:
93+
94+
$ cd pycom-micropython-sigfox
95+
$ git submodule update --init
96+
97+
If you updated the repository from a previous version and/or if switching to the development branch,<br>
98+
make sure to also update the submodules with the command above as a new submodule has been added<br>
99+
in the development branch!
100+
95101
Prior to building the main firmware, you need to build mpy-cross
96102

97103
$ cd mpy-cross && make clean && make && cd ..
98104

99105
By default the firmware is built for the WIPY2:
100106

107+
$ cd esp32
108+
$ make clean
109+
$ make
110+
$ make flash
111+
112+
By default, both bootloader and application are built. To build them separately:
113+
101114
$ cd esp32
102115
$ make clean
103116
$ make TARGET=boot
@@ -108,15 +121,21 @@ You can change the board type by using the BOARD variable:
108121

109122
$ cd esp32
110123
$ make BOARD=GPY clean
111-
$ make BOARD=GPY TARGET=boot
112-
$ make BOARD=GPY TARGET=app
124+
$ make BOARD=GPY
113125
$ make BOARD=GPY flash
114126

115127
We currently support the following BOARD types:
116128

117129
WIPY LOPY SIPY GPY FIPY LOPY4
130+
131+
For OEM modules, please use the following BOARD type:
118132

119-
For LoRa, you may need to specify the `LORA_BAND` as explained below.
133+
``` text
134+
W01: WIPY
135+
L01: LOPY
136+
L04: LOPY4
137+
G01: GPY
138+
```
120139

121140
To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable:
122141

@@ -125,26 +144,40 @@ To specify a serial port other than /dev/ttyUSB0, use ESPPORT variable:
125144
$ # On Windows
126145
$ make ESPPORT=COM3 flash
127146
$ # On linux
128-
$ # make ESPPORT=/dev/ttyUSB1 flash
147+
$ make ESPPORT=/dev/ttyUSB1 flash
129148

130149
To flash at full speed, use ESPSPEED variable:
131150

132151
$ make ESPSPEED=921600 flash
133152

134-
To build and flash a LoPy:
153+
Make sure that your board is placed into <b>programming mode</b>, otherwise <b>flashing will fail</b>.<br>
154+
All boards except Expansion Board 2.0 will automatically switch into programming mode<br><br>
155+
Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the board.
156+
157+
158+
To create a release package that can be flashed with the Pycom firmware tool:
159+
160+
$ cd esp32
161+
$ make clean
162+
$ make release
163+
164+
To create a release package for all currently supported Pycom boards:
135165

136166
$ cd esp32
137-
$ make BOARD=LOPY clean
138-
$ make BOARD=LOPY TARGET=boot
139-
$ make BOARD=LOPY TARGET=app
140-
$ make BOARD=LOPY flash
167+
$ for BOARD in WIPY LOPY SIPY GPY FIPY LOPY4; do make BOARD=$BOARD clean && make BOARD=$BOARD release; done
168+
169+
To specify a directory other than the default build/ directory:
170+
171+
$ cd esp32
172+
$ make clean
173+
$ make RELEASE_DIR=~/pycom-packages release
174+
175+
To create a release package for all currently supported Pycom boards in a directory other than the default build/ directory:
176+
177+
$ cd esp32
178+
$ for BOARD in WIPY LOPY SIPY GPY FIPY LOPY4; do make BOARD=$BOARD clean && make BOARD=$BOARD RELEASE_DIR=~/pycom-packages release; done
141179

142-
The above also applies to the FiPy and LoPy4
143180

144-
Make sure that your board is placed into programming mode, otherwise flashing will fail.<br>
145-
PyTrack and PySense boards will automatically switch into programming mode<br>
146-
(currently supported on MacOS and Linux only!)<br><br>
147-
Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the board.
148181

149182
## Steps for using Secure Boot and Flash Encryption
150183

@@ -157,7 +190,7 @@ Expansion Board 2.0 users, please connect ``P2`` to ``GND`` and then reset the b
157190

158191
### Prerequisites
159192

160-
$ export $IDF_PATH=<pycom-esp-idf_PATH>
193+
$ export IDF_PATH=<pycom-esp-idf_PATH>
161194
$ cd esp32
162195

163196
Hold valid keys for Flash Encryption and Secure Boot; they can be generated randomly with the following commands:
@@ -191,7 +224,7 @@ Flash keys (`flash_encryption_key.bin` and `secure-bootloader-key.bin`) into the
191224

192225
### Makefile options:
193226

194-
make BOARD=GPY SECURE=on SECURE_KEY=secure_boot_signing_key.pem ENCRYPT_KEY=flash_encryption_key.bin TARGET=[boot|app]
227+
make BOARD=GPY SECURE=on SECURE_KEY=secure_boot_signing_key.pem ENCRYPT_KEY=flash_encryption_key.bin
195228

196229
- `SECURE=on` is the main flag; it's not optional
197230
- if `SECURE=on` by default:
@@ -210,8 +243,7 @@ For flashing the bootloader-reflash-digest.bin has to be written at address 0x0,
210243
Build is done using `SECURE=on` option; additionally, all the binaries are pre-encrypted.
211244

212245
make BOARD=GPY clean
213-
make BOARD=GPY SECURE=on TARGET=boot
214-
make BOARD=GPY SECURE=on TARGET=app
246+
make BOARD=GPY SECURE=on
215247
make BOARD=GPY SECURE=on flash
216248

217249
Manual flash command:

bare-arm/Makefile

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)