File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -836,6 +836,12 @@ int __attribute__((used)) main(void) {
836
836
// Start the debug serial
837
837
serial_early_init ();
838
838
839
+ #if CIRCUITPY_EXTERNAL_FLASH_SETUP
840
+ // Set up anything that might need to get done before we try to use SPI flash
841
+ // This is needed for some boards where flash relies on GPIO setup to work
842
+ external_flash_setup ();
843
+ #endif
844
+
839
845
// Create a new filesystem only if we're not in a safe mode.
840
846
// A power brownout here could make it appear as if there's
841
847
// no SPI flash filesystem, and we might erase the existing one.
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ CFLAGS += -DMICROPY_PY_USELECT=$(MICROPY_PY_USELECT)
49
49
MICROPY_PY_USELECT_SELECT ?= $(MICROPY_PY_USELECT )
50
50
CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT )
51
51
52
+ # enable pre-flash GPIO setup
53
+ CIRCUITPY_EXTERNAL_FLASH_SETUP ?= 0
54
+ CFLAGS += -DCIRCUITPY_EXTERNAL_FLASH_SETUP=$(CIRCUITPY_EXTERNAL_FLASH_SETUP )
52
55
53
56
CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD )
54
57
CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO )
Original file line number Diff line number Diff line change @@ -47,5 +47,9 @@ void reset_board(void);
47
47
// disabling USB, BLE or flash) because CircuitPython may continue to run.
48
48
void board_deinit (void );
49
49
50
+ // Configure anything that needs to get set up before the external flash
51
+ // is init'ed. For example, if GPIO needs to be configured to enable the
52
+ // flash chip, as is the case on some boards.
53
+ void external_flash_setup (void );
50
54
51
55
#endif // MICROPY_INCLUDED_SUPERVISOR_BOARD_H
You can’t perform that action at this time.
0 commit comments