From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbGdO-0005bI-LM for qemu-devel@nongnu.org; Thu, 15 Dec 2011 14:06:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbGdN-0002d8-AN for qemu-devel@nongnu.org; Thu, 15 Dec 2011 14:06:26 -0500 Received: from indium.canonical.com ([91.189.90.7]:57566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbGdN-0002d2-3Q for qemu-devel@nongnu.org; Thu, 15 Dec 2011 14:06:25 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RbGdM-0006s2-Mo for ; Thu, 15 Dec 2011 19:06:24 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id AA7562E8056 for ; Thu, 15 Dec 2011 19:06:24 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 15 Dec 2011 18:56:42 -0000 From: Peter Maydell Sender: bounces@canonical.com References: <20101231203043.711.86363.malonedeb@potassium.ubuntu.com> Message-Id: <20111215185642.8948.43226.malone@chaenomeles.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 696094] Re: TI Stellaris lm3s811evb (ARM Cortex-M3) : Systick interrupt not working Reply-To: Bug 696094 <696094@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org NB: the attached project fails for me like this: qemu: hardware error: gic_dist_writeb: Bad offset d23 CPU #0: R00=3Dffffffff R01=3De000ed00 R02=3D000000e0 R03=3De000ed0b R04=3D00000000 R05=3D00000000 R06=3D00000000 R07=3D200004bb R08=3D00000000 R09=3D00000000 R10=3D00000000 R11=3D00000000 R12=3D00000000 R13=3D200004bb R14=3D000003bd R15=3D00000338 PSR=3D80000173 N--- T svc32 This is because we don't support byte wide accesses to the SHPR* registers. (The error message refers to the GIC because we currently map the whole of that area of address space as part of the GIC and then have it redirect some areas to code in arm7m_nvic.c. That should probably be cleaned up.) -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/696094 Title: TI Stellaris lm3s811evb (ARM Cortex-M3) : Systick interrupt not working Status in QEMU: New Bug description: I've tried to create a small project that uses the CMSIS as base library. The problem is that the SysTick_interrupt_handler() doesn't get executed = when the systick event is detected in QEMU. Furthermore, it seems asif QEMU= gets stuck in an endless loop. QEMU doesn't respond to Ctrl-C on the comma= nd line and the GDB session also stalls. 'kill -9' is the only way to stop = QEMU. It seems asif the initialisation of the NVIC works fine. I've traced the = function calls in QEMU as follows: stellaris.c: stellaris_init() - Perform generic armv7 init: armv7m_init() armv7m.c: armv7m_init() - Create and init the nvic: nvic =3D qdev_create(NULL, "armv7m_nvic"); env->nvic =3D nvic; qdev_init_nofail(nvic); - Configure the programmable interrupt control= ler: Call: arm_pic_init_cpu() = qemu_allocate_irqs(arm_pic_cpu_ha= ndler) - Initialise 64 interrupt structures. The following call sequence is observed when the systick event occur: armv7m_nvic.c: systick_timer_tick(): set pending interrupt armv7m_nvic.c: armv7m_nvic_set_pending() for irq:15 arm_gic.c: gic_set_pending_private(): GIC_SET_PENDING(15,) arm_gic.c: gic_update() - Raise IRQ with qemu_set_irq() irq.c: eqmu_set_irq() - Call the irq->handler = -- I assume the irq handler is 'arm_pic_cp= u_handler()', since that was passed as the parameter = when qemu_allocate_irqs() was called in ... arm_pic.c: arm_pic_cpu_handler() - After evaluation, call cpu_i= nterrupt() exec.c: cpu_interrupt() is called. = The tools that were used during the testing of this project: GCC: Codesourcery ARM eabi 2010q3 QEMU: Checked out on 31/12/2010 - Last commit: 0fcec41eec0432c77645b4a4= 07d3a3e030c4abc4 The project files are attached, for reproducing of the errors. Note: The CMSIS wants to perform byte accesses to the NVIC. For the Co= rtex-M3, unaligned 8 bit and 16 bit accesses are allowed. The current QEMU = implementation doesn't yet cater for it. As a work around, updated versions= of arm_gic.c armv7m_nvic.h armv7m_nvic.c is also included. Launch project with: go_gdb.sh Attach debugger with: arm-none-eabi-gdbtui --command=3DgdbCommands_tui (s =3D step, n =3D next, c =3D continue, Ctrl-C =3D stop, print to look at variable contents) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/696094/+subscriptions