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

v00x vs v003 firmware size difference #543

Open
prplz opened this issue Mar 1, 2025 · 5 comments
Open

v00x vs v003 firmware size difference #543

prplz opened this issue Mar 1, 2025 · 5 comments

Comments

@prplz
Copy link

prplz commented Mar 1, 2025

For example:
V002 = 6816 B
v003 = 6756 B

I believe most of it is caused by v003 using libgcc.a from the repo and v00x using it from the system.
Relevant line in ch32fun.mk is LDFLAGS+=-L$(CH32FUN)/../misc -lgcc in the v003 block. I haven't tested adding it to v00x yet.

@TommyMurphyTM1234
Copy link
Contributor

TommyMurphyTM1234 commented Mar 2, 2025

I believe most of it is caused by v003 using libgcc.a from the repo and v00x using it from the system.

The likes of the map and list files should clarify exactly where each byte of each linked image is coming from and eliminate any speculation.

@prplz
Copy link
Author

prplz commented Mar 2, 2025

ok i tried making it link against the libgcc.a in the repo and the binaries match except an extra instruction needed to setup the stack pointer due to bigger sram.

@cnlohr
Copy link
Owner

cnlohr commented Mar 5, 2025

Should this be closed?

@prplz
Copy link
Author

prplz commented Mar 5, 2025

No, I think you need to add LDFLAGS+=-L$(CH32FUN)/../misc -lgcc to the v00x block, assuming you think it’s right to use the vendored one for v00x (I don’t know the consequences of that)

@cnlohr
Copy link
Owner

cnlohr commented Mar 7, 2025

I think we want to only force that for the v003. We could consider getting other platform-specific ones, but it would theoretically be less efficient or worse to use the v003 one on any of the others, since the others have a multiply instruction.

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