Skip to content

daplink: Fix READ_SECTOR firmware bugs in DAPLink bridge. #165

@nedseb

Description

@nedseb

Context

The DAPLink Flash driver (daplink_flash) communicates with the STM32F103 via I2C to access the W25Q64JV SPI flash. Three bugs in the DAPLink firmware affect the driver.

Bugs identified

Bug 1: READ_SECTOR argument length mismatch

The I2C layer expects 2 argument bytes but the task handler checks for 1. Command always rejected.

Bug 2: READ_SECTOR hardcoded read address

steami_flash_read_sector() always reads from address 0 regardless of sector number.

Bug 3: WRITE_DATA page boundary corruption

Local bytes_wrote variable reinitialized to 0 on each 30ms hook call. When writes cross a 256-byte page boundary, remaining data is written from the wrong buffer offset. Causes ~1 corrupted line per 256 bytes.

Fix

PR submitted on the DAPLink fork: steamicc/DAPLink#1

Impact

  • Without fix: read_sector() / read() do not work, write() corrupts data at page boundaries
  • With fix: all operations work correctly, validated with 300-row CSV test

Related

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfirmwareConcerne le firmware DAPLink (F103)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions