[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] qemu ARM semihosting

From: Martin
Subject: [Qemu-discuss] qemu ARM semihosting
Date: Fri, 26 Apr 2013 18:37:25 +0200

I'm Qemu and ARM newbie. My understanding of semihosting is that I can use for 
example printf("Hello, world!); function in my ARM code and Qemu will print the 
text to console. I would like to use semihosting for debugging purpose and use 
printf stuff. I've written simple C code, hopefully setup correct link script a 
generate binary file for ARM Cortex-M3.
#include <stdio.h>
#ifndef __NO_SYSTEM_INIT
void SystemInit()

void main()
  unsigned int a;
  unsigned int b;
  unsigned int c;

  c = 10;
  for (a=0; a < 10; a++) {
    b = a + c;
    c = b + 1;
  printf("Hello, world!");
  for (;;);
I'm sure that generated binary file is correct and running in Qemu because I 
can use gdb and qemu together to succesfully debug this code. I can see correct 
variable values and even debug the assembler. All inside including the asembler 
make sense and works. I've checked that there is BKPT 0xAB in assembler which 
should be appropriate code to use semihosting functions. I haven't check 
registers value before BKPT 0xAB to be sure they are correct.
But nothing has been printed to windows command line. I would expect that when 
I call qemu-system-armw.exe -M lm3s6965evb -semihosting -kernel 
c:\arm\example\c\minimum.bin then I will see `Hello, world!` in console. I'm 
forced to use windows environment, therefore I downloaded precompiled qemu 
binaries Qemu-1.3.1-windows.zip from http://lassauge.free.fr/qemu/.
Am I completely wrong? Did I miss any basic semihosting idea? Should my 
approach work? Any Ideas why I don't see text in windows command line? Is 
anywhere some binary file for ARM Cortex-M3 using semihosting which I can try 
to see if qemu prints something to console?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]