File tree Expand file tree Collapse file tree 4 files changed +13
-18
lines changed Expand file tree Collapse file tree 4 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 19
19
#ifndef __TARGET_INIT_H
20
20
#define __TARGET_INIT_H
21
21
22
- #include "stm32h7xx_hal.h"
23
- #include "stm32h7xx_hal_mdma.h"
24
- #include "stm32h7xx_hal_qspi.h"
25
- #if MCUBOOT_APPLICATION_DFU
26
- #include "usbd_core.h"
27
- #include "usbd_desc.h"
28
- #include "usbd_dfu.h"
29
- #include "usbd_dfu_flash.h"
30
- #endif
31
-
32
- #if MCUBOOT_APPLICATION_DFU
33
- #define APP_DEFAULT_ADD USBD_DFU_APP_DEFAULT_ADD
34
- #else
35
- #define APP_DEFAULT_ADD 0x08040000
36
- #endif
22
+ #define BOARD_APP_DEFAULT_ADD 0x08040000
37
23
38
24
#define BOOTLOADER_CONFIG_MAGIC 0xA0
39
25
#define BOOTLOADER_VERSION 4
Original file line number Diff line number Diff line change 21
21
22
22
/* Includes ------------------------------------------------------------------ */
23
23
#include "board.h"
24
+ #include "usbd_core.h"
25
+ #include "usbd_desc.h"
26
+ #include "usbd_conf.h"
24
27
25
28
/* Private typedef ----------------------------------------------------------- */
26
29
/* Private define ------------------------------------------------------------ */
Original file line number Diff line number Diff line change 22
22
#define __USBD_CONF_H
23
23
24
24
/* Includes ------------------------------------------------------------------*/
25
+ #include "board.h"
25
26
#include "stm32h7xx_hal.h"
26
27
#include <stdio.h>
27
28
#include <stdlib.h>
40
41
/* DFU Class Config */
41
42
#define USBD_DFU_MAX_ITF_NUM 4
42
43
#define USBD_DFU_XFER_SIZE 4096 /* Max DFU Packet Size = 4096 bytes */
43
- #define USBD_DFU_APP_DEFAULT_ADD 0x08040000 /* The first sector (32 KB) is reserved for DFU code */
44
+ #define USBD_DFU_APP_DEFAULT_ADD BOARD_APP_DEFAULT_ADD /* The first sector (32 KB) is reserved for DFU code */
44
45
#define USBD_DFU_MAX_NB_OF_SECTORS 16 /* Max number of sectors */
45
46
46
47
#define CDC_CLASS_DESC_SIZE (8 + 58)
Original file line number Diff line number Diff line change 29
29
#include " bootutil/image.h"
30
30
#include " mbedtls/platform.h"
31
31
32
+ #if MCUBOOT_APPLICATION_DFU
33
+ #include " usbd_desc.h"
34
+ #include " usbd_dfu_flash.h"
35
+ #endif
36
+
32
37
// clock source is selected with CLOCK_SOURCE in json config
33
38
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO)
34
39
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
@@ -268,9 +273,9 @@ int main(void) {
268
273
269
274
if (valid_application ()) {
270
275
/* Boot Sketch */
271
- BOOT_LOG_INF (" Booting sketch at 0x%x\n " , APP_DEFAULT_ADD );
276
+ BOOT_LOG_INF (" Booting sketch at 0x%x\n " , BOARD_APP_DEFAULT_ADD );
272
277
RTCSetBKPRegister (RTC_BKP_DR0, 0 );
273
- mbed_start_application (APP_DEFAULT_ADD );
278
+ mbed_start_application (BOARD_APP_DEFAULT_ADD );
274
279
} else {
275
280
BOOT_LOG_INF (" No sketch found" );
276
281
}
You can’t perform that action at this time.
0 commit comments