128Kb is still not big enough to allocate a 155Kb buffer. The memory
has to be contiguous. Adding any chunk of memory < 155Kb will not give
you more contiguous memory.
The 23LC1024 is a serial, SPI SRAM you can't use a serial part for heap
memory under any condition. You need to use a standard parallel memory
interface as you would with any other SRAM. Don't waste your time with
that.
External SRAM normally connects via FSMC. For STM32F407, the
STM324-EVAL is a good example:
https://www.st.com/en/evaluation-tools/stm3240g-eval.html The
STM324-EVAL uses a 16-Mbit SRAM, this one:
http://www.issi.com/WW/pdf/61WV102416ALL.pdf. Schematics for the
STM324-EVAL are here:
https://www.st.com/resource/en/schematic_pack/stm324xg-eval_sch.zip
Then you can look at the boards/arm/stm32/stm3240g-eval/src/stm32_boot.c:
79 #ifdef CONFIG_STM32_FSMC
80 /* If the FSMC is enabled, then enable SRAM access */
81
82 stm32_selectsram();
83 #endif
And all of boards/arm/stm32/stm3240g-eval/src/stm32_selectsram.c
QSPI is a possibility, I suppose. But you really should consider
standard SRAM first.
Greg
I just got a 23LC1024 (128kb SDRAM 1MBit) and want to "attach" this as
external RAM. To scale up the free mem.
I am looking at examples like stm32_extmem.c and qspi.. which one is best to
use? And do I have to "make" a driver for it? And bind it to SPI? Or are my
thoughts wrong?