Skip to main content
deep_rune
Associate III
July 8, 2020
Question

How to tell how big my program is?

  • July 8, 2020
  • 5 replies
  • 893 views

i have a program with a BIG lookup table. The program compiles fine except for if i reference the lookup table, then it quits with one error and doesn't tell me what the error is.

How can i tell how big the compiled program - would be - with the lookup table? how can i confirm the error is because of the lookup table?

This topic has been closed for replies.

5 replies

Uwe Bonnes
Chief
July 8, 2020

Perhaps arm-none-eabi-nm *.elf?

S.Ma
Principal
July 8, 2020

Does it fail at compile or link step? Usually linker automatically try to remove from memories stuffs that seems unused.

Try to compile half size of the LUT to see what happen. Are your LUT function pointer or 32 bit aligned structure or something more exotic?

Jack Peacock_2
Associate II
July 8, 2020

The linker has an option to generate a map file. This text file shows where all globals are placed in the memory space of the controller. Typically the end of flash image will be where the C runtime variable initialization section ends. The end of each SRAM section can be found from the addresses where space is allocated.

Jack Peacock

Tesla DeLorean
Guru
July 8, 2020

If a linker error, and one where no .MAP is generated, you could expand the FLASH size in linker script, scatter file, or UI to be something massive like 64MB so that the linker can get closure, and then review the .MAP

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Piranha
Principal III
July 11, 2020

Typically the size of LUT is known. If that's the case, then just add it to the size of firmware without LUT.