In my (un-optimised) Debug LPC1768 application I have create the following
#define DLAB 0x00000080UL // Divider Latches Access Bit
#define U1LCR (volatile U32*)0x4001000CUL // UART1 Line Control Register
*U1LCR = *U1LCR | (U32)DLAB;
The problem I have is that U1LCR bit 7 does not get set.
When debugging I see the following assembly for this function.
Stepping through, r3 gets the correct value of 0x00000008 but it is stored to an undefined location held in r2.
r2 is not initialised anywhere and contains 0xFFFFFFFF
4B05 ldr r3, 0x000011AC
4B06 ldr r3, 0x000011B0
681B ldr r3, [r3]
F0430380 orr r3, r3, #0x80
6013 str r3, [r2]
What am I doing wrong.
Please sign in to leave a comment.