I'm learning ropes with STM32 and everything was going pretty well until...
I have STM32F469i-Discovery (Touch DSI 800x480, SDRAM, QSPI Flash etc.) Have ton of docs - datasheets, manuals, PCB schematic and so on.
So now I got to the stage where I need to interface SDRAM IC with FMC. I used STM32Cube_FW_F4_V1.26.1 collection of examples, specifically \STM32Cube\Repository\STM32Cube_FW_F4_V1.26.1\Projects\STM32469I-Discovery\Examples\FMC\FMC_SDRAM.
According to code comments/documentation, my SDRAM is executing this example script correctly (LEDs indicate all good). So it works. But I don't understand how and why.
So the datasheet of 469 clearly indicates
But when I use debugging and breakpoint, I find only garbage at address 0x60000800 (taking SDRAM offset into account). Instead, the correct values are under 0xC0000800, which is FMC Bank 5 as per datasheet.
hsdram.Init.SDBank = FMC_SDRAM_BANK1;
at the same time, main.h has
#define SDRAM_BANK_ADDR ((uint32_t)0xC0000000)
My only question can be summarized as:
Can anyone give a reasonable explanation and/or provide a link which makes this clear as to why FMC bank 1 gets mapped onto FMC bank 5 addresses?