Skip to content

Commit eaeb794

Browse files
authored
Merge pull request #1091 from fpistm/subvariant
[variant] Improve variant support and genericity
2 parents 3c414ec + 7ec57a1 commit eaeb794

File tree

3,851 files changed

+482443
-87921
lines changed

Some content is hidden

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

3,851 files changed

+482443
-87921
lines changed

Diff for: .github/actions/pio-build/entrypoint.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ platformio platform install "https://github.com/platformio/platform-ststm32.git"
1111
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; del data['packages']['framework-arduinoststm32']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
1212
exit 1
1313
}
14+
15+
# Fix for variant path change while not updated in PIO
16+
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/boards/malyanm300_f070cb.json'), 'r+'); data=json.load(fp); data['build']['variant'] = 'STM32F0xx/F070CBT'; data['build']['extra_flags'] = '-DSTM32F070xB -DVARIANT_H=\\\\\"variant_MALYANMx00_F070CB.h\\\\\"'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
17+
exit 1
18+
}
19+
python3 -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/boards/nucleo_l152re.json'), 'r+'); data=json.load(fp); data['build']['variant'] = 'STM32L1xx/L151RET_L152RET_L162RET'; data['build']['extra_flags'] = '-DSTM32L152xE -DVARIANT_H=\\\\\"variant_NUCLEO_L152RE.h\\\\\"'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
20+
exit 1
21+
}
22+
1423
ln --symbolic "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || {
1524
exit 1
1625
}
@@ -24,6 +33,6 @@ tar --extract --bzip2 --file="$CMSIS_ARCHIVE" || {
2433
cd "$GITHUB_WORKSPACE/CI/build/" || {
2534
exit 1
2635
}
27-
python3 platformio-builder.py --board=blackpill_f103c8 --board=remram_v1
36+
python3 platformio-builder.py --board=malyanm300_f070cb --board=nucleo_l152re
2837

2938
exit $?

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ boards.local.txt
44
platform.local.txt
55
path_config.json
66
update_config.json
7+
variant_config.json
78

89
# Backup
910
*.bak
@@ -34,4 +35,4 @@ __pycache__/
3435
!.vscode/tasks.json
3536
!.vscode/launch.json
3637
!.vscode/extensions.json
37-
*.code-workspace
38+
*.code-workspace

Diff for: CI/build/README.md

+30-26
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,65 @@
1-
# arduino-builder.py
1+
# arduino-cli.py
22

3-
This script manages _[arduino-builder](https://github.com/arduino/arduino-builder)_ command line tool for compiling Arduino sketch(es).
3+
This script manages _[arduino-cli](https://github.com/arduino/arduino-cli)_ command line tool for compiling Arduino sketch(es).
44

55
## Requirements
6-
- [Arduino IDE](https://www.arduino.cc/en/Main/Software) (_[arduino-builder](https://github.com/arduino/arduino-builder)_ is included)
6+
- [arduino-cli](https://github.com/arduino/arduino-cli)
77
- Python version greater than or equal to 3.2 (due to `concurrent.futures` usage)
88

99
## Usage
1010

1111
```
12-
usage: arduino-builder.py [-h] [-l [{board,sketch}] | -a] [-b pattern] [-c]
13-
[--arch architecture]
14-
[--config <core configuration file>] [-v]
15-
[--bin | --travis]
16-
[-i <shetch filepath> | -f <sketches list filepath> | -s pattern | -e <excluded sketches list filepath>]
12+
usage: arduino-cli.py [-h] [-l [{board,sketch}] | -a] [-b pattern] [-c]
13+
[--arch architecture]
14+
[--config <core configuration file>] [-u <string>] [-v]
15+
[--ci]
16+
[-i <shetch filepath> | -f <sketches list filepath> | -s pattern | -e <excluded sketches list filepath>]
1717
18-
Manage arduino-builder command line tool for compiling Arduino sketch(es).
18+
Manage arduino-cli to build sketche(s) for STM32 boards.
1919
2020
optional arguments:
2121
-h, --help show this help message and exit
2222
-l [{board,sketch}], --list [{board,sketch}]
2323
list available board(s) or sketch(es)
2424
-a, --all build all sketches found for all available boards
2525
-b pattern, --board pattern
26-
pattern to find one or more board(s) to build
27-
-c, --clean clean output directory
28-
<user path config>/arduinoBuilderOutput
26+
pattern to build one or more board(s)
27+
-c, --clean clean output directory.
2928
--arch architecture core architecture to build. Default build architecture
30-
is stm32
29+
is 'stm32'
3130
--config <core configuration file>
3231
JSON file containing the build configuration for one
3332
or more maintainer/architecture. Board options for
3433
build, applicability of sketches for boards or
3534
required options. If sketch is not listed then
3635
applicable to all board. Default core configuration is
37-
for 'stm32' architecture in: conf/cores_config.json
38-
-v, --verbose enable arduino-builder verbose mode
39-
--bin save binaries
40-
--travis Custom configuration for Travis CI build
36+
for 'stm32 'architecture in:
37+
<core path>\CI\build\conf\cores_config.json
38+
-u <string>, --url <string>
39+
additional URL for the board manager Default url : htt
40+
ps://github.com/stm32duino/BoardManagerFiles/raw/maste
41+
r/STM32/package_stm_index.json
42+
-v, --verbose enable arduino-cli verbose mode
43+
--ci custom configuration for CI build
4144
4245
Sketch(es) options:
43-
By default build <arduino path>/examples/01.Basics/BareMinimum/BareMinimum.ino
46+
By default build C:\STM32\arduino\arduino-1.8.13\portable\packages\STM32\h
47+
ardware\stm32\2.0.0-dev\CI\build\examples\BareMinimum
4448
4549
-i <shetch filepath>, --ino <shetch filepath>
46-
single ino file to build
50+
single sketch file to build
4751
-f <sketches list filepath>, --file <sketches list filepath>
4852
file containing list of sketches to build
4953
-s pattern, --sketches pattern
5054
pattern to find one or more sketch to build
5155
-e <excluded sketches list filepath>, --exclude <excluded sketches list filepath>
52-
file containing pattern of sketches to ignore. Default
53-
path : conf/exclude_list.txt
56+
file containing sketches pattern to ignore. Default
57+
path : <core path>\\CI\build\conf\exclude_list.txt
5458
```
5559

5660
## Cores configuration files
5761

58-
Script is able to uses a JSON configuration file containing the build configuration for one or more maintainer/architecture.
62+
Script is able to uses a JSON configuration file containing the build configuration for one or more maintainer/architecture.
5963
A default configuration file is provided: [cores_config.json](conf/cores_config.json)
6064

6165

@@ -144,7 +148,7 @@ Will build all sketches available in `09.USB/*` for the listed boards and add `
144148

145149
* List all boards containing `F1` or `L4` (not case sensitive):
146150

147-
`python3 arduino-builder.py -l -b "F1|l4"`
151+
`python3 arduino-cli.py -l -b "F1|l4"`
148152

149153
Will produce on the [stm32](https://github.com/stm32duino/Arduino_Core_STM32) core:
150154
```
@@ -164,7 +168,7 @@ NUCLEO_L496ZG-P
164168

165169
* List all sketch containing `digital` or `analog` (not case sensitive):
166170

167-
`python3 arduino-builder.py -l sketch -s "Digital|analog"`
171+
`python3 arduino-cli.py -l sketch -s "Digital|analog"`
168172

169173
Will produce on the [stm32](https://github.com/stm32duino/Arduino_Core_STM32) core:
170174
```
@@ -194,11 +198,11 @@ Build configuration for 'STM32' maintainer and 'stm32' architecture
194198

195199
* Build all sketches containing `digital` or `analog` for all boards containing `F1` or `L4` (not case sensitive):
196200

197-
`python3 arduino-builder.py -s "Digital|analog" -b "F1|l4"`
201+
`python3 arduino-cli.py -s "Digital|analog" -b "F1|l4"`
198202

199203
* List all boards for STM32F1 core:
200204

201-
`python3 arduino-builder.py -l --arch STM32F1`
205+
`python3 arduino-cli.py -l --arch STM32F1`
202206

203207
Will list:
204208
```

0 commit comments

Comments
 (0)