jonlamb-gh / pinetime-rs

RTIC PineTime project
2 stars 1 forks source link

The binary is considerably large #1

Closed aw closed 3 years ago

aw commented 3 years ago

Hi,

I'm guessing this is still a work in progress, but I wanted to try it anyways. I compiled the firmware but the pinetime binary is 1.5MB. Just wondering how to flash this to the watch since there isn't enough space.

Also, do you have a LICENSE and more specific TODO for this project, since I'd like to contribute but I don't want to duplicate efforts.

Thanks.

jonlamb-gh commented 3 years ago

:wave:

I'm guessing this is still a work in progress

Yep. Currently the project has no clear direction yet, just a thing I've been hacking on in my spare time for fun.

I compiled the firmware but the pinetime binary is 1.5MB. Just wondering how to flash this to the watch since there isn't enough space.

I suspect your looking at the size of the ELF file (i.e. target/thumbv7em-none-eabihf/release/pinetime). I like to keep debug symbols around, even on release builds since they don't actually end up in the target binary which is around 112 KiB currently.

cargo size --release 
   text    data     bss     dec     hex filename
 112280     196    1448  113924   1bd04 pinetime

cargo size --release -- -A 
pinetime  :
section               size        addr
.vector_table          220         0x0        
.text                50804        0xdc        
.rodata              61256      0xc750        
.data                  196  0x2000f990        
.bss                  1304  0x2000fa54        
.uninit                144  0x2000ff6c        
.debug_loc          127038         0x0                              
.debug_abbrev         3605         0x0                              
.debug_info         353459         0x0                              
.debug_aranges        2288         0x0                              
.debug_ranges        86208         0x0                              
.debug_str          350502         0x0                              
.debug_pubnames     135115         0x0                              
.debug_pubtypes     107540         0x0                              
.ARM.attributes         58         0x0
.debug_frame          5060         0x0
.debug_line          79668         0x0
.comment               109         0x0
Total              1364574

I'm using cargo-embed for general flashing & debugging, but the runner is setup to use probe-run as well. https://github.com/jonlamb-gh/pinetime-rs/blob/a031112eb68a2fb8b3928cb6f8d1ef6d9766f47c/.cargo/config#L3

Also, do you have a LICENSE

Not at the moment, mostly because I'm still grabbing random resources/fonts/icons/etc from the internet which probably will affect licensing, but also wasn't expecting anyone to notice this project yet :)

If this thing ever makes it past the randomly-hacked-together-pile-of-ideas stage, I'll collect some design goals and get setup for contributions. Otherwise, feel free to fork and/or comment on things.

aw commented 3 years ago

Thanks for the quick reply. Indeed I was looking at the ELF. I typically use gdb-multiarch to upload manually, but I forgot to use arm-none-eabi-objcopy to convert to hex. The output size is fine now, but I guess I can give probe-run a try since it seems much simpler than my current manual approach. Cheers!