I have an interesting issue that I am curious if anyone on here has any insight into.
I have been using CooIDE 1.7.8 and ARM GNU compiler (ver 4.7) for developing code on STM32 parts.
I finished a version of code and happened to recollect the "text" size during compilation. I was moving some files around, and again, compiled the code. Hmm, the "text" size did not seem right. I compiled again, still wrong.
Thinking I had gotten the wrong version, I did some moving. Here is what I found:
If I compile the code on a flash drive, I get size A (which happens to be the smallest). If I take this flash drive to another computer with the same IDE/Compiler, I again get size A. If I move the code to the desktop of my computer, I get size B. If I move the file to a project directory, I get size C (the largest). Size A and and size C differ by right over 500 bytes with "O1" optimization. (I assume "text" size is bytes). With optimization OFF, I still see a difference of around 300 bytes.
I did a compare the .hex files are indeed different (one is 39K, the other 41K). Seemingly mostly toward the end.
Thinking perhaps this was just some housekeeping crap, I imported the .hex files into my programming utility and sure enough, the two have different ending addresses in memory.
My understanding of the compilation process does not explain why where the target files resides have any influence on the size of the code going onto the controller. Is this just an IDE issue? Compiler issue?
This project I am trying to keep on a fairly space limited chip. I never thought I'd be forced to keep the source files in a particular location to meet the size requirement.
I have been using CooIDE 1.7.8 and ARM GNU compiler (ver 4.7) for developing code on STM32 parts.
I finished a version of code and happened to recollect the "text" size during compilation. I was moving some files around, and again, compiled the code. Hmm, the "text" size did not seem right. I compiled again, still wrong.
Thinking I had gotten the wrong version, I did some moving. Here is what I found:
If I compile the code on a flash drive, I get size A (which happens to be the smallest). If I take this flash drive to another computer with the same IDE/Compiler, I again get size A. If I move the code to the desktop of my computer, I get size B. If I move the file to a project directory, I get size C (the largest). Size A and and size C differ by right over 500 bytes with "O1" optimization. (I assume "text" size is bytes). With optimization OFF, I still see a difference of around 300 bytes.
I did a compare the .hex files are indeed different (one is 39K, the other 41K). Seemingly mostly toward the end.
Thinking perhaps this was just some housekeeping crap, I imported the .hex files into my programming utility and sure enough, the two have different ending addresses in memory.
My understanding of the compilation process does not explain why where the target files resides have any influence on the size of the code going onto the controller. Is this just an IDE issue? Compiler issue?
This project I am trying to keep on a fairly space limited chip. I never thought I'd be forced to keep the source files in a particular location to meet the size requirement.