I am using keil uv5 but hex file created is only of 4kb even though i have written enough program and i am using lpc2138 and it happens for every program I write so I am unable to load my program in my microcontroller
You didn't supply much information. So what does the tools write in the output window when you build? One piece of information formation would be the amount of code and data.
Everything is working fine only the problem is the hex file the size of hex file is less as compared to uv4 Hex file create in Uv5 is of 4kb while in Uv4 is of 48kb I am using flash magic to upload my hex file. but I am not getting desired output. Actually I think the hex file is blank.
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'Target 1' compiling uart.c... linking... Program Size: Code=740 RO-data=16 RW-data=0 ZI-data=96 FromELF: creating hex file... ".\Objects\uart.axf" - 0 Error(s), 0 Warning(s). Build Time Elapsed: 00:00:08
this is the output I get after I build my program
Exactly why have you started this thread?
You write: "Everything is working fine only the problem is the hex file"
Why do you think you have a problem with the hex file?
Didn't you notice that the compiler output said: "Program Size: Code=740 RO-data=16 RW-data=0 ZI-data=96"
That's a tiny program, so why should you get a larger hex file? You don't need a 48kB hex file to store 740 bytes of code, and 16 bytes of read-only data.
740 bytes of code requires 1480 bytes of hex data. 16 bytes of data (assuming no compression) requires 32 bytes of hex data.
There is a bit of overhead in a hex file with checksums, addresses, record types etc, but no problem at all to fit the above in a 4kB hex file.
So stop looking at the hex file and suspect it of being empty or broken. It isn't.
Is 740 bytes of code a reasonable size? I don't know. No one here knows what source code you have supplied to the compiler.
Create a map file and look at it - it tells you exactly what is included in the produced output file.
You wouldn't be using the free Evaluation - or "Lite" - version, would you?
I seem to remember that older Evaluation versions used to insert a load of dummy padding ...
Yes I am using Lite version
This is the basic Led blinking program i am using
The hex file created for this program in Uv4 is running fine and I am getting the output
While the hex file for same program in Uv5 is not running properly I am not getting anything as output the Leds are not blinking
#include <LPC214X.H>
void delay_ms(unsigned int); int main() {
VPBDIV = 0X00; //PERIPHERAL CLOCK FREQ = 15MHZ IO0DIR = 0X00FF0000; // SET PORT DIRECTION I/O PINSEL1 = 0X00000000; // PORT PIN CONFIGURATION AS A GPIO (P0.16 TO P0.31)
while(1) {
IO0SET = 0X00FF0000; delay_ms(2000); IO0CLR = 0X00FF0000; delay_ms(2000); }
} void delay_ms(unsigned int value ) { unsigned int i; value = value * 15000; for(i=0;i<value;i++); }
1) That's a tiny program, so why expect a large hex file?
2) Your source file is uart.c. But the source code doesn't seem to relate to any UART.
3) Are you sure you have any LED on the specific pins?
4) How have you verified that the program gets downloaded correctly?
5) How have you verified what happens on the relevant port pins?
6) How do you know if the processor leaves the reset state?
7) How do you know the processor doesn't stays in the boot loader?
8) Have you verified all project settings?
9) Any other observations you have made, that is actually relevant to your problem and not related to your assumptions about size of produced hex file?