Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling project with this extension produces 75KB file; CubeIDE produces 50KB file #187

Open
yusufso opened this issue May 16, 2024 · 4 comments

Comments

@yusufso
Copy link

yusufso commented May 16, 2024

When I compile my project on STM32CubeIDE with optimization set for size, it produces a 50KB .bin file.

When doing the same with the stm32-for-vscode extension (still optimizing for size using "-Os" in STM32_for_VSCode.config.yaml), it produces a 75KB file.

What do you think is causing this discrepancy? Aren't both environments using the same toolchain to compile?

I have flashed the 75KB file to a MCU and it does work the way it is supposed to, just find it odd why there's a size difference.

@jortbmd
Copy link
Member

jortbmd commented May 17, 2024

Hi. Thanks for opening up an issue! It should use a similar toolchain. I do not know if there are some slight differences between the two do you maybe have a project you can share which has a similar behaviour? This way I can check what the differences are.

@yusufso
Copy link
Author

yusufso commented May 21, 2024

CubeIDE_makefile.txt
stm32forvscode_makefile.txt

Hi.

I am unable to share the project but I have attached the makefiles from STM32CubeIDE and another from stm32-for-vscode extension. I think the cause would likely be here.

@jortbmd
Copy link
Member

jortbmd commented May 22, 2024

Thanks for sharing. I had a quick look at it and I do not see any significant difference in the makefile in terms of linking. For the STM32 for VSCode one the -lnosys library is included, which you maybe could forgo. On top of that I cannot see how the object files in the CubeIDE makefile are generated. Do you maybe have any optimisations enabled or removed things like debugging symbols?

@yusufso
Copy link
Author

yusufso commented May 23, 2024

Optimization is set for size (-Os) on both. Debugging symbols are unchanged. I used the extension's importer tool on the project and did not make any further changes.

I removed the -inosys library from the config.yaml, build size is still 75 kb.

I downloaded a standalone toolchain which uses the same arm-none-eabi-gcc compiler and the build size was around 50 kb. It seems there must be some setting in the extension that cannot be changed in the config.yaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants