Skip to content

Main content

Flash Page Crossing Write Budget Tool

Calculate flash page crossing write budget from explicit caller-supplied inputs.

Loading tool…

Description

Calculate room to the next page boundary, use the smaller of room and bytes for firstPageBytes, and count any remaining pages by ceiling division.

Address calculations distinguish an occupied last byte from an exclusive end, and alignment rounds to a defined boundary. Element counts and byte counts are not interchangeable.

Calculate room to the next page boundary, use the smaller of room and bytes for firstPageBytes, and count any remaining pages by ceiling division.

When to use this tool

Use Flash Page Crossing Write Budget when you need an explicit address, alignment, page, or transfer-count mapping.

How to use the tool and how it works

  1. Enter address, bytes, pageSize. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read firstPageBytes, pages. Use the output convention below.

Calculate room to the next page boundary, use the smaller of room and bytes for firstPageBytes, and count any remaining pages by ceiling division. Return zero pages for zero bytes.1

Input fieldMeaning and unitsAccepted input
addressAddressRequired. Safe integer; minimum 0.
bytesBytesRequired. Safe integer; minimum 0.
pageSizePage SizeRequired. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
firstPageBytesFirst Page BytesRequired. Safe integer.
pagesPagesRequired. Safe integer.
json
{
  "input": {
    "address": 250,
    "bytes": 20,
    "pageSize": 256
  },
  "output": {
    "firstPageBytes": 6,
    "pages": 2
  }
}

Limitations and assumptions

  • This counts page coverage only; it does not split a write operation or verify device-specific page behavior.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Validate the resulting span against actual memory bounds and device-specific access and transfer rules.

References

  1. Calculation and input contract: microcontroller/flash-page-crossing-write-budget — tool.io

Similar or alternative tools