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

Total ROM Size in -map file doesn't include last byte of ROM, why?

Hello,

for crc calculation, I'm using the total ROM size out of the .map file.

To check, all code is included, I've added the total ROM size to my start address.

Then I saw, that I only get the address of the first byte of my last word, half word ....

I would expect to get the address of the last byte or the last byte plus some stuffing bytes to get an alignment of 4.

Do you know, why I get the address of the first byte (of my last word/half word....) if I'm adding the total ROM size to my start address?

Best regards,
klaus

Parents
  • Hello Ronan,

    thank you for your response.

    I'm using µVision Version 5.37 and an ST G4 controller.

    I'm deriving my data out of the .map file:

        Total ROM Size (Code + RO Data + RW Data)     146904 ( 143.46kB)
    

    There I also found my last placed data in ROM:

    Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20014078   0x080245d8   0x00000004   Data   RW         1875    RAM_DMA     yyy.o

    Now I would expect, to get the address of the last byte inside the ROM, by adding the total ROM size to my start address (0x08000800):

    146904 -> 0x00023dd8 (convert size to hex)

    0x08000800 + 0x00023dd8 = 0x80245D8 -> last byte?

    If I check the calculated last address of my ROM I'll get the start address of the last data (no matter if it's of size 1, 2, 3 or 4 bytes). But the last data is of size 4, so I would expect to get 0x80245DB as last byte.

    Maybe I made a mistake, a logical error, but I can't see it at the moment....

Reply
  • Hello Ronan,

    thank you for your response.

    I'm using µVision Version 5.37 and an ST G4 controller.

    I'm deriving my data out of the .map file:

        Total ROM Size (Code + RO Data + RW Data)     146904 ( 143.46kB)
    

    There I also found my last placed data in ROM:

    Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20014078   0x080245d8   0x00000004   Data   RW         1875    RAM_DMA     yyy.o

    Now I would expect, to get the address of the last byte inside the ROM, by adding the total ROM size to my start address (0x08000800):

    146904 -> 0x00023dd8 (convert size to hex)

    0x08000800 + 0x00023dd8 = 0x80245D8 -> last byte?

    If I check the calculated last address of my ROM I'll get the start address of the last data (no matter if it's of size 1, 2, 3 or 4 bytes). But the last data is of size 4, so I would expect to get 0x80245DB as last byte.

    Maybe I made a mistake, a logical error, but I can't see it at the moment....

Children