我用arm来读写fpga端的SDRAM,一直出问题,请大家指教
short int a[10]={1,2,3,4,5,6,7,8,9,10};
short int b[10]={0};
memcpy( (short int *) (h2p_memory_addr) , (short int *)(a) , 8 ) ; //h2p_memory_addr为SDRAM对应的虚拟地址
memcpy( ( short int *)(b) , (short int *)(h2p_memory_addr) , 8 );
按这种写法,数组b中应该是{1,2,3,4,0,0,0,0,0,0},但是我读取的却全部都是4,请问这是怎么回事?
|