使用 QEMU 代替 STM32 开发版本 docker 一键启动

dockerfile

# Compile and install qemu_stm32
from fedora:28
RUN dnf install -y \
          arm-none-eabi-gcc\
          arm-none-eabi-newlib\
          findutils\
          gcc\
          git\
          glib2-devel\
          libfdt-devel\
          pixman-devel\
          pkgconf-pkg-config\
          python\
          make\
          zlib-devel ;\
    git clone https://github.com/beckus/qemu_stm32.git
RUN cd qemu_stm32 && ./configure --extra-cflags="-w" --enable-debug --target-list="arm-softmmu" && make && make install

# Install demos
RUN git clone https://github.com/beckus/stm32_p103_demos.git && cd stm32_p103_demos && make

docker-compose

version: '3'
services:
  qemu_stm32:
    container_name: qemu_stm32
    build:
      context: .
      dockerfile: Dockerfile
    working_dir: /stm32_p103_demos/demos/freertos_singlethread
    command: [ "/bin/sh","-c","sleep 99999" ]

STM32F103

qemu-system-arm -M stm32-p103 -kernel main.bin

查看支持的开发版

 qemu-system-arm -machine help

posted @ 2023-07-27 15:05  vx_guanchaoguo0  阅读(296)  评论(0)    收藏  举报