当前位置:网站首页>STM32 virtualization environment of QEMU

STM32 virtualization environment of QEMU

2022-07-05 08:11:00 Nanbolwan

Tips : When the article is finished , Directories can be generated automatically , How to generate it, please refer to the help document on the right


Preface

Close to the year ,2021 The new year is once again affected by the new crown and can't go home well . Because the work needs to know a little ARM Knowledge of assembly , So I decided to study . The first thing I want to do is to have a learning environment , It's not worth buying a development board , So I hope it can be used qemu Build a virtual environment to help your learning enthusiasm .


One 、qemu What is it?

qeme It's a virtual machine , Self supporting many architectures cpu, Anyway, it's an open source and powerful thing . For details, please refer to the instructions on the official website , In most cases, this thing is used to run embedded linux Systematic . I feel that theoretically, one can also be simulated stm32 Development board , Generally, these things are github In the upper probability, someone will have done it , Go up and look for it . I didn't expect to find https://github.com/beckus/qemu_stm32

Two 、 Do as you say

1. Environment description and source code construction

Before you start, you need to install linux Your computer or linux Virtual machines can also , My notebook itself is ubuntu System , Because I used to do embedded linux The developed cross compilers also have , So the environment is still perfect , So start straight .

Access to the source code :

git clone git://github.com/beckus/qemu_stm32.git

To configure :

./configure --enable-debug --disable-werror --target-list="arm-softmmu"

This step requires many libraries , Just install whatever library you lack . There is no –disable-werror This parameter , I will report an error when compiling, but I can't compile , Just add this entry .
Compile and install :

make && make install

Installation may require root jurisdiction , You can choose the following command :

sudo make install

2. function Demo

The source code author provides Demo, Download it and you can compile and run it directly .

git clone git://github.com/beckus/stm32_p103_demos.git
cd stm32_p103_demos
./configure
make

Compilation requires a cross compiler , This has been done. arm linux Students of development should be familiar with , Compiler name is arm-none-eabi-gcc, If there is no installation, you can directly execute the command installation :

sudo apt-get install arm-none-eabi-gcc

After compilation , At every demo There will be a... Under the folder main.bin file , We can run , Then test our learning environment ;

cd /stm32_p103_demos/demos/qemu_test
qemu-system-arm -M stm32-p103 -kernel main.bin

 Insert picture description here

The successful running !!!


summary

Here we are , There should be no problem with the environment , But how to write a program and run it needs further research , Next, I plan to study demo Source code and Makefile To implement your own program , Then further study qemu Source code stm32 Part of the source code , Interested partners are welcome to study and discuss .

原网站

版权声明
本文为[Nanbolwan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140545439845.html