This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ISR / DSR debugging


I am trying to get an ISR+DSR working with no avail.

I have a setup where I am loading my application onto a board that has Redboot, via gdb over the ethernet connection.

When the application starts up:

I have a diag_printf() in the hal_IRQ_handler() and can see that the clock tick ISR is working fine.

When my interrupt occurs (via a pushbutton) I can see the vector # being returned in the hal_IRQ_handler() but I don't see the ISR or DSR diag_printf() getting called.
Also at this point the application locks up (I really don't know where it is as I don't have any debugging at this point).


It looks like the ISR / DSR that I've created and attached isn't getting called.

Any suggestions on how I should try and debug this?

Thanks!

Here are some code pieces for the ISR & DSR and initialization.

static cyg_interrupt int1;
static cyg_handle_t int1_handle;

cyg_uint32 gpio_isr(cyg_vector_t vector, cyg_addrword_t data) {
    diag_printf("gpio_isr()\n");


cyg_interrupt_mask(vector); cyg_interrupt_acknowledge(vector);

return (CYG_ISR_HANDLED | CYG_ISR_CALL_DSR); // Run the DSR
}
void gpio_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) {
diag_printf("gpio_dsr()\n");
intr_count++;


    // !!! just clear PortB:0 for now
    *GPIOBEOI = 0x1;

    // !!! clear the bit(s)
    //cyg_interrupt_unmask(vector);
}
void cyg_user_start(void) {

gpioInit();

    cyg_vector_t int1_vector = CYGNUM_HAL_INTERRUPT_GPIO;
    cyg_priority_t int1_priority = 0;
    cyg_interrupt_create(int1_vector,
                         int1_priority,
                         (cyg_addrword_t) 0,
                         (cyg_ISR_t *) gpio_isr,
                         (cyg_DSR_t *) gpio_dsr,
&int1_handle,
&int1);

    cyg_interrupt_attach(int1_handle);
    cyg_interrupt_unmask(int1_vector);

    cyg_thread_create(4, gpio_thread, (cyg_addrword_t) 0, "gpio_thread",
            (void *) stack[0], STACKSIZE, &thread[0], &thread_obj[0]);
    cyg_thread_resume(thread[0]);
}




-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]