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

reduce vector table size #3

Open
nerdralph opened this issue Jan 2, 2023 · 7 comments
Open

reduce vector table size #3

nerdralph opened this issue Jan 2, 2023 · 7 comments

Comments

@nerdralph
Copy link

Since there`s gaps in the vector table, you can put some of the startup code there to save flash.
https://github.com/nerdralph/stm32f0-blink/blob/master/src/vector_table.S#L29

@deividAlfa
Copy link
Collaborator

Why so much hassle to save few dozens of flash bytes?

@nerdralph
Copy link
Author

nerdralph commented Jan 3, 2023

Why so much hassle to save few dozens of flash bytes?

I didn't think copying my vector table asm code would be a hassle.

@deividAlfa
Copy link
Collaborator

I can see the bss zeroing, but where's the data initialization?

@IOsetting
Copy link
Owner

Hi Ralph, is it feasible to add a new startup file e.g. "startup_hk32f030mf4p6_compact.s"? Then user can choose different options in Makefile for compiling.

@nerdralph
Copy link
Author

Hi Ralph, is it feasible to add a new startup file e.g. "startup_hk32f030mf4p6_compact.s"? Then user can choose different options in Makefile for compiling.

I suppose, but what would be the reason not to use a smaller init all the time? I think the effort of adding makefile options would be better spent on making a single optimized init.

@IOsetting
Copy link
Owner

IOsetting commented Jan 4, 2023

Hi Ralph,
I got your point. In a fixed scenario, a smaller init would be preferred, users will benefit from these hacks.
This is a project template for a rarely known chip, I feel that at this phase, a standard startup file would be best for most users, readable, reliable.
Changing the startup file only need to edit one line in Makefile so no effort needed, if most users feel the smaller init is stable and good in most cases, we can set it as default.

@nerdralph
Copy link
Author

nerdralph commented Jan 5, 2023 via email

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

3 participants