This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

keil uvision5 hex problem

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

Parents
  • 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.

Reply
  • 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.

Children
No data