2025-07-24 9:07 AM
Hi everyone.
I've got a question about a strange aspect of my project and the compiling process.
I have some files to be compiled for my project. The compile process goes fine, everything is correctly compiled and looking both on console output and build target, all the required file are correctly compiled.
What strangely happens is that if I look to the size of the .text section at the end of compile process, it is equal to only 96Bytes which are a very small size infact my code doesn't work correctly both on debug and on release.
Any suggestions where can I look to try to fix the issue?
I've already given a look to the linked files (headers) and source location tab (all the required folders are into the sources list), same for .make files, and .map files Wich contains all the required files. The only strange file is the .list file that is very small and, looking to the disassembly cose, there isn't all the code I was expecting but only a small piece.
Any advice?
2025-07-24 9:45 AM
Can you include the entire project?
What happens when you try to debug the code? Does it launch? What does "doesn't work correctly" mean here?
2025-07-24 10:30 AM
Hi TDK
I cannot include the project, Sorry.
When I say that code doesn't work I mean that when I start the debug, program counter jumps to an invalid address (0xFFFFFF). This is an expected behavior because the flash memory is not written. If I look to the Memory address where the code should we loaded in fact I count only 96 bytes.
2025-07-24 10:45 AM
Can you show the full output of the Console tab when you build the program?
2025-07-25 2:27 AM
@zioMorgan wrote:
How to get a proper screenshot:
much better than a photograph of the screen!
Or just copy & paste it as text.
What optimisation setting are you using?
Maybe your code is all being optimised away?
Your .bss section is large - is your code meant to run in RAM, or something?
More details would help - see: How to write your question to maximize your chances to find a solution
Examine the Map file to see what's actually being included in the image.
Use the CubeIDE Build Analyser:
2025-07-25 4:42 PM - edited 2025-07-25 4:46 PM
This can mean that most of your code is not referred by main() and functions called from it, therefore the linker eliminates the unreferenced code. Check that your functions are actually called in the code.
Also this can happen if the linker cannot find the proper startup .s file or because a broken linker script.