# Ledger Nano Gen5 porting

If you need to adapt a device app to be compatible with the Ledger Nano Gen5, follow the guidelines below.
Get in touch with your usual contact at Ledger if you are not sure if you should proceed with the modifications.

## What needs to be updated

- Create two icons for your application: a 48x48px B\&W png and a 32x32px B\&W png
  - Add the 48x48px in the `glyphs` folder, and use this naming template `app_yourcoin_48px.png`
  - Add the 32x32px in the `icons` folder, and use this naming template `app_yourcoin_32px.png`
- For C applications, update the makefile, with the the 32px icon target
  ```bash
  ICON_APEX_P = icons/app_yourcoin_32px.png
  ```
- For Rust applications, update `cargo.toml` with the Nano Gen5 target (apex\_p)
  ```bash
  [package.metadata.ledger.apex_p]
  icon = "icons/app_yourcoin_32px.png"
  # ...
  unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("apex_p", "stax", "flex", "nanos", "nanox", "nanosplus"))'] }
  ```
- For both C and Rust applications, update `ledger_app.toml` with the Nano Gen5 target (apex\_p)
  ```bash
  devices = ["nanox", "nanos+", "stax", "flex", "apex_p"]
  ```
- Add tests for Nano Gen5
- Add the Nano Gen5 target (apex\_p) to your App in the [the Ledger App Database ](https://github.com/LedgerHQ/ledger-app-database/blob/main/app-load-params-db.json)

## Examples

You can use our Boilerplates Apps update to understand the required modifications.

- For Device Apps in C, read [this PR](https://github.com/LedgerHQ/app-boilerplate/pull/158).
- For Device Apps in Rust, read [this PR](https://github.com/LedgerHQ/app-boilerplate-rust/pull/154).

## Submission

Use [the submission form](../submission-process/submission-form) to submit your update.
