From 65a7e00078fae27521dd9df78e328c6fa1e3b288 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 30 Jun 2020 14:23:50 +1000 Subject: [PATCH] stm32/mboot: Add DFU logic to respond to DFU_GETSTATE request. This is required for some DFU programmers, eg ST's DfuSe demo PC app. Signed-off-by: Damien George --- ports/stm32/mboot/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c index 8cc14c2ac9..ba0c35b8bf 100644 --- a/ports/stm32/mboot/main.c +++ b/ports/stm32/mboot/main.c @@ -933,6 +933,9 @@ static int dfu_handle_tx(int cmd, int arg, int len, uint8_t *buf, int max_len) { dfu_context.status = DFU_STATUS_OK; dfu_context.error = 0; return 6; + } else if (cmd == DFU_GETSTATE && len == 1) { + buf[0] = dfu_context.state; // bState + return 1; } return -1; }