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

Smaller code size for core?? #113

Open
lpuser13 opened this issue Jan 31, 2023 · 3 comments
Open

Smaller code size for core?? #113

lpuser13 opened this issue Jan 31, 2023 · 3 comments

Comments

@lpuser13
Copy link

Thanks for the great work on this repository... :)

Is it possible to make the base code size smaller.

For example I compiled a default/empty sketch for ch552 using CDC. The output shows:
Sketch uses 4123 bytes (28%) of program storage space. Maximum is 14336 bytes.

When I checked the generated .map file i saw the following:
image

Is there any way to change compiler optimizations to stop the highlighted or unused functions from being included?

@DeqingSun
Copy link
Owner

You may have to edit the core to do the job. SDCC's linker is not very good at linking optimization

@lpuser13
Copy link
Author

lpuser13 commented Feb 1, 2023

ok, please close

@serisman
Copy link

I noticed this a few months ago as well. I have a project with a large buffer that wouldn't compile after I upgraded to the newest version. It looks like the inclusion of UART1 took up enough extra RAM so my code wouldn't compile, even though I wasn't using either serial port. (CH551 doesn't even have a UART1).

PR #115 is a potential solution to this that allows selection of which (if any) hardware serial ports to include in the build.

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