Skip to content

Commit

Permalink
Merge branch 'feat/update_idf_build_apps' into 'master'
Browse files Browse the repository at this point in the history
feat: Update idf_build_apps

Closes AEG-1219

See merge request ae_group/esp-iot-solution!976
  • Loading branch information
leeebo committed Apr 10, 2024
2 parents 78ab2bc + 8dab090 commit 5def8ba
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
31 changes: 17 additions & 14 deletions .gitlab/ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
EXAMPLE_CONFIG: "="
script:
- pip install "idf-component-manager<1.5"
- pip install "idf_build_apps<2.0"
- pip install idf_build_apps
- python tools/build_apps.py ${EXAMPLE_DIR} --config ${EXAMPLE_CONFIG} -t all -vv

build_example_audio_wav_player:
Expand All @@ -58,6 +58,7 @@ build_example_bluetooth_ble_conn_mgr_ble_periodic_adv:
matrix:
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_conn_mgr/ble_periodic_adv

Expand All @@ -69,6 +70,7 @@ build_example_bluetooth_ble_conn_mgr_ble_periodic_sync:
matrix:
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_conn_mgr/ble_periodic_sync

Expand All @@ -78,10 +80,10 @@ build_example_bluetooth_ble_conn_mgr_ble_spp_client:
- .rules:build:example_bluetooth_ble_conn_mgr
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_conn_mgr/ble_spp/spp_client

Expand All @@ -91,10 +93,10 @@ build_example_bluetooth_ble_conn_mgr_ble_spp_server:
- .rules:build:example_bluetooth_ble_conn_mgr
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_conn_mgr/ble_spp/spp_server

Expand All @@ -104,10 +106,10 @@ build_example_bluetooth_ble_anp:
- .rules:build:example_bluetooth_ble_anp
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_profiles/ble_anp

Expand All @@ -117,10 +119,10 @@ build_example_bluetooth_ble_hrp:
- .rules:build:example_bluetooth_ble_hrp
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_profiles/ble_hrp

Expand All @@ -130,10 +132,10 @@ build_example_bluetooth_ble_htp:
- .rules:build:example_bluetooth_ble_htp
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_profiles/ble_htp

Expand All @@ -143,10 +145,10 @@ build_example_bluetooth_ble_services_ble_ans:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_ans

Expand All @@ -156,10 +158,10 @@ build_example_bluetooth_ble_services_ble_bas:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_bas

Expand All @@ -169,10 +171,10 @@ build_example_bluetooth_ble_services_ble_dis:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_dis

Expand All @@ -182,10 +184,10 @@ build_example_bluetooth_ble_services_ble_hrs:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_hrs

Expand All @@ -195,10 +197,10 @@ build_example_bluetooth_ble_services_ble_hts:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_hts

Expand All @@ -208,10 +210,10 @@ build_example_bluetooth_ble_services_ble_tps:
- .rules:build:example_bluetooth_ble_services
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.3
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_services/ble_tps

Expand All @@ -224,6 +226,7 @@ build_example_bluetooth_ble_ota:
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.1
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_ota

Expand All @@ -234,6 +237,7 @@ build_example_bluetooth_ble_remote_control:
parallel:
matrix:
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:release-v5.2
variables:
EXAMPLE_DIR: examples/bluetooth/ble_remote_control

Expand Down Expand Up @@ -410,8 +414,7 @@ build_example_get_started_button_power_save:
parallel:
matrix:
- IMAGE: espressif/idf:release-v4.4
- IMAGE: espressif/idf:release-v5.0
- IMAGE: espressif/idf:latest
- IMAGE: espressif/idf:release-v5.1
variables:
EXAMPLE_DIR: examples/get-started/button_power_save

Expand Down
8 changes: 7 additions & 1 deletion components/bluetooth/ble_profiles/esp/ble_ota/src/ble_ota.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <string.h>
#include "freertos/FreeRTOS.h"
#include "esp_idf_version.h"

#include "esp_log.h"
#include "ble_ota.h"
Expand Down Expand Up @@ -1076,7 +1077,12 @@ esp_err_t esp_ble_ota_recv_fw_data_callback(esp_ble_ota_recv_fw_cb_t callback)
esp_err_t esp_ble_ota_host_init(void)
{
esp_err_t ret;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT();
ret = esp_bluedroid_init_with_cfg(&cfg);
#else
ret = esp_bluedroid_init();
#endif
if (ret) {
ESP_LOGE(TAG, "%s init bluetooth failed: %s\n", __func__, esp_err_to_name(ret));
return ret;
Expand Down
8 changes: 7 additions & 1 deletion examples/bluetooth/ble_remote_control/main/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -17,6 +17,7 @@
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/event_groups.h"
#include "esp_idf_version.h"

// Example includes
#include "controller.h"
Expand Down Expand Up @@ -167,7 +168,12 @@ esp_err_t ble_config(void)
return ESP_FAIL;
}

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
esp_bluedroid_config_t cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT();
ret = esp_bluedroid_init_with_cfg(&cfg);
#else
ret = esp_bluedroid_init();
#endif
if (ret) {
ESP_LOGE(HID_DEMO_TAG, "%s init bluedroid failed\n", __func__);
return ESP_FAIL;
Expand Down
15 changes: 9 additions & 6 deletions tools/build_apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -10,10 +10,13 @@
import sys
import os
import re
import logging
from pathlib import Path
from typing import List

from idf_build_apps import LOGGER, App, build_apps, find_apps, setup_logging
from idf_build_apps import App, build_apps, find_apps, setup_logging

logger = logging.getLogger('idf_build_apps')

PROJECT_ROOT = Path(__file__).parent.parent.absolute()
APPS_BUILD_PER_JOB = 30
Expand Down Expand Up @@ -59,8 +62,8 @@ def get_cmake_apps(
target=target,
build_dir=f'{idf_ver}/build_@t_@w',
config_rules_str=config_rules_str,
build_log_path='build_log.txt',
size_json_path='size.json',
build_log_filename='build_log.txt',
size_json_filename='size.json',
check_warnings=True,
preserve=True,
default_build_targets=default_build_targets,
Expand All @@ -81,8 +84,8 @@ def main(args): # type: (argparse.Namespace) -> None
else:
apps_to_build = apps[:]

LOGGER.info('Found %d apps after filtering', len(apps_to_build))
LOGGER.info(
logger.info('Found %d apps after filtering', len(apps_to_build))
logger.info(
'Suggest setting the parallel count to %d for this build job',
len(apps_to_build) // APPS_BUILD_PER_JOB + 1,
)
Expand Down

0 comments on commit 5def8ba

Please sign in to comment.