Code size analysis#

pw_hdlc: Simple, robust, and efficient serial communication

pw_hdlc currently optimizes for robustness and flexibility instead of binary size or performance.

The HDLC encode and decode size report shows the cost of everything needed to use pw_hdlc, including the dependencies on common modules like CRC32 from pw_checksum and variable-length integer handling from pw_varint.

The HDLC encode and decode, ignoring CRC and varint size report shows the cost of pw_hdlc if your application is already linking CRC32 and variable-length integer handling. pw_varint is commonly used since it’s necessary for protocol buffer handling, so it’s often already present.

Label

Segment

Delta

HDLC encode and decode

FLASH

+44

[section .rodata]

+68

pw::size_report::HdlcSizeReport()

+12

vPortSVCHandler_C

+24

pw::stream::Stream::Write()

+36

pw::containers::internal::OptionalData<>::OptionalData()

+4

__aeabi_dcmpun

NEW

+1,024

_pw_checksum_InternalCrc32EightBit::kCrc32Table

NEW

+200

pw::hdlc::Decoder::Process()

NEW

+144

pw::varint::Decode()

NEW

+100

pw::varint::Encode()

NEW

+88

pw::size_report::RunChecksum()

NEW

+84

pw::hdlc::Decoder::CheckFrame()

NEW

+84

pw::hdlc::WriteUIFrame()

NEW

+76

pw::hdlc::Encoder::WriteData()

NEW

+76

pw::hdlc::MaxEncodedFrameSize()

NEW

+74

pw::hdlc::Encoder::StartFrame()

NEW

+62

pw::hdlc::Decoder::AppendByte()

NEW

+56

pw::hdlc::Frame::Parse()

NEW

+48

pw::hdlc::EscapeAndWrite()

NEW

+46

pw::hdlc::Decoder::VerifyFrameCheckSequence()

NEW

+36

_pw_checksum_InternalCrc32EightBit

NEW

+36

pw::checksum::Crc32Impl<>::Update()

NEW

+36

pw::hdlc::Encoder::FinishFrame()

NEW

+34

pw::hdlc::EscapedSize()

NEW

+32

std::__2::__find_if[abi:nqn240000]<>()

NEW

+14

pw::hdlc::NeedsEscaping()

NEW

+14

std::__2::find_if[abi:nqn240000]<>()

NEW

+12

pw::hdlc::Encoder::StartUnnumberedFrame()

NEW

+2

pw::hdlc::kEscapedEscape

NEW

+2

pw::hdlc::kEscapedFlag

+2,568

HDLC encode and decode, ignoring CRC and varint

FLASH

+44

[section .rodata]

+60

pw::size_report::HdlcSizeReport()

DEL

-88

pw::size_report::RunChecksum()

-4

vPortSVCHandler_C

+24

pw::stream::Stream::Write()

+36

pw::containers::internal::OptionalData<>::OptionalData()

+4

__aeabi_dcmpun

+16

pw::checksum::Crc32Impl<>::Update()

NEW

+200

pw::hdlc::Decoder::Process()

NEW

+144

pw::varint::Decode()

NEW

+100

pw::varint::Encode()

NEW

+84

pw::hdlc::Decoder::CheckFrame()

NEW

+84

pw::hdlc::WriteUIFrame()

NEW

+76

pw::hdlc::Encoder::WriteData()

NEW

+76

pw::hdlc::MaxEncodedFrameSize()

NEW

+74

pw::hdlc::Encoder::StartFrame()

NEW

+62

pw::hdlc::Decoder::AppendByte()

NEW

+56

pw::hdlc::Frame::Parse()

NEW

+48

pw::hdlc::EscapeAndWrite()

NEW

+46

pw::hdlc::Decoder::VerifyFrameCheckSequence()

NEW

+36

pw::hdlc::Encoder::FinishFrame()

NEW

+34

pw::hdlc::EscapedSize()

NEW

+32

std::__2::__find_if[abi:nqn240000]<>()

NEW

+14

pw::hdlc::NeedsEscaping()

NEW

+14

std::__2::find_if[abi:nqn240000]<>()

NEW

+12

pw::hdlc::Encoder::StartUnnumberedFrame()

NEW

+2

pw::hdlc::kEscapedEscape

NEW

+2

pw::hdlc::kEscapedFlag

+1,288

More pw_hdlc docs#

Get started & guides

How to set up and use pw_hdlc

Get started & guides
API reference

Reference details about the pw_hdlc API

API reference
Design

Design details about pw_hdlc

Design & roadmap
Code size analysis

The code size impact of pw_hdlc

Code size analysis
RPC over HDLC example

A step-by-step example of sending RPCs over HDLC

RPC over HDLC example
Experimental async router

An experimental asynchronous HDLC router using pw_channel

Router