6/19/2023 0 Comments Clickrepair 96kbOur reference project allows getting trace up in less than 10 minutes. However, in this case I do not care about trace. I use a regular J-Link to download the program. I just needed a board with an LED under software control, so pretty much any hardware would do. Selecting File -> New Project from the menu, I get to select a template. The first option, an executable for a Cortex-M CPU running from Flash, is what I want.Īfter clicking next a few times to use the defaults, I end up with a small project, as shown below in the Project Explorer Window. Selecting Build -> Build Mini or hitting F7 builds my program. I do not have the hardware connected at this point, so Embedded Studio asks me to use the built-in simulator instead.Ĭlicking Yes or hitting Enter starts the simulator. The debugger is set to stop at main, so this is where I am: At the start of the standard small little program, a grown up version of “Hello world”. Not bad, but I would like to understand what the memory is used for and what can be done to minimize the program, before adding the Now, to get started with a minimal application, let’s reduce this to basically an empty loop and see what we get.Īfter a build, the Output window nicely presents the memory usage.ġ58 bytes of Flash. In order to do that, I can look at the Memory Usage Window, the linker map file, the ELF file that has been produced by the linker, or simply at the Project Explorer. The Project explorer tells me that there are 3 source files which make up the executable, and how much Code+RO space they use. Note that these are the numbers for the compiler-generated object. Clickrepair bytes 96kb code#įor the final executable the linker can eliminate unused functions or might add veneers (to jump from Flash to RAM or from Thumb to ARM) and padding (for example to start on a 4 byte boundary) if necessary.Īnother source of flash usage can be code that gets pulled in from libraries, such as the C Runtime Library. However, my small project does not make real use of library functions, so that does not make a big difference and becomes irrelevant. So the Project Explorer tells me the memory usage of each of the 3 sources (2, 128, and 24 bytes) and the total memory usage of the project executable: 158 bytes. This is the same number I see in the Output window. And it is the relevant number, as it takes everything into account.
0 Comments
Leave a Reply. |