Skip to content

Commit f7ff9bb

Browse files
committed
Fix deep_sleep hold
CI: Only release-v5.4 and 5.5.2 for ESP32P4. Changelog fixes and additions. Other minor fixes related to CI. Signed-off-by: Peter M <petermm@gmail.com>
1 parent 8e72d74 commit f7ff9bb

File tree

7 files changed

+64
-14
lines changed

7 files changed

+64
-14
lines changed

.github/workflows/esp32-build.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ jobs:
4545
fail-fast: false
4646

4747
matrix:
48-
esp-idf-target: ["esp32", "esp32c3", "esp32p4"]
49-
language: ['cpp']
48+
esp-idf-target: ["esp32", "esp32c3"]
5049
idf-version:
5150
- 'v5.1.6'
5251
- 'v5.2.6'
@@ -57,10 +56,11 @@ jobs:
5756
exclude:
5857
- esp-idf-target: "esp32c3"
5958
idf-version: 'v5.1.6'
59+
include:
6060
- esp-idf-target: "esp32p4"
61-
idf-version: 'v5.1.6'
61+
idf-version: 'release-v5.4'
6262
- esp-idf-target: "esp32p4"
63-
idf-version: 'v5.2.6'
63+
idf-version: 'v5.5.2'
6464

6565
steps:
6666
- name: Checkout repo
@@ -70,9 +70,9 @@ jobs:
7070
run: git config --global --add safe.directory /__w/AtomVM/AtomVM
7171

7272
- name: "Initialize CodeQL"
73-
uses: github/codeql-action/init@v3
73+
uses: github/codeql-action/init@v4
7474
with:
75-
languages: ${{matrix.language}}
75+
languages: ["cpp"]
7676
build-mode: manual
7777
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql
7878

@@ -94,7 +94,7 @@ jobs:
9494
idf.py size-components
9595
9696
- name: "Perform CodeQL Analysis"
97-
uses: github/codeql-action/analyze@v3
97+
uses: github/codeql-action/analyze@v4
9898

9999
- name: Install dependencies to build host AtomVM and run qemu
100100
run: |

.github/workflows/esp32-simtest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ jobs:
9696
idf-version: "v5.2.6"
9797
- esp-idf-target: "esp32c5"
9898
idf-version: "v5.3.4"
99-
# CI now uses chip revision 3 that is currently only available in release-v5.5 branch
99+
# CI now uses chip revision 3 that is currently only available in 5.5.2
100100
include:
101101
- esp-idf-target: "esp32p4"
102-
idf-version: "release-v5.5"
102+
idf-version: "v5.5.2"
103103

104104
steps:
105105
- name: Checkout repo

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7373
### Changed
7474

7575
- Removed `externalterm_to_term_copy` added in [0.6.5] and introduced flags to `externalterm_to_term` to perform copy.
76-
- Release images for ESP32 chips are built with ESP-IDF v5.4
76+
- Release images for ESP32 chips are built with ESP-IDF v5.5
77+
- Only support ESP32P4 on ESP-IDF v5.5.2, v5.4.4 and later, release images are for the mass market rev3 version.
7778
- ESP32: SPI peripheral defaults to `"spi2"` instead of deprecated `hspi`
7879
- Added `zlib:compress/1`
7980
- Entry point now is `init:boot/1` if it exists. It starts the kernel application and calls `start/0` from the

src/platforms/esp32/components/avm_builtins/gpio_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ static term nif_gpio_hold_dis(Context *ctx, int argc, term argv[])
723723
return hold_dis(argv[0]);
724724
}
725725

726-
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
726+
#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
727727
static term nif_gpio_deep_sleep_hold_en(Context *ctx, int argc, term argv[])
728728
{
729729
UNUSED(ctx);
@@ -785,7 +785,7 @@ static const struct Nif gpio_hold_dis_nif =
785785
.nif_ptr = nif_gpio_hold_dis
786786
};
787787

788-
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
788+
#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
789789
static const struct Nif gpio_deep_sleep_hold_en_nif = {
790790
.base.type = NIFFunctionType,
791791
.nif_ptr = nif_gpio_deep_sleep_hold_en
@@ -844,7 +844,7 @@ const struct Nif *gpio_nif_get_nif(const char *nifname)
844844
return &gpio_hold_dis_nif;
845845
}
846846

847-
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
847+
#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
848848
if (strcmp("gpio:deep_sleep_hold_en/0", nifname) == 0 || strcmp("Elixir.GPIO:deep_sleep_hold_en/0", nifname) == 0) {
849849
TRACE("Resolved platform nif %s ...\n", nifname);
850850
return &gpio_deep_sleep_hold_en_nif;

src/platforms/esp32/test/main/test_erl_sources/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ compile_erlang(test_ssl)
7676
compile_erlang(test_time_and_processes)
7777
compile_erlang(test_twdt)
7878
compile_erlang(test_tz)
79+
compile_erlang(test_deep_sleep_hold)
7980

8081
set(erlang_test_beams
8182
test_esp_partition.beam
@@ -96,6 +97,7 @@ set(erlang_test_beams
9697
test_time_and_processes.beam
9798
test_twdt.beam
9899
test_tz.beam
100+
test_deep_sleep_hold.beam
99101
)
100102

101103
if(NOT AVM_DISABLE_JIT)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2026 Peter M <petermm@gmail.com>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
20+
21+
-module(test_deep_sleep_hold).
22+
-export([start/0]).
23+
24+
start() ->
25+
Sysinfo = erlang:system_info(esp32_chip_info),
26+
Model =
27+
if
28+
is_map(Sysinfo) -> maps:get(model, Sysinfo);
29+
true -> undefined
30+
end,
31+
case Model of
32+
% esp32_p4 has no support on earlier revisions, and thus left out here.
33+
M when M =:= esp32; M =:= esp32_s2; M =:= esp32_c3; M =:= esp32_s3; M =:= esp32_c2 ->
34+
io:format("Testing: deep_sleep_hold_en/dis\n"),
35+
ok = gpio:deep_sleep_hold_en(),
36+
ok = gpio:deep_sleep_hold_dis();
37+
_ ->
38+
io:format("Not testing: deep_sleep_hold_en/dis\n"),
39+
ok
40+
end,
41+
ok.

src/platforms/esp32/test/main/test_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,12 @@ TEST_CASE("test_tz", "[test_run]")
515515
TEST_ASSERT(ret_value == OK_ATOM);
516516
}
517517

518+
TEST_CASE("test_deep_sleep_hold", "[test_run]")
519+
{
520+
term ret_value = avm_test_case("test_deep_sleep_hold.beam");
521+
TEST_ASSERT(ret_value == OK_ATOM);
522+
}
523+
518524
#ifndef AVM_NO_SMP
519525
TEST_CASE("atomvm_smp_0", "[smp]")
520526
{
@@ -613,7 +619,7 @@ TEST_CASE("test_wifi_example", "[test_run]")
613619
#endif
614620

615621
// Works C3 on local runs, but fails GH actions
616-
#if (ESP_IDF_VERSION_MAJOR >= 5 && !CONFIG_IDF_TARGET_ESP32C3) || (ESP_IDF_VERSION_MAJOR >= 5 && !CONFIG_ETH_USE_OPENETH)
622+
#if (ESP_IDF_VERSION_MAJOR >= 5 && !CONFIG_IDF_TARGET_ESP32C3 && !CONFIG_IDF_TARGET_ESP32P4) || (ESP_IDF_VERSION_MAJOR >= 5 && !CONFIG_IDF_TARGET_ESP32P4 && !CONFIG_ETH_USE_OPENETH)
617623
TEST_CASE("test_twdt", "[test_run]")
618624
{
619625
term ret_value = avm_test_case("test_twdt.beam");

0 commit comments

Comments
 (0)