diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-24 17:01:53 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-24 17:01:53 +1100 |
commit | f8a022bc1188863a5dbde2b34e81af95b6284c70 (patch) | |
tree | 98a5b8fb957c53b7d8073b692a118b4148e309a7 | |
parent | d6a2d0016793ad962a8f2b6da48f2a64de84b023 (diff) | |
download | micropython-f8a022bc1188863a5dbde2b34e81af95b6284c70.tar.gz micropython-f8a022bc1188863a5dbde2b34e81af95b6284c70.zip |
stmhal/boards/STM32L476DISC: Use external SPI flash for filesystem.
-rw-r--r-- | stmhal/boards/STM32L476DISC/board_init.c | 10 | ||||
-rw-r--r-- | stmhal/boards/STM32L476DISC/mpconfigboard.h | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/stmhal/boards/STM32L476DISC/board_init.c b/stmhal/boards/STM32L476DISC/board_init.c new file mode 100644 index 0000000000..fdc41c4019 --- /dev/null +++ b/stmhal/boards/STM32L476DISC/board_init.c @@ -0,0 +1,10 @@ +#include "py/mphal.h" +#include "genhdr/pins.h" + +void STM32L476DISC_board_early_init(void) { + // set SPI flash WP and HOLD pins high + mp_hal_pin_output(&pin_E14); + mp_hal_pin_output(&pin_E15); + mp_hal_pin_write(&pin_E14, 1); + mp_hal_pin_write(&pin_E15, 1); +} diff --git a/stmhal/boards/STM32L476DISC/mpconfigboard.h b/stmhal/boards/STM32L476DISC/mpconfigboard.h index 2be5c9de65..a93b486c68 100644 --- a/stmhal/boards/STM32L476DISC/mpconfigboard.h +++ b/stmhal/boards/STM32L476DISC/mpconfigboard.h @@ -1,5 +1,8 @@ #include STM32_HAL_H +#define MICROPY_BOARD_EARLY_INIT STM32L476DISC_board_early_init +void STM32L476DISC_board_early_init(void); + #define MICROPY_HW_BOARD_NAME "L476-DISCO" #define MICROPY_HW_MCU_NAME "STM32L476" @@ -16,6 +19,13 @@ #define MICROPY_HW_ENABLE_DAC (0) #define MICROPY_HW_ENABLE_CAN (0) +// use external SPI flash for storage +#define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024) +#define MICROPY_HW_SPIFLASH_CS (pin_E11) +#define MICROPY_HW_SPIFLASH_SCK (pin_E10) +#define MICROPY_HW_SPIFLASH_MOSI (pin_E12) +#define MICROPY_HW_SPIFLASH_MISO (pin_E13) + // MSI is used and is 4MHz #define MICROPY_HW_CLK_PLLM (1) #define MICROPY_HW_CLK_PLLN (40) |