-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-enable-external-flash-qspi.patch
48 lines (43 loc) · 1.87 KB
/
0001-enable-external-flash-qspi.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/01_GPIO_IOToggle/Core/Src/system_stm32h7xx.c b/01_GPIO_IOToggle/Core/Src/system_stm32h7xx.c
index 851ebcb..43dc993 100644
--- a/01_GPIO_IOToggle/Core/Src/system_stm32h7xx.c
+++ b/01_GPIO_IOToggle/Core/Src/system_stm32h7xx.c
@@ -47,6 +47,8 @@
#include "stm32h7xx.h"
#include <math.h>
+#define EXT_Flash_SPI /*! Relocate the vector table to external QSPI Flash */
+
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
@@ -87,6 +89,9 @@
remap of boot address selected */
/* #define USER_VECT_TAB_ADDRESS */
+#define VECT_TAB_OFFSET 0x00000000UL /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
#if defined(USER_VECT_TAB_ADDRESS)
#if defined(DUAL_CORE) && defined(CORE_CM4)
/*!< Uncomment the following line if you need to relocate your vector Table
@@ -297,6 +302,10 @@ void SystemInit (void)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal D1 AXI-RAM or in Internal FLASH */
#endif /* USER_VECT_TAB_ADDRESS */
+#if defined(EXT_Flash_SPI)
+ SCB->VTOR = 0x90000000 | VECT_TAB_OFFSET;
+#endif
+
#endif /*DUAL_CORE && CORE_CM4*/
}
diff --git a/01_GPIO_IOToggle/STM32H7B0VBTX_FLASH.ld b/01_GPIO_IOToggle/STM32H7B0VBTX_FLASH.ld
index 4ca6860..cd14f62 100644
--- a/01_GPIO_IOToggle/STM32H7B0VBTX_FLASH.ld
+++ b/01_GPIO_IOToggle/STM32H7B0VBTX_FLASH.ld
@@ -44,7 +44,7 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
- FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
+ FLASH (rx) : ORIGIN = 0x90000000, LENGTH = 8192K
DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K