> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform migrations

> Port firmware to a new MCU or board: record a baseline, review the port in Plan mode, move one module at a time, and verify the same behavior on the new target.

Use this workflow to move firmware to a different MCU, board, or SDK while keeping the behavior your product depends on. Before porting any code, define what the new target must preserve: interfaces, timing, startup behavior, peripheral functions, and resource limits.

## Choose a guide

| Change | Guide |
| - | - |
| A different MCU, board, or SDK | This page. You review the port in **Plan** mode and implement it in **Act** mode. |
| A different RTOS on the same board | [RTOS migrations](/docs/solutions/rtos-migrations.md), including a FreeRTOS-to-Zephyr example. |
| A SigmaStudio DSP project or other firmware to an XMOS board | [Migrate to XMOS](/docs/solutions/sigmastudio-to-xmos.md), using **Migration** mode. Migration mode appears in projects that target an XMOS board. |
| A port between Infineon AURIX platforms | This page. In the Infineon customer build only, Infineon migration mode plans the port. See [Migrate between Infineon platforms](/docs/supported-hardware/infineon.md#migrate-between-infineon-platforms). |

## Identify both targets

Record the source and destination MCU, package, board revision, SDK, toolchain, and build configuration in [INLAY.md](/docs/core-concepts/inlay-md.md), so every request works from the same facts. For a custom board, or one the catalog doesn't cover, add the target documentation and [upload the schematics](/docs/core-concepts/schematics.md).

> [!NOTE]
>
> If the destination is an AURIX Development Studio project, follow [AURIX ADS and Flasher](/docs/debug-mode/aurix.md) to prepare command-line builds on Windows. If the project already has a working build workflow, record its commands in [INLAY.md](/docs/core-concepts/inlay-md.md) instead.

## Capture the source baseline

Before you change anything, run the existing tests and the hardware checks you care about on the source board. Save the outputs the new target must match.

```text theme={"theme":"css-variables"}
Build the current firmware for the source board and run its tests. Flash it,
run a five-second PWM and fault-input test, and save the measured frequency,
duty range, startup order, and fault latency as the migration baseline.
```

Use the same workload and tolerances on both boards. List any differences you accept, so they aren't mistaken for regressions later.

## Compare hardware constraints

Run `/plan` to switch to **Plan** mode. Then ask Inlay to compare clocks, reset sequences, registers, pin routing, interrupts, DMA, memory layout, startup, and tools:

```text theme={"theme":"css-variables"}
Compare the source UART with the destination device documentation and board
schematic. Identify required changes and unresolved assumptions. Keep the
application-facing interface stable where possible.
```

Check the package and the board routing, not only the MCU's alternate-function table. A pin that supports the peripheral may be reserved or unreachable on the board.

## Review an ordered plan

Still in **Plan** mode, ask for the plan. Name both targets, what to preserve, and how to verify it:

```text theme={"theme":"css-variables"}
Plan the migration from NUCLEO-F446RE to NUCLEO-G474RE. Preserve the
control-loop API and 10 kHz update rate. Use pins routed to the target headers
and verify PWM and fault-input behavior on the new board. Order the work so
each module builds and passes its board check before the next one starts.
```

A good plan builds the target image first, then brings up an observation path, ports one service at a time, and verifies each service's consumers. Check that it lists the affected files, generated-code boundaries, tests, and a recovery path if bring-up fails.

To change the plan, reply with what to change. To start implementation, approve it: in VS Code, select **Approve & Execute**. Inlay switches to **Act** mode and starts the plan. See [Plan mode](/docs/core-concepts/modes.md#plan-review-an-approach-before-implementation) for the approval options in VS Code and the terminal UI.

## Port one module at a time

1. Produce the smallest target image with the correct startup and linker setup.
2. Establish UART, RTT, or another observation path.
3. Move one clock, GPIO, transport, or timing service.
4. Run its focused tests and target check.
5. Move to dependent modules only after the lower layer works.

Check every register value against the destination reference manual. Values copied from another family can build cleanly and still be wrong.

## Verify equivalent behavior

Repeat the baseline checks on the new target, with the same workload and tolerances:

```text theme={"theme":"css-variables"}
Build and flash the target image. Run the same five-second PWM and fault-input
test used on the source board. Compare frequency, duty range, startup order,
and fault latency against the agreed tolerances. Report each check as passed,
failed, or unverified, with its evidence.
```

Save repeatable bench checks as [hardware scripts](/docs/debug-mode/hardware-scripts.md) so later changes use the same procedure. Switch to **Debug** mode when you need to inspect target state. Preserve a fault before you reset or reprogram the board.

Finish by updating [INLAY.md](/docs/core-concepts/inlay-md.md) with the destination's build, flash, and test commands, and record any behavior that is still unverified. See [Supported hardware](/docs/supported-hardware/overview.md) for board setup references.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.