qmk/qmk_firmware

[Bug] Large external EEPROM fails on AVR

オープン

#8,742 opened on 2020/04/09

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)C (43,867 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (20,368 個のスター)
PR merge metrics
 (平均マージ 20d 9h) (30d で 27 merged PRs)

説明

Describe the Bug

All the eeprom function signatures provided by avr-libc accept a void* address parameter for the EEPROM offset. This causes problems with AVR when attempting to address 32kB (using signed offsets) or 64kB (when using unsigned).

ChibiOS/ARM reuse the same function signatures to ensure compatibility across the rest of QMK -- these have no issue with addressing as the pointer size is 32-bit.

Suggested fix

  • Rework the persistent storage as a separate subsystem, perhaps called nvram_read_byte() and similar, which provides the same set of functions, but with uint32_t offsets.
  • Relocate things like the Teensy SmartEEPROM to match the current drivers/eeprom/ structure.
  • Relocate the emulated flash to the same location.

コントリビューターガイド