DDR in twr-k70

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DDR in twr-k70

1,409 Views
vibhu
Contributor III

Hi Guys,

I am using twr - k70f120m board. The IDE I am using is keil uvision v5.28.0.0. I wanted to test the DDR in the twr board. How do I test it ? Is there any example or document which tells how to write and read from DDR ? I need to know the steps and initialization required to write and read from DDR.

In keil for projects there are four options,

DDR.png

I thought if we select the Int Flash DDRData the code will be written to DDR, But DDR is said to be volatile, So on power cycle the code should not run. But it is still running.

Can anyone please help me with the concept of the DDR.

Regards,

Vibhu.

5 Replies

1,224 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Vibhu:

Yes, there are two different build configurations in MQX K70 projects. SRAM_DATA and DDR_data.

It means that the linker file is configured to store your data in SRAM or DDR.

Please refer to below link 

https://community.nxp.com/message/412110 

Regards

Daniel

1,224 Views
vibhu
Contributor III

Hi Daniel,

Can you please help me out with this DDR ?

Regards,

Vibhu

0 Kudos
Reply

1,224 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Vibhu:

You can use _bsp_ddr2_setup()  to initialize DDR,  then if you need to disable DDR, you can disable bit 14 (DDR clock gate)  to disable DDR,  and next you can enable bit14 if you need to use DDR again.

 

Regards

Daniel

0 Kudos
Reply

1,224 Views
danielchen
NXP TechSupport
NXP TechSupport

For how to use DDR in MQX, you need to call _mem_extend to add physical memory to the default memory pool.

Please read MQX_Reference_Manul  

pastedImage_1.png

Please also read https://community.nxp.com/message/409116?commentID=409116#comment-409116  for how to use _mem_extend.

Regards

Danile

0 Kudos
Reply

1,224 Views
vibhu
Contributor III

Hi Daniel,

Thank you very much for the reply. 

I have some doubts regarding the DDR.

In the link which you have mentioned, It is stated that ,

In init_hw.c which is located in C:\Freescale\Freescale_MQX_4_1\mqx\source\bsp\twrk70f120m you will find DDR2 initialization.

 

/* Initialize SDRAM */
//    _bsp_ddr2_setup();

 

Finally, if you want to disable or enable DDR you can unclock this module using bit 14 of SIM_SCGC3 register.

Should I first enable bit 14 of SIM_SCGC3 register and then use the _bsp_ddr2_setup() function or any one ?

And How do I write and Read from the memory address in DDR ? Is there any function available for this ?

Please Help.

Regards,

Vibhu.

0 Kudos
Reply