I am having an olimex board LPC-2378STK (link to the site where information about the board is : www.olimex.com/.../index.html). I have a start up code LPC2300.s which the keil uvision generated. But it is getting stuck at a particular point while I am debugging using ulink debugger. I don't know what the problem is . Can any please give me working startup code for lpc2378 because I don't know how to debug a startup code. Can anyone please help me ,( I don't have enough time to study the startup code and generate it myself since my deadline is fast approaching Thankyou....
What point?
What have you done to find out why it's hanging there? ie, what have you done to Debug it?
For examples of startup files, take a look at the projects provided in your Keil\ARM\Boards and Keil\ARM\Examples folder trees...
If it's a hardware dependency on the Olimex board, take a look at the examples provided by Olimex. Call Olimex support.
Thank you neil for your quick reply . I was stuck at this point for two days. It is getting stuck at a particular point , I am not able to tell you exactly right now. I will post the exact point tomorrow.
I am a beginner so I don't know how to debug a start up code. Can you help me. Or can you suggest any study materials or books. I didn't do much preparation since I am running short of time. Once again thank you neil
Unfortnately, preparation is key to success!
To debug startup code, you need to uncheck 'Run to main' in the project debug options. Then you can step through the startup code...
Thank You very much . I will try that and post my progress.
U0FCR = 0x07; /* Enable and reset TX and RX FIFO. */
This is a portion of code in UARTInit() function which is initializing the UART of the ucontroller. I am using keil uvision3. But the simulator shows the value of U0FCR after stepping through this line as 0XC1 instead of 0x07.
What might be the problem? can anyone please help me?
Because after this line I am trying to write data to U0THR in my UARTSend() function where no value is coming on U0THR. ( U0THR = 0X05; //writing value to U0THR).
I am using keil uvision3. But the simulator shows the value of U0FCR after stepping through this line as 0XC1 instead of 0x07.
And are you sure that's not exactly what you should get from reading that register? Did you check back with the data sheet?
It is not uncommon that the bits returned when reading a register are different from the bits affected by writing that register.
It is also not uncommon that writing a certain bit may affect the values read-back from other bits.
The only way to know, as previously mentioned, is by careful study of the datasheet...
I checked the datasheet , when I was not able to get anything I posted it here. I actually read the user manual lpc23xx_um. where the bits 0,1,2 U0FCR are FIFO enable,RX and TX FIFO RESET respectively. I have to do this in UARTInit() ie during UART initialization. so I am writing 0x07 to U0FCR. But instead value coming on U0FCR is 0xC1. But I am not able to figure out the reason.
These informations are available on usermanual pages 411 and 412. Thank You for the response.
I also had same problem when i use USB Examples in LPC2378. I use UART and Terminal to trace USB operation. when i send char, terminal show uncorrect character.
My solution is use startup code of Blinky example. However, i think some other problems will invoke which i can predict. At moment, i don't get any error in my firmware.
View all questions in Keil forum