Skip to content

Commit f802020

Browse files
committed
Merge pull request #1438 from UncleGrumpy/esp32p4
Introduce support for ESP32P4 Adds device info for `erlang:system_info(esp32_chip_info)` for the ESP32P4, as well as building release images. This does not include any network support yet. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents ceb2f71 + e181d9f commit f802020

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.github/workflows/esp32-mkimage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
otp: ["27"]
4545
elixir_version: ["1.17"]
4646
compiler_pkgs: ["clang-14"]
47-
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2"]
47+
soc: ["esp32", "esp32c2", "esp32c3", "esp32s2", "esp32s3", "esp32c6", "esp32h2", "esp32p4"]
4848
flavor: ["", "-elixir"]
4949

5050
env:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010

1111
- Added the ability to run beams from the CLI for Generic Unix platform (it was already possible with nodejs and emscripten).
12+
- Added preliminary support for ESP32P4 (no networking support yet).
1213

1314
### Fixed
1415

libs/estdlib/src/erlang.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ process_info(_Pid, _Key) ->
264264
%% <li><b>esp32_free_heap_size</b> the number of (noncontiguous) free bytes in the ESP32 heap (integer)</li>
265265
%% <li><b>esp32_largest_free_block</b> the number of the largest contiguous free bytes in the ESP32 heap (integer)</li>
266266
%% <li><b>esp32_minimum_free_size</b> the smallest number of free bytes in the ESP32 heap since boot (integer)</li>
267+
%% <li><b>esp32_chip_info</b> Details about the model and capabilities of the ESP32 device (map)</li>
267268
%% </ul>
268269
%%
269270
%% Additional keys may be supported on some platforms that are not documented here.

src/platforms/esp32/components/avm_sys/sys.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ static const char *const esp32_c2_atom = "\x8" "esp32_c2";
8989
static const char *const esp32_c3_atom = "\x8" "esp32_c3";
9090
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
9191
static const char *const esp32_c6_atom = "\x8" "esp32_c6";
92-
#endif
9392
static const char *const esp32_h2_atom = "\x8" "esp32_h2";
9493
#endif
94+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
95+
static const char *const esp32_p4_atom = "\x8" "esp32_p4";
96+
#endif
97+
#endif
9598
static const char *const emb_flash_atom = "\x9" "emb_flash";
9699
static const char *const bgn_atom = "\x3" "bgn";
97100
static const char *const ble_atom = "\x3" "ble";
@@ -489,9 +492,13 @@ static term get_model(Context *ctx, esp_chip_model_t model)
489492
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
490493
case CHIP_ESP32C6:
491494
return globalcontext_make_atom(ctx->global, esp32_c6_atom);
492-
#endif
493495
case CHIP_ESP32H2:
494496
return globalcontext_make_atom(ctx->global, esp32_h2_atom);
497+
#endif
498+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
499+
case CHIP_ESP32P4:
500+
return globalcontext_make_atom(ctx->global, esp32_p4_atom);
501+
#endif
495502
default:
496503
return UNDEFINED_ATOM;
497504
}

0 commit comments

Comments
 (0)