LPC23xx, GCC and UART0 ISR not responding

Guest #1780721
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
}
Guest
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.
Guest
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.

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.