-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Slim down sketch size #553
base: master
Are you sure you want to change the base?
Conversation
__assert_func and its dependencies are automatically added by libc unless we provide a stub implementation and avoid uisng -Wl,--whole-archive when linking against system lib
By moving the BLE stack initialization to its library we can avoid including it in any build.
@@ -158,6 +158,9 @@ SECTIONS | |||
{ | |||
. = ALIGN(4); | |||
__start_heap = .; | |||
end = __start_heap; | |||
_end = end; | |||
__end = end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear on the purpose of these 3 new symbols? can you explain them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first step to properly support newlib's nano.specs
, which unfortunately aren't compiled in the current toolchain. The nano lib doesn't provide all the symbols and the linker would fail with something like
sbrk.c:(.text._sbrk+0x2): undefined reference to `end'
@SidLeung can you review please? |
Since 0304de7 the sketch size has exploded. Moving the BLE stack to ARC core is the main responsible.
This patch addresses two main fields:
The first patch could be further optimized but since most sketches uses the CDC port it doesn't make much sense.
Sketch size comparison:
BareMinimum: 48744 -> 12540
(BLE central) Scan: 91692 -> 80440