-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esp32c3: Add MCUboot support files for testing
Signed-off-by: Gustavo Henrique Nihei <[email protected]>
- Loading branch information
1 parent
8a08009
commit 74b5338
Showing
4 changed files
with
42 additions
and
1 deletion.
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
SCRIPT_NAME=$(basename "${BASH_SOURCE[0]}") | ||
|
||
set -eo pipefail | ||
|
||
usage() { | ||
echo "" | ||
echo "USAGE: ${SCRIPT_NAME} <ELF>" | ||
echo "" | ||
} | ||
|
||
if [ -z "${1}" ]; then | ||
echo "ERROR: Missing application ELF file." | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# MCUboot's tool for image signing and key management | ||
if ! command -v imgtool &> /dev/null; then | ||
echo "" | ||
echo "imgtool not found. Please run: \"pip install imgtool\"" | ||
echo "" | ||
exit 1 | ||
fi | ||
|
||
elf_file=${1} | ||
|
||
objcopy -O ihex "${elf_file}" app.hex | ||
imgtool sign --pad --align 4 -v 0 -s auto -H 32 --pad-header -S 0x100000 app.hex app.bin | ||
esptool.py -c esp32c3 -p /dev/ttyUSB0 -b 921600 --after no_reset write_flash -fs 4MB -fm dio -ff 40m 0x0 ./mcuboot-esp32c3.bin 0x110000 ./app.bin | ||
picocom -b 115200 /dev/ttyUSB0 --imap lfcrlf |