Thanks a lot for the suggestion.
Indeed, doing DDR initialization from gdb server was the way to go. We have now access to DDR but the next problem we see when downloading the binary through JTAG is that debugger writes the binary in chunks and reads them back to verify that write operation was successful. In there is a mismatch between written and read data. The following is a log snippet of such operation:
03-00000000-00-00001948-002A: Downloading 996 bytes @ address 0x17800000
02-00000000-00-00001949-0042: TD9BF8640 001:948.990 JLINK_WriteMem(0x17800000, 0x3E4 Bytes, ...)
02-00000000-00-00001949-0052: TD9BF8640 001:949.000 Data: B8 00 00 EA 14 F0 9F E5 14 F0 9F E5 14 F0 9F E5 ...
02-00000000-00-00001949-003C: TD9BF8640 001:949.504 CPU_WriteMem(996 bytes @ 0x17800000)
02-00000000-00-00001970-002E: TD9BF8640 001:970.074 - 21.091ms returns 0x3E4
02-00000000-00-00001970-0041: TD9BF8640 001:970.124 JLINK_ReadMem(0x17800000, 0x3E4 Bytes, ...)
02-00000000-00-00001970-003B: TD9BF8640 001:970.155 CPU_ReadMem(996 bytes @ 0x17800000)
02-00000000-00-00001988-0052: TD9BF8640 001:988.726 Data: B8 00 9F 00 14 F0 80 E5 14 F0 9F E5 14 F0 80 E5 ...
02-00000000-00-00001988-002A: TD9BF8640 001:988.764 - 18.644ms returns 0
03-00000000-00-00001988-0011: - Verify failed
One can see that written bytes are not all the same as read bytes.
Using of UUU tool to flash the same binary to DDR memory through the USB port passes without problems and i can see in serial port that the binary is starting.
I tried to tune some DDR initialization register values with help of NXP's DDR Stress Tester calibration tool but with the same result. Similarly, when I run DDR calibration tool via USB it works, however, when trying to run the calibration over JTAG, the test starts but after several message like "HC_DEL=0x00000000⇥ result[00]=0x11111111" it stops with the following output:
ERROR FOUND, we can't get suitable value !!!!
dram test fails for all values.
Error: failed during ddr calibration
Is it possible that JTAG somehow influences DDR operation? Or maybe there are some hardware constrains for JTAG to successfully operation with i.MX6?
One other question is about Register Programming Aid v2.4 for IMX6DQ. We have 4 DDR3 chips all connected to CS0 and each of which is 8Gb (i.e. 16 bit row, 11 bit column and 8 banks). This should indeed give 1GB per chip since 0x10000 * 0x800 * 8 = 1GB. So the DRAM configuration in XLS looks as follows:
davithakobyan_1-1686860211618.png
However, when we load from this XLS generated INC file to DDR Test tool, it prints the following summary:
davithakobyan_2-1686860434554.jpeg
It is unclear from where this 8192MB appeared as one would expect to see 4096MB?