From 4019b17f9d138902275a07fdc74f8e5eee89face Mon Sep 17 00:00:00 2001 From: reppad Date: Wed, 21 Apr 2021 22:09:21 +0200 Subject: [PATCH 1/2] Update to MicroPython v1.15 --- bdev.c | 4 ++++ mpconfigboard.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bdev.c b/bdev.c index 18b5b85..308d3bb 100644 --- a/bdev.c +++ b/bdev.c @@ -13,14 +13,18 @@ STATIC const mp_soft_spi_obj_t soft_spi_bus = { .miso = MICROPY_HW_SPIFLASH_MISO, }; +#if MICROPY_HW_SPIFLASH_ENABLE_CACHE STATIC mp_spiflash_cache_t spi_bdev_cache; +#endif const mp_spiflash_config_t spiflash_config = { .bus_kind = MP_SPIFLASH_BUS_SPI, .bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS, .bus.u_spi.data = (void*)&soft_spi_bus, .bus.u_spi.proto = &mp_soft_spi_proto, +#if MICROPY_HW_SPIFLASH_ENABLE_CACHE .cache = &spi_bdev_cache, +#endif }; spi_bdev_t spi_bdev; diff --git a/mpconfigboard.h b/mpconfigboard.h index f439be3..46a06c5 100644 --- a/mpconfigboard.h +++ b/mpconfigboard.h @@ -4,7 +4,10 @@ // 1 = use internal flash (1 MByte) // 0 = use onboard SPI flash (2 MByte) Winbond W25Q16 -#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1) +#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0) +#if !BUILDING_MBOOT +#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1) +#endif #define MICROPY_HW_HAS_SWITCH (1) // has 1 button KEY0 #define MICROPY_HW_HAS_FLASH (1) From c70f820fc085e9a950a4d210d15521527f749302 Mon Sep 17 00:00:00 2001 From: reppad Date: Thu, 22 Apr 2021 11:08:23 +0200 Subject: [PATCH 2/2] enable SD card --- mpconfigboard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpconfigboard.h b/mpconfigboard.h index 46a06c5..0cd99b7 100644 --- a/mpconfigboard.h +++ b/mpconfigboard.h @@ -15,7 +15,7 @@ #define MICROPY_HW_ENABLE_RTC (1) #define MICROPY_HW_ENABLE_DAC (1) #define MICROPY_HW_ENABLE_USB (1) -#define MICROPY_HW_ENABLE_SDCARD (0) // it has a sd scard, but i am not sure what the detect pin is, yet +#define MICROPY_HW_ENABLE_SDCARD (1) // HSE is 8MHz #define MICROPY_HW_CLK_PLLM (8) // divide external clock by this to get 1MHz