FreeRTOS-Kernel/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC
alfred gedeon 41237e01d0
Split networking from posix and qemu mps2 demos (#455)
Split networking from posix and qemu mps2 demos
2020-12-12 16:29:23 -08:00
..
CMSIS Qemu mps2 networking (#439) 2020-12-03 23:44:57 -08:00
init Qemu mps2 networking (#439) 2020-12-03 23:44:57 -08:00
scripts Qemu mps2 networking (#439) 2020-12-03 23:44:57 -08:00
FreeRTOSConfig.h Split networking from posix and qemu mps2 demos (#455) 2020-12-12 16:29:23 -08:00
main.c Split networking from posix and qemu mps2 demos (#455) 2020-12-12 16:29:23 -08:00
main_blinky.c Split networking from posix and qemu mps2 demos (#455) 2020-12-12 16:29:23 -08:00
Makefile Split networking from posix and qemu mps2 demos (#455) 2020-12-12 16:29:23 -08:00
Readme.md Split networking from posix and qemu mps2 demos (#455) 2020-12-12 16:29:23 -08:00
syscall.c Qemu mps2 networking (#439) 2020-12-03 23:44:57 -08:00

Emulating MPS2 Cortex M3 AN385 on QEMU

Requirements

  1. GNU Arm Embedded Toolchain download here
  2. qemu-arm-system download here
  3. Make (tested on version 3.82)
  4. Linux OS (tested on Ubuntu 18.04)

How to download

Navigate to a parent directory of your choice and run the following command

$ git clone https://github.com/FreeRTOS/FreeRTOS.git --recurse-submodules --depth 1

The previous command should create a directory named FreeRTOS

Blinky Demo

How to build blinky demo

Navigate with the command line to FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC For a release build run:

$ export PATH=/path/to/arm/toolchain:$PATH
$ make

For a versions with debugging symbols and no optimizations -O0, run:

$ make DEBUG=1

How to run the blinky demo

run:

$ sudo qemu-system-arm -machine mps2-an385 -monitor null -semihosting \
        --semihosting-config enable=on,target=native \
        -kernel ./build/RTOSDemo.axf \
        -serial stdio -nographic

Blinky Demo Expectations

after running the blinky demo you shoud see on the screen the word blinking printed continuously

How to start debugging

  1. gdb

Append the -s and -S switches to the previous command (qemu-system-arm)
-s: allow gdb to be attached to the process remotely at port 1234
-S: start the program in the paused state

run: (make sure you build the debug version)

$ arm-none-eabi-gdb -q ./build/RTOSDemo.axf

(gdb) target remote :1234
(gdb) break main
(gdb) c