stm32/mboot/main: Use correct formula for DFU download address.

As per ST's DfuSe specification, and following their example code.
pull/4097/head
Damien George 2018-09-05 15:22:05 +10:00
rodzic 5f3016c663
commit a23719e0ad
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -760,7 +760,8 @@ static int dfu_process_dnload(void) {
}
} else if (dfu_state.wBlockNum > 1) {
// write data to memory
ret = do_write(dfu_state.addr, dfu_state.buf, dfu_state.wLength);
uint32_t addr = (dfu_state.wBlockNum - 2) * DFU_XFER_SIZE + dfu_state.addr;
ret = do_write(addr, dfu_state.buf, dfu_state.wLength);
}
if (ret == 0) {
return DFU_STATUS_DNLOAD_IDLE;