Boot Zephyr
We may follow below steps to setup Zephyr with SBL on UP2 maker board and QEMU.
UP2 Board
Follow Getting Started Guide to setup Zephyr build/dev environment
Build an application uses synchronization sample application:
setup zephyr environment:
source zephyr-env.sh or zephyr-env.cmdBuild sample application for UP2 board:
cd samples/synchronization mkdir build_up2 && cd build_up2 cmake -GNinja -DBOARD=up_squared_sbl .. ninjaOutput file:
samples/synchronization/build_up2/zephyr/zephyr.elf
Build SBL image with zephyr.elf as a direct payload for simple test.
build Slim Bootloader for UP2 board with the built zephyr.elf:
python BuildLoader.py build apl -p <zephyr_root>/samples/synchronization/build_up2/zephyr/zephyr.elf
Create a IFWI for UP2, follow the steps here.
Flash IFWI and check the zephyr up & running thru serial console:
...... Stage2 heap: 0xB4C000 (0x10C000 used, 0xA40000 free) Payload ent***** Booting Zephyr OS zephyr-v1.13.0-1689-g4a7c422182 ***** threadA: Hello World from up_squared! threadB: Hello World from up_squared! threadA: Hello World from up_squared! threadB: Hello World from up_squared! threadA: Hello World from up_squared!
QEMU
Build an application uses synchronization sample application:
setup zephyr environment:
source zephyr-env.sh or zephyr-env.cmdBuild sample application for QEMU:
cd samples/synchronization mkdir build_qemu && cd build_qemu cmake -GNinja -DBOARD=qemu_x86 .. ninjaOutput file:
samples/synchronization/build_qemu/zephyr/zephyr.elf
Build SBL image with zephyr.elf as as payload for simple test.
Build SBL to include zephyr.elf:
python BuildLoader.py build qemu -p <zephyr_root>/samples/synchronization/build_qemu/zephyr/zephyr.elf
Run QEMU and check the zephyr up & running thru serial console :
Execute QEMU:
qemu-system-x86_64 -m 256M -machine q35 -nographic -pflash Outputs/qemu/SlimBootloader.binCheck result thru serial console:
...... Payload entry: 0x00001000 Jump to payload ***** Booting Zephyr OS zephyr-v1.13.0-1689-gbc34b1aa09 ***** threadA: Hello World from qemu_x86! threadB: Hello World from qemu_x86! threadA: Hello World from qemu_x86!