From d8359a99e16e7c5eba132911efb6b1d13f38f31b Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sun, 1 May 2016 15:51:20 +0200 Subject: [PATCH] Define MAIN_FW_ADDR. --- src/bootloader/src/usbd_cdc_interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bootloader/src/usbd_cdc_interface.c b/src/bootloader/src/usbd_cdc_interface.c index 2a78634f8..83055640b 100644 --- a/src/bootloader/src/usbd_cdc_interface.c +++ b/src/bootloader/src/usbd_cdc_interface.c @@ -2,8 +2,9 @@ #include #include "flash.h" -#define APP_RX_DATA_SIZE 2048 -#define APP_TX_DATA_SIZE 2048 +#define MAIN_FW_ADDR 0x08010000 +#define APP_RX_DATA_SIZE 2048 +#define APP_TX_DATA_SIZE 2048 USBD_CDC_LineCodingTypeDef LineCoding = { @@ -191,9 +192,10 @@ static int8_t CDC_Itf_Receive(uint8_t *Buf, uint32_t *Len) uint32_t *cmd_buf = (uint32_t*) Buf; uint32_t cmd = *cmd_buf++; + switch (cmd) { case BOOTLDR_START: - flash_offset = 0x08010000; + flash_offset = MAIN_FW_ADDR; ide_connected = 1; // Send back the START command as an ACK CDC_Tx(Buf, 4);