We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all,
I'm using RTX and ADUC7020 processor and have a problem with the UART ISR routine where the ISR isn't triggering when UART data is sent to it.
In my main(), I have:
GP1DAT |= 0x8C000000; REFCON = 1; //Set Baud for 9600bps COMCON0 = 0x80; //Set DLAB to access COMDIV COMDIV0 = 0x88; //Low byte COMDIV1 = 0x00; //High Byte COMCON0 = 0x03; //clear DLAB and set serial for 8,N,1 COMIEN0 = 0x07; // enable interrupt when buffer is full during a reception. // enable interrupt when buffer is empty during a transmission // enable generation of an interrupt if any of COMSTA0[3:0] is set. IRQEN |= 0x4000;
In my rtx_config.c, I have changed the following from the default:
/*--------------------------- IRQ_Handler -----------------------------------*/ // User Interrupt Functions //extern __irq void IRQx (void); // User IRQx Function extern __irq void IRQy (void); // User IRQy Function //#define mIRQx 0x00000080 // User IRQx Mask #define mIRQy 0x00004000 // User IRQy Mask __asm void IRQ_Handler (void) { // Common IRQ Handler PRESERVE8 ARM STMDB SP!,{R0} ; Save R0 LDR R0,=__cpp((U32)&IRQSTA) ; Load IRQSTA Address LDR R0,[R0] ; Load IRQSTA Value // TST R0,#mIRQx ; Check IRQx Flag // LDMNEIA SP!,{R0} ; Restore R0 // LDRNE PC,=__cpp(IRQx) ; IRQx Function TST R0,#mIRQy ; Check IRQy Flag LDMNEIA SP!,{R0} ; Restore R0 LDRNE PC,=__cpp(IRQy) ; IRQy Function TST R0,#(SWI_BIT :OR: RTOS_TIMER_BIT) ; Check OS IRQ Flag LDMIA SP!,{R0} ; Restore R0 LDRNE PC,=__cpp(os_clock_interrupt) ; OS Clock IRQ Function LDR PC,=__cpp(os_def_interrupt) ; OS Default IRQ Function }
And finally, I have the ISR function that's also in the same source as main()
__irq void IRQy(void) { /*if (IRQSIG & 0x00000008) { timer1_handler(); }*/ if (IRQSIG & 0x00004000) { uart_handler(); // break point here } }
I have a break point on uart_handler() but it doesn't hit when I send UART data to it. I have a non RTX version that's configured the same and the break point hits everytime. Is there something I forgot to do? Any help is appreciated.
I apologize for not having all the information under one post. In the UV4 under Peripherals menu, both the Interrupt Controller and UART dialog are showing the UART interrupt is setup using RTX.
Here are some register values of interest when I paused the system while UART data is continuously sent to the ADUC7020:
IRQSIG: 0x00048004 IRQEN: 0x00004004 IRQSTA: 0x00000004
COMIEN0: 0x07 COMCON0: 0x03 COMSTA0: 0x60
Thanks, Shane