This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Interrupt and IO-device driver
- To: Daniel Lind <daniel dot lind at sth dot frontec dot se>
- Subject: Re: [ECOS] Interrupt and IO-device driver
- From: Jesper Skov <jskov at redhat dot com>
- Date: 18 Oct 2000 15:47:06 +0200
- Cc: ecos-discuss at sourceware dot cygnus dot com
- References: <39ED54A6.6B90D0FB@bluelabs.se>
>>>>> "Daniel" == Daniel Lind <daniel.lind@sth.frontec.se> writes:
Daniel> Hi, I'm using PowerPC MBX860 and I'm trying to write a device
Daniel> driver for SCC2. Look bellow for the code.... The interrupts
Daniel> doesn't seem to work right. I have investigated SCCE[Tx] and
Daniel> this bit is set after a buffert is sent, so this is ok. I have
Daniel> also checked CIPR (CPM interrupt pending register) and this
Daniel> register tells me that an interrupt is pending on SCC2, this
Daniel> is also ok. After doing these tests I think that the problem
Daniel> is that I haven't initialized the interrupts in the right
Daniel> way.....ISR and DSR are never called.
Does the CPM arbiter in var_intr.c (hal_arbitration_isr_cpm) get
properly set up? It probably does if you selected the 860 variant.
Still, that's the only thing in the chain I can think of (off hand) as
being broken. Do the mpc8xx/intr0 test PASS on your board?
Daniel> void scc_uart_init_int(void){
Daniel> cyg_drv_interrupt_create(CYGNUM_HAL_INTERRUPT_CPM_SCC2,
Daniel> CYGARC_SIU_PRIORITY_HIGH, (cyg_addrword_t) &buffers,
Daniel> scc_uart_ISR, scc_uart_DSR, &serial_interrupt_handle,
Daniel> serial_interrupt);
Daniel> cyg_drv_interrupt_attach(serial_interrupt_handle);
Daniel> cyg_drv_interrupt_unmask(CYGNUM_HAL_INTERRUPT_CPM_SCC2); }
Also please verify that the CPM interrupt is unmasked properly (it
would be if the intr0 test PASSes).
Finally, you should try to enable assertions (enable
CYGDBG_USE_ASSERTS and CYGPKG_INFRA_DEBUG) to catch any unhandled
interrupts.
Jesper