Skip to content

Main content

Microcontroller: Flash Page Offset Field Tool

Split an explicit region-relative flash offset into page index and within-page byte offset; not a device geometry lookup or erase-safety check.

Loading tool…

Description

Divide the nonnegative addressOffset by positive pageSize, returning a floored pageIndex and offsetWithinPage.

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.

Divide the nonnegative addressOffset by positive pageSize, returning a floored pageIndex and offsetWithinPage.

When to use this tool

Use Microcontroller: Flash Page Offset Field when you need an explicit address, alignment, page, or transfer-count mapping.

How to use the tool and how it works

  1. Enter addressOffset, 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 result. Expand result to inspect the returned fields.

Divide the nonnegative addressOffset by positive pageSize, returning a floored pageIndex and offsetWithinPage.1

Input fieldMeaning and unitsAccepted input
addressOffsetAddress OffsetRequired. Safe integer.
pageSizePage SizeRequired. Safe integer.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.pageIndexPage IndexCalculated result member: number.
result.offsetWithinPageOffset Within PageCalculated result member: number.
json
{
  "input": {
    "addressOffset": 513,
    "pageSize": 256
  },
  "output": {
    "result": {
      "pageIndex": 2,
      "offsetWithinPage": 1
    }
  }
}

Limitations and assumptions

  • Addresses are offsets on the supplied page grid; physical layout, erased state, and programming restrictions are outside scope.
  • Outputs are nested inside result. 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-offset-field — tool.io

Similar or alternative tools