I tried simple code using Keil MDK5 for STM32F769 CPU. I've used Keil simulator and noticed that vector table is settled at 0 (ITCM RAM) with BOOT_ADDRx =0, directing CPU to start from 0. The question is how vector table was filled in RAM. If JTAG did it, what will happen when I don't have JTAG, ie in production ? If some code from flash did it, how CPU started from flash at the first place, if at least stack addr should be at 0 ?
My error- there were no JTAG present, because I was in simulation, but would it write ITCM RAM if JTAG was present and if do, what will happen in production (without JTAG) ?
"JTAG" does nothing. The debugger will download your ELF file. You code is generally placed in ROM (at 0x08000000) and the CPU will start there. If you want the vector table in ITCMRAM and boot from there you must link the vector table to address 0 and the debugger will download it there.
What I noticed viewing memory contents at 0x0800 0000 and at 0, that they are the same in vector table region. My code consists of only three lines and I'm not the one who arranged the table at 0. Then how it emerged there (at 0) ? Also, what confuses me is stack pointer. AFAIK CPU expect it to be at address 0, which is (being RAM) undefined at power up.
I do not know this specific device, but often, the flash (or parts of it) are mapped to zero. So the CPU will fetch SP and PC from flash. But I guess an ST forum is the better place to ask those ST specific question.