- Import this project using west
west init -m https://github.com/lucasdietrich/zephyr-qemu-dev --mr main my-workspace
- Update Zephyr RTOS version in
west.yml
- Set
revisiontomain,2.7.2or3.0.0for example - Run
west updateto synchronize git repositories
- Install net-tools (https://github.com/zephyrproject-rtos/net-tools) if using network
Using west:
- For QEMU x86:
west build -b qemu_x86 - For QEMU ARM Cortex M3:
west build -b qemu_cortex_m3
Run:
west build -t run
This project is well integrated into VS Code. Simply install actboy168.tasks extension which expose tasks.
Open tasks panel with Ctrl + Maj + B.
Run the debug server
ninja debugserver -C build -v- Select debug configuration among
(gdb) QEMU x86or(gdb) QEMU ARM - Press
F5
NAT/masquerading on host to access Internet :
sudo iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.0.2.1
sudo sysctl -w net.ipv4.ip_forward=1
In order to run/debug the networking application :
- Run
../net-tools/loop-socat.sh - Run
sudo ../net-tools/loop-slip-tap.sh
And keep the consoles open over sessions
Run or debug the application normally
-
If previous ninja process still listenning to the serial port 1234, find it with
sudo netstat -anpe | grep "1234" | grep "LISTEN"orsudo lsof -i :1234and kill it. -
preLaunchTaskis not working inlaunch.json -
Don't forget to activate python
venvif usingwest -
Clean
buildfolder if strange error appear -
If closing
loop-slip-tap.shby error, kill processes locking the fd usingsudo lsof | grep slipand relaunch -
Make sure to change manifest path to
zephyr-qemu-devin workspace.west/configfile.
- Zephyr CMake Package - Zephyr Build Configuration CMake package
- Application Development
- Zephyr Example Application
- Build and Configuration Systems - Build System (CMake)
- VS Code integration #21119
- West (Zephyr’s meta-tool)
- West Manifests
- Moving to West
- Workspaces
- Zephyr RTOS Development in Linux
- All Configuration Options
- VS Code - Variables Reference
- QEMU wiki
- GDB: The GNU Project Debugger
- VS Code - Debugging
- NAT/masquerading on host to access Internet
