My rule of thumb is if I am concerned then I am concerned
You may easily be fine, but sometimes best to be safe than sorry.
If I run into things like this, some of the steps I might take, include some of the following. Usually I will look for some easy low hanging fruit.
a) if You have some larger uninitialized buffers - I would consider moving them to RAM2, like:
Code:
DMAMEM uint16_t myScreenBuffer[320*240];
b) If I have large constant tables, I would look to leave those tables in the flash memory and not copied to RAM1(DTCM)
Code:
static const uint8_t PROGMEM init_commands[] = {4, 0xEF, 0x03, 0x80, 0x02,
4, 0xCF, 0x00, 0XC1, 0X30,
5, 0xED, 0x64, 0x03, 0X12, 0X81,
4, 0xE8, 0x85, 0x00, 0x78,
...
c) If you can reduce the code that is downloaded to RAM1(ITCM) by enough it will give that memory to DTCM. These are in chunks of 32K.
That padding 20344 tells you that you used about 12K of the last ITCM page. So if you mark enough code with FLASHMEM like:
Code:
FLASHMEM void ILI9341_t3n::begin(uint32_t spi_clock, uint32_t spi_clock_read) {
Then you could gain that 32k for data...