User Tools

Site Tools


proiecte:qemu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
proiecte:qemu [2018/11/14 15:00]
stefan_dan.ciocirlan [Setup]
proiecte:qemu [2018/11/25 19:35] (current)
stefan_dan.ciocirlan [Network]
Line 6: Line 6:
 ===== Devices ===== ===== Devices =====
 ==== Emulated Devices ==== ==== Emulated Devices ====
-===  LM3S6965 (NRND) Stellaris LM3S Microcontroller  ===+=== Cortex M3 === 
 +==  LM3S6965 (NRND) Stellaris LM3S Microcontroller  ==
 {{proiecte:lm3s6965.jpg}} {{proiecte:lm3s6965.jpg}}
  
  
-The Stellaris family of microcontrollers—the first ARM® CortexTM-M3 based controllers—brings high-performance 32-bit computing to cost-sensitive embedded microcontroller applications. These pioneering parts deliver customers 32-bit performance at a cost equivalent to legacy 8- and 16-bit devices, all in a package with a small footprint. The Stellaris family offers efficient performance and extensive integration, favorably positioning the device into cost-conscious applications requiring significant control-processing and connectivity capabilities. The Stellaris LM3S6000 series combines both a 10/100 Ethernet Media Access Control (MAC) and Physical (PHY) layer, marking the first time that integrated connectivity is available with an ARM Cortex-M3 MCU and the only integrated 10/100 Ethernet MAC and PHY available in an ARM architecture MCU. The LM3S6965 microcontroller is targeted for industrial applications, including remote monitoring, electronic point-of-sale machines, test and measurement equipment, network appliances and switches, factory automation, HVAC and building control, gaming equipment, motion control, medical instrumentation, and fire and security. For applications requiring extreme conservation of power, the LM3S6965 microcontroller features a battery-backed Hibernation module to efficiently power down the LM3S6965 to a low-power state during extended periods of inactivity. With a power-up/power-down sequencer, a continuous time counter (RTC), a pair of match registers, an APB interface to the system bus, and dedicated non-volatile memory, the Hibernation module positions the LM3S6965 microcontroller perfectly for battery applications. +""The Stellaris family of microcontrollers—the first ARM® CortexTM-M3 based controllers—brings high-performance 32-bit computing to cost-sensitive embedded microcontroller applications. These pioneering parts deliver customers 32-bit performance at a cost equivalent to legacy 8- and 16-bit devices, all in a package with a small footprint. The Stellaris family offers efficient performance and extensive integration, favorably positioning the device into cost-conscious applications requiring significant control-processing and connectivity capabilities. The Stellaris LM3S6000 series combines both a 10/100 Ethernet Media Access Control (MAC) and Physical (PHY) layer, marking the first time that integrated connectivity is available with an ARM Cortex-M3 MCU and the only integrated 10/100 Ethernet MAC and PHY available in an ARM architecture MCU. The LM3S6965 microcontroller is targeted for industrial applications, including remote monitoring, electronic point-of-sale machines, test and measurement equipment, network appliances and switches, factory automation, HVAC and building control, gaming equipment, motion control, medical instrumentation, and fire and security. For applications requiring extreme conservation of power, the LM3S6965 microcontroller features a battery-backed Hibernation module to efficiently power down the LM3S6965 to a low-power state during extended periods of inactivity. With a power-up/power-down sequencer, a continuous time counter (RTC), a pair of match registers, an APB interface to the system bus, and dedicated non-volatile memory, the Hibernation module positions the LM3S6965 microcontroller perfectly for battery applications. 
-In addition, the LM3S6965 microcontroller offers the advantages of ARM's widely available development tools, System-on-Chip (SoC) infrastructure IP applications, and a large user community. Additionally, the microcontroller uses ARM's Thumb®-compatible Thumb-2 instruction set to reduce memory requirements and, thereby, cost. Finally, the LM3S6965 microcontroller is code-compatible to all members of the extensive Stellaris family; providing flexibility to fit our customers' precise needs. The datasheet can be found at {{proiecte:lm3s6965.pdf}}+In addition, the LM3S6965 microcontroller offers the advantages of ARM's widely available development tools, System-on-Chip (SoC) infrastructure IP applications, and a large user community. Additionally, the microcontroller uses ARM's Thumb®-compatible Thumb-2 instruction set to reduce memory requirements and, thereby, cost. Finally, the LM3S6965 microcontroller is code-compatible to all members of the extensive Stellaris family; providing flexibility to fit our customers' precise needs."" This info and more can be found in the datasheet at {{proiecte:lm3s6965.pdf}}
  
-===  STM32-P103  ===+==  STM32-P103  ==
 {{proiecte:stm32-p103.jpg}} {{proiecte:stm32-p103.jpg}}
-STM32-P103 board is development board which allows you to explore thee features of the ARM Cortex M3 STM32F103RBT6 microcontroller produced by ST Microelectronics Inc. The board has SD/MMC card connector and allows USB Mass storage device demo to be evaluated. The RS232 driver and connector allows USB to Virtual COM port demo to be evaluated. The CAN port and driver allows CAN applications to be developed. The UEXT connector allows access to all other UEXT modules produced by OLIMEX (like MOD-MP3, MOD-NRF24LR, MOD-NOKIA6610, etc) to be connected easily. In the prototype area the customer can solder his own custom circuits and interface them to USB, CAN, RS232 etc. The datasheet can be found at {{proiecte:stm32-p103.pdf}}+""STM32-P103 board is development board which allows you to explore thee features of the ARM Cortex M3 STM32F103RBT6 microcontroller produced by ST Microelectronics Inc. The board has SD/MMC card connector and allows USB Mass storage device demo to be evaluated. The RS232 driver and connector allows USB to Virtual COM port demo to be evaluated. The CAN port and driver allows CAN applications to be developed. The UEXT connector allows access to all other UEXT modules produced by OLIMEX (like MOD-MP3, MOD-NRF24LR, MOD-NOKIA6610, etc) to be connected easily. In the prototype area the customer can solder his own custom circuits and interface them to USB, CAN, RS232 etc."" This info and more can be found in the datasheet at {{proiecte:stm32-p103.pdf}} 
 + 
 + 
 +=== Cortex M4 === 
 +== STM32-F4 Discovery == 
 +{{proiecte:stm32-f407.jpeg}} 
 + 
 + 
 +""The STM32F4DISCOVERY Discovery kit allows users to easily develop applications with the STM32F407VG high performance microcontroller with the ARM ® Cortex ® -M4 32-bit core. It includes everything required either for beginners or for experienced users to get quickly started. Based on STM32F407VG, it includes an ST-LINK/V2 or ST-LINK/V2-A embedded debug tool, two ST-MEMS digital accelerometers, a digital microphone, one audio DAC with integrated class D speaker driver, LEDs, push buttons and a USB OTG micro-AB connector."" This info and more can be found in the datasheet at {{proiecte:stm32-f407.pdf}}
 ==== Physical Devices ==== ==== Physical Devices ====
 {{proiecte:ubuntu-logo.png}} {{proiecte:ubuntu-logo.png}}
Line 56: Line 65:
   * Xen Hosting - QEMU is involved only in the emulation of hardware; the execution of the guest is done within Xen and is totally hidden from QEMU.   * Xen Hosting - QEMU is involved only in the emulation of hardware; the execution of the guest is done within Xen and is totally hidden from QEMU.
  
-We used the System emulation operating mode.+We used the System emulation operating mode. For Cortex-M4 I used a fork from qemu [[https://gnu-mcu-eclipse.github.io/qemu/]]
 ===== Setup ===== ===== Setup =====
 ==== Requirements ==== ==== Requirements ====
Line 80: Line 89:
 </file> </file>
  
 +4. qemu gnu muc eclipse
 +<file>
 +sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf libncurses5-dev libtool libusb-dev libusb-1.0.0-dev
 +sudo apt-get install libgmp-dev libgmp3-dev libmpfr-dev libmpc-dev texinfo
 +sudo apt-get install opencd
 +sudo apt-get install docker
 +rm -rf ~/Downloads/qemu-build.git
 +git clone --recurse-submodules https://github.com/gnu-mcu-eclipse/qemu-build.git ~/Downloads/qemu-build.git
 +bash ~/Downloads/qemu-build.git/scripts/build.sh preload-images
 +</file>
  
 ==== Qemu ==== ==== Qemu ====
  
 To debug and create the entire functionalities for our machines you need the source code for Qemu. To debug and create the entire functionalities for our machines you need the source code for Qemu.
-I used a version of Qemu that is targeting the arm devices and stm32 boards.+I used a version of Qemu which is targeting the arm devices and stm32 boards.
 <file> <file>
 git clone https://github.com/beckus/qemu_stm32.git qemu-arm git clone https://github.com/beckus/qemu_stm32.git qemu-arm
Line 150: Line 169:
 git clone https://bitbucket.org/nuttx/apps.git apps git clone https://bitbucket.org/nuttx/apps.git apps
 </file> </file>
-Another module can be found at [[https://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.19/NxWidgets-1.19.tar.gz/download | The nx module]] It is the graphic module+Nx module was moved in the apps repository. If you want an older version, you can find it at  [[https://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.19/NxWidgets-1.19.tar.gz/download | The nx module]].
  
 <file> <file>
Line 165: Line 184:
 <file> <file>
 ./configure.sh lm3s6965-ek/nsh ./configure.sh lm3s6965-ek/nsh
 +</file>
 +
 +
 +for stm32-f4discovery:
 +<file>
 +./configure.sh stm32f4discovery/nsh
 </file> </file>
  
Line 187: Line 212:
  
  
- +==== Qemu MCU Eclipse ==== 
 +First you need to build for the first time 
 +<file> 
 +bash ~/Downloads/qemu-build.git/scripts/build.sh --linux64 --develop --debug 
 +</file> 
 +Now in your home directory you have an directory called Work and in inside a folder called qemu-REALEASE_VERSION. It depends on your release version. The executable is located at ~/Work/qemu-REALEASE_VERSION/install/centos64/qemu/bin/qemu-system-gnuarmeclipse. The code that is being build is located at ~/Work/qemu-REALEASE_VERSION/qemu.git. You can modify as you want this code and after you can reuse the command shown before for building the new code. I made a fork with some USART implementation for the devices at https://github.com/sdcioc/qemu. 
 ===== Run ===== ===== Run =====
 for running the machine(stm32-p103/lm3s6965) on Qemu with gdb debuging(-s)  for running the machine(stm32-p103/lm3s6965) on Qemu with gdb debuging(-s) 
 <file> <file>
 ./qemu-arm/arm-softmmu/qemu-system-arm -M stm32-p103 -kernel ./nuttx_env/nuttx/nuttx.bin -s ./qemu-arm/arm-softmmu/qemu-system-arm -M stm32-p103 -kernel ./nuttx_env/nuttx/nuttx.bin -s
 +</file>
 +for running the machine(stm32-f407) on Qemu with gdb debuging(-s) 
 +<file>
 +~/Work/qemu-REALEASE_VERSION/install/centos64/qemu/bin/qemu-system-gnuarmeclipse  -M STM42F4-Discovery -kernel ./nuttx_env/nuttx/nuttx.bin --cpu cortex-m4 -s --serial pty --serial pty --serial pty --serial pty  --serial pty --serial pty --serial pty --serial pty --serial pty --serial pty -S
 </file> </file>
 After you can use the elf file from directory to use gdb After you can use the elf file from directory to use gdb
Line 204: Line 237:
  
 ===== Extra ===== ===== Extra =====
-====Add you own app====+====Add a new machine in qemu==== 
 +For Qemu MCU Eclipse for the stm32 type machine you can find a template in gnu-mcu-eclpise/develop/template 
 +====Add a new machine in nuttx==== 
 +if you want to add a new machine to nuttx the next tutorial it can help you [[http://www.nuttx.org/Documentation/NuttxPortingGuide.html]] 
 +====Add you own app to nuttx====
 Use the template for app nuttx_env/apps/examples/hello Use the template for app nuttx_env/apps/examples/hello
 and after use the menuconfig to add the app from Aplication configuration/Examples/YOUR_APP and after use the menuconfig to add the app from Aplication configuration/Examples/YOUR_APP
Line 211: Line 248:
 https://cristovaorufino.wordpress.com/2014/01/14/compiling-nuttx-for-stm32f4discovery/ https://cristovaorufino.wordpress.com/2014/01/14/compiling-nuttx-for-stm32f4discovery/
 ====Network==== ====Network====
-http://www.zilogic.com/blog/building-nuttx.html+If you want to implement the stelaris ethernet follow [[http://www.zilogic.com/blog/building-nuttx.html]] 
 + 
 +====Other modules for stm32==== 
 +If you want to test different functionalitties for stm32-f4 discovery follow [[http://jeremyherbert.net/get/stm32f4_getting_started]]
 ===== Bibliography ===== ===== Bibliography =====
   - [[https://www.cnx-software.com/2012/03/08/how-to-build-qemu-system-arm-in-linux/]]   - [[https://www.cnx-software.com/2012/03/08/how-to-build-qemu-system-arm-in-linux/]]
proiecte/qemu.1542200407.txt.gz · Last modified: 2018/11/14 15:00 by stefan_dan.ciocirlan