denizzzka / d_c_arm_test

C + D + dpp + libopencm3 + freertos test project
14 stars 4 forks source link

How to run #7

Open denizzzka opened 3 years ago

denizzzka commented 3 years ago

Prepare build directory:

$ meson setup --cross-file arm_cortex_m3_cross.ini --debug --buildtype=debug builddir 

How to run unittests:

Automatically by Meson:

$ cd builddir
$ meson test

Manually:

$ qemu-system-arm -machine mps2-an511 -nographic -semihosting -s -S -kernel firmware.elf

QEMU will wait for gdb connection.

Then connect by GDB to QEMU for debug of this binary:

$ gdb-multiarch --init-eval-command="set architecture armv7e-m" --init-eval-command="target remote localhost:1234" firmware.elf

Happy hacking!

denizzzka commented 3 years ago

If you want to build binary for run app.d main() just comment out --unittest line from arm_cortex_m3_cross.ini file. (Meson testing facility is not convient to use for now. See more: https://github.com/mesonbuild/meson/issues/7880)