Skip to content

Commit d698082

Browse files
committed
Test
1 parent f4e0971 commit d698082

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/scripts/tests_run.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ function run_test() {
4040

4141
if [ $platform == "qemu" ]; then
4242
PATH=$HOME/qemu/bin:$PATH
43-
extra_args="--embedded-services qemu --qemu-image-path $build_dir/$sketchname.ino.bin"
43+
esptool.py -c $target merge_bin -o $build_dir/$sketchname.ino.merged.bin @$build_dir/qemu_flash_args
44+
extra_args="--embedded-services qemu --qemu-image-path $build_dir/$sketchname.ino.merged.bin"
4445

4546
if [ $target == "esp32" ] || [ $target == "esp32s3" ]; then
46-
extra_args+=" --target $target --qemu-prog-path qemu-system-xtensa --qemu-cli-args \"-nographic\""
47+
extra_args+=" --qemu-prog-path qemu-system-xtensa --qemu-cli-args=\"-machine $target -m 4M -nographic\""
48+
elif [ $target == "esp32c3" ]; then
49+
extra_args+=" --qemu-prog-path qemu-system-riscv32 --qemu-cli-args=\"-machine $target -icount 3 -nographic\""
4750
else
48-
extra_args+=" --target $target --qemu-prog-path qemu-system-riscv32 --qemu-cli-args \"-nographic\""
51+
echo "Unsupported QEMU target: $target"
52+
exit 1
4953
fi
5054
else
5155
extra_args="--embedded-services esp,arduino"

platform.txt

+4
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ recipe.objcopy.bin.pattern_args=--chip {build.mcu} elf2image --flash_mode "{buil
160160
recipe.objcopy.bin.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
161161
recipe.objcopy.bin.pattern.linux=python3 "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
162162

163+
## Create qemu_flash_args file
164+
qemu_flash_args.path={build.path}/qemu_flash_args
165+
recipe.objcopy.qemu_flash_args.pattern=/usr/bin/env bash -c "(echo '--fill-flash-size {build.flash_size} --flash_mode keep --flash_freq keep --flash_size keep'; echo '{build.bootloader_addr} {build.path}/{build.project_name}.bootloader.bin'; echo '0x8000 {build.path}/{build.project_name}.partitions.bin'; echo '0xe000 {runtime.platform.path}/tools/partitions/boot_app0.bin'; echo '0x10000 {build.path}/{build.project_name}.bin') > {qemu_flash_args.path}"
166+
163167
## Create Insights Firmware Package
164168
recipe.hooks.objcopy.postobjcopy.1.pattern_args={build.path} {build.project_name} "{build.source.path}"
165169
recipe.hooks.objcopy.postobjcopy.1.pattern=/usr/bin/env bash -c "[ ! -d "{build.path}"/libraries/Insights ] || {tools.gen_insights_pkg.cmd} {recipe.hooks.objcopy.postobjcopy.1.pattern_args}"

0 commit comments

Comments
 (0)