Skip to content

BSS Section size tracking #23

@christophersanborn

Description

@christophersanborn

This is a tracking issue, tabulating size of the .bss section of the app binary. The .bss section is the memory reserved for global variables within the 4 KB of working RAM available to Nano S apps. In the Nano S, there are global variables, and there stack variables that both compete for the same 4 KB of space. Being parsimonious with the globals ensures that there is adequate head room for the stack. (Note global constant variables and other app static data are kept in the flash ram, and so do not compete for the 4KB of working ram. Also there are no heap variables.)

The size of the .bss segment can be retrieved with readelf -S obj/app.elf. Note that the size of the .bss segment also includes the reserved size of the stack. (This guarantees at least a minimum stack size before the linker refuses to link.) Thus, to get the actual size consumed by the globals, you need to subtract out this reservation. The current version of the SDK (1.5.5) sets this reservation to 512 bytes. (The previous SDK reserved 768 bytes.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions