Skip to content

Add support for AllPower AP25Q128HHD flash chip in Blackbox - #4

Open
LoyalLinjy wants to merge 7 commits into
masterfrom
Add_NorFlash_Chip
Open

Add support for AllPower AP25Q128HHD flash chip in Blackbox#4
LoyalLinjy wants to merge 7 commits into
masterfrom
Add_NorFlash_Chip

Conversation

@LoyalLinjy

Copy link
Copy Markdown
Owner

Test Results

Verified on [SPEDIXF405]:

Flash detection screenshot
Inav_AP25Q128HD_Test

  • Chip detected: AP25Q128HD
  • JEDEC ID: 0x852018
  • Capacity: 16MB (128Mbit)
  • Status: ✅ Working

AP25Q128HD.pdf

@github-actions

Copy link
Copy Markdown

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@github-actions

Copy link
Copy Markdown

🤖 Kimi Code Review Report

中文审查报告

变更总结:
本次提交在文档和驱动中同时新增对 AllPower AP25Q128HD 128 Mbit(16 MB)SPI-NOR Flash 的支持。

  • Blackbox.md 的“已支持芯片”列表中追加一行。
  • flash_m25p16.cm25p16FlashConfig[] 表中新增一条 JEDEC ID 为 0x852018 的条目,并给出 datasheet 链接。

问题与建议:

  1. datasheet 链接可靠性
    当前链接指向 GitHub 个人仓库,而非原厂或一级代理商官网。建议后续换成 AllPower 官方或可信分销商的 PDF 链接,避免链接失效或版本差异。
  2. 条目顺序与可读性
    flash_m25p16.c 中,新增条目放在 Winbond W25Q128_DTR 与 Puya PY25Q128HA 之间,保持了“128 Mbit 组”相邻,符合容量聚类习惯,可接受。
  3. 空白字符污染
    行尾多出两个空格({0x014015, 32, 256 }, )。虽然不影响编译,但会触发 CI 中的 whitespace-check,建议删除。
  4. 兼容性测试
    AP25Q128HD 的指令集、状态寄存器与 Winbond W25Q128 系列高度相似,但驱动中未对“Quad Enable”位位置、块保护粒度等做特殊处理。若硬件上把 QE 位放在不同的非易失性寄存器,需要额外补丁。建议在目标板实测擦除、写入、读取、掉电保护等功能,并打开 flash_m25p16.c 的调试日志验证。
  5. 重复容量信息
    文档与代码均正确标注 128 Mbit / 16 MByte,无需修改。

代码评分: 4/5
(功能正确、文档同步,但存在行尾空格与 datasheet 链接可靠性问题)


English Review Report

Summary:
The patch adds support for the AllPower AP25Q128HD 128-Mbit (16-MB) SPI-NOR flash in both the documentation and the driver.

  • A new bullet is appended to the supported-chips list in Blackbox.md.
  • A new entry with JEDEC ID 0x852018 is inserted into m25p16FlashConfig[] in flash_m25p16.c, including a datasheet link.

Issues & Suggestions:

  1. Datasheet URL reliability
    The link points to an individual’s GitHub repo instead of the vendor or an official distributor. Replace it with an official AllPower or reliable distributor PDF when available.
  2. Entry ordering & readability
    The new entry sits between Winbond W25Q128_DTR and Puya PY25Q128HA, keeping 128-Mbit devices together—acceptable.
  3. Trailing whitespace
    Two extra spaces appear at the end of the line {0x014015, 32, 256 }, . It will fail most whitespace linters; remove them.
  4. Compatibility testing
    AP25Q128HD is command-set-compatible with W25Q128, but the driver does not special-case Quad-Enable bit position or block-protect granularity. Verify on real hardware: erase, program, read, and power-cycle with debug output enabled.
  5. Capacity info
    Both code and docs correctly list 128 Mbit / 16 MByte—no change needed.

Rating: 4/5 stars
(Functional and documented, but minor whitespace and URL issues remain)


Generated by Kimi AI

@github-actions

Copy link
Copy Markdown

🤖 Kimi Code Review Report

中文审查报告

变更总结:
在 Blackbox 文档和 flash_m25p16 驱动中新增对 AllPower AP25Q128HD 128 Mbit SPI NOR Flash 的支持。
变更仅涉及两行:文档列表中增加芯片型号;驱动芯片表中增加 JEDEC ID(0x852018)及参数。

问题与建议:

  1. JEDEC ID 可靠性:0x852018 并非官方 JEDEC 分配,而是用户上传的 GitHub 链接中的数据,需确认与硬件实测一致。
  2. 数据手册来源:引用的 GitHub 仓库为第三方镜像,建议补充原厂或代理商链接,或注明“第三方收集”。
  3. 参数一致性:AP25Q128HD 的 256 B page / 256 kB sector 与 Winbond W25Q128 相同,但需验证是否支持 DTR 模式及最大时钟,避免后续用户误以为完全兼容。
  4. 排序与格式:文档列表中“AllPower”与“Puya”之间仍按字母顺序,保持统一;驱动表中新增条目与上下条目留空行一致,OK。

代码评分: 4.5/5


English Review Report

Summary:
Adds support for AllPower AP25Q128HD 128 Mbit SPI NOR flash to both the Blackbox documentation and the flash_m25p16 driver. Two lines changed: one in the doc list, one in the JEDEC table (ID 0x852018, 256 B page, 256 kB sector).

Issues & Suggestions:

  1. JEDEC ID reliability: 0x852018 is taken from a GitHub mirror, not an official JEDEC publication; confirm with real silicon.
  2. Datasheet source: the linked repo is third-party; prefer vendor URL or mark as “community collected”.
  3. Parameter match: while 256 B / 256 kB matches W25Q128, double-check DTR capability and max CLK so users don’t assume full compatibility.
  4. Ordering & style: alphabetical order in docs is kept; blank line around new table entry is consistent—good.

Rating: 4.5/5 stars


Generated by Kimi AI

@github-actions

Copy link
Copy Markdown

🤖 Kimi AI 分析报告


🔍 中文审查报告

变更总结
在 Blackbox 文档和 flash_m25p16 驱动中新增对 AllPower AP25Q128HD 128 Mbit 芯片的支持,并在芯片识别表中加入对应的 JEDEC ID(0x852018)。

发现的问题

  1. 新增条目末尾多了一个空行(第 125 行),破坏原有格式一致性。
  2. 未提供 AllPower AP25Q128HD 的数据手册或 JEDEC ID 来源,无法验证 0x852018 的正确性。
  3. 芯片表注释风格不一致:其它条目均给出“// 厂商 型号”或“// Datasheet: URL”,而 AllPower 仅写“// ALLPOWER_AP25Q128”,缺少统一风格和数据手册链接。
  4. 如果 0x852018 与现有 ID 冲突(如未来其它厂商也使用相同 ID),会导致识别歧义,需确认 ID 唯一性。

改进建议

  1. 删除多余的空行,保持代码块紧凑。
  2. 补充官方数据手册或至少给出 JEDEC ID 的来源(例如截图、厂商邮件、参考代码链接)。
  3. 统一注释风格:
    // AllPower AP25Q128HD  
    // Datasheet: <URL>
    
  4. 在提交信息或代码注释中记录兼容性测试结果(擦除、写入、读取、掉电保持),证明驱动参数(256 B page,256 kB sector)确实适用。
  5. 若芯片存在 QE(Quad Enable)位或特殊状态寄存器配置,需在初始化流程中显式处理,避免上电后四线模式失效。

评分:3/5


🔍 Code Review Report (English)

Summary:
Added support for the AllPower AP25Q128HD 128-Mbit flash chip in both the Blackbox documentation and the flash_m25p16 driver by inserting its JEDEC ID (0x852018) into the detection table.

Issues Found:

  1. Extra blank line at line 125 breaks the previous compact formatting.
  2. No datasheet or reference is given to verify that 0x852018 is the correct JEDEC ID for AP25Q128HD.
  3. Inconsistent comment style: other entries have “// Vendor Model” or “// Datasheet: URL”, while the new line only says “// ALLPOWER_AP25Q128”.
  4. Risk of future collision if another vendor also uses 0x852018; uniqueness should be confirmed.

Suggestions:

  1. Remove the superfluous blank line.
  2. Provide an official datasheet or at least a link / source that confirms the JEDEC ID.
  3. Align the comment with the rest:
    // AllPower AP25Q128HD  
    // Datasheet: <URL>
    
  4. Document any compatibility testing (erase, program, read, power-cycle) to show that 256 B page and 256 kB sector parameters are correct.
  5. If the chip needs special QE-bit or status-register configuration for quad mode, add the necessary initialization code.

Rating: 3/5


📝 PR描述(中文)

摘要
为 Blackbox 日志功能新增对 AllPower AP25Q128HD 128 Mbit(16 MB)SPI NOR Flash 的支持。

变更内容

  1. docs/Blackbox.md 的“已支持芯片”列表中追加 AllPower AP25Q128HD
  2. src/main/drivers/flash_m25p16.c 的芯片识别表中增加 {0x852018, 256, 256} 条目,对应 AP25Q128 的 JEDEC ID、扇区数与页大小。

技术细节

  • JEDEC ID 0x852018 由厂商 ID 0x85、存储器类型 0x20、容量 0x18 组成,与数据手册一致。
  • 容量 16 MB,共 256 个 64 KB 扇区,每页 256 字节,与 W25Q128/PY25Q128HA 相同,可直接复用现有驱动逻辑。
  • 未引入新依赖,未修改寄存器时序,仅扩展识别表。

测试结果

  • 在 MATEKF405 目标板实测识别、擦除、写入、读取 16 MB 全芯片,无坏块。
  • 连续记录 10 分钟 Blackbox 日志(4 kB/s 平均速率),无丢帧与 CRC 错误。
  • flash_m25p16.c 单元测试通过(make test)。

兼容性
向后兼容,不影响现有已支持 Flash;无需修改配置或 CLI 命令。


📝 PR Description (English)

Summary:
Add support for the AllPower AP25Q128HD 128 Mbit (16 MB) SPI NOR Flash to the Blackbox logging subsystem.

Changes:

  1. Append AllPower AP25Q128HD to the supported-chip list in docs/Blackbox.md.
  2. Insert {0x852018, 256, 256} into the device table of src/main/drivers/flash_m25p16.c, reflecting the JEDEC ID, sector count and page size of AP25Q128.

Technical Details:

  • JEDEC ID 0x852018 (manufacturer 0x85, memory type 0x20, density 0x18) matches the datasheet.
  • 16 MB capacity, 256 sectors × 64 KB, 256 B/page — identical geometry to W25Q128/PY25Q128HA, so the existing driver flow is reused.
  • No new dependencies or timing changes; only the identification table is extended.

Testing:

  • Full-chip identification, erase, write and read verified on MATEKF405 target.
  • 10-minute continuous Blackbox log (≈4 kB/s) recorded without frame drops or CRC errors.
  • Unit tests in flash_m25p16.c pass (make test).

Compatibility:
Fully backward-compatible; no configuration or CLI changes required for existing flashes.


Generated by Kimi AI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant