EmbDev.net

Forum: ARM programming with GCC/GNU tools LPC23xx, GCC and UART0 ISR not responding


von Christian (Guest)


Rate this post
useful
not useful
Hello,

i'm new to ARM7 and i'm trying to build a application using freertos and 
an interrupt driven uart (uart0 in my case). Unfortunately the isr is 
not called (THRE and RX).
But if i set VICSoftInt the ISR is called.
1
 VICSoftInt = 0x40;


Can anyone point me to a probable cause? Did imiss setting a certain 
register?

I use the current codesourcery toolchain for linux.

UART init:
1
/* Constants to setup and access the UART. */
2
#define serDLAB              ( ( unsigned char ) 0x80 )
3
#define serENABLE_INTERRUPTS      ( ( unsigned char ) 0x03 )
4
#define serNO_PARITY          ( ( unsigned char ) 0x00 )
5
#define ser1_STOP_BIT          ( ( unsigned char ) 0x00 )
6
#define ser8_BIT_CHARS          ( ( unsigned char ) 0x03 )
7
#define serFIFO_ON            ( ( unsigned char ) 0x01 )
8
#define serCLEAR_FIFO          ( ( unsigned char ) 0x06 )
9
#define serWANTED_CLOCK_SCALING      ( ( unsigned long ) 16 )
10
11
/* Constants to setup and access the VIC. */
12
#define serUART0_VIC_CHANNEL      ( ( unsigned long ) 0x0006 )
13
#define serUART0_VIC_CHANNEL_BIT    ( ( unsigned long ) 0x0040 )
14
#define serUART0_VIC_ENABLE        ( ( unsigned long ) 0x0020 )
15
16
void init()
17
{
18
.............
19
      /* Setup the baud rate:  Calculate the divisor value. */
20
            ulWantedClock = ulWantedBaud * serWANTED_CLOCK_SCALING * 4;  // * 4 because of PCLK_UART0
21
      ulDivisor = configCPU_CLOCK_HZ / ulWantedClock;
22
23
      /* Set the DLAB bit so we can access the divisor. */
24
      U0LCR |= serDLAB;
25
26
      /* Setup the divisor. */
27
      U0DLL = ( unsigned char ) ( ulDivisor & ( unsigned long ) 0xff );
28
      ulDivisor >>= 8;
29
      U0DLM = ( unsigned char ) ( ulDivisor & ( unsigned long ) 0xff );
30
31
      /* Turn on the FIFO's and clear the buffers. */
32
      U0FCR = ( serFIFO_ON | serCLEAR_FIFO );
33
34
      /* Setup transmission format. */
35
      U0LCR = serNO_PARITY | ser1_STOP_BIT | ser8_BIT_CHARS;
36
37
      /* Enable UART0 interrupts. */
38
      U0IER = serENABLE_INTERRUPTS; //RBR and THR IRQ
39
40
      /* initialize VIC */
41
      VICIntEnClr  = 0xffffffff;
42
      VICVectAddr  = 0x00000000;
43
      VICIntSelect = 0x00000000; /* all IRQ */
44
45
      /* Setup the VIC for the UART. */
46
      VICIntSelect &= ~( serUART0_VIC_CHANNEL_BIT ); //IRQ, not FIQ
47
      VICIntEnClr = serUART0_VIC_CHANNEL_BIT;
48
      VICVectAddr6 = ( long ) vUART_ISR_Handler;
49
      VICVectCntl6 = 0xF; //Prio
50
      VICIntEnable |= serUART0_VIC_CHANNEL_BIT;
51
52
..........
53
}

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
IRQs enabled on core-level? See core documentation: CPSR, I-Bit.

von Christian (Guest)


Rate this post
useful
not useful
Hi Martin,

thank you. I will have a look at the core documentation. The CPSR access 
is handled by freertos. I will ad some debug code and hope that i find 
the problem.

von Christian (Guest)


Rate this post
useful
not useful
Now the ISR is responding. I made some mistakes in the freertos 
configuration (stack too small and one queue was too big).

The ISR works, the ticks work, but receiving characters from the serial 
queue does not work yet.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.