diff options
Diffstat (limited to 'projects/hsm/mgmt-bootloader.c')
-rw-r--r-- | projects/hsm/mgmt-bootloader.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/projects/hsm/mgmt-bootloader.c b/projects/hsm/mgmt-bootloader.c index 738686e..1d8b8ad 100644 --- a/projects/hsm/mgmt-bootloader.c +++ b/projects/hsm/mgmt-bootloader.c @@ -50,16 +50,19 @@ extern hal_user_t user; static uint32_t dfu_offset; -static int _flash_write_callback(uint8_t *buf, size_t len) +static HAL_StatusTypeDef _flash_write_callback(uint8_t *buf, size_t len) { - if (stm_flash_write32(dfu_offset, (uint32_t *)buf, (uint32_t)len/4) != 1) - return 0; + HAL_StatusTypeDef status = stm_flash_write32(dfu_offset, (uint32_t *)buf, len/4); dfu_offset += DFU_UPLOAD_CHUNK_SIZE; - return 1; + return status; } static int cmd_bootloader_upload(struct cli_def *cli, const char *command, char *argv[], int argc) { + command = command; + argv = argv; + argc = argc; + if (user < HAL_USER_SO) { cli_print(cli, "Permission denied."); return CLI_ERROR; |