fbuild 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fbuild might be problematic. Click here for more details.

Files changed (93) hide show
  1. fbuild/__init__.py +0 -0
  2. fbuild/assets/example.txt +1 -0
  3. fbuild/build/__init__.py +117 -0
  4. fbuild/build/archive_creator.py +186 -0
  5. fbuild/build/binary_generator.py +444 -0
  6. fbuild/build/build_component_factory.py +131 -0
  7. fbuild/build/build_state.py +325 -0
  8. fbuild/build/build_utils.py +98 -0
  9. fbuild/build/compilation_executor.py +422 -0
  10. fbuild/build/compiler.py +165 -0
  11. fbuild/build/compiler_avr.py +574 -0
  12. fbuild/build/configurable_compiler.py +612 -0
  13. fbuild/build/configurable_linker.py +637 -0
  14. fbuild/build/flag_builder.py +186 -0
  15. fbuild/build/library_dependency_processor.py +185 -0
  16. fbuild/build/linker.py +708 -0
  17. fbuild/build/orchestrator.py +67 -0
  18. fbuild/build/orchestrator_avr.py +656 -0
  19. fbuild/build/orchestrator_esp32.py +797 -0
  20. fbuild/build/orchestrator_teensy.py +543 -0
  21. fbuild/build/source_compilation_orchestrator.py +220 -0
  22. fbuild/build/source_scanner.py +516 -0
  23. fbuild/cli.py +566 -0
  24. fbuild/cli_utils.py +312 -0
  25. fbuild/config/__init__.py +16 -0
  26. fbuild/config/board_config.py +457 -0
  27. fbuild/config/board_loader.py +92 -0
  28. fbuild/config/ini_parser.py +209 -0
  29. fbuild/config/mcu_specs.py +88 -0
  30. fbuild/daemon/__init__.py +34 -0
  31. fbuild/daemon/client.py +929 -0
  32. fbuild/daemon/compilation_queue.py +293 -0
  33. fbuild/daemon/daemon.py +474 -0
  34. fbuild/daemon/daemon_context.py +196 -0
  35. fbuild/daemon/error_collector.py +263 -0
  36. fbuild/daemon/file_cache.py +332 -0
  37. fbuild/daemon/lock_manager.py +270 -0
  38. fbuild/daemon/logging_utils.py +149 -0
  39. fbuild/daemon/messages.py +301 -0
  40. fbuild/daemon/operation_registry.py +288 -0
  41. fbuild/daemon/process_tracker.py +366 -0
  42. fbuild/daemon/processors/__init__.py +12 -0
  43. fbuild/daemon/processors/build_processor.py +157 -0
  44. fbuild/daemon/processors/deploy_processor.py +327 -0
  45. fbuild/daemon/processors/monitor_processor.py +146 -0
  46. fbuild/daemon/request_processor.py +401 -0
  47. fbuild/daemon/status_manager.py +216 -0
  48. fbuild/daemon/subprocess_manager.py +316 -0
  49. fbuild/deploy/__init__.py +17 -0
  50. fbuild/deploy/deployer.py +67 -0
  51. fbuild/deploy/deployer_esp32.py +314 -0
  52. fbuild/deploy/monitor.py +495 -0
  53. fbuild/interrupt_utils.py +34 -0
  54. fbuild/packages/__init__.py +53 -0
  55. fbuild/packages/archive_utils.py +1098 -0
  56. fbuild/packages/arduino_core.py +412 -0
  57. fbuild/packages/cache.py +249 -0
  58. fbuild/packages/downloader.py +366 -0
  59. fbuild/packages/framework_esp32.py +538 -0
  60. fbuild/packages/framework_teensy.py +346 -0
  61. fbuild/packages/github_utils.py +96 -0
  62. fbuild/packages/header_trampoline_cache.py +394 -0
  63. fbuild/packages/library_compiler.py +203 -0
  64. fbuild/packages/library_manager.py +549 -0
  65. fbuild/packages/library_manager_esp32.py +413 -0
  66. fbuild/packages/package.py +163 -0
  67. fbuild/packages/platform_esp32.py +383 -0
  68. fbuild/packages/platform_teensy.py +312 -0
  69. fbuild/packages/platform_utils.py +131 -0
  70. fbuild/packages/platformio_registry.py +325 -0
  71. fbuild/packages/sdk_utils.py +231 -0
  72. fbuild/packages/toolchain.py +436 -0
  73. fbuild/packages/toolchain_binaries.py +196 -0
  74. fbuild/packages/toolchain_esp32.py +484 -0
  75. fbuild/packages/toolchain_metadata.py +185 -0
  76. fbuild/packages/toolchain_teensy.py +404 -0
  77. fbuild/platform_configs/esp32.json +150 -0
  78. fbuild/platform_configs/esp32c2.json +144 -0
  79. fbuild/platform_configs/esp32c3.json +143 -0
  80. fbuild/platform_configs/esp32c5.json +151 -0
  81. fbuild/platform_configs/esp32c6.json +151 -0
  82. fbuild/platform_configs/esp32p4.json +149 -0
  83. fbuild/platform_configs/esp32s3.json +151 -0
  84. fbuild/platform_configs/imxrt1062.json +56 -0
  85. fbuild-1.1.0.dist-info/METADATA +447 -0
  86. fbuild-1.1.0.dist-info/RECORD +93 -0
  87. fbuild-1.1.0.dist-info/WHEEL +5 -0
  88. fbuild-1.1.0.dist-info/entry_points.txt +5 -0
  89. fbuild-1.1.0.dist-info/licenses/LICENSE +21 -0
  90. fbuild-1.1.0.dist-info/top_level.txt +2 -0
  91. fbuild_lint/__init__.py +0 -0
  92. fbuild_lint/ruff_plugins/__init__.py +0 -0
  93. fbuild_lint/ruff_plugins/keyboard_interrupt_checker.py +158 -0
@@ -0,0 +1,404 @@
1
+ """Teensy Toolchain Management.
2
+
3
+ This module handles downloading, extracting, and managing ARM GCC toolchain
4
+ needed for Teensy 4.x builds.
5
+
6
+ Toolchain Download Process:
7
+ 1. Download ARM GCC toolchain for ARM Cortex-M
8
+ 2. Extract to cache directory
9
+ 3. Provide access to compiler binaries
10
+
11
+ Toolchain Structure (after extraction):
12
+ arm-none-eabi/
13
+ ├── bin/
14
+ │ ├── arm-none-eabi-gcc.exe
15
+ │ ├── arm-none-eabi-g++.exe
16
+ │ ├── arm-none-eabi-ar.exe
17
+ │ ├── arm-none-eabi-objcopy.exe
18
+ │ └── ...
19
+ ├── lib/
20
+ └── include/
21
+
22
+ Supported Boards:
23
+ - Teensy 4.1 (NXP i.MX RT1062, ARM Cortex-M7 @ 600MHz)
24
+ - Teensy 4.0 (NXP i.MX RT1062, ARM Cortex-M7 @ 600MHz)
25
+ """
26
+
27
+ import platform
28
+ from pathlib import Path
29
+ from typing import Any, Dict, Optional
30
+
31
+ from .cache import Cache
32
+ from .downloader import DownloadError, ExtractionError, PackageDownloader
33
+ from .package import IToolchain, PackageError
34
+
35
+
36
+ class ToolchainErrorTeensy(PackageError):
37
+ """Raised when Teensy toolchain operations fail."""
38
+
39
+ pass
40
+
41
+
42
+ class ToolchainTeensy(IToolchain):
43
+ """Manages Teensy toolchain download, extraction, and access.
44
+
45
+ This class handles downloading and managing ARM GCC toolchain for Teensy 4.x:
46
+ - ARM GCC for Teensy 4.0, 4.1 (ARM Cortex-M7)
47
+ """
48
+
49
+ # Binary prefix for ARM GCC toolchain
50
+ BINARY_PREFIX = "arm-none-eabi-"
51
+
52
+ # Toolchain download URLs for different platforms
53
+ # Source: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
54
+ # Version 15.2.Rel1 (released December 17, 2025)
55
+ TOOLCHAIN_URLS = {
56
+ "Windows": "https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-mingw-w64-x86_64-arm-none-eabi.zip",
57
+ "Linux": "https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-x86_64-arm-none-eabi.tar.xz",
58
+ "Darwin": "https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz",
59
+ }
60
+
61
+ def __init__(
62
+ self,
63
+ cache: Cache,
64
+ show_progress: bool = True,
65
+ ):
66
+ """Initialize Teensy toolchain manager.
67
+
68
+ Args:
69
+ cache: Cache manager instance
70
+ show_progress: Whether to show download/extraction progress
71
+ """
72
+ self.cache = cache
73
+ self.show_progress = show_progress
74
+ self.downloader = PackageDownloader()
75
+
76
+ # Get platform-specific toolchain URL
77
+ self.toolchain_url = self._get_platform_toolchain_url()
78
+
79
+ # Extract version from URL
80
+ self.version = self._extract_version_from_url(self.toolchain_url)
81
+
82
+ # Get toolchain path from cache
83
+ self.toolchain_path = cache.get_toolchain_path(self.toolchain_url, self.version)
84
+
85
+ @staticmethod
86
+ def _get_platform_toolchain_url() -> str:
87
+ """Get toolchain URL for the current platform.
88
+
89
+ Returns:
90
+ URL to platform-specific toolchain archive
91
+
92
+ Raises:
93
+ ToolchainErrorTeensy: If platform is not supported
94
+ """
95
+ system = platform.system()
96
+ if system not in ToolchainTeensy.TOOLCHAIN_URLS:
97
+ raise ToolchainErrorTeensy(f"Unsupported platform: {system}. " + f"Supported platforms: {', '.join(ToolchainTeensy.TOOLCHAIN_URLS.keys())}")
98
+ return ToolchainTeensy.TOOLCHAIN_URLS[system]
99
+
100
+ @staticmethod
101
+ def _extract_version_from_url(url: str) -> str:
102
+ """Extract version string from toolchain URL.
103
+
104
+ Args:
105
+ url: Toolchain URL
106
+
107
+ Returns:
108
+ Version string (e.g., "15.2.0")
109
+ """
110
+ # Extract version from URL pattern: .../15.2.0/...
111
+ parts = url.split("/")
112
+ for part in parts:
113
+ if "." in part and part[0].isdigit():
114
+ return part
115
+
116
+ # Fallback: use URL hash if version extraction fails
117
+ from .cache import Cache
118
+
119
+ return Cache.hash_url(url)[:8]
120
+
121
+ def ensure_toolchain(self) -> Path:
122
+ """Ensure toolchain is downloaded and extracted.
123
+
124
+ Returns:
125
+ Path to the extracted toolchain directory
126
+
127
+ Raises:
128
+ ToolchainErrorTeensy: If download or extraction fails
129
+ """
130
+ if self.is_installed():
131
+ if self.show_progress:
132
+ print(f"Using cached ARM GCC toolchain {self.version}")
133
+ return self.toolchain_path
134
+
135
+ try:
136
+ if self.show_progress:
137
+ print(f"Downloading ARM GCC toolchain {self.version}...")
138
+
139
+ # Download and extract toolchain package
140
+ self.cache.ensure_directories()
141
+
142
+ # Use downloader to handle download and extraction
143
+ archive_name = Path(self.toolchain_url).name
144
+ toolchain_cache_dir = self.toolchain_path.parent / "bin"
145
+ toolchain_cache_dir.mkdir(parents=True, exist_ok=True)
146
+ archive_path = toolchain_cache_dir / archive_name
147
+
148
+ # Download if not cached
149
+ if not archive_path.exists():
150
+ self.downloader.download(self.toolchain_url, archive_path, show_progress=self.show_progress)
151
+ else:
152
+ if self.show_progress:
153
+ print("Using cached toolchain archive")
154
+
155
+ # Extract to toolchain directory
156
+ if self.show_progress:
157
+ print("Extracting toolchain...")
158
+
159
+ # Create temp extraction directory
160
+ temp_extract = toolchain_cache_dir / "temp_extract"
161
+ temp_extract.mkdir(parents=True, exist_ok=True)
162
+
163
+ self.downloader.extract_archive(archive_path, temp_extract, show_progress=self.show_progress)
164
+
165
+ # Find the toolchain directory in the extracted content
166
+ # Usually it's a subdirectory like "arm-gnu-toolchain-15.2.0-..."
167
+ extracted_dirs = list(temp_extract.glob("arm-gnu-toolchain-*"))
168
+ if not extracted_dirs:
169
+ # Maybe it extracted directly
170
+ extracted_dirs = [temp_extract]
171
+
172
+ source_dir = extracted_dirs[0]
173
+
174
+ # Move to final location (toolchain_path/bin)
175
+ final_bin_path = toolchain_cache_dir
176
+ if final_bin_path.exists() and final_bin_path != temp_extract:
177
+ # Remove old installation
178
+ import shutil
179
+
180
+ for item in final_bin_path.iterdir():
181
+ if item.name != "temp_extract" and not item.name.endswith((".zip", ".tar", ".xz", ".gz")):
182
+ if item.is_dir():
183
+ shutil.rmtree(item)
184
+ else:
185
+ item.unlink()
186
+
187
+ # Copy contents from source_dir to final_bin_path
188
+ import shutil
189
+
190
+ for item in source_dir.iterdir():
191
+ dest = final_bin_path / item.name
192
+ if item.is_dir():
193
+ if dest.exists():
194
+ shutil.rmtree(dest)
195
+ shutil.copytree(item, dest)
196
+ else:
197
+ if dest.exists():
198
+ dest.unlink()
199
+ shutil.copy2(item, dest)
200
+
201
+ # Clean up temp directory
202
+ if temp_extract.exists():
203
+ import shutil
204
+
205
+ shutil.rmtree(temp_extract, ignore_errors=True)
206
+
207
+ # Update toolchain_path to point to the actual installation location
208
+ self.toolchain_path = toolchain_cache_dir
209
+
210
+ if self.show_progress:
211
+ print("ARM GCC toolchain installed successfully")
212
+
213
+ return self.toolchain_path
214
+
215
+ except (DownloadError, ExtractionError) as e:
216
+ raise ToolchainErrorTeensy(f"Failed to install ARM GCC toolchain: {e}")
217
+ except KeyboardInterrupt as ke:
218
+ from fbuild.interrupt_utils import handle_keyboard_interrupt_properly
219
+
220
+ handle_keyboard_interrupt_properly(ke)
221
+ raise # Never reached, but satisfies type checker
222
+ except Exception as e:
223
+ raise ToolchainErrorTeensy(f"Unexpected error installing toolchain: {e}")
224
+
225
+ def is_installed(self) -> bool:
226
+ """Check if toolchain is already installed.
227
+
228
+ Returns:
229
+ True if toolchain directory exists with key binaries
230
+ """
231
+ if not self.toolchain_path.exists():
232
+ return False
233
+
234
+ # Verify essential toolchain binaries exist
235
+ gcc_path = self._find_binary("gcc")
236
+ return gcc_path is not None and gcc_path.exists()
237
+
238
+ def get_bin_dir(self) -> Optional[Path]:
239
+ """Get path to toolchain bin directory.
240
+
241
+ Returns:
242
+ Path to bin directory containing compiler binaries, or None if not found
243
+ """
244
+ # Check common bin directory locations
245
+ possible_paths = [
246
+ self.toolchain_path / "bin" / "bin", # Nested bin
247
+ self.toolchain_path / "bin", # Direct bin
248
+ ]
249
+
250
+ for path in possible_paths:
251
+ if path.exists() and path.is_dir():
252
+ # Verify it contains toolchain binaries
253
+ if list(path.glob(f"{self.BINARY_PREFIX}gcc*")):
254
+ return path
255
+
256
+ return None
257
+
258
+ def _find_binary(self, binary_name: str) -> Optional[Path]:
259
+ """Find a binary in the toolchain bin directory.
260
+
261
+ Args:
262
+ binary_name: Name of the binary (e.g., "gcc", "g++")
263
+
264
+ Returns:
265
+ Path to binary or None if not found
266
+ """
267
+ bin_dir = self.get_bin_dir()
268
+ if not bin_dir:
269
+ return None
270
+
271
+ # Try with and without .exe extension
272
+ binary_path = bin_dir / f"{self.BINARY_PREFIX}{binary_name}"
273
+ if binary_path.exists():
274
+ return binary_path
275
+
276
+ binary_path_exe = bin_dir / f"{self.BINARY_PREFIX}{binary_name}.exe"
277
+ if binary_path_exe.exists():
278
+ return binary_path_exe
279
+
280
+ return None
281
+
282
+ def get_gcc_path(self) -> Optional[Path]:
283
+ """Get path to GCC compiler.
284
+
285
+ Returns:
286
+ Path to gcc binary or None if not found
287
+ """
288
+ return self._find_binary("gcc")
289
+
290
+ def get_gxx_path(self) -> Optional[Path]:
291
+ """Get path to G++ compiler.
292
+
293
+ Returns:
294
+ Path to g++ binary or None if not found
295
+ """
296
+ return self._find_binary("g++")
297
+
298
+ def get_ar_path(self) -> Optional[Path]:
299
+ """Get path to archiver (ar).
300
+
301
+ Returns:
302
+ Path to ar binary or None if not found
303
+ """
304
+ return self._find_binary("ar")
305
+
306
+ def get_objcopy_path(self) -> Optional[Path]:
307
+ """Get path to objcopy utility.
308
+
309
+ Returns:
310
+ Path to objcopy binary or None if not found
311
+ """
312
+ return self._find_binary("objcopy")
313
+
314
+ def get_size_path(self) -> Optional[Path]:
315
+ """Get path to size utility.
316
+
317
+ Returns:
318
+ Path to size binary or None if not found
319
+ """
320
+ return self._find_binary("size")
321
+
322
+ def get_objdump_path(self) -> Optional[Path]:
323
+ """Get path to objdump utility.
324
+
325
+ Returns:
326
+ Path to objdump binary or None if not found
327
+ """
328
+ return self._find_binary("objdump")
329
+
330
+ def get_all_tool_paths(self) -> Dict[str, Optional[Path]]:
331
+ """Get paths to all common toolchain binaries.
332
+
333
+ Returns:
334
+ Dictionary mapping tool names to their paths
335
+ """
336
+ return {
337
+ "gcc": self.get_gcc_path(),
338
+ "g++": self.get_gxx_path(),
339
+ "ar": self.get_ar_path(),
340
+ "objcopy": self.get_objcopy_path(),
341
+ "size": self.get_size_path(),
342
+ "objdump": self.get_objdump_path(),
343
+ }
344
+
345
+ def get_all_tools(self) -> Dict[str, Path]:
346
+ """Get paths to all required tools (IToolchain interface).
347
+
348
+ Returns:
349
+ Dictionary mapping tool names to their paths (non-None only)
350
+
351
+ Raises:
352
+ ToolchainErrorTeensy: If any required tool is not found
353
+ """
354
+ all_tools = self.get_all_tool_paths()
355
+
356
+ # Filter out None values and verify all required tools exist
357
+ result = {}
358
+ for name, path in all_tools.items():
359
+ if path is None:
360
+ raise ToolchainErrorTeensy(f"Required tool '{name}' not found in toolchain")
361
+ result[name] = path
362
+
363
+ return result
364
+
365
+ def get_toolchain_info(self) -> Dict[str, Any]:
366
+ """Get information about the installed toolchain.
367
+
368
+ Returns:
369
+ Dictionary with toolchain information
370
+ """
371
+ info = {
372
+ "type": "arm-none-eabi",
373
+ "version": self.version,
374
+ "path": str(self.toolchain_path),
375
+ "url": self.toolchain_url,
376
+ "installed": self.is_installed(),
377
+ "binary_prefix": self.BINARY_PREFIX,
378
+ }
379
+
380
+ if self.is_installed():
381
+ info["bin_dir"] = str(self.get_bin_dir())
382
+ info["tools"] = {name: str(path) if path else None for name, path in self.get_all_tool_paths().items()}
383
+
384
+ return info
385
+
386
+ # Implement IPackage interface
387
+ def ensure_package(self) -> Path:
388
+ """Ensure package is downloaded and extracted.
389
+
390
+ Returns:
391
+ Path to the extracted package directory
392
+
393
+ Raises:
394
+ PackageError: If download or extraction fails
395
+ """
396
+ return self.ensure_toolchain()
397
+
398
+ def get_package_info(self) -> Dict[str, Any]:
399
+ """Get information about the package.
400
+
401
+ Returns:
402
+ Dictionary with package metadata (version, path, etc.)
403
+ """
404
+ return self.get_toolchain_info()
@@ -0,0 +1,150 @@
1
+ {
2
+ "name": "ESP32",
3
+ "description": "Configuration for ESP32 MCU extracted from PlatformIO",
4
+ "mcu": "esp32",
5
+ "architecture": "xtensa-esp32",
6
+
7
+ "compiler_flags": {
8
+ "common": [
9
+ "-Os",
10
+ "-mlongcalls",
11
+ "-ffunction-sections",
12
+ "-fdata-sections",
13
+ "-Wno-error=unused-function",
14
+ "-Wno-error=unused-variable",
15
+ "-Wno-error=unused-but-set-variable",
16
+ "-Wno-error=deprecated-declarations",
17
+ "-Wno-error=extra",
18
+ "-Wno-unused-parameter",
19
+ "-Wno-sign-compare",
20
+ "-Wno-enum-conversion",
21
+ "-gdwarf-4",
22
+ "-ggdb",
23
+ "-mdisable-hardware-atomics",
24
+ "-freorder-blocks",
25
+ "-Wwrite-strings",
26
+ "-fstack-protector",
27
+ "-fstrict-volatile-bitfields",
28
+ "-fno-jump-tables",
29
+ "-fno-tree-switch-conversion",
30
+ "-MMD"
31
+ ],
32
+ "c": [
33
+ "-Wno-frame-address",
34
+ "-fno-builtin-memcpy",
35
+ "-fno-builtin-memset",
36
+ "-fno-builtin-bzero",
37
+ "-fno-builtin-stpcpy",
38
+ "-fno-builtin-strncpy",
39
+ "-std=gnu17",
40
+ "-Wno-old-style-declaration",
41
+ "-Wno-strict-prototypes"
42
+ ],
43
+ "cxx": [
44
+ "-Wno-frame-address",
45
+ "-fno-builtin-memcpy",
46
+ "-fno-builtin-memset",
47
+ "-fno-builtin-bzero",
48
+ "-fno-builtin-stpcpy",
49
+ "-fno-builtin-strncpy",
50
+ "-std=gnu++2b",
51
+ "-fexceptions",
52
+ "-fno-rtti",
53
+ "-fuse-cxa-atexit"
54
+ ]
55
+ },
56
+
57
+ "linker_flags": [
58
+ "-mlongcalls",
59
+ "-Wno-frame-address",
60
+ "-nostartfiles",
61
+ "-Wl,--cref",
62
+ "-Wl,--defsym=IDF_TARGET_ESP32=0",
63
+ "-Wl,--no-warn-rwx-segments",
64
+ "-Wl,--orphan-handling=warn",
65
+ "-fno-rtti",
66
+ "-fno-lto",
67
+ "-Wl,--gc-sections",
68
+ "-Wl,--warn-common",
69
+ "-Wl,--wrap=log_printf",
70
+ "-Wl,--wrap=longjmp",
71
+ "-Wl,--undefined=FreeRTOS_openocd_params",
72
+ "-u", "nvs_sec_provider_include_impl",
73
+ "-u", "ld_include_hli_vectors_bt",
74
+ "-u", "_Z5setupv",
75
+ "-u", "_Z4loopv",
76
+ "-u", "esp_app_desc",
77
+ "-u", "esp_efuse_startup_include_func",
78
+ "-u", "ld_include_highint_hdl",
79
+ "-u", "start_app",
80
+ "-u", "start_app_other_cores",
81
+ "-u", "__ubsan_include",
82
+ "-u", "esp_system_include_startup_funcs",
83
+ "-u", "__assert_func",
84
+ "-u", "esp_dport_access_reg_read",
85
+ "-u", "esp_security_init_include_impl",
86
+ "-u", "app_main",
87
+ "-u", "esp_libc_include_heap_impl",
88
+ "-u", "esp_libc_include_reent_syscalls_impl",
89
+ "-u", "esp_libc_include_syscalls_impl",
90
+ "-u", "esp_libc_include_pthread_impl",
91
+ "-u", "esp_libc_include_assert_impl",
92
+ "-u", "esp_libc_include_getentropy_impl",
93
+ "-u", "esp_libc_include_init_funcs",
94
+ "-u", "esp_libc_init_funcs",
95
+ "-u", "pthread_include_pthread_impl",
96
+ "-u", "pthread_include_pthread_cond_var_impl",
97
+ "-u", "pthread_include_pthread_local_storage_impl",
98
+ "-u", "pthread_include_pthread_rwlock_impl",
99
+ "-u", "pthread_include_pthread_semaphore_impl",
100
+ "-u", "__cxa_guard_dummy",
101
+ "-u", "__cxx_init_dummy",
102
+ "-u", "esp_timer_init_include_func",
103
+ "-u", "uart_vfs_include_dev_init",
104
+ "-u", "include_esp_phy_override",
105
+ "-u", "esp_vfs_include_console_register",
106
+ "-u", "vfs_include_syscalls_impl",
107
+ "-u", "esp_vfs_include_nullfs_register",
108
+ "-u", "esp_system_include_coredump_init"
109
+ ],
110
+
111
+ "linker_scripts": [
112
+ "esp32.rom.redefined.ld",
113
+ "esp32.peripherals.ld",
114
+ "esp32.rom.ld",
115
+ "esp32.rom.api.ld",
116
+ "esp32.rom.libgcc.ld",
117
+ "esp32.rom.newlib-data.ld",
118
+ "esp32.rom.syscalls.ld",
119
+ "memory.ld",
120
+ "sections.ld"
121
+ ],
122
+
123
+ "defines": [
124
+ "ESP32_ARDUINO_LIB_BUILDER",
125
+ ["ESP_MDNS_VERSION_NUMBER", "\"1.9.0\""],
126
+ "ESP_PLATFORM",
127
+ ["IDF_VER", "\"v5.5.1-710-g8410210c9a\""],
128
+ ["MBEDTLS_CONFIG_FILE", "\"mbedtls/esp_config.h\""],
129
+ ["MD5_ENABLED", "1"],
130
+ ["OPENTHREAD_CONFIG_FILE", "\"openthread-core-esp32x-spinel-config.h\""],
131
+ ["OPENTHREAD_PROJECT_LIB_CONFIG_FILE", "\"openthread-core-esp32x-spinel-config.h\""],
132
+ ["SERIAL_FLASHER_BOOT_HOLD_TIME_MS", "50"],
133
+ ["SERIAL_FLASHER_RESET_HOLD_TIME_MS", "100"],
134
+ ["SOC_MMU_PAGE_SIZE", "CONFIG_MMU_PAGE_SIZE"],
135
+ ["SOC_XTAL_FREQ_MHZ", "CONFIG_XTAL_FREQ"],
136
+ "UNITY_INCLUDE_CONFIG_H",
137
+ "_GLIBCXX_HAVE_POSIX_SEMAPHORE",
138
+ "_GLIBCXX_USE_POSIX_SEMAPHORE",
139
+ "_GNU_SOURCE",
140
+ "_POSIX_READER_WRITER_LOCKS",
141
+ "TF_LITE_STATIC_MEMORY",
142
+ ["CHIP_CONFIG_SOFTWARE_VERSION_NUMBER", "0"],
143
+ ["CHIP_DNSSD_DEFAULT_PLATFORM", "true"],
144
+ ["CHIP_DNSSD_DEFAULT_NONE", "false"],
145
+ ["CHIP_DNSSD_DEFAULT_MINIMAL", "false"],
146
+ "ARDUINO_ARCH_ESP32",
147
+ "CHIP_HAVE_CONFIG_H",
148
+ ["ESP32", "ESP32"]
149
+ ]
150
+ }
@@ -0,0 +1,144 @@
1
+ {
2
+ "name": "ESP32-C2",
3
+ "description": "Configuration for ESP32-C2 MCU extracted from PlatformIO",
4
+ "mcu": "esp32c2",
5
+ "architecture": "riscv32",
6
+
7
+ "compiler_flags": {
8
+ "common": [
9
+ "-Os",
10
+ "-ffunction-sections",
11
+ "-fdata-sections",
12
+ "-Wno-error=unused-function",
13
+ "-Wno-error=unused-variable",
14
+ "-Wno-error=unused-but-set-variable",
15
+ "-Wno-error=deprecated-declarations",
16
+ "-Wno-error=extra",
17
+ "-Wno-unused-parameter",
18
+ "-Wno-sign-compare",
19
+ "-Wno-enum-conversion",
20
+ "-gdwarf-4",
21
+ "-ggdb",
22
+ "-nostartfiles",
23
+ "-freorder-blocks",
24
+ "-Wwrite-strings",
25
+ "-fstack-protector",
26
+ "-fstrict-volatile-bitfields",
27
+ "-fno-jump-tables",
28
+ "-fno-tree-switch-conversion",
29
+ "-MMD"
30
+ ],
31
+ "c": [
32
+ "-march=rv32imc_zicsr_zifencei",
33
+ "-std=gnu17",
34
+ "-Wno-old-style-declaration",
35
+ "-Wno-strict-prototypes"
36
+ ],
37
+ "cxx": [
38
+ "-march=rv32imc_zicsr_zifencei",
39
+ "-std=gnu++2b",
40
+ "-fexceptions",
41
+ "-fno-rtti",
42
+ "-fuse-cxa-atexit"
43
+ ]
44
+ },
45
+
46
+ "linker_flags": [
47
+ "-nostartfiles",
48
+ "-march=rv32imc_zicsr_zifencei",
49
+ "-Wl,--cref",
50
+ "-Wl,--defsym=IDF_TARGET_ESP32C2=0",
51
+ "-Wl,--no-warn-rwx-segments",
52
+ "-Wl,--orphan-handling=warn",
53
+ "-fno-rtti",
54
+ "-fno-lto",
55
+ "-Wl,--gc-sections",
56
+ "-Wl,--warn-common",
57
+ "-Wl,--defsym=__wrap_log_printf=esp_log_printf",
58
+ "-Wl,--undefined=FreeRTOS_openocd_params",
59
+ "--specs=nano.specs",
60
+ "-u", "nvs_sec_provider_include_impl",
61
+ "-u", "_Z5setupv",
62
+ "-u", "_Z4loopv",
63
+ "-u", "esp_app_desc",
64
+ "-u", "esp_efuse_startup_include_func",
65
+ "-u", "start_app",
66
+ "-u", "__ubsan_include",
67
+ "-u", "esp_system_include_startup_funcs",
68
+ "-u", "tlsf_set_rom_patches",
69
+ "-u", "esp_rom_include_multi_heap_patch",
70
+ "-u", "__assert_func",
71
+ "-u", "esp_security_init_include_impl",
72
+ "-u", "esp_sleep_gpio_include",
73
+ "-u", "app_main",
74
+ "-u", "esp_libc_include_heap_impl",
75
+ "-u", "esp_libc_include_reent_syscalls_impl",
76
+ "-u", "esp_libc_include_syscalls_impl",
77
+ "-u", "esp_libc_include_pthread_impl",
78
+ "-u", "esp_libc_include_assert_impl",
79
+ "-u", "esp_libc_include_getentropy_impl",
80
+ "-u", "esp_libc_include_init_funcs",
81
+ "-u", "esp_libc_init_funcs",
82
+ "-u", "pthread_include_pthread_impl",
83
+ "-u", "pthread_include_pthread_cond_var_impl",
84
+ "-u", "pthread_include_pthread_local_storage_impl",
85
+ "-u", "pthread_include_pthread_rwlock_impl",
86
+ "-u", "pthread_include_pthread_semaphore_impl",
87
+ "-u", "__cxa_guard_dummy",
88
+ "-u", "__cxx_init_dummy",
89
+ "-u", "esp_timer_init_include_func",
90
+ "-u", "uart_vfs_include_dev_init",
91
+ "-u", "include_esp_phy_override",
92
+ "-u", "esp_vfs_include_console_register",
93
+ "-u", "vfs_include_syscalls_impl",
94
+ "-u", "esp_vfs_include_nullfs_register",
95
+ "-u", "esp_system_include_coredump_init"
96
+ ],
97
+
98
+ "linker_scripts": [
99
+ "rom.api.ld",
100
+ "esp32c2.peripherals.ld",
101
+ "esp32c2.rom.ld",
102
+ "esp32c2.rom.api.ld",
103
+ "esp32c2.rom.rvfp.ld",
104
+ "esp32c2.rom.wdt.ld",
105
+ "esp32c2.rom.systimer.ld",
106
+ "esp32c2.rom.version.ld",
107
+ "esp32c2.rom.ble.ld",
108
+ "esp32c2.rom.libc.ld",
109
+ "esp32c2.rom.libc-suboptimal_for_misaligned_mem.ld",
110
+ "esp32c2.rom.newlib.ld",
111
+ "esp32c2.rom.newlib-nano.ld",
112
+ "esp32c2.rom.heap.ld",
113
+ "memory.ld",
114
+ "sections.ld"
115
+ ],
116
+
117
+ "defines": [
118
+ "ESP32_ARDUINO_LIB_BUILDER",
119
+ ["ESP_MDNS_VERSION_NUMBER", "\"1.9.0\""],
120
+ "ESP_PLATFORM",
121
+ ["IDF_VER", "\"v5.5.1-710-g8410210c9a\""],
122
+ ["MBEDTLS_CONFIG_FILE", "\"mbedtls/esp_config.h\""],
123
+ ["MD5_ENABLED", "1"],
124
+ ["OPENTHREAD_CONFIG_FILE", "\"openthread-core-esp32x-spinel-config.h\""],
125
+ ["OPENTHREAD_PROJECT_LIB_CONFIG_FILE", "\"openthread-core-esp32x-spinel-config.h\""],
126
+ ["SERIAL_FLASHER_BOOT_HOLD_TIME_MS", "50"],
127
+ ["SERIAL_FLASHER_RESET_HOLD_TIME_MS", "100"],
128
+ ["SOC_MMU_PAGE_SIZE", "CONFIG_MMU_PAGE_SIZE"],
129
+ ["SOC_XTAL_FREQ_MHZ", "CONFIG_XTAL_FREQ"],
130
+ "UNITY_INCLUDE_CONFIG_H",
131
+ "_GLIBCXX_HAVE_POSIX_SEMAPHORE",
132
+ "_GLIBCXX_USE_POSIX_SEMAPHORE",
133
+ "_GNU_SOURCE",
134
+ "_POSIX_READER_WRITER_LOCKS",
135
+ "TF_LITE_STATIC_MEMORY",
136
+ ["CHIP_CONFIG_SOFTWARE_VERSION_NUMBER", "0"],
137
+ ["CHIP_DNSSD_DEFAULT_PLATFORM", "true"],
138
+ ["CHIP_DNSSD_DEFAULT_NONE", "false"],
139
+ ["CHIP_DNSSD_DEFAULT_MINIMAL", "false"],
140
+ "ARDUINO_ARCH_ESP32",
141
+ "CHIP_HAVE_CONFIG_H",
142
+ ["ESP32", "ESP32"]
143
+ ]
144
+ }