From: Frikkie Thirion <696094@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 696094] [NEW] TI Stellaris lm3s811evb (ARM Cortex-M3) : Systick interrupt not working
Date: Fri, 31 Dec 2010 20:30:43 -0000 [thread overview]
Message-ID: <20101231203043.711.86363.malonedeb@potassium.ubuntu.com> (raw)
In-Reply-To: 20101231203043.711.86363.malonedeb@potassium.ubuntu.com
Public bug reported:
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 command 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 = qdev_create(NULL, "armv7m_nvic");
env->nvic = nvic;
qdev_init_nofail(nvic);
- Configure the programmable interrupt controller:
Call: arm_pic_init_cpu()
qemu_allocate_irqs(arm_pic_cpu_handler)
- 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_cpu_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_interrupt()
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: 0fcec41eec0432c77645b4a407d3a3e030c4abc4
The project files are attached, for reproducing of the errors.
Note: The CMSIS wants to perform byte accesses to the NVIC. For the Cortex-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=gdbCommands_tui
(s = step, n = next, c = continue, Ctrl-C = stop, print <variable> to look at variable contents)
** Affects: qemu
Importance: Undecided
Status: New
--
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 command 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 = qdev_create(NULL, "armv7m_nvic");
env->nvic = nvic;
qdev_init_nofail(nvic);
- Configure the programmable interrupt controller:
Call: arm_pic_init_cpu()
qemu_allocate_irqs(arm_pic_cpu_handler)
- 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_cpu_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_interrupt()
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: 0fcec41eec0432c77645b4a407d3a3e030c4abc4
The project files are attached, for reproducing of the errors.
Note: The CMSIS wants to perform byte accesses to the NVIC. For the Cortex-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=gdbCommands_tui
(s = step, n = next, c = continue, Ctrl-C = stop, print <variable> to look at variable contents)
next parent reply other threads:[~2010-12-31 20:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-31 20:30 Frikkie Thirion [this message]
2010-12-31 20:30 ` [Qemu-devel] [Bug 696094] Re: TI Stellaris lm3s811evb (ARM Cortex-M3) : Systick interrupt not working Frikkie Thirion
2011-08-01 10:16 ` ARUNKUMAR VASUDEVAN
2011-12-16 19:28 ` Sebastian Huber
2011-08-01 10:26 ` ARUNKUMAR VASUDEVAN
2011-08-01 11:28 ` Peter Maydell
2011-12-11 16:56 ` Petteri Aimonen
2011-12-11 18:57 ` Peter Maydell
2011-12-15 18:56 ` Peter Maydell
2011-12-18 14:25 ` Peter Maydell
2017-11-06 11:40 ` Peter Maydell
2017-11-07 17:02 ` Peter Maydell
2017-12-15 16:15 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101231203043.711.86363.malonedeb@potassium.ubuntu.com \
--to=696094@bugs.launchpad.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.