forked from AGlass0fMilk/mbed-mcuboot-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a127d01
commit c477e9b
Showing
14 changed files
with
241 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Example GitHub Actions workflow which provides a CI build for your Mbed CE project. | ||
|
||
name: Test that this Mbed project compiles | ||
|
||
on: push | ||
|
||
jobs: | ||
compile: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/armmbed/mbed-os-env:master-latest | ||
|
||
strategy: | ||
matrix: | ||
mbed_target: | ||
# Change the below to match the target(s) you want to compile the project for. | ||
- NUCLEO_H743ZI2 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install python3-venv | ||
run: | | ||
apt-get update | ||
apt-get install -y python3-venv | ||
- name: Generate transient key pair | ||
run: | | ||
python3 -m pip install --user -r mcuboot/scripts/requirements.txt | ||
python3 -m pip install --user mcuboot/scripts | ||
imgtool keygen -k signing-keys.pem -t rsa-2048 | ||
imgtool getpub -k signing-keys.pem > signing_keys.c | ||
- name: Build project for ${{ matrix.mbed_target }} | ||
run: | | ||
mkdir build && cd build | ||
python3 -m pip install -r | ||
cmake .. -GNinja -DMBED_TARGET=${{ matrix.mbed_target }} | ||
ninja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
/Debug/ | ||
BUILD/ | ||
.cproject | ||
*~ | ||
.mbed | ||
.project | ||
.settings/ | ||
GettingStarted.html | ||
makefile.targets | ||
mbed_settings.py | ||
mbed_settings.pyc | ||
mbed_config.h | ||
*.hex | ||
*.pem | ||
# Public key file | ||
signing_keys.c | ||
mbed-os/* | ||
mcuboot/* | ||
|
||
# Private key file | ||
signing-keys.pem | ||
|
||
# CLion build dirs | ||
cmake-build-*/ | ||
|
||
# User-specific CLion stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/dictionaries | ||
.idea/**/shelf | ||
.idea/runConfigurations | ||
|
||
# Generated CLion files | ||
.idea/**/contentModel.xml | ||
|
||
# Sensitive or high-churn CLion files | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
.idea/**/dbnavigator.xml | ||
|
||
# Gradle | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# VS Code build dir | ||
build/ | ||
|
||
# VS Code config files | ||
.vscode/ | ||
|
||
# Python stuff | ||
*.pyc | ||
|
||
# Mac stuff | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "mbed-os"] | ||
path = mbed-os | ||
url = https://github.com/mbed-ce/mbed-os.git | ||
[submodule "mcuboot"] | ||
path = mcuboot | ||
url = https://github.com/multiplemonomials/mcuboot.git |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
cmake_minimum_required(VERSION 3.19) | ||
cmake_policy(VERSION 3.19) | ||
|
||
set(MBED_APP_JSON_PATH mbed_app.json5) | ||
|
||
include(mbed-os/tools/cmake/app.cmake) | ||
|
||
add_subdirectory(mbed-os) | ||
|
||
project(mbed-mcuboot-bootloader) | ||
|
||
set(MBED_MCUBOOT_BOOTLOADER_SOURCES | ||
default_bd.cpp | ||
enc_key.c | ||
shared_data.c | ||
signing_keys.c) | ||
|
||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/signing_keys.c) | ||
message(FATAL_ERROR "Missing signing_keys.c in source directory! Please follow the README instructions to generate the signing keys!") | ||
endif() | ||
|
||
# Compile mcuboot sources | ||
add_subdirectory(mcuboot/boot/bootutil) | ||
add_subdirectory(mcuboot/boot/mbed) | ||
|
||
add_executable(${CMAKE_PROJECT_NAME} ${MBED_MCUBOOT_BOOTLOADER_SOURCES}) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} mbed-baremetal mbed-mcuboot) | ||
mbed_set_post_build(${CMAKE_PROJECT_NAME}) | ||
|
||
mbed_finalize_build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"config": { | ||
"serial-bootloader-enable": { | ||
"help": "Build bootloader with serial update support", | ||
"value": 0 | ||
}, | ||
"secondary-slot-in-flash": { | ||
"help": "If enabled, store the secondary slot in the application flash immediately after the primary slot.", | ||
"value": false | ||
} | ||
}, | ||
|
||
|
||
"target_overrides": { | ||
"*": { | ||
"platform.stdio-baud-rate": 115200, | ||
"target.restrict_size": "0x20000", | ||
"target.c_lib": "small", | ||
"mcuboot.log-level": "MCUBOOT_LOG_LEVEL_DEBUG", | ||
"mbed-trace.enable": true, | ||
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG", | ||
"mbed-trace.fea-ipv6": false | ||
}, | ||
// "NRF52840_DK": { | ||
// "target.features_remove": ["CRYPTOCELL310"], | ||
// "target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"], | ||
// "mcuboot.primary-slot-address": "0x20000", | ||
// "mcuboot.slot-size": "0xC0000", | ||
// "mcuboot.scratch-address": "0xE0000", | ||
// "mcuboot.scratch-size": "0x20000", | ||
// "mcuboot.max-img-sectors": "0x180", | ||
// "mcuboot.read-granularity": 4, | ||
// "qspif.QSPI_MIN_PROG_SIZE": 4 | ||
// }, | ||
// "EP_AGORA": { | ||
// "target.features_remove": ["CRYPTOCELL310"], | ||
// "target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"], | ||
// "mcuboot.primary-slot-address": "0x20000", | ||
// "mcuboot.slot-size": "0xC0000", | ||
// "mcuboot.scratch-address": "0xE0000", | ||
// "mcuboot.scratch-size": "0x20000", | ||
// "mcuboot.max-img-sectors": "0x180", | ||
// "mcuboot.read-granularity": 4, | ||
// "qspif.QSPI_MIN_PROG_SIZE": 4 | ||
// }, | ||
// "DISCO_L475VG_IOT01A": { | ||
// "mcuboot.primary-slot-address": "0x8020000", | ||
// "mcuboot.slot-size": "0xC0000", | ||
// "mcuboot.scratch-address": "0x80E0000", | ||
// "mcuboot.scratch-size": "0x20000", | ||
// "mcuboot.max-img-sectors": "0x180", | ||
// "mcuboot.read-granularity": 1, | ||
// "qspif.QSPI_MIN_PROG_SIZE": 1 | ||
// }, | ||
// "K64F": { | ||
// "mcuboot.primary-slot-address": "0x20000", | ||
// "mcuboot.slot-size": "0xC0000", | ||
// "mcuboot.scratch-address": "0xE0000", | ||
// "mcuboot.scratch-size": "0x20000", | ||
// "mcuboot.max-img-sectors": "0x180", | ||
// "mcuboot.read-granularity": 512 | ||
// }, | ||
|
||
"MCU_STM32H743xI": { | ||
// Configure bootloader to live in the first sector of flash | ||
"target.memory_bank_config": { | ||
"IROM1": { | ||
"size": 0x20000 | ||
} | ||
}, | ||
|
||
// Since STM32H743 boards have no external block device, keep everything in the MCU flash. | ||
"app.secondary-slot-in-flash": true, | ||
|
||
// Slot size can be as big as 896k, since we need to reserve the first flash sector for the bootloader | ||
// and the last flash sector for scratch space | ||
"mcuboot.primary-slot-address": "0x20000", | ||
"mcuboot.slot-size": "0xE0000", | ||
|
||
"mcuboot.max-img-sectors": "0x180", | ||
"mcuboot.read-granularity": 512, | ||
|
||
// STM32H7 flash sector size is 128k, so we need to make the scratch region at least that big | ||
"mcuboot.scratch-address": "0x1E0000", | ||
"mcuboot.scratch-size": "0x20000", | ||
|
||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters