We have a design based on the reference code from TWR - K70F120M board.
Now I need to adjust the values in the twr_ddr2_script_init() function because we switched to another DDR2 ram.
It seems that the Freescale tool: Kinetis K70 DDR Init Tool has been used to generate the init code, but when trying out the sample input files (*.mem) it did not nearly generate the same register init values as the reference code.
How is the twr_ddr2_script_init() function in the TWR reference code created, by hand or by a tool ?
If it was created with the Kinetis K70 DDR Init Tool, what mem file where used ?
-Tomasz Valdman
Hi Tomasz Valdman,
Which reference code you're referring to? Would you please help to specify it? Thanks for your patience!
Have a great day,
Kan
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kan,
The function twr_ddr2_script_init() I am referring to can be found inside the sdram.c.
The reference code which contains the sdram.c can be downloaded here:
Kinetis 120MHz bare metal sample code
Thank you
Tomasz
Hi Tomasz,
Are you using the ver 1.11.1? Actually there are some changes from 1.0, you may find details in ReleaseNotes.txt as below:
Revision 1.11-1 - Update drive strength from FULL to half for all .mem files.
Revision 1.11 - Update for CW script. Remove clkendly, clkdisdly, cmddly of DDR_CR57, phyupdresp of DDR_CR54, ctrlupdmx of DDR_CR53,
dllradly, dllrstdly of DDR_CR51
Revision 1.0 - Initial release
So I think the driver code in sdram.c might be old code, maybe even older than 1.0, so there are some difference from the current version. If you are using the same DDR2 device as TWR-K70, you may use the mem file of "MT47H64M16.mem" in the folder of "C:\Freescale\Kinetis K70 DDR Init Tool\K70Memctrl\Memory Devices\DDR2".
Hope that helps,
Have a great day,
Kan
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------