From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4m6v-0007hK-N4 for qemu-devel@nongnu.org; Wed, 21 Apr 2010 22:25:49 -0400 Received: from [140.186.70.92] (port=38484 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4m6s-0007hC-O4 for qemu-devel@nongnu.org; Wed, 21 Apr 2010 22:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4m6q-0003Ac-Cf for qemu-devel@nongnu.org; Wed, 21 Apr 2010 22:25:46 -0400 Received: from mail-bw0-f211.google.com ([209.85.218.211]:41065) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4m6q-0003AP-80 for qemu-devel@nongnu.org; Wed, 21 Apr 2010 22:25:44 -0400 Received: by bwz3 with SMTP id 3so7407623bwz.11 for ; Wed, 21 Apr 2010 19:25:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4b94fe2a1003140656q1cf408e7y9f0d20715a5fb38d@mail.gmail.com> References: <4b94fe2a1003140656q1cf408e7y9f0d20715a5fb38d@mail.gmail.com> Date: Thu, 22 Apr 2010 04:25:43 +0200 Message-ID: Subject: Re: [Qemu-devel] Cortex m3 initialisation From: andrzej zaborowski Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Bagland Cc: qemu-devel@nongnu.org On 14 March 2010 15:56, Benjamin Bagland wrote: > Hi, > > I'm having an issue while trying to use the lm3s811 board emulation with > qemu 0.12.3 or git. It works fine however with qemu-0.11.1. > > The problem comes from hw/armv7m.c, around line 231, the initial PC and SP > are set by reading from physical memory, however the rom data is not copied > in physical memory until the reset later on in the initialisation (comes > from commit 45a50b1668822c23afc I think). Since the initial PC is invalid, > the cpu goes straight into UsageFault instead of going to the proper reset > routine. > > I've made a small patch to read from rom instead of physical memory, that > fixes the issue with my test program but I'm not sure if it's the proper > thing to do, or even if it works with other arm boards. The patch seems to be generated on top of some code that is not in the repository, but in short, I think both loading the kernel, roms, and setting of pc and sp should be done only on reset. There's probably a bootloader somewhere that sets the pc and sp on real hw. Cheers