From 82fa02bcac5e278586cb2e3c9cc597699f6f640d Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 5 Apr 2025 11:10:12 +0200 Subject: fw: btl: Configure bootloader build with Meson CMake ExternalProject creates a pretty confusing build tree. Since the rest of the project anyway starts moving to Meson the bootloader is configured via Meson as a first step. --- fw/btl/configure.sh | 14 ++++++++++++++ fw/btl/meson.build | 16 ++++++++++++++++ fw/meson.build | 7 +++++++ fw/rtos/meson.build | 3 +++ fw/rtos/modules/meson.build | 8 ++++++++ 5 files changed, 48 insertions(+) create mode 100755 fw/btl/configure.sh create mode 100644 fw/btl/meson.build create mode 100644 fw/meson.build create mode 100644 fw/rtos/meson.build create mode 100644 fw/rtos/modules/meson.build (limited to 'fw') diff --git a/fw/btl/configure.sh b/fw/btl/configure.sh new file mode 100755 index 0000000..87df3d2 --- /dev/null +++ b/fw/btl/configure.sh @@ -0,0 +1,14 @@ +#!/bin/sh + + +set -eufx + + +cmake \ + "-S$1" \ + "-B$2" \ + "-DBOARD=$3" \ + "-DZEPHYR_BASE=$4" \ + "-DZEPHYR_MODULES=${5}" \ + "-DEXTRA_CONF_FILE=${6}" \ + "-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"${7}\"" diff --git a/fw/btl/meson.build b/fw/btl/meson.build new file mode 100644 index 0000000..fd6562e --- /dev/null +++ b/fw/btl/meson.build @@ -0,0 +1,16 @@ +bootloader_config = meson.current_source_dir() / 'bootloader.conf' + +external_project = import('unstable-external_project') +bootloader_bin = meson.current_build_dir() / 'zephyr' / 'zephyr.bin' +bootloader_project = external_project.add_project('configure.sh', + configure_options: [ + bootloader_firmware, + meson.current_build_dir(), + board, + zephyr, + ';'.join(zephyr_modules), + bootloader_config, + signing_key, + ], + verbose: true, +) diff --git a/fw/meson.build b/fw/meson.build new file mode 100644 index 0000000..7f9bead --- /dev/null +++ b/fw/meson.build @@ -0,0 +1,7 @@ +board = 'nucleo_f767zi' + +fs = import('fs') +signing_key = fs.expanduser('~') / 'mcuboot' / 'key.pem' + +subdir('rtos') +subdir('btl') diff --git a/fw/rtos/meson.build b/fw/rtos/meson.build new file mode 100644 index 0000000..800153d --- /dev/null +++ b/fw/rtos/meson.build @@ -0,0 +1,3 @@ +subdir('modules') + +zephyr = meson.current_source_dir() / 'zephyr' diff --git a/fw/rtos/modules/meson.build b/fw/rtos/modules/meson.build new file mode 100644 index 0000000..52f50c2 --- /dev/null +++ b/fw/rtos/modules/meson.build @@ -0,0 +1,8 @@ +zephyr_modules = [ + meson.current_source_dir() / 'cmsis', + meson.current_source_dir() / 'hal_stm32', + meson.current_source_dir() / 'mbedtls', + meson.current_source_dir() / 'mcuboot', +] + +bootloader_firmware = meson.current_source_dir() / 'mcuboot' / 'boot' / 'zephyr' -- cgit v1.2.3-70-g09d2 From 28576b0bdb6b6e08b186c2919bbed4393b38bb7f Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 13:28:53 +0200 Subject: fw: btl: Fix build with Meson --- fw/btl/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fw') diff --git a/fw/btl/meson.build b/fw/btl/meson.build index fd6562e..08399a9 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -5,7 +5,7 @@ bootloader_bin = meson.current_build_dir() / 'zephyr' / 'zephyr.bin' bootloader_project = external_project.add_project('configure.sh', configure_options: [ bootloader_firmware, - meson.current_build_dir(), + meson.current_build_dir() / 'build', board, zephyr, ';'.join(zephyr_modules), -- cgit v1.2.3-70-g09d2 From 9f75ad79c0df9035bcdfd11011ba475cc80ad50a Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 13:38:24 +0200 Subject: fw: btl: Configure with Python script To use a more readable scripting language and keep portability the POSIX shell script for Zephyr configuration is replaced by Python. --- fw/btl/configure.py | 30 ++++++++++++++++++++++++++++++ fw/btl/configure.sh | 14 -------------- fw/btl/meson.build | 2 +- 3 files changed, 31 insertions(+), 15 deletions(-) create mode 100755 fw/btl/configure.py delete mode 100755 fw/btl/configure.sh (limited to 'fw') diff --git a/fw/btl/configure.py b/fw/btl/configure.py new file mode 100755 index 0000000..a1f6e38 --- /dev/null +++ b/fw/btl/configure.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + + +import subprocess +import sys + + +source_tree = sys.argv[1] +build_tree = sys.argv[2] +board = sys.argv[3] +zephyr_base = sys.argv[4] +zephyr_modules = sys.argv[5] +extra_conf_file = sys.argv[6] +signing_key_file = sys.argv[7] + + +subprocess.run( + [ + "cmake", + f"-S{source_tree}", + f"-B{build_tree}", + f"-DBOARD={board}", + f"-DZEPHYR_BASE={zephyr_base}", + f"-DZEPHYR_MODULES={zephyr_modules}", + f"-DEXTRA_CONF_FILE={extra_conf_file}", + f"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"{signing_key_file}\"" + ], + shell=False, + check=True, +) diff --git a/fw/btl/configure.sh b/fw/btl/configure.sh deleted file mode 100755 index 87df3d2..0000000 --- a/fw/btl/configure.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - - -set -eufx - - -cmake \ - "-S$1" \ - "-B$2" \ - "-DBOARD=$3" \ - "-DZEPHYR_BASE=$4" \ - "-DZEPHYR_MODULES=${5}" \ - "-DEXTRA_CONF_FILE=${6}" \ - "-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"${7}\"" diff --git a/fw/btl/meson.build b/fw/btl/meson.build index 08399a9..0b48c11 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -2,7 +2,7 @@ bootloader_config = meson.current_source_dir() / 'bootloader.conf' external_project = import('unstable-external_project') bootloader_bin = meson.current_build_dir() / 'zephyr' / 'zephyr.bin' -bootloader_project = external_project.add_project('configure.sh', +bootloader_project = external_project.add_project('configure.py', configure_options: [ bootloader_firmware, meson.current_build_dir() / 'build', -- cgit v1.2.3-70-g09d2 From e28796985d5f605fbdb1f5043618b1f570e747af Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 13:41:42 +0200 Subject: fw: btl: Clean up meson.build --- fw/btl/meson.build | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'fw') diff --git a/fw/btl/meson.build b/fw/btl/meson.build index 0b48c11..b783191 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -1,7 +1,5 @@ -bootloader_config = meson.current_source_dir() / 'bootloader.conf' - external_project = import('unstable-external_project') -bootloader_bin = meson.current_build_dir() / 'zephyr' / 'zephyr.bin' + bootloader_project = external_project.add_project('configure.py', configure_options: [ bootloader_firmware, @@ -9,7 +7,7 @@ bootloader_project = external_project.add_project('configure.py', board, zephyr, ';'.join(zephyr_modules), - bootloader_config, + meson.current_source_dir() / 'bootloader.conf', signing_key, ], verbose: true, -- cgit v1.2.3-70-g09d2 From 5376b67a9df63d2b30cac415cb827e6b4c1674e9 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 14:24:06 +0200 Subject: Build bootloader and add to website Meson makes this relatively easy. The current approach is nevertheless a bit hacky. For the first attempt it is still way better than CMake ExternalProject. --- fw/btl/build.py | 29 +++++++++++++++++++++++++++++ fw/btl/meson.build | 11 +++++++++++ web/layouts/home.html | 1 + web/meson.build | 1 + 4 files changed, 42 insertions(+) create mode 100755 fw/btl/build.py (limited to 'fw') diff --git a/fw/btl/build.py b/fw/btl/build.py new file mode 100755 index 0000000..6478701 --- /dev/null +++ b/fw/btl/build.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + + +import multiprocessing +import shutil +import subprocess +import sys +import pathlib + + +build_tree = pathlib.Path(sys.argv[1]) +output_dir = build_tree.parent + + +subprocess.run( + [ + "make", + f"-j{multiprocessing.cpu_count()}", + "-C", + f"{str(build_tree)}", + ], + shell=False, + check=True, +) + +shutil.copy( + build_tree / "zephyr" / "zephyr.bin", + output_dir / "bootloader.bin" +) diff --git a/fw/btl/meson.build b/fw/btl/meson.build index b783191..37c8c25 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -12,3 +12,14 @@ bootloader_project = external_project.add_project('configure.py', ], verbose: true, ) + +bootloader = custom_target('bootloader', + output: ['bootloader.bin'], + command: [ + meson.current_source_dir() / 'build.py', + meson.current_build_dir() / 'build', + ], + build_by_default: true, + install: true, + install_dir: 'website/static', +) diff --git a/web/layouts/home.html b/web/layouts/home.html index bf534cf..4f1f7fc 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -3,5 +3,6 @@ {{- end -}} diff --git a/web/meson.build b/web/meson.build index 1526621..270b7c3 100644 --- a/web/meson.build +++ b/web/meson.build @@ -13,6 +13,7 @@ website = custom_target('website', depends: [ schematic, bom, + bootloader, ], build_by_default: true, install: true, -- cgit v1.2.3-70-g09d2 From e78341079228b135bee65deb8e0d4e2b4385cf94 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 17:27:49 +0200 Subject: tools: Add directory and move scripts here This allows to re-use these scripts. Since they are currently used to build Zephyr builds and three are intended (application, bootloader and application as native_sim build) this makes sense. --- fw/btl/build.py | 29 ---- fw/btl/configure.py | 30 ---- fw/btl/meson.build | 5 +- meson.build | 4 + tools/LICENSE.txt | 373 ++++++++++++++++++++++++++++++++++++++++++++++ tools/build_zephyr.py | 34 +++++ tools/configure_zephyr.py | 35 +++++ 7 files changed, 449 insertions(+), 61 deletions(-) delete mode 100755 fw/btl/build.py delete mode 100755 fw/btl/configure.py create mode 100644 tools/LICENSE.txt create mode 100755 tools/build_zephyr.py create mode 100755 tools/configure_zephyr.py (limited to 'fw') diff --git a/fw/btl/build.py b/fw/btl/build.py deleted file mode 100755 index 6478701..0000000 --- a/fw/btl/build.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - - -import multiprocessing -import shutil -import subprocess -import sys -import pathlib - - -build_tree = pathlib.Path(sys.argv[1]) -output_dir = build_tree.parent - - -subprocess.run( - [ - "make", - f"-j{multiprocessing.cpu_count()}", - "-C", - f"{str(build_tree)}", - ], - shell=False, - check=True, -) - -shutil.copy( - build_tree / "zephyr" / "zephyr.bin", - output_dir / "bootloader.bin" -) diff --git a/fw/btl/configure.py b/fw/btl/configure.py deleted file mode 100755 index a1f6e38..0000000 --- a/fw/btl/configure.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - - -import subprocess -import sys - - -source_tree = sys.argv[1] -build_tree = sys.argv[2] -board = sys.argv[3] -zephyr_base = sys.argv[4] -zephyr_modules = sys.argv[5] -extra_conf_file = sys.argv[6] -signing_key_file = sys.argv[7] - - -subprocess.run( - [ - "cmake", - f"-S{source_tree}", - f"-B{build_tree}", - f"-DBOARD={board}", - f"-DZEPHYR_BASE={zephyr_base}", - f"-DZEPHYR_MODULES={zephyr_modules}", - f"-DEXTRA_CONF_FILE={extra_conf_file}", - f"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"{signing_key_file}\"" - ], - shell=False, - check=True, -) diff --git a/fw/btl/meson.build b/fw/btl/meson.build index 37c8c25..ed40cd3 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -1,6 +1,7 @@ external_project = import('unstable-external_project') -bootloader_project = external_project.add_project('configure.py', +bootloader_project = external_project.add_project( + configure_zephyr, configure_options: [ bootloader_firmware, meson.current_build_dir() / 'build', @@ -16,7 +17,7 @@ bootloader_project = external_project.add_project('configure.py', bootloader = custom_target('bootloader', output: ['bootloader.bin'], command: [ - meson.current_source_dir() / 'build.py', + build_zephyr, meson.current_build_dir() / 'build', ], build_by_default: true, diff --git a/meson.build b/meson.build index 9205388..446fb29 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,9 @@ project('iot-contact') +tools = meson.current_source_dir() / 'tools' +configure_zephyr = tools / 'configure_zephyr.py' +build_zephyr = tools / 'build_zephyr.py' + fs = import('fs') css = fs.copyfile( meson.current_source_dir() / 'simple.css' / 'simple.css', diff --git a/tools/LICENSE.txt b/tools/LICENSE.txt new file mode 100644 index 0000000..d0a1fa1 --- /dev/null +++ b/tools/LICENSE.txt @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/tools/build_zephyr.py b/tools/build_zephyr.py new file mode 100755 index 0000000..c99727e --- /dev/null +++ b/tools/build_zephyr.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + + +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + + +import multiprocessing +import shutil +import subprocess +import sys +import pathlib + + +build_tree = pathlib.Path(sys.argv[1]) +output_dir = build_tree.parent + + +subprocess.run( + [ + "make", + f"-j{multiprocessing.cpu_count()}", + "-C", + f"{str(build_tree)}", + ], + shell=False, + check=True, +) + +shutil.copy( + build_tree / "zephyr" / "zephyr.bin", + output_dir / "bootloader.bin" +) diff --git a/tools/configure_zephyr.py b/tools/configure_zephyr.py new file mode 100755 index 0000000..fa1fc5d --- /dev/null +++ b/tools/configure_zephyr.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 + + +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. + + +import subprocess +import sys + + +source_tree = sys.argv[1] +build_tree = sys.argv[2] +board = sys.argv[3] +zephyr_base = sys.argv[4] +zephyr_modules = sys.argv[5] +extra_conf_file = sys.argv[6] +signing_key_file = sys.argv[7] + + +subprocess.run( + [ + "cmake", + f"-S{source_tree}", + f"-B{build_tree}", + f"-DBOARD={board}", + f"-DZEPHYR_BASE={zephyr_base}", + f"-DZEPHYR_MODULES={zephyr_modules}", + f"-DEXTRA_CONF_FILE={extra_conf_file}", + f"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"{signing_key_file}\"" + ], + shell=False, + check=True, +) -- cgit v1.2.3-70-g09d2 From 84ab791be78c4f2014a78b09305c5c332b5383e3 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 17:33:13 +0200 Subject: fw: btl: Clean meson.build --- fw/btl/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fw') diff --git a/fw/btl/meson.build b/fw/btl/meson.build index ed40cd3..cedd11d 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -1,6 +1,6 @@ external_project = import('unstable-external_project') -bootloader_project = external_project.add_project( +external_project.add_project( configure_zephyr, configure_options: [ bootloader_firmware, -- cgit v1.2.3-70-g09d2 From 867755129e5c50f4e35bc34d5818c2397f3f09db Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 17:59:06 +0200 Subject: tools: Use argparse for build scripts This makes them re-usable for the application and native_sim firmwares. --- fw/btl/meson.build | 17 +++++++------- tools/build_zephyr.py | 47 +++++++++++++++++++++++-------------- tools/configure_zephyr.py | 59 ++++++++++++++++++++++++++++++----------------- 3 files changed, 77 insertions(+), 46 deletions(-) (limited to 'fw') diff --git a/fw/btl/meson.build b/fw/btl/meson.build index cedd11d..b64fd40 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -3,13 +3,13 @@ external_project = import('unstable-external_project') external_project.add_project( configure_zephyr, configure_options: [ - bootloader_firmware, - meson.current_build_dir() / 'build', - board, - zephyr, - ';'.join(zephyr_modules), - meson.current_source_dir() / 'bootloader.conf', - signing_key, + '--source-tree', bootloader_firmware, + '--build-tree', meson.current_build_dir() / 'build', + '--board', board, + '--zephyr-base', zephyr, + '--zephyr-modules', ';'.join(zephyr_modules), + '--extra-config', meson.current_source_dir() / 'bootloader.conf', + '--signing-key', signing_key, ], verbose: true, ) @@ -18,7 +18,8 @@ bootloader = custom_target('bootloader', output: ['bootloader.bin'], command: [ build_zephyr, - meson.current_build_dir() / 'build', + '--build-tree', meson.current_build_dir() / 'build', + '--target-name', 'bootloader.bin', ], build_by_default: true, install: true, diff --git a/tools/build_zephyr.py b/tools/build_zephyr.py index c99727e..e201bac 100755 --- a/tools/build_zephyr.py +++ b/tools/build_zephyr.py @@ -6,29 +6,42 @@ # obtain one at https://mozilla.org/MPL/2.0/. +import argparse import multiprocessing import shutil import subprocess -import sys import pathlib -build_tree = pathlib.Path(sys.argv[1]) -output_dir = build_tree.parent +def main() -> None: + parser = argparse.ArgumentParser( + description="Build a Zephyr GNU Make build", + ) + parser.add_argument("-B", "--build-tree", required=True) + parser.add_argument("-n", "--target-name", required=True) -subprocess.run( - [ - "make", - f"-j{multiprocessing.cpu_count()}", - "-C", - f"{str(build_tree)}", - ], - shell=False, - check=True, -) + args = parser.parse_args() -shutil.copy( - build_tree / "zephyr" / "zephyr.bin", - output_dir / "bootloader.bin" -) + build_tree = pathlib.Path(args.build_tree) + output_dir = build_tree.parent + + subprocess.run( + [ + "make", + f"-j{multiprocessing.cpu_count()}", + "-C", + f"{str(build_tree)}", + ], + shell=False, + check=True, + ) + + shutil.copy( + build_tree / "zephyr" / "zephyr.bin", + output_dir / args.target_name + ) + + +if __name__ == "__main__": + main() diff --git a/tools/configure_zephyr.py b/tools/configure_zephyr.py index fa1fc5d..e709063 100755 --- a/tools/configure_zephyr.py +++ b/tools/configure_zephyr.py @@ -6,30 +6,47 @@ # obtain one at https://mozilla.org/MPL/2.0/. +import argparse import subprocess -import sys -source_tree = sys.argv[1] -build_tree = sys.argv[2] -board = sys.argv[3] -zephyr_base = sys.argv[4] -zephyr_modules = sys.argv[5] -extra_conf_file = sys.argv[6] -signing_key_file = sys.argv[7] +def main() -> None: + parser = argparse.ArgumentParser( + description="Configure a Zephyr CMake build", + ) + parser.add_argument("-S", "--source-tree", required=True) + parser.add_argument("-B", "--build-tree", required=True) + parser.add_argument("-b", "--board", required=True) + parser.add_argument("-z", "--zephyr-base", required=True) + parser.add_argument("-m", "--zephyr-modules", required=False) + parser.add_argument("-c", "--extra-config", required=False) + parser.add_argument("-k", "--signing-key", required=False) + parser.add_argument("--prefix", required=False) + parser.add_argument("--libdir", required=False) + parser.add_argument("--bindir", required=False) -subprocess.run( - [ + args = parser.parse_args() + + command = [ "cmake", - f"-S{source_tree}", - f"-B{build_tree}", - f"-DBOARD={board}", - f"-DZEPHYR_BASE={zephyr_base}", - f"-DZEPHYR_MODULES={zephyr_modules}", - f"-DEXTRA_CONF_FILE={extra_conf_file}", - f"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"{signing_key_file}\"" - ], - shell=False, - check=True, -) + f"-S{args.source_tree}", + f"-B{args.build_tree}", + f"-DBOARD={args.board}", + f"-DZEPHYR_BASE={args.zephyr_base}", + ] + + if args.zephyr_modules is not None: + command.append(f"-DZEPHYR_MODULES={args.zephyr_modules}") + + if args.extra_config is not None: + command.append(f"-DEXTRA_CONF_FILE={args.extra_config}") + + if args.signing_key is not None: + command.append(f"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"{args.signing_key}\"") + + subprocess.run(command, shell=False, check=True) + + +if __name__ == "__main__": + main() -- cgit v1.2.3-70-g09d2 From 8350421e659e9273a94debdd6f29cd80979a63f1 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 18:04:25 +0200 Subject: fw: app: Build with Meson --- fw/app/meson.build | 25 +++++++++++++++++++++++++ fw/meson.build | 1 + web/layouts/home.html | 1 + web/meson.build | 1 + 4 files changed, 28 insertions(+) create mode 100644 fw/app/meson.build (limited to 'fw') diff --git a/fw/app/meson.build b/fw/app/meson.build new file mode 100644 index 0000000..7f35ebb --- /dev/null +++ b/fw/app/meson.build @@ -0,0 +1,25 @@ +external_project = import('unstable-external_project') + +external_project.add_project( + configure_zephyr, + configure_options: [ + '--source-tree', meson.current_source_dir(), + '--build-tree', meson.current_build_dir() / 'build', + '--board', board, + '--zephyr-base', zephyr, + '--zephyr-modules', ';'.join(zephyr_modules), + ], + verbose: true, +) + +application = custom_target('application', + output: ['application.bin'], + command: [ + build_zephyr, + '--build-tree', meson.current_build_dir() / 'build', + '--target-name', 'application.bin', + ], + build_by_default: true, + install: true, + install_dir: 'website/static', +) diff --git a/fw/meson.build b/fw/meson.build index 7f9bead..492465e 100644 --- a/fw/meson.build +++ b/fw/meson.build @@ -4,4 +4,5 @@ fs = import('fs') signing_key = fs.expanduser('~') / 'mcuboot' / 'key.pem' subdir('rtos') +subdir('app') subdir('btl') diff --git a/web/layouts/home.html b/web/layouts/home.html index 4f1f7fc..fe40af2 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -3,6 +3,7 @@ {{- end -}} diff --git a/web/meson.build b/web/meson.build index 270b7c3..da45440 100644 --- a/web/meson.build +++ b/web/meson.build @@ -13,6 +13,7 @@ website = custom_target('website', depends: [ schematic, bom, + application, bootloader, ], build_by_default: true, -- cgit v1.2.3-70-g09d2 From 7fc6bc84609022992e1827a07b95c427208e7289 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 18:43:28 +0200 Subject: fw: sim: Integrate into Meson build This adds a build for the native_sim board of the application firmware to the default Meson build. The resulting Linux binary is also added to the webpage. --- fw/app/meson.build | 5 ++++- fw/btl/meson.build | 1 + fw/meson.build | 1 + fw/sim/meson.build | 27 +++++++++++++++++++++++++++ tools/build_zephyr.py | 3 ++- web/layouts/home.html | 1 + 6 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 fw/sim/meson.build (limited to 'fw') diff --git a/fw/app/meson.build b/fw/app/meson.build index 7f35ebb..d477331 100644 --- a/fw/app/meson.build +++ b/fw/app/meson.build @@ -1,9 +1,11 @@ external_project = import('unstable-external_project') +application_source = meson.current_source_dir() + external_project.add_project( configure_zephyr, configure_options: [ - '--source-tree', meson.current_source_dir(), + '--source-tree', application_source, '--build-tree', meson.current_build_dir() / 'build', '--board', board, '--zephyr-base', zephyr, @@ -17,6 +19,7 @@ application = custom_target('application', command: [ build_zephyr, '--build-tree', meson.current_build_dir() / 'build', + '--binary-name', 'zephyr.bin', '--target-name', 'application.bin', ], build_by_default: true, diff --git a/fw/btl/meson.build b/fw/btl/meson.build index b64fd40..4d80a58 100644 --- a/fw/btl/meson.build +++ b/fw/btl/meson.build @@ -19,6 +19,7 @@ bootloader = custom_target('bootloader', command: [ build_zephyr, '--build-tree', meson.current_build_dir() / 'build', + '--binary-name', 'zephyr.bin', '--target-name', 'bootloader.bin', ], build_by_default: true, diff --git a/fw/meson.build b/fw/meson.build index 492465e..8194827 100644 --- a/fw/meson.build +++ b/fw/meson.build @@ -6,3 +6,4 @@ signing_key = fs.expanduser('~') / 'mcuboot' / 'key.pem' subdir('rtos') subdir('app') subdir('btl') +subdir('sim') diff --git a/fw/sim/meson.build b/fw/sim/meson.build new file mode 100644 index 0000000..a4dcb8a --- /dev/null +++ b/fw/sim/meson.build @@ -0,0 +1,27 @@ +external_project = import('unstable-external_project') + +external_project.add_project( + configure_zephyr, + configure_options: [ + '--source-tree', application_source, + '--build-tree', meson.current_build_dir() / 'build', + '--board', 'native_sim/native/64', + '--zephyr-base', zephyr, + '--zephyr-modules', ';'.join(zephyr_modules), + ], + verbose: true, +) + +simulation = custom_target( + 'simulation', + output: ['simulation-linux-amd64.exe'], + command: [ + build_zephyr, + '--build-tree', meson.current_build_dir() / 'build', + '--binary-name', 'zephyr.exe', + '--target-name', 'simulation-linux-amd64.exe', + ], + build_by_default: true, + install: true, + install_dir: 'website/static', +) diff --git a/tools/build_zephyr.py b/tools/build_zephyr.py index e201bac..1d9e783 100755 --- a/tools/build_zephyr.py +++ b/tools/build_zephyr.py @@ -19,6 +19,7 @@ def main() -> None: ) parser.add_argument("-B", "--build-tree", required=True) + parser.add_argument("-b", "--binary-name", required=True) parser.add_argument("-n", "--target-name", required=True) args = parser.parse_args() @@ -38,7 +39,7 @@ def main() -> None: ) shutil.copy( - build_tree / "zephyr" / "zephyr.bin", + build_tree / "zephyr" / args.binary_name, output_dir / args.target_name ) diff --git a/web/layouts/home.html b/web/layouts/home.html index fe40af2..f4c4e80 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -5,5 +5,6 @@
  • schematic.pdf
  • application.bin
  • bootloader.bin
  • +
  • simulation-linux-amd64.exe
  • {{- end -}} -- cgit v1.2.3-70-g09d2 From f6f6d285c318d28bddfb99cf04104a5306a97c78 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 19:05:20 +0200 Subject: fw: app: Add image signing to Meson build This automates signing the application firmware image for the MCUboot bootloader. --- fw/app/meson.build | 19 ++++++++++++++++++- fw/rtos/modules/meson.build | 4 +++- web/layouts/home.html | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) (limited to 'fw') diff --git a/fw/app/meson.build b/fw/app/meson.build index d477331..97c17f1 100644 --- a/fw/app/meson.build +++ b/fw/app/meson.build @@ -14,7 +14,8 @@ external_project.add_project( verbose: true, ) -application = custom_target('application', +application = custom_target( + 'application', output: ['application.bin'], command: [ build_zephyr, @@ -22,7 +23,23 @@ application = custom_target('application', '--binary-name', 'zephyr.bin', '--target-name', 'application.bin', ], +) + +application_signed = custom_target( + 'application_signed', + output: ['application.signed.bin'], + command: [ + imgtool, + 'sign', + '--version', '0.0.0', + '--header-size', '0x200', + '--slot-size', '0xc0000', + '--key', signing_key, + meson.current_build_dir() / 'application.bin', + meson.current_build_dir() / 'application.signed.bin', + ], build_by_default: true, + depends: application, install: true, install_dir: 'website/static', ) diff --git a/fw/rtos/modules/meson.build b/fw/rtos/modules/meson.build index 52f50c2..14b14f5 100644 --- a/fw/rtos/modules/meson.build +++ b/fw/rtos/modules/meson.build @@ -5,4 +5,6 @@ zephyr_modules = [ meson.current_source_dir() / 'mcuboot', ] -bootloader_firmware = meson.current_source_dir() / 'mcuboot' / 'boot' / 'zephyr' +mcuboot = meson.current_source_dir() / 'mcuboot' +bootloader_firmware = mcuboot / 'boot' / 'zephyr' +imgtool = mcuboot / 'scripts' / 'imgtool.py' diff --git a/web/layouts/home.html b/web/layouts/home.html index f4c4e80..6bc457c 100644 --- a/web/layouts/home.html +++ b/web/layouts/home.html @@ -3,7 +3,7 @@ -- cgit v1.2.3-70-g09d2 From 51531e94ad3d909b6a136b6506f79fdb463f7432 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 19:12:17 +0200 Subject: fw: Remove nucleo.sh Because of the Meson build system the application firmware is signed automatically. Furthermore all artifacts required to flash the Nucleo board are deployed to the website. Thus this script is not necessary anymore. --- fw/nucleo.sh | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100755 fw/nucleo.sh (limited to 'fw') diff --git a/fw/nucleo.sh b/fw/nucleo.sh deleted file mode 100755 index ad0467b..0000000 --- a/fw/nucleo.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - - -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - - -set -euf - - -SCRIPT="$(realpath "$0")" -FW="$(dirname "$SCRIPT")" -ROOT="$(dirname "$FW")" -BUILD="${ROOT}/build" -BOOTLOADER_FIRMWARE="${BUILD}/fw/btl/zephyr/zephyr.bin" -APPLICATION_FIRMWARE="${BUILD}/fw/app/zephyr/zephyr.bin" -APPLICATION_FIRMWARE_SIGNED="${BUILD}/fw/app/zephyr/zephyr.signed.bin" -BOOTLOADER_FLASH_ADDRESS='0x8000000' -APPLICATION_FLASH_ADDRESS='0x8040000' -IMGTOOL="${ROOT}/imgtool.py" -KEY="${HOME}/mcuboot/key.pem" -BOARD='nucleo_f767zi' - - -set -x - -python "$IMGTOOL" sign \ - --version 0.0.0 \ - --header-size 0x200 \ - --slot-size 0xc0000 \ - --key "$KEY" \ - "$APPLICATION_FIRMWARE" \ - "$APPLICATION_FIRMWARE_SIGNED" -st-flash --connect-under-reset write "$BOOTLOADER_FIRMWARE" \ - "$BOOTLOADER_FLASH_ADDRESS" -st-flash --connect-under-reset write "$APPLICATION_FIRMWARE_SIGNED" \ - "$APPLICATION_FLASH_ADDRESS" -- cgit v1.2.3-70-g09d2 From 71f6c1991f0451df4c5c92fd8cd8302146fcbf6f Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 19:14:01 +0200 Subject: fw: Remove README.md --- fw/README.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 fw/README.md (limited to 'fw') diff --git a/fw/README.md b/fw/README.md deleted file mode 100644 index 9883b2d..0000000 --- a/fw/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# iot-contact Firmware - -This is the firmware for iot-contact. It is based on the Zephyr real time -operating system [1]. - -[1]: https://zephyrproject.org -- cgit v1.2.3-70-g09d2 From 8cc751f284b15ff3dbc5b1ba27e3733671cb964c Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 6 Apr 2025 19:16:48 +0200 Subject: Remove top-level CMake build system Meson now handles this. CMake is only used as Meson external project to build Zephyr firmwares. --- CMakeLists.txt | 5 ----- fw/CMakeLists.txt | 37 ------------------------------------- fw/rtos/CMakeLists.txt | 16 ---------------- 3 files changed, 58 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 fw/CMakeLists.txt delete mode 100644 fw/rtos/CMakeLists.txt (limited to 'fw') diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 7d5602c..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -project(iot-contact LANGUAGES NONE) - -add_subdirectory(fw) diff --git a/fw/CMakeLists.txt b/fw/CMakeLists.txt deleted file mode 100644 index 2affe92..0000000 --- a/fw/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -cmake_minimum_required(VERSION 3.20.0) - -include(ExternalProject) - -set(KEY_DEFAULT "$ENV{HOME}/mcuboot/key.pem") -set(KEY ${KEY_DEFAULT} CACHE STRING "Firmware signing key path") -message(STATUS "Firmware signing key path: ${KEY}") - -set(BOARD_DEFAULT "native_sim/native/64") -set(BOARD ${BOARD_DEFAULT} CACHE STRING "Zephyr board identifier") -message(STATUS "Selected board: ${BOARD}") - -add_subdirectory(rtos) -string(REPLACE ";" "," ZEPHYR_MODULES_COMMA "${ZEPHYR_MODULES}") - -if(BOARD STREQUAL "nucleo_f767zi") - ExternalProject_Add( - btl - PREFIX btl - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rtos/modules/mcuboot/boot/zephyr" - BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/btl" - INSTALL_COMMAND "" - LIST_SEPARATOR "," - CMAKE_ARGS - "-DBOARD=${BOARD}" - "-DZEPHYR_BASE=${ZEPHYR_BASE}" - "-DZEPHYR_MODULES=${ZEPHYR_MODULES_COMMA}" - "-DEXTRA_CONF_FILE=${CMAKE_CURRENT_SOURCE_DIR}/btl/bootloader.conf" - -DCONFIG_BOOT_SIGNATURE_KEY_FILE="${KEY}" - ) -endif() - -add_subdirectory(app) diff --git a/fw/rtos/CMakeLists.txt b/fw/rtos/CMakeLists.txt deleted file mode 100644 index d9f116c..0000000 --- a/fw/rtos/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public License, -# v. 2.0. If a copy of the MPL was not distributed with this file, You can -# obtain one at https://mozilla.org/MPL/2.0/. - -set(ZEPHYR_MODULES - "${CMAKE_CURRENT_SOURCE_DIR}/modules/cmsis" - "${CMAKE_CURRENT_SOURCE_DIR}/modules/hal_stm32" - "${CMAKE_CURRENT_SOURCE_DIR}/modules/mbedtls" - "${CMAKE_CURRENT_SOURCE_DIR}/modules/mcuboot" - PARENT_SCOPE -) - -set(ZEPHYR_BASE - "${CMAKE_CURRENT_SOURCE_DIR}/zephyr" - PARENT_SCOPE -) -- cgit v1.2.3-70-g09d2