2024-10-10 03:25 PM - edited 2024-10-10 04:21 PM
Hello,
I'm running into an issue with Makefile. I ported over the structure that the CubeIDE uses to generate an elf and I'm using the exact same commands. I can build my target elf file successfully but at the end I get a warning stating: /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 0000000008000000
I generate a startup_stm32l051t8yx.o file and it's part of the object files that the linker is using to generate an elf.
Things I've debugged:
I looked into what this meant from a few previous post (https://community.st.com/t5/stm32cubeide-mcus/how-to-fix-quot-warning-cannot-find-entry-symbol-reset-handler/td-p/252538). None of those suggestions helped fix my issue. I have a Reset_Handler entry point in my linker file and my startup file (i.e startup_stm32l051t8yx.s) also has it defined.
I did an arm-none-eabi-nm on my generated elf file and it has an "U" as in undefined address for the Reset_Handler. Attached are the outputs.
I notice that if I explicitly add the object files (that includes the startup_assembly.o) not as a pre-req to to the rule but as part of the command, the Reset_Handler has an address assigned. The problem with then is my elf file is 512Kb instead of 42Kb.
For example this doesn't work:
$(TARGET): $(OBJECTS) $(LD_SCRIPT)
I'd really appreciate any sort of help on this.
2024-10-10 03:34 PM