Only 30kB of memory available on reset on a STM32F407VE board (BLACK_F407VE) #17524
Unanswered
hacksterous
asked this question in
STM32 / Pyboard
Replies: 1 comment
-
|
Could you try the following patch?
diff --git a/mpconfigboard.h b/mpconfigboard.h
index 1bb257c..a9a868a 100644
--- a/mpconfigboard.h
+++ b/mpconfigboard.h
@@ -169,7 +169,7 @@ extern struct _spi_bdev_t spi_bdev;
// #define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
// #define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
-// Ethernet via RMII
+#if 0 // Ethernet via RMII
#define MICROPY_HW_ETH_MDC (pin_C1)
#define MICROPY_HW_ETH_MDIO (pin_A2)
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
@@ -179,3 +179,4 @@ extern struct _spi_bdev_t spi_bdev;
#define MICROPY_HW_ETH_RMII_TX_EN (pin_B11)
#define MICROPY_HW_ETH_RMII_TXD0 (pin_B12)
#define MICROPY_HW_ETH_RMII_TXD1 (pin_B13)
+#endif
diff --git a/mpconfigboard.mk b/mpconfigboard.mk
index c678078..e94d45c 100644
--- a/mpconfigboard.mk
+++ b/mpconfigboard.mk
@@ -5,6 +5,6 @@ LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000
-MICROPY_PY_LWIP = 1
-MICROPY_PY_USSL = 1
-MICROPY_SSL_MBEDTLS = 1
+#MICROPY_PY_LWIP = 1
+#MICROPY_PY_USSL = 1
+#MICROPY_SSL_MBEDTLS = 1After applying the patch, you will get about 100KB free memory on reset. >>> import gc
>>> gc.mem_free()
101840Note that STM32F407VE has 192KB RAM but you can use only 128KB as a heap of micropython because STM32F407VE's RAM is composed 128KB SRAM and 64KB CCMRAM which are not continuous (CCMRAM is used as internal filesystem cache). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I flashed the standard BLACK_F407VE firmware image from the top-of-the-tree code and see only 30kB free memory on an SoC that provides 192kB.
What macros can I set to compile out unnecessary features and how? I don't need networking, webrepl, LWIP, SPI and I2C possibly more.
I have tried setting defines in
ports/stm32/boards/BLACK_F407VE/mpconfigboard.hsuch as below and regenerating the firmware, but it didn't help.So, even though this board provides a goodly amount of memory, I can't even run the MicroPython editor here -- fails with memory allocate error.
How do I reduce the memory footprint on this board?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions