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

+68

pw::size_report::HdlcSizeReport()

+34

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

-2

pw_log_tokenized_HandleLog

-4

p05.0

+14

pw::internal_result::StatusOrData<>::StatusOrData<>()

NEW

+1,024

_pw_checksum_InternalCrc32EightBit::kCrc32Table

NEW

+264

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

NEW

+216

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

NEW

+174

pw::hdlc::WriteUIFrame()

NEW

+146

pw_varint_DecodeCustom

NEW

+102

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

NEW

+102

pw_varint_EncodeCustom

NEW

+96

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

NEW

+76

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

NEW

+74

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

NEW

+64

pw::hdlc::internal::EscapeAndWrite()

NEW

+46

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

NEW

+44

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

NEW

+40

_pw_checksum_InternalCrc32EightBit

NEW

+12

pw::hdlc::NeedsEscaping()

NEW

+6

__gnu_cxx::__ops::_Iter_pred<>::operator()<>()

NEW

+2

pw::hdlc::kEscapedEscape

NEW

+2

pw::hdlc::kEscapedFlag

+2,600

HDLC encode and decode, ignoring CRC and varint

FLASH

+68

pw::size_report::HdlcSizeReport()

+34

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

-2

pw_log_tokenized_HandleLog

-4

p05.0

+14

pw::internal_result::StatusOrData<>::StatusOrData<>()

NEW

+264

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

NEW

+216

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

NEW

+174

pw::hdlc::WriteUIFrame()

NEW

+146

pw_varint_DecodeCustom

NEW

+102

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

NEW

+102

pw_varint_EncodeCustom

NEW

+96

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

NEW

+76

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

NEW

+74

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

NEW

+64

pw::hdlc::internal::EscapeAndWrite()

NEW

+46

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

NEW

+44

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

NEW

+12

pw::hdlc::NeedsEscaping()

NEW

+6

__gnu_cxx::__ops::_Iter_pred<>::operator()<>()

NEW

+2

pw::hdlc::kEscapedEscape

NEW

+2

pw::hdlc::kEscapedFlag

+1,536

More pw_hdlc docs#

Get started & guides

How to set up and use pw_hdlc

API reference

Reference details about the pw_hdlc API

Design

Design details about pw_hdlc

Code size analysis

The code size impact of pw_hdlc

RPC over HDLC example

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