Skip to content

Commit d373cab

Browse files
cy-opmKyle Kearney
authored andcommitted
Initialize serial flash on device startup
1 parent ee944cf commit d373cab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/mbed_overrides.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#include "mbed_power_mgmt.h"
2424
#include "rtos_idle.h"
2525
#include "us_ticker_api.h"
26+
#if defined(CYBSP_ENABLE_FLASH_STORAGE)
27+
#include "cybsp_serial_flash.h"
28+
#endif /* defined(CYBSP_ENABLE_FLASH_STORAGE) */
2629

2730
#if defined(COMPONENT_SPM_MAILBOX)
2831
void mailbox_init(void);
@@ -88,6 +91,12 @@ void mbed_sdk_init(void)
8891
us_ticker_init();
8992
#endif
9093

94+
#if defined(CYBSP_ENABLE_FLASH_STORAGE)
95+
/* The linker script allows storing data in external memory, if needed, enable access to that memory. */
96+
cybsp_serial_flash_init();
97+
cybsp_serial_flash_enable_xip(true);
98+
#endif /* defined(CYBSP_ENABLE_FLASH_STORAGE) */
99+
91100
/* Enable global interrupts (disabled in CM4 startup assembly) */
92101
__enable_irq();
93102
#endif

0 commit comments

Comments
 (0)