Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with interrupt (NVIC) #116

Open
LittleNewton opened this issue Feb 21, 2023 · 2 comments
Open

How to deal with interrupt (NVIC) #116

LittleNewton opened this issue Feb 21, 2023 · 2 comments

Comments

@LittleNewton
Copy link

LittleNewton commented Feb 21, 2023

Hi there.

Avatar2 worked very well when I made a software-defined peripheral and accessed it with MMIO (Memory Mapped I/O). The run trace is the same as it runs on a real board. P.S. This firmware contains no interrupt handling routine.

Nowadays, I have decided to try firmware with interrupt handling procedures. I am using the old method, a software-defined peripheral for the lack of real board. But quickly, I got a problem. NVIC, the ARM's nested vector interrupt controller, is the core of the problem.

The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors, 3rd Edition said that NVIC-related registers could be found in the system block, which is located from 0xE000E000 to 0xE000EFFF memory range. However, when I tried to modify nvic related registers mapped to this memory range, I found the memory write operation could not realize. Is this a problem for Qemu writing not in a privileged mode?

I have been stuck on this problem for several days. Could you give me an example of how to use avatar2 to trigger an external interrupt and jump to the interrupt service routine? Thanks a lot.

@rawsample
Copy link
Member

Hi!

Thanks for showing your interest in the avatar2 project.
The support for interrupts is only partial, you should find a start of answer in these two replies:

@albrecht-flo
Copy link
Contributor

@LittleNewton I am currently working on interrupt handing in Avatar2, maybe I can help you.

From your message I am assuming, you are running your firmware in QEMU without any hardware in the loop and a python peripheral to emulate the behavior of the board?

How are you accessing the NVIC registers, from the firmware itself or from Avatar2 using target.read/write_memory(...)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants