ARM Interrupts
Manne Tallmarken
mannet at kth.se
Mon Jul 11 02:34:39 UTC 2011
I was wrong about the clock tick driver, it apparently exist because it works now.
What was my problem from the beginning was that I got spammed about "spurious interrupts: 0", so first I thought it was about the clock tick driver.
After some time tracking what was wrong, I found that there is something wrong with the Advanced Interrupt Controller.
I have configured it with an interrupt mask 0x2, so no matter what, if I get an interrupt, it must be from source 1.
However, if I put a breakpoint at the irq exception vector and read the interrupt status register when it stops, it tells me the interrupt source is 0.
To see what was happening, I hardwired the variable "vector" to 1 (correct for the system timer) inside the bsp_interrupt_dispatch routine... and my program worked... but now I can't access the other interrupts, obviously.
summary of debugging the at91rm9200:
* mask out interrupts from source 1 only (system timer)
(set *0xfffff124=0xffffffff)
(set *0xfffff120=0x2)
* clear all interrupts
(set *0xfffff128=0xffffffff)
* breakpoint at irq exception vector
(hbreak *0x18)
* program stops, reading that source is 0
(p/x *0xfffff108 returns 0)
The microcontroller says 1=0. Why?
-Manne
________________________________________
From: Gedare Bloom [gedare at gwmail.gwu.edu]
Sent: Sunday, July 10, 2011 20:32
To: Manne Tallmarken
Cc: rtems-users at rtems.org
Subject: Re: ARM Interrupts
You probably want to copy from an ARM-based board instead of the
no_cpu template. You have the right interpretation of set_vector: it
just sets the jump in the interrupt table directly to the handler, as
opposed to vectoring through RTEMS interrupt handling (which supports
nesting interrupts and creates an environment to execute C code).
I don't use the ARM cpus much, so I cannot speak to what does or
doesn't work, or rather how the ARM BSPs install ISRs.
-Gedare
On Sun, Jul 10, 2011 at 2:06 PM, Manne Tallmarken <mannet at kth.se> wrote:
> Hello people,
>
> First of all, I am pretty new to RTEMS and currently I am working with BSP development to a board (kb9202) with an at91rm9200 cpu.
>
> What I need to get working is the clock driver and I feel a bit lost in where to add the code to get it nice. My approach is the following:
>
> Copy and modify the code from no_bsp/clock/ckinit.c
> Now, that file makes a call to set_vector
> => need to write that function
>
> Copy and modify the code from no_bsp/startup/setvec.c
> Now, I need to install non-RTEMS ISRs as "raw" interrupts (my interpretation of "raw" interrupts is putting pointers in the interrupt controller inside the uC)
> => seems like the RTEMS-way of doing this is to call _CPU_ISR_install_raw_handler, but that function does not exist for the arm
> => need to add that function to rtems-4.10.0/cpukit/score/cpu/arm/cpu.c.
>
> When looking in cpukit/score/cpu/no_cpu/cpu.c, _CPU_ISR_install_vector makes a call to _CPU_ISR_install_raw_handler so maybe I need to add that call to the arm file as well (but then I don't know if I need to do more modifications).
>
> But wait! Now it's not BSP-development anymore, it's about porting basic functions to the ARM cpu.
> Have I missed something?
> What is the correct way of adding a clock tick driver for this cpu?
>
> Regards,
> Manne
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>
More information about the users
mailing list