Skip to content

Commit f2f31c9

Browse files
committed
daplink_flash: Fix read_sector timing for DMA response.
1 parent 597c975 commit f2f31c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/daplink_flash/daplink_flash/device.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ def read_sector(self, sector):
135135
"""
136136
self._wait_busy()
137137
self._write_reg(CMD_READ_SECTOR, bytes([sector >> 8, sector & 0xFF]))
138-
sleep_ms(100)
139-
self._wait_busy()
138+
# F103 processes the command in its 30ms hook, then sets up DMA.
139+
# After DMA setup, the F103 is no longer in listen mode — only
140+
# a plain readfrom() will work (no register-based status poll).
141+
sleep_ms(200)
140142
return self.i2c.readfrom(self.address, SECTOR_SIZE)
141143

142144
def read(self, length=None):

0 commit comments

Comments
 (0)