#include "mcom_runtime\ddr.h" int main() { // whether to initialize ddr3-mc0 int b_mc0_init = 1; // whether to initialize ddr3-mc1 int b_mc1_init = 0; int is_ddr3_init = init_ddr3(DDR_DEFAULT_FREQ, b_mc0_init, b_mc1_init); int is_ddr3_mc0_init = b_mc0_init&(!(is_ddr3_init&0xffff)); int is_ddr3_mc1_init = b_mc1_init&(!((is_ddr3_init>>16)&0xffff)); if(is_ddr3_mc0_init) { int value = 0x12345678; // write some value into ddr memory // 0x40000000 - start address ddr-mc0 *((volatile int*)0x40000000)=value; value = 0; value = *((volatile int*)0x40000000); } if(is_ddr3_mc1_init) { int value = 0x12345678; // write some value into ddr memory // 0xa0000000 - start address ddr-mc1 *((volatile int*)0xa0000000)=value; value = 0; value = *((volatile int*)0xa0000000); } return 0; }