avr: updated flash procedure code.

This commit is contained in:
Martin Preuss
2025-01-19 15:44:46 +01:00
parent ba279ae2bb
commit c390b1059c
12 changed files with 653 additions and 67 deletions

View File

@@ -40,18 +40,18 @@ flashWriteFlashReady:
ldi yh, HIGH(flashUid) ; 4 bytes
ldi yl, LOW(flashUid)
ldi r18, 4
rcall Utils_Copy_SDRAM
ldi zl, low(devInfoBlock*2) ; 12 bytes
rcall Utils_Copy_SDRAM ; (R17, R18, X, Y)
ldi zl, LOW(devInfoBlock*2) ; 12 bytes
ldi zh, HIGH(devInfoBlock*2)
ldi r18, 12
rcall Utils_CopyFromFlash
rcall Utils_CopyFromFlash ; (R16, R18, X, Z)
ldi r16, LOW(PAGESIZE*2) ; 2 bytes
st X+, r16
ldi r16, HIGH(PAGESIZE*2)
st X+, r16
sbiw xh:xl, 22 ; go back to beginning of message
rcall com2CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
sbiw xh:xl, 23 ; go back to beginning of message