summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-x[-rw-r--r--]tools/build.py4
-rwxr-xr-x[-rw-r--r--]tools/build_utils.py30
-rwxr-xr-x[-rw-r--r--]tools/gen_doc.py1
-rwxr-xr-x[-rw-r--r--]tools/get_deps.py22
-rwxr-xr-x[-rw-r--r--]tools/iar_gen.py2
-rwxr-xr-x[-rw-r--r--]tools/make_release.py1
-rwxr-xr-x[-rw-r--r--]tools/mksunxi.py0
-rwxr-xr-xtools/pcapng_to_corpus.py2
8 files changed, 40 insertions, 22 deletions
diff --git a/tools/build.py b/tools/build.py
index 3a771ed6b..3a9239bc2 100644..100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
import argparse
import random
import os
@@ -67,6 +68,7 @@ def get_examples(family):
if family == 'espressif':
all_examples.append('device/board_test')
all_examples.append('device/video_capture')
+ all_examples.append('host/device_info')
all_examples.sort()
return all_examples
@@ -88,7 +90,7 @@ def cmake_board(board, toolchain, build_flags_on):
if len(build_flags_on) > 0:
build_flags = ' '.join(f'-D{flag}=1' for flag in build_flags_on)
build_flags = f'-DCFLAGS_CLI="{build_flags}"'
- build_dir += '-' + '-'.join(build_flags_on)
+ build_dir += '-f1_' + '_'.join(build_flags_on)
family = find_family(board)
if family == 'espressif':
diff --git a/tools/build_utils.py b/tools/build_utils.py
index 265ab5c52..2998f940d 100644..100755
--- a/tools/build_utils.py
+++ b/tools/build_utils.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python3
import subprocess
import pathlib
-import time
+import re
build_format = '| {:29} | {:30} | {:18} | {:7} | {:6} | {:6} |'
@@ -35,18 +36,21 @@ def skip_example(example, board):
mk_contents = board_mk.read_text()
mcu = "NONE"
- for token in mk_contents.split():
- if "CFG_TUSB_MCU=OPT_MCU_" in token:
- # Strip " because cmake files has them.
- token = token.strip("\"")
- _, opt_mcu = token.split("=")
- mcu = opt_mcu[len("OPT_MCU_"):]
- if "esp32s2" in token:
- mcu = "ESP32S2"
- if "esp32s3" in token:
- mcu = "ESP32S3"
- if mcu != "NONE":
- break
+ if family == "espressif":
+ for line in mk_contents.splitlines():
+ match = re.search(r'set\(IDF_TARGET\s+"([^"]+)"\)', line)
+ if match:
+ mcu = match.group(1).upper()
+ break
+ else:
+ for token in mk_contents.split():
+ if "CFG_TUSB_MCU=OPT_MCU_" in token:
+ # Strip " because cmake files has them.
+ token = token.strip("\"")
+ _, opt_mcu = token.split("=")
+ mcu = opt_mcu[len("OPT_MCU_"):]
+ if mcu != "NONE":
+ break
# Skip all OPT_MCU_NONE these are WIP port
if mcu == "NONE":
diff --git a/tools/gen_doc.py b/tools/gen_doc.py
index 668c77ef6..c69f3ff29 100644..100755
--- a/tools/gen_doc.py
+++ b/tools/gen_doc.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
import pandas as pd
from tabulate import tabulate
from pathlib import Path
diff --git a/tools/get_deps.py b/tools/get_deps.py
index 5946d7def..58709414c 100644..100755
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
import argparse
import sys
import subprocess
@@ -72,6 +73,9 @@ deps_optional = {
'hw/mcu/sony/cxd56/spresense-exported-sdk': ['https://github.com/sonydevworld/spresense-exported-sdk.git',
'2ec2a1538362696118dc3fdf56f33dacaf8f4067',
'spresense'],
+ 'hw/mcu/st/cmsis_device_c0': ['https://github.com/STMicroelectronics/cmsis_device_c0.git',
+ 'fb56b1b70c73b74eacda2a4bcc36886444364ab3',
+ 'stm32c0'],
'hw/mcu/st/cmsis_device_f0': ['https://github.com/STMicroelectronics/cmsis_device_f0.git',
'2fc25ee22264bc27034358be0bd400b893ef837e',
'stm32f0'],
@@ -120,6 +124,12 @@ deps_optional = {
'hw/mcu/st/cmsis_device_wb': ['https://github.com/STMicroelectronics/cmsis_device_wb.git',
'9c5d1920dd9fabbe2548e10561d63db829bb744f',
'stm32wb'],
+ 'hw/mcu/st/stm32-mfxstm32l152': ['https://github.com/STMicroelectronics/stm32-mfxstm32l152.git',
+ '7f4389efee9c6a655b55e5df3fceef5586b35f9b',
+ 'stm32h7'],
+ 'hw/mcu/st/stm32c0xx_hal_driver': ['https://github.com/STMicroelectronics/stm32c0xx_hal_driver.git',
+ '41253e2f1d7ae4a4d0c379cf63f5bcf71fcf8eb3',
+ 'stm32c0'],
'hw/mcu/st/stm32f0xx_hal_driver': ['https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git',
'0e95cd88657030f640a11e690a8a5186c7712ea5',
'stm32f0'],
@@ -185,12 +195,12 @@ deps_optional = {
'ch32f20x'],
'lib/CMSIS_5': ['https://github.com/ARM-software/CMSIS_5.git',
'20285262657d1b482d132d20d755c8c330d55c1f',
- 'imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2x'
- 'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43'
- 'stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h5'
- 'stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wb'
- 'sam3x samd11 samd21 samd51 samd5x_e5x same5x same7x saml2x samg'
- 'tm4c'],
+ 'imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2x '
+ 'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 '
+ 'stm32c0 stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h5 '
+ 'stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wb '
+ 'sam3x samd11 samd21 samd51 samd5x_e5x same5x same7x saml2x samg '
+ 'tm4c '],
'lib/sct_neopixel': ['https://github.com/gsteiert/sct_neopixel.git',
'e73e04ca63495672d955f9268e003cffe168fcd8',
'lpc55'],
diff --git a/tools/iar_gen.py b/tools/iar_gen.py
index ebcfa1423..8d45659db 100644..100755
--- a/tools/iar_gen.py
+++ b/tools/iar_gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
import os
import sys
diff --git a/tools/make_release.py b/tools/make_release.py
index 3e653c12d..92c75baf9 100644..100755
--- a/tools/make_release.py
+++ b/tools/make_release.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
import re
import gen_doc
diff --git a/tools/mksunxi.py b/tools/mksunxi.py
index fd8557cfc..fd8557cfc 100644..100755
--- a/tools/mksunxi.py
+++ b/tools/mksunxi.py
diff --git a/tools/pcapng_to_corpus.py b/tools/pcapng_to_corpus.py
index 9c31365eb..3089f0bb6 100755
--- a/tools/pcapng_to_corpus.py
+++ b/tools/pcapng_to_corpus.py
@@ -1,4 +1,4 @@
-#!/bin/python3
+#!/usr/bin/env python3
import argparse
import pcapng
import zipfile