Skip to content

Update 13 octuber 2020 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 135 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
7ea6570
Fixed setting HardwareTimer interrupt priority
sjasonsmith May 9, 2020
3a9c71c
[CI] Update configuration
fpistm May 11, 2020
ebf27ee
Set priority for Capture/Compare if different IRQ than Update
sjasonsmith May 13, 2020
6b5f0ab
Merge pull request #1062 from sjasonsmith/PR/HardwareTimerPriority
fpistm May 13, 2020
5e6b0a4
Add NadHAT PYBSTICK26 variants
garatronic May 11, 2020
c8f1f1a
Update PULL_REQUEST_TEMPLATE.md
fpistm May 14, 2020
96e597c
[PYBStick] Add Sx pin number naming
garatronic May 14, 2020
c194e25
Add Daisy Seed variant
May 4, 2020
a524563
[CI] Update configuration
fpistm May 15, 2020
7bf9f34
Merge pull request #1070 from fpistm/pr_1063_review
fpistm May 15, 2020
8dbbbfd
Update to release 1.9.0 version
fpistm May 15, 2020
17fd01f
[PYBStick] Remove non standard character from the name
fpistm May 15, 2020
2002aa7
Update README.md
fpistm May 15, 2020
00236f4
Update core version to 2.0.0-dev (020000F0)
fpistm May 19, 2020
5147110
Update Prntr Board device
ghent360 May 23, 2020
24bec9a
Add support of B-L4S5I-IOT01A variant
ABOSTM Feb 25, 2020
ce7e3e1
Add new node name for B_L4S5I_IOT01A
fpistm Jun 1, 2020
56c8d04
[F4] Update STM32F4xx HAL Drivers to v1.7.8
fpistm Apr 6, 2020
6f6e64f
[F4] Update STM32F4xx CMSIS Drivers to v2.6.5
fpistm Apr 6, 2020
58c8b12
[F4] Update wrapped files
fpistm Apr 6, 2020
b766ee7
[F4] Fix HAL_RCC_USART3 definition for STM32F412Cx
fpistm Mar 6, 2020
adabe23
[F4] I2C HAL fix: generate Start only once Stop is finished
ABOSTM Jan 28, 2020
ea77445
[F7] Update STM32F7xx HAL Drivers to v1.2.8
fpistm Apr 6, 2020
d0f4889
[F7] Update STM32F7xx CMSIS Drivers to v1.2.5
fpistm Apr 6, 2020
b74759b
Update CMSIS Cortex-Mx Device Peripheral Access Layer System Source File
fpistm Apr 6, 2020
52642d9
[USB] Update STM32 USB Device library to v2.6.0
fpistm Apr 6, 2020
07b50a8
[USB] Update STM32 USB Host library to v3.3.4
fpistm Apr 6, 2020
fe50080
[USBD] Update after middleware update to 2.6.0
fpistm Apr 6, 2020
2790e61
[USB] Fix EPO STALL issue in STM32 USB Device library
fpistm Jun 4, 2020
f190402
Merge pull request #1027 from fpistm/UpdateCubeFw
fpistm Jun 4, 2020
10bd598
Change PWM pin mapping
chrissbarr Jun 8, 2020
19dcdbc
Tidy Pin Defines
chrissbarr Jun 8, 2020
133a3ca
Enable all ADC1 Pins
chrissbarr Jun 8, 2020
8057c0a
Update Peripherals from genpinmap
chrissbarr Jun 8, 2020
12ca052
Enable UART5
chrissbarr Jun 8, 2020
28dadd2
Set TIMER_SERIAL to TIM9
chrissbarr Jun 8, 2020
f13ec1e
Allow overriding timer definitions
chrissbarr Jun 10, 2020
9876616
[SoftwareSerial] Fix analog pins usage
fpistm Jun 10, 2020
443ede7
Merge pull request #1092 from chrissbarr/RUMBA32-improvements
fpistm Jun 12, 2020
d55b270
Update new-variant-request.md
fpistm Jun 12, 2020
d07c1db
Fixed link
fpistm Jun 24, 2020
b12a554
[CI] Force arduino-cli 0.10.0 usage
fpistm Jun 29, 2020
b351b55
[CI] Fix build failed management
fpistm Jun 29, 2020
7568025
[CI] Update binary management after cli change.
fpistm Jun 29, 2020
c52765f
[CI] Manage arduino-cli version
fpistm Jun 30, 2020
6da8759
[CI] Harden exception handling
fpistm Jun 29, 2020
3e3cfb3
Revert "[CI] Force arduino-cli 0.10.0 usage"
fpistm Jul 3, 2020
73f76d6
Merge pull request #1107 from fpistm/CLI_output
fpistm Jul 3, 2020
469a95f
Move the STM32 rtc drivers from core to library
fpistm Jun 2, 2020
348fdc4
Use more efficient mode for STM32L4XX stop mode (#1097)
angelnu Jul 3, 2020
73633eb
HardwareTimer: getTimerClkFreq() add comment to avoid confusion
ABOSTM Jul 6, 2020
cfc2de7
Move the STM32 low power drivers from core to library
fpistm Jul 7, 2020
011addb
[CI] Fix stderr output
fpistm Jul 8, 2020
422fde9
[CI] Add url option
fpistm Jul 8, 2020
2d498c7
Merge pull request #1116 from fpistm/CI_dev
fpistm Jul 9, 2020
17e8cda
Make CI badge clickable
fpistm Aug 3, 2020
6fc4073
Fix flash offset on HY_TinySTM103T variant. (#1131)
mkarr Aug 3, 2020
9c457e4
Fix RHF76-052 device
fpistm Aug 4, 2020
497122d
Moved from arm-none-eabi-gcc 9.2.1-1.1 to 9.3.1-1.1
fpistm Jul 9, 2020
2e7b8bc
[CI] Use dev branch for test
fpistm Jul 9, 2020
b9f2434
Merge pull request #1117 from fpistm/xpack
fpistm Aug 5, 2020
1d55525
[G4] Update STM32G4xx HAL Drivers to v1.2.0
fpistm Aug 4, 2020
5e32e9d
[G4] Update STM32G4xx CMSIS Drivers to v1.2.0
fpistm Aug 4, 2020
bef3857
[G4] Update wrapped files
fpistm Aug 4, 2020
6dd4526
[G4] Fix LL FMC build issue introduce in HAL version v1.1.1
fpistm Apr 4, 2020
9cc22c7
[G4] Set default HSE_VALUE to 24MHz
fpistm Aug 5, 2020
952fb78
Merge pull request #1137 from fpistm/Update_G4
fpistm Aug 5, 2020
0402aed
[L4] Update STM32L4xx HAL Drivers to v1.12.0
fpistm Aug 4, 2020
e6811ce
[L4] Update STM32L4xx CMSIS Drivers to v1.7.0
fpistm Aug 4, 2020
4b8fdb0
[L4] Update license header
fpistm Aug 5, 2020
1657dfa
[USB] Fix EP0 MPS definition after HAL update
fpistm Aug 5, 2020
f41f10e
Merge pull request #1138 from fpistm/Update_L4
fpistm Aug 6, 2020
738ff72
[WB] Update STM32WBxx HAL Drivers to v1.6.0
fpistm Aug 4, 2020
5b5f50a
[WB] Update STM32WBxx CMSIS Drivers to v1.6.0
fpistm Aug 4, 2020
2e64639
[WB] Update wrapped files
fpistm Aug 4, 2020
a2454dc
Merge pull request #1139 from fpistm/Update_WB
fpistm Aug 6, 2020
9dec9f6
[H7] Update STM32H7xx HAL Drivers to v1.9.0
fpistm Aug 4, 2020
7e2bb73
[H7] Update STM32H7xx CMSIS Drivers to v1.9.0
fpistm Aug 4, 2020
9ca09cf
[H7] Update wrapped files
fpistm Aug 4, 2020
46ba1c6
[H7] Update HAL default configuration
fpistm Aug 6, 2020
df3b533
[H7] Update CMSIS Cortex-Mx Device Peripheral Access Layer System Sou…
fpistm Aug 6, 2020
d89c283
Merge pull request #1140 from fpistm/Update_H7
fpistm Aug 6, 2020
5cd6cbb
[G0] Fix Timer and USART IRQ definition
fpistm Aug 6, 2020
ad89347
[L1] Update STM32L1xx HAL Drivers to v1.4.1
fpistm Aug 4, 2020
caf88ac
[L1] Update STM32L1xx CMSIS Drivers to v2.3.1
fpistm Aug 4, 2020
df5e421
[L1] Update wrapped files
fpistm Aug 4, 2020
0f5c113
[L1] Update HAL default configuration
fpistm Aug 7, 2020
b4d9a7c
[HardwareTimer] Fix issue when no channel N state
fpistm Aug 7, 2020
5529c93
[L1] Remove HAL I2C patch
fpistm Aug 7, 2020
59dda5c
Merge pull request #1142 from fpistm/Update_L1
fpistm Aug 7, 2020
9826d97
[F3] Update STM32F3xx HAL Drivers to v1.5.4
fpistm Aug 19, 2020
2d5bd28
[F0] Update STM32F0xx HAL Drivers to v1.7.4
fpistm Aug 20, 2020
0f522e0
stm32L0xx or stm32L1xx soc series has an embedded EEPROM
FRASTM Aug 24, 2020
9a5672f
remove stm32L0x and stm32L1x outside the use of EEPROM
FRASTM Aug 20, 2020
d85772f
remove stm32L0x and stm32L1x EEPROM buffered functions
FRASTM Aug 24, 2020
e5d9368
Merge pull request #1129 from FRASTM/eeprom_l0
fpistm Aug 24, 2020
242671d
Move the STM32 eeprom driver from core to library
fpistm Aug 24, 2020
00acff6
[F1] Update STM32F1xx HAL Drivers to v1.1.5
fpistm Aug 31, 2020
7b66f42
[F1] Remove HAL I2C patch
fpistm Aug 31, 2020
6fff465
Merge pull request #1159 from fpistm/Update_F1
fpistm Aug 31, 2020
1fb2181
[CI] Remove platformio-build.py from ignore paths
fpistm Sep 3, 2020
962470a
Moved from arm-none-eabi-gcc 9.3.1-1.1 to 9.3.1-1.2
fpistm Aug 27, 2020
6b6a254
Update PlatformIO scripts (#1164)
valeros Sep 4, 2020
8c34ed0
[F4] Fix IS_ADC_CHANNEL()
TheCodeSharman Sep 4, 2020
ab026fa
[B_L4S5I_IOT01A] Update OCTOSPI pinmap arrays
fpistm Sep 2, 2020
66fd429
Update QSPI pinmap arrays
fpistm Sep 8, 2020
bb8458b
Define pins for QSPI MX25R6435F
fpistm Sep 8, 2020
9d3b308
HardwareTimer: pause() need to call HAL API to restore HAL state
ABOSTM Sep 9, 2020
22ef1b4
Merge pull request #1163 from fpistm/OSPI
fpistm Sep 10, 2020
16973cd
[F4] Update STM32F4xx HAL Drivers to v1.7.9
fpistm Sep 11, 2020
0aa10e1
[F4] Fix HAL_RCC_USART3 definition for STM32F412Cx
fpistm Mar 6, 2020
ab26bd2
[F4] Remove HAL I2C patch
fpistm Sep 11, 2020
ac2ad18
Add [F4] Fix IS_ADC_CHANNEL()
fpistm Sep 11, 2020
bf63509
Fix IS_ADC_CHANNEL()
TheCodeSharman Sep 4, 2020
41820f4
Merge pull request #1169 from fpistm/updateF4
fpistm Sep 11, 2020
fdc2856
Change ARMED tone and servo timers
ktand Aug 11, 2020
06274cf
Align Print API of (unsigned) long long
fpistm Sep 14, 2020
dce241d
Moved Stream.flush() to Print.flush()
fpistm Sep 14, 2020
7dfd03b
Added Print.availableForWrite()
fpistm Sep 14, 2020
0f155d0
Fix flash latency for F4x5RG running full speed at 168MHz
geosmall Sep 14, 2020
70a6928
Merge pull request #1173 from fpistm/api-fixes
fpistm Sep 15, 2020
5c9ea25
[L0] Update STM32L0xx HAL Drivers to v1.10.3
fpistm Sep 18, 2020
2fe15c1
[MP1] Fix redefinition
fpistm Sep 18, 2020
95e58e6
Enable USB clock for Nucleo L053R8
fpistm Sep 21, 2020
5f0993e
[G0] Fix USART IRQ handler
fpistm Sep 24, 2020
d229f55
[CI] Add fork error pattern detection
fpistm Sep 24, 2020
ac1d03e
[CI] Update configuration
fpistm Sep 28, 2020
d3a4388
[F1] Update STM32F1xx HAL Drivers to v1.1.6
fpistm Oct 9, 2020
b720ec5
[F1] Update STM32F1xx CMSIS Drivers to v4.3.2
fpistm Oct 9, 2020
a4058ae
Merge pull request #1200 from fpistm/updateF1
fpistm Oct 9, 2020
6ad352d
[F2] Update STM32F2xx HAL Drivers to v1.2.5
fpistm Oct 9, 2020
513bfe3
[F2] Update STM32F2xx CMSIS Drivers to v2.2.4
fpistm Oct 9, 2020
9c1ea14
[F2] Remove HAL I2C patch
fpistm Oct 9, 2020
e67b477
Merge pull request #1201 from fpistm/updateF2
fpistm Oct 9, 2020
cbccfe4
Moved from arm-none-eabi-gcc 9.3.1-1.2 to 9.3.1-1.3
fpistm Oct 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/new-variant-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ assignees: ''
**Note that user can add a STM32 based board following this [wiki](https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board))**

Any contribution is welcome, so do not hesitate to submit a PR.

All new variant request will be moved to [New Variant] request list #722 and the related issue will be closed.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Explain the **motivation** for making this change. What existing problem does th

**Validation**

* Ensure Travis CI build is passed.
* Ensure CI build is passed.
* Demonstrate the code is solid. [e.g. Provide a sketch]

<!-- Make sure tests pass on both Travis CI. -->
<!-- Make sure tests pass on both CI. -->

**Code formatting**

* Ensure AStyle check is passed thanks Travis CI (soon)
* Ensure AStyle check is passed thanks CI

<!-- See the simple style guide. -->

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/pio-build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ platformio platform install "https://github.com/platformio/platform-ststm32.git"
exit 1
}
# Prepare framework for CI
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'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
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()" || {
exit 1
}
ln --symbolic "$GITHUB_WORKSPACE" "$HOME/.platformio/packages/framework-arduinoststm32" || {
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Continuous-Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- '!CI/build/arduino-cli.py'
- '!CI/build/platformio-builder.py'
- tools/**
- '!tools/platformio-build.py'
pull_request:
paths-ignore:
- '*.json'
Expand All @@ -20,6 +21,7 @@ on:
- '!CI/build/arduino-cli.py'
- '!CI/build/platformio-builder.py'
- tools/**
- '!tools/platformio-build.py'
jobs:
astyle_check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -53,6 +55,8 @@ jobs:
- name: Compilation
id: Compile
uses: stm32duino/actions/compile-examples@master
with:
additional-url: 'https://github.com/stm32duino/BoardManagerFiles/raw/dev/STM32/package_stm_index.json'

# Use the output from the `Compile` step
- name: Compilation Errors
Expand Down
159 changes: 93 additions & 66 deletions CI/build/arduino-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import timedelta
import json
import os
from packaging import version
import re
import shutil
import subprocess
Expand Down Expand Up @@ -52,6 +53,8 @@
arch = arch_default
arduino_platform = arduino_platform_default
arduino_cli = ""
arduino_cli_default_version = "0.10.0"
arduino_cli_version = arduino_cli_default_version

# List
sketch_list = []
Expand Down Expand Up @@ -117,9 +120,8 @@ def create_output_log_tree():
file.write(build_separator + "\n")
# Folders
for board in board_fqbn:
createFolder(os.path.join(output_dir, board, bin_dir))
createFolder(os.path.join(output_dir, board))
if args.bin:
createFolder(os.path.join(output_dir, board, bin_dir))
createFolder(os.path.join(build_output_dir, board))


Expand Down Expand Up @@ -152,12 +154,15 @@ def create_config():

def check_config():
global arduino_cli
global arduino_cli_version
global arduino_cli_path
global sketches_path_list
global build_output_dir
global root_output_dir
global output_dir
global log_file
global stm32_url

if args.ci is False:
if os.path.isfile(path_config_filename):
try:
Expand Down Expand Up @@ -193,37 +198,69 @@ def check_config():
else:
arduino_cli = "arduino-cli"

try:
output = subprocess.check_output(
[arduino_cli, "version"], stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
res = re.match(r".*Version:\s+(\d+\.\d+\.\d+).*", output.decode("utf-8"))
if res:
arduino_cli_version = res.group(1)
print("Arduino CLI version used: " + arduino_cli_version)
else:
print(
"Unable to define Arduino CLI version, use default: "
+ arduino_cli_default_version
)

if args.url:
stm32_url = args.url

try:
output = subprocess.check_output(
[arduino_cli, "core", "search", "stm32", "--additional-urls", stm32_url],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
)
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
if arduino_platform not in output.decode("utf-8"):
raise subprocess.CalledProcessError(1, "re")
print(arduino_platform + " is not installed!")
quit(1)
# Add core and library path to sketches_path_list
try:
output = subprocess.check_output(
[arduino_cli, "config", "dump", "--format", "json"],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
).decode("utf-8")
except subprocess.CalledProcessError as e:
print(
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
cli_config = json.loads(output)
if cli_config is not None:
if cli_config["directories"]["data"] is not None:
sketches_path_list.append(cli_config["directories"]["data"])
else:
raise subprocess.CalledProcessError(3, "No data directory")
print("No data directory")
quit(1)
if cli_config["directories"]["user"] is not None:
sketches_path_list.append(cli_config["directories"]["user"])
else:
raise subprocess.CalledProcessError(2, "No user directory")
print("No user directory!")
quit(1)
else:
raise subprocess.CalledProcessError(1, "No fqbn")
except subprocess.CalledProcessError:
print("No arduino-cli config!")
quit()
except subprocess.CalledProcessError:
print(arduino_platform + " is not installed!")
quit()
print("No arduino-cli config!")
quit(1)


def load_core_config():
Expand Down Expand Up @@ -366,7 +403,7 @@ def manage_inos():
break
else:
print("Sketch {} path does not exist!".format(args.ino))
quit()
quit(1)
# Sketches listed in a file
elif args.file:
assert os.path.exists(args.file), "Sketches list file does not exist"
Expand Down Expand Up @@ -397,7 +434,7 @@ def manage_inos():
sketch_list.append(sketch_default)
if len(sketch_list) == 0:
print("No sketch to build for " + arduino_platform + "!")
quit()
quit(1)


# Find all .ino files and save directory
Expand Down Expand Up @@ -429,32 +466,41 @@ def find_board():
try:
output = subprocess.check_output(
[arduino_cli, "board", "listall", "--format", "json"],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
).decode("utf-8")
except subprocess.CalledProcessError as e:
print('"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode))
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
boards_list = json.loads(output)
if boards_list is not None:
for board in boards_list["boards"]:
if arduino_platform in board["FQBN"]:
fqbn_list_tmp.append(board["FQBN"])
if not len(fqbn_list_tmp):
raise subprocess.CalledProcessError(2, "No fqbn")
else:
raise subprocess.CalledProcessError(1, "No fqbn")
except subprocess.CalledProcessError:
print("No fqbn found for " + arduino_platform + "!")
quit()
if not len(fqbn_list_tmp):
print("No boards found for " + arduino_platform)
quit(1)

# For STM32 core, pnum is requested
for fqbn in fqbn_list_tmp:
try:
output = subprocess.check_output(
[arduino_cli, "board", "details", "--format", "json", fqbn],
stderr=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
).decode("utf-8")
except subprocess.CalledProcessError as e:
print(
'"' + " ".join(e.cmd) + '" failed with code: {}!'.format(e.returncode)
)
print(e.stdout.decode("utf-8"))
quit(e.returncode)
else:
board_detail = json.loads(output)
if board_detail is not None:
if "config_options" not in board_detail:
raise subprocess.CalledProcessError(3, "No config_options")
print("No config_options found for " + fqbn)
quit(1)
for option in board_detail["config_options"]:
if option["option"] == "pnum":
for value in option["values"]:
Expand All @@ -466,14 +512,12 @@ def find_board():
)
break
else:
raise subprocess.CalledProcessError(1, "No fqbn")
except subprocess.CalledProcessError as e:
print("No fqbn detail found for " + e.cmd + "!")
print('No detail found for:"' + fqbn + '"!')
if board_found:
board_fqbn = collections.OrderedDict(sorted(board_found.items()))
else:
print("No board found for " + arduino_platform + "!")
quit()
quit(1)


# Check the status
Expand All @@ -484,14 +528,13 @@ def check_status(status, build_conf, boardKo):

if status[1] == 0:
result = "\033[32msucceeded\033[0m"
if args.bin:
bin_copy(build_conf[0], sketch_name)
nb_build_passed += 1
elif status[1] == 1:
# Check if failed due to a region overflowed
logFile = os.path.join(build_conf[3], sketch_name + ".log")
# error or fatal error
error_pattern = re.compile(r":\d+:\d+:\s.*error:\s")
fork_pattern = re.compile(r"^Error during build: fork/exec")
error_pattern = re.compile(r":\d+:\d+:\s.*error:\s|^Error:")
ld_pattern = re.compile("arm-none-eabi/bin/ld:")
overflow_pattern = re.compile(
r"(will not fit in |section .+ is not within )?region( .+ overflowed by [\d]+ bytes)?"
Expand All @@ -500,6 +543,8 @@ def check_status(status, build_conf, boardKo):
for i, line in enumerate(open(logFile)):
if error_pattern.search(line):
error_found = True
elif fork_pattern.search(line):
error_found = True
elif ld_pattern.search(line):
# If one ld line is not for region overflowed --> failed
if overflow_pattern.search(line) is None:
Expand All @@ -514,8 +559,6 @@ def check_status(status, build_conf, boardKo):
else:
# else consider it succeeded
result = "\033[32msucceeded*\033[0m"
if args.bin:
empty_bin(build_conf[0], sketch_name)
nb_build_passed += 1
else:
result = "\033[31merror\033[0m"
Expand Down Expand Up @@ -645,34 +688,6 @@ def log_final_result():
print(output_dir)


# Create an empty binary
def empty_bin(board_name, sketch_name):
empty_path = os.path.abspath(os.path.join(output_dir, board_name, bin_dir))
createFolder(empty_path)
empty_file = os.path.join(
empty_path, sketch_name + "_COULD_NOT_FIT_IN_THIS_BOARD.bin"
)
try:
f = open(empty_file, "w")
except IOError:
print("Cannot create empty binary: ", empty_file)
else:
f.close()


# Create a "bin" directory for each board and copy all binary files
# from the builder output directory into it
def bin_copy(board_name, sketch_name):
try:
shutil.copy(
os.path.join(build_output_dir, board_name, sketch_name + ".bin"),
os.path.abspath(os.path.join(output_dir, board_name, bin_dir)),
)
except OSError as e:
print("Cannot copy the binary from the arduino-cli output: " + e.strerror)
raise


# Set up specific options to customise arduino builder command
def get_fqbn(b_name):
if b_name in board_custom_fqbn and board_custom_fqbn[b_name]:
Expand All @@ -696,8 +711,12 @@ def genBasicCommand(b_name):
cmd.append(build_output_cache_dir)
if args.verbose:
cmd.append("--verbose")
cmd.append("-o")
cmd.append(os.path.join(build_output_dir, b_name, "sketch"))
if version.parse(arduino_cli_version) <= version.parse(arduino_cli_default_version):
cmd.append("--output")
cmd.append(os.path.join(output_dir, b_name, bin_dir, "dummy_sketch"))
else:
cmd.append("--output-dir")
cmd.append(os.path.join(output_dir, b_name, bin_dir))
cmd.append("--fqbn")
cmd.append(get_fqbn(b_name))
cmd.append("dummy_sketch")
Expand Down Expand Up @@ -727,6 +746,9 @@ def build_config(sketch, boardSkipped):

for idx in reversed(range(len(build_conf_list))):
build_conf_list[idx][4][-1] = sketch
build_conf_list[idx][4][-4] = build_conf_list[idx][4][-4].replace(
"dummy_sketch", os.path.basename(sketch)
)
if na_sketch_pattern:
if build_conf_list[idx][0] in na_sketch_pattern:
for pattern in na_sketch_pattern[build_conf_list[idx][0]]:
Expand Down Expand Up @@ -860,12 +882,17 @@ def build(build_conf):
+ cores_config_file_default,
)

parser.add_argument(
"-u", "--url", metavar="<string>", help="additional URL for the board manager\
Default url : "
+ stm32_url,
)

parser.add_argument(
"-v", "--verbose", help="enable arduino-cli verbose mode", action="store_true"
)

g1 = parser.add_mutually_exclusive_group()
g1.add_argument("--bin", help="save binaries", action="store_true")
g1.add_argument("--ci", help="custom configuration for CI build", action="store_true")

# Sketch options
Expand Down
Loading