inav icon indicating copy to clipboard operation
inav copied to clipboard

Add support for Puya PY25Q128HA flash chip

Open sensei-hacker opened this issue 3 weeks ago • 1 comments

User description

Summary

Adds detection and support for the Puya PY25Q128HA flash chip, a W25Q128-compatible 128Mbit (16MB) SPI NOR flash commonly found on flight controllers.

Changes

Driver Support (flash_m25p16.c:102-104)

  • Added JEDEC ID entry (0x856018) to m25p16FlashConfig[] array for automatic chip detection

Documentation (Blackbox.md:123)

  • Added PY25Q128HA to the list of supported flash chips

Technical Details

  • JEDEC ID: 0x856018
    • Manufacturer: 0x85 (Puya Semiconductor)
    • Memory Type: 0x60
    • Capacity: 0x18 (128Mbit)
  • Geometry: 256 sectors × 256 pages × 256 bytes = 16 MByte
  • Command Set: Standard W25Q128-compatible (no driver changes needed)

Testing

The PY25Q128HA uses an identical command set to the W25Q128 and other supported flash chips. The existing M25P16-compatible driver already supports all necessary operations:

  • JEDEC ID detection (0x9F)
  • Read/write/erase operations
  • Standard timing parameters

Compatibility

This is a backwards-compatible change:

  • Adds new chip detection only
  • No changes to existing driver logic
  • No impact on boards without this chip
  • Boards with PY25Q128HA will now auto-detect the chip at boot

Files Changed

  • src/main/drivers/flash_m25p16.c - Added JEDEC ID entry
  • docs/Blackbox.md - Updated documentation

PR Type

Enhancement


Description

  • Adds JEDEC ID detection for Puya PY25Q128HA flash chip

  • Enables automatic chip recognition during initialization

  • Updates documentation with new supported flash chip


Diagram Walkthrough

flowchart LR
  A["Puya PY25Q128HA<br/>JEDEC ID: 0x856018"] -- "Added to detection table" --> B["flash_m25p16FlashConfig[]"]
  B -- "Auto-detection at boot" --> C["Chip Support Enabled"]
  D["Documentation Updated"] -- "Lists supported chips" --> E["Blackbox.md"]

File Walkthrough

Relevant files
Enhancement
flash_m25p16.c
Add Puya PY25Q128HA JEDEC ID to flash config                         

src/main/drivers/flash_m25p16.c

  • Added Puya PY25Q128HA JEDEC ID entry (0x856018) to m25p16FlashConfig[]
    array
  • Included datasheet reference link for the chip
  • Configured with 256 sectors and 256 pages matching W25Q128 geometry
+3/-0     
Documentation
Blackbox.md
Document Puya PY25Q128HA support                                                 

docs/Blackbox.md

  • Added Puya PY25Q128HA to the list of supported flash chips
  • Documented chip capacity as 128 Mbit / 16 MByte
  • Maintains consistent formatting with existing chip entries
+1/-0     

sensei-hacker avatar Dec 06 '25 18:12 sensei-hacker

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

qodo-code-review[bot] avatar Dec 06 '25 18:12 qodo-code-review[bot]