Replies: 2 comments 1 reply
-
|
Hi @ITstreet1 you can disable all useless features. This will reduce the size of binary. Made a try with the displayOnOffTest from Adafruit SSD1351 and have region `FLASH' overflowed by 104 bytes after some customization. Optimize for debugging disabled -DHAL_ADC_MODULE_DISABLED
-DHAL_RTC_MODULE_DISABLED
-DHAL_TIM_MODULE_DISABLED
-DHAL_DAC_MODULE_DISABLED
-DHAL_EXTI_MODULE_DISABLED
-DHAL_ETH_MODULE_DISABLED
-DHAL_SD_MODULE_DISABLED
-DHAL_QSPI_MODULE_DISABLEDCustomize some pinmap array: const PinMap PinMap_UART_TX[] = {
{PA_2_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, LL_GPIO_PULL_UP, GPIO_AF4_USART2)},
{NC, NP, 0}
};
const PinMap PinMap_UART_RX[] = {
{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, LL_GPIO_PULL_UP, GPIO_AF4_USART2)},
{NC, NP, 0}
};
const PinMap PinMap_UART_RTS[] = {
{NC, NP, 0}
};
const PinMap PinMap_UART_CTS[] = {
{NC, NP, 0}
};
const PinMap PinMap_I2C_SDA[] = {
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, LL_GPIO_PULL_NO, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
const PinMap PinMap_I2C_SCL[] = {
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, LL_GPIO_PULL_NO, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
const PinMap PinMap_SPI_MOSI[] = {
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, LL_GPIO_PULL_UP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
const PinMap PinMap_SPI_MISO[] = {
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, LL_GPIO_PULL_UP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
const PinMap PinMap_SPI_SCLK[] = {
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, LL_GPIO_PULL_UP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
const PinMap PinMap_SPI_SSEL[] = {
{NC, NP, 0}
};For example with all HAL disabled, Serial disable and Optimize for debugging disabled, we can reach 4500 bytes. |
Beta Was this translation helpful? Give feedback.
-
|
As the HAL eats a lot of memory space, it would be nice to add an option that can disable everything that is not essential. This way, for a simple task, the STM32 MCUs are unusable in comparison to the ATmega328p. And the simple task is to read a temperature on, say, a BME280 and to print it on the OLED display. If a 32KB STM32 can't do that, and a 32KB AVR can, then things are clear. It is ok to do all those changes you suggested, but those are a lot of fixes. It is much easier to move to another platform. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The regular Blink sketch on STM32L031K6T6 eats 65% of memory. The basic OLED example with the Adafruit lib can't compile. It turns out that 32KB STM32 MCUs are not usable in the Arduino world. Let's say I want to use OLED and SX1276. On ATmega32p, this is not a problem.
Is there a way to make Arduino IDE use waaaaaay less memory for the STM32 MCUs?
Beta Was this translation helpful? Give feedback.
All reactions