|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +# LZMA support check |
| 16 | +try: |
| 17 | + import lzma as _lzma |
| 18 | +except ImportError: |
| 19 | + import sys |
| 20 | + print("ERROR: Python's lzma module is unavailable or broken in this interpreter.", file=sys.stderr) |
| 21 | + print("LZMA (liblzma) support is required for tool/toolchain installation.", file=sys.stderr) |
| 22 | + print("Please install Python built with LZMA support.", file=sys.stderr) |
| 23 | + raise SystemExit(1) |
| 24 | +else: |
| 25 | + # Keep namespace clean |
| 26 | + del _lzma |
| 27 | + |
15 | 28 | import fnmatch
|
16 | 29 | import os
|
17 | 30 | import json
|
|
21 | 34 | import logging
|
22 | 35 | from typing import Optional, Dict, List, Any
|
23 | 36 |
|
| 37 | +from platformio.compat import IS_WINDOWS |
24 | 38 | from platformio.public import PlatformBase, to_unix_path
|
25 | 39 | from platformio.proc import get_pythonexe_path
|
26 | 40 | from platformio.project.config import ProjectConfig
|
27 | 41 | from platformio.package.manager.tool import ToolPackageManager
|
28 | 42 |
|
29 | 43 | # Constants
|
| 44 | +try: |
| 45 | + with open('/proc/device-tree/model') as f: |
| 46 | + SUBPROCESS_TIMEOUT = 900 if 'raspberry pi' in f.read().lower() else 300 |
| 47 | +except: |
| 48 | + SUBPROCESS_TIMEOUT = 300 |
30 | 49 | RETRY_LIMIT = 3
|
31 |
| -SUBPROCESS_TIMEOUT = 300 |
32 | 50 | DEFAULT_DEBUG_SPEED = "5000"
|
33 | 51 | DEFAULT_APP_OFFSET = "0x10000"
|
34 | 52 | tl_install_name = "tool-esp_install"
|
|
68 | 86 | ]
|
69 | 87 |
|
70 | 88 | # System-specific configuration
|
71 |
| -IS_WINDOWS = sys.platform.startswith("win") |
72 | 89 | # Set Platformio env var to use windows_amd64 for all windows architectures
|
73 | 90 | # only windows_amd64 native espressif toolchains are available
|
74 | 91 | if IS_WINDOWS:
|
@@ -850,7 +867,7 @@ def _get_debug_server_args(self, openocd_interface: str, debug: Dict) -> List[st
|
850 | 867 | return [
|
851 | 868 | "-s", "$PACKAGE_DIR/share/openocd/scripts",
|
852 | 869 | "-f", f"interface/{openocd_interface}.cfg",
|
853 |
| - "-f", f"{config_type}/{config_name}.cfg" |
| 870 | + "-f", f"{config_type}/{config_name}" |
854 | 871 | ]
|
855 | 872 |
|
856 | 873 | def configure_debug_session(self, debug_config):
|
|
0 commit comments