ch55xduino icon indicating copy to clipboard operation
ch55xduino copied to clipboard

Smaller code size for core??

Open lpuser13 opened this issue 2 years ago • 3 comments

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?

lpuser13 avatar Jan 31 '23 18:01 lpuser13

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

DeqingSun avatar Jan 31 '23 19:01 DeqingSun

ok, please close

lpuser13 avatar Feb 01 '23 14:02 lpuser13

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.

serisman avatar Feb 12 '23 22:02 serisman