From 71b194810ea85b7055a327d8577aa2eaea768b69 Mon Sep 17 00:00:00 2001 From: Alexey Gerenkov Date: Thu, 15 Aug 2024 17:33:50 +0300 Subject: [PATCH] contrib/loaders: Install Espressif flasher stub binaries --- .gitlab/ci/build.yml | 14 -------------- CMakeLists.txt | 8 +++++++- Makefile.am | 12 ++++++++++++ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index de87d12b45..6b8c878ca8 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -21,16 +21,6 @@ mv ${ARCHIVE_NAME} ${DIST_ART_DIR} echo "${ARCHIVE_NAME}" > ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME} -.copy_stub_bins: ©_stub_bins | - STUB_BIN_PATH=$DIST_INSTALLED_DIR/share/openocd/esp_stub_bins - mkdir -p $STUB_BIN_PATH/{esp32c6,esp32h2} - - for chip in esp32c6 esp32h2; do - cp contrib/loaders/flash/espressif/$chip/inc/stub_flash_idf_binary_code.inc $STUB_BIN_PATH/$chip/ - cp contrib/loaders/flash/espressif/$chip/inc/stub_flash_idf_binary_data.inc $STUB_BIN_PATH/$chip/ - cp contrib/loaders/flash/espressif/$chip/stub_flash_idf_image.h $STUB_BIN_PATH/$chip/ - done - .buildx_libusb: &buildx_libusb | export LIBUSB_VER=libusb-1.0.26 wget https://dl.espressif.com/dl/$LIBUSB_VER.tar.gz -O $LIBUSB_VER.tar.gz @@ -128,7 +118,6 @@ echo coverage enabled rsync -a --prune-empty-dirs --include '*/' --include '*.gcno' --exclude '*' _build/ ${DIST_INSTALLED_DIR}/_build fi - - *copy_stub_bins - *dist_archive .build_macos_template: &build_macos_template @@ -153,7 +142,6 @@ - export OSXCROSS_PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$OSXCROSS_PKG_CONFIG_PATH - export LDFLAGS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit -Wl,-framework,Security" - *buildx_openocd - - *copy_stub_bins - *dist_archive build_linux: @@ -188,7 +176,6 @@ build_linux: - src/openocd --version 2>&1 | { ! grep 'dirty'; } - MAKEFLAGS= make install-strip - popd - - *copy_stub_bins - *dist_archive # Just to test build with latest gcc. @@ -274,7 +261,6 @@ build_linux_arm64: - export LDFLAGS=$ZLIB_LDFLAGS - *buildx_openocd - cp $PWD/${ZLIB_VER}/dist/bin/zlib1.dll $DIST_INSTALLED_DIR/bin/ - - *copy_stub_bins - *dist_archive build_windows_win32: diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b9c48f45a..f987195534 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,13 @@ install(TARGETS openocd DESTINATION ${bindir}) install(DIRECTORY tcl/ DESTINATION ${pkgdatadir}/scripts) install(FILES contrib/60-openocd.rules DESTINATION ${pkgdatadir}/contrib) install(DIRECTORY contrib/libdcc DESTINATION ${pkgdatadir}/contrib) -install(FILES tools/esp_detect_config.py DESTINATION ${pkgdatadir}/tools) +install(FILES tools/esp_detect_config.py DESTINATION ${pkgdatadir}/espressif/tools) +install(FILES contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_code.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6) +install(FILES contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_data.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6) +install(FILES contrib/loaders/flash/espressif/esp32c6/stub_flash_idf_image.h DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6) +install(FILES contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_code.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2) +install(FILES contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_data.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2) +install(FILES contrib/loaders/flash/espressif/esp32h2/stub_flash_idf_image.h DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2) get_property(ulink_firmware TARGET ocdjtagdrivers PROPERTY ULINK_FIRMWARE) if(BUILD_JLINK) install(FILES ${ulink_firmware} DESTINATION ${pkgdatadir}/OpenULINK) diff --git a/Makefile.am b/Makefile.am index fa9729021c..82ad8be3e1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,6 +23,18 @@ esptoolsdir = $(pkgdatadir)/espressif/tools dist_esptools_DATA = \ tools/esp_detect_config.py +esp32c6stubsdir = $(pkgdatadir)/espressif/stub_bins/esp32c6 +dist_esp32c6stubs_DATA = \ + contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_code.inc \ + contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_data.inc \ + contrib/loaders/flash/espressif/esp32c6/stub_flash_idf_image.h + +esp32h2stubsdir = $(pkgdatadir)/espressif/stub_bins/esp32h2 +dist_esp32h2stubs_DATA = \ + contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_code.inc \ + contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_data.inc \ + contrib/loaders/flash/espressif/esp32h2/stub_flash_idf_image.h + SUBDIRS = DIST_SUBDIRS = bin_PROGRAMS =