Coder Social home page Coder Social logo

zephyr-qemu-dev's Introduction

Zephyr RTOS and QEMU emulator

Installation

  1. Import this project using west
west init -m https://github.com/lucasdietrich/zephyr-qemu-dev --mr main my-workspace
  1. Update Zephyr RTOS version in west.yml
  • Set revision to main, 2.7.2 or 3.0.0 for example
  • Run west update to synchronize git repositories
  1. Install net-tools (https://github.com/zephyrproject-rtos/net-tools) if using network

Build, run, debug

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

VS Code

This project is well integrated into VS Code. Simply install actboy168.tasks extension which expose tasks.

Open tasks panel with Ctrl + Maj + B.

Debug (VS Code)

Run the debug server

  • ninja debugserver -C build -v
  • Select debug configuration among (gdb) QEMU x86 or (gdb) QEMU ARM
  • Press F5

Networking (if needed)

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

Illustration

zephyr_qemu_networking_debug.png

Troubleshooting

  • If previous ninja process still listenning to the serial port 1234, find it with sudo netstat -anpe | grep "1234" | grep "LISTEN" or sudo lsof -i :1234 and kill it.

  • preLaunchTask is not working in launch.json

  • Don't forget to activate python venv if using west

  • Clean build folder if strange error appear

  • If closing loop-slip-tap.sh by error, kill processes locking the fd using sudo lsof | grep slip and relaunch

  • Make sure to change manifest path to zephyr-qemu-dev in workspace .west/config file.

Ressources

zephyr-qemu-dev's People

Contributors

lucasdietrich avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.