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
*** 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.